Version Description
Download this release
Release Info
Developer | ceylonsystems |
Plugin | IgniteUp – Coming Soon and Maintenance Mode |
Version | 3.4.3 |
Comparing to | |
See all releases |
Code changes from version 3.4.2 to 3.4.3
- igniteup.php +2 -2
- includes/class-admin-options.php +19 -19
- includes/class-coming-soon-creator.php +160 -167
- includes/css/bootstrap-switch.min.css +9 -21
- includes/css/bootstrap.min.css +4 -3
- includes/css/codemirror.min.css +2 -0
- includes/css/codemirror/codemirror.css +0 -340
- includes/css/codemirror/ttcn.css +0 -64
- includes/css/jquery-ui.min.css +7 -0
- includes/css/jquery.timepicker.min.css +3 -3
- includes/js/bootstrap-switch.min.js +9 -21
- includes/js/codemirror.min.js +1 -0
- includes/js/codemirror/codemirror.js +0 -9351
- includes/js/codemirror/css.js +0 -830
- includes/js/codemirror/htmlmixed.js +0 -152
- includes/js/codemirror/javascript.js +0 -813
- includes/js/codemirror/xml.js +0 -394
- includes/js/jquery-ui/images/ui-icons_444444_256x240.png +0 -0
- includes/js/jquery-ui/images/ui-icons_555555_256x240.png +0 -0
- includes/js/jquery-ui/images/ui-icons_777620_256x240.png +0 -0
- includes/js/jquery-ui/images/ui-icons_777777_256x240.png +0 -0
- includes/js/jquery-ui/images/ui-icons_cc0000_256x240.png +0 -0
- includes/js/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- includes/js/jquery-ui/jquery-ui.min.css +0 -7
- includes/js/jquery-ui/jquery-ui.min.js +0 -9
igniteup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: IgniteUp
|
4 |
Plugin URI: http://getigniteup.com
|
5 |
Description: IgniteUp is a powerful plugin which allows you to keep your site on launchpad till ignite-up and to build amazing coming soon pages.
|
6 |
-
Version: 3.4.
|
7 |
Author: Ceylon Systems
|
8 |
Author URI: http://getigniteup.com
|
9 |
License: GPLv2 or later
|
@@ -14,4 +14,4 @@
|
|
14 |
require_once 'includes/core-import.php';
|
15 |
require_once 'includes/core-helpers.php';
|
16 |
|
17 |
-
new CSComingSoonCreator(__FILE__, '3.4.
|
3 |
Plugin Name: IgniteUp
|
4 |
Plugin URI: http://getigniteup.com
|
5 |
Description: IgniteUp is a powerful plugin which allows you to keep your site on launchpad till ignite-up and to build amazing coming soon pages.
|
6 |
+
Version: 3.4.3
|
7 |
Author: Ceylon Systems
|
8 |
Author URI: http://getigniteup.com
|
9 |
License: GPLv2 or later
|
14 |
require_once 'includes/core-import.php';
|
15 |
require_once 'includes/core-helpers.php';
|
16 |
|
17 |
+
new CSComingSoonCreator(__FILE__, '3.4.3');
|
includes/class-admin-options.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
|
6 |
public static $gener_options = array('enable', 'cs_page_title', 'skipfor', 'skip_with_get_request', 'whitelisted_ips', 'powered_by', 'customcss', 'favicon_url', 'send_status');
|
@@ -79,9 +79,9 @@ class CSAdminOptions
|
|
79 |
ksort($templates);
|
80 |
|
81 |
/*
|
82 |
-
*
|
83 |
* Check for incompatible templates.
|
84 |
-
*
|
85 |
*/
|
86 |
foreach ($templates as $template => $option) {
|
87 |
if (isset($option['igniteup_version']) && floatval($option['igniteup_version']) > floatval($version)) {
|
@@ -111,15 +111,15 @@ class CSAdminOptions
|
|
111 |
/**
|
112 |
* Returns a requested default string.
|
113 |
* Available Strings are listed below.
|
114 |
-
*
|
115 |
-
* CountDown: days, hours, minutes, secs, mins
|
116 |
-
*
|
117 |
* Forms: subscribe_thankyou, contact_success, contact_failed
|
118 |
-
*
|
119 |
-
* Common: invalid_email, existing_email, sending, error
|
120 |
-
*
|
121 |
* @param string $key slug
|
122 |
-
* @return string Requested translatable string
|
123 |
*/
|
124 |
public static function getDefaultStrings($key)
|
125 |
{
|
@@ -133,7 +133,7 @@ class CSAdminOptions
|
|
133 |
|
134 |
/**
|
135 |
* Array of default strings
|
136 |
-
*
|
137 |
* @return array
|
138 |
*/
|
139 |
static function messageBag()
|
@@ -141,9 +141,9 @@ class CSAdminOptions
|
|
141 |
return array(
|
142 |
|
143 |
/*
|
144 |
-
*
|
145 |
* Subscribe Form
|
146 |
-
*
|
147 |
*/
|
148 |
'subscribe_text' => __('Subscribe', CSCS_TEXT_DOMAIN),
|
149 |
'subscribe_done' => __('Subscribed', CSCS_TEXT_DOMAIN),
|
@@ -153,17 +153,17 @@ class CSAdminOptions
|
|
153 |
'subscribe_thankyou' => __('Thanks for subscribing!', CSCS_TEXT_DOMAIN), //Subscribe form on SUCCESS
|
154 |
|
155 |
/*
|
156 |
-
*
|
157 |
* Contact Form
|
158 |
-
*
|
159 |
*/
|
160 |
'contact_success' => __("Thanks for making a sound!", CSCS_TEXT_DOMAIN), //Contact form on SUCCESS
|
161 |
'contact_failed' => __("Message not sent.", CSCS_TEXT_DOMAIN), //Contact form on !SUCCESS
|
162 |
|
163 |
/*
|
164 |
-
*
|
165 |
* Common
|
166 |
-
*
|
167 |
*/
|
168 |
'invalid_email' => __("Please enter a valid email.", CSCS_TEXT_DOMAIN),
|
169 |
'existing_email' => __("That email is already with us.", CSCS_TEXT_DOMAIN),
|
@@ -171,9 +171,9 @@ class CSAdminOptions
|
|
171 |
'error' => __("Something Went Wrong.", CSCS_TEXT_DOMAIN),
|
172 |
|
173 |
/*
|
174 |
-
*
|
175 |
* Countdown
|
176 |
-
*
|
177 |
*/
|
178 |
'days' => __('DAY<span id="day-s">S</span>', CSCS_TEXT_DOMAIN),
|
179 |
'hours' => __('HOUR<span id="hrs-s">S</span>', CSCS_TEXT_DOMAIN),
|
1 |
<?php
|
2 |
|
3 |
+
class CSAdminOptions
|
4 |
{
|
5 |
|
6 |
public static $gener_options = array('enable', 'cs_page_title', 'skipfor', 'skip_with_get_request', 'whitelisted_ips', 'powered_by', 'customcss', 'favicon_url', 'send_status');
|
79 |
ksort($templates);
|
80 |
|
81 |
/*
|
82 |
+
*
|
83 |
* Check for incompatible templates.
|
84 |
+
*
|
85 |
*/
|
86 |
foreach ($templates as $template => $option) {
|
87 |
if (isset($option['igniteup_version']) && floatval($option['igniteup_version']) > floatval($version)) {
|
111 |
/**
|
112 |
* Returns a requested default string.
|
113 |
* Available Strings are listed below.
|
114 |
+
*
|
115 |
+
* CountDown: days, hours, minutes, secs, mins
|
116 |
+
*
|
117 |
* Forms: subscribe_thankyou, contact_success, contact_failed
|
118 |
+
*
|
119 |
+
* Common: invalid_email, existing_email, sending, error
|
120 |
+
*
|
121 |
* @param string $key slug
|
122 |
+
* @return string Requested translatable string
|
123 |
*/
|
124 |
public static function getDefaultStrings($key)
|
125 |
{
|
133 |
|
134 |
/**
|
135 |
* Array of default strings
|
136 |
+
*
|
137 |
* @return array
|
138 |
*/
|
139 |
static function messageBag()
|
141 |
return array(
|
142 |
|
143 |
/*
|
144 |
+
*
|
145 |
* Subscribe Form
|
146 |
+
*
|
147 |
*/
|
148 |
'subscribe_text' => __('Subscribe', CSCS_TEXT_DOMAIN),
|
149 |
'subscribe_done' => __('Subscribed', CSCS_TEXT_DOMAIN),
|
153 |
'subscribe_thankyou' => __('Thanks for subscribing!', CSCS_TEXT_DOMAIN), //Subscribe form on SUCCESS
|
154 |
|
155 |
/*
|
156 |
+
*
|
157 |
* Contact Form
|
158 |
+
*
|
159 |
*/
|
160 |
'contact_success' => __("Thanks for making a sound!", CSCS_TEXT_DOMAIN), //Contact form on SUCCESS
|
161 |
'contact_failed' => __("Message not sent.", CSCS_TEXT_DOMAIN), //Contact form on !SUCCESS
|
162 |
|
163 |
/*
|
164 |
+
*
|
165 |
* Common
|
166 |
+
*
|
167 |
*/
|
168 |
'invalid_email' => __("Please enter a valid email.", CSCS_TEXT_DOMAIN),
|
169 |
'existing_email' => __("That email is already with us.", CSCS_TEXT_DOMAIN),
|
171 |
'error' => __("Something Went Wrong.", CSCS_TEXT_DOMAIN),
|
172 |
|
173 |
/*
|
174 |
+
*
|
175 |
* Countdown
|
176 |
+
*
|
177 |
*/
|
178 |
'days' => __('DAY<span id="day-s">S</span>', CSCS_TEXT_DOMAIN),
|
179 |
'hours' => __('HOUR<span id="hrs-s">S</span>', CSCS_TEXT_DOMAIN),
|
includes/class-coming-soon-creator.php
CHANGED
@@ -163,23 +163,18 @@ class CSComingSoonCreator
|
|
163 |
if (isset($_GET['page']) && ($_GET['page'] == 'cscs_options' || $_GET['page'] == 'cscs_subscribers')) {
|
164 |
wp_enqueue_style('wp-color-picker');
|
165 |
|
166 |
-
wp_enqueue_style('codemirror-main', plugin_dir_url(CSCS_FILE) . 'includes/css/codemirror
|
167 |
-
wp_enqueue_style('codemirror-theme', plugin_dir_url(CSCS_FILE) . 'includes/css/codemirror/ttcn.css');
|
168 |
wp_enqueue_style('jquery-timepicker-css', plugin_dir_url(CSCS_FILE) . 'includes/css/jquery.timepicker.min.css');
|
169 |
-
|
170 |
|
|
|
171 |
wp_enqueue_script('jquery-form', false, array('jquery'));
|
172 |
wp_enqueue_script('jquery-timepicker', plugin_dir_url(CSCS_FILE) . 'includes/js/jquery.timepicker.min.js', array('jquery'), CSCS_CURRENT_VERSION, true);
|
173 |
wp_enqueue_script('jquery-ui-accordion', false, array('jquery'));
|
174 |
wp_enqueue_script('jquery-ui-datepicker');
|
175 |
-
wp_enqueue_style('jquery-ui-theme', '//code.jquery.com/ui/1.11.4/themes/flick/jquery-ui.css');
|
176 |
wp_enqueue_script('bootstrap-switch', plugin_dir_url(CSCS_FILE) . 'includes/js/bootstrap-switch.min.js', array('jquery'), CSCS_CURRENT_VERSION, true);
|
177 |
wp_enqueue_script('igniteup', plugin_dir_url(CSCS_FILE) . 'includes/js/main.js', array('jquery', 'wp-color-picker', 'jquery-timepicker'), CSCS_CURRENT_VERSION, true);
|
178 |
-
wp_enqueue_script('codemirror-main', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror
|
179 |
-
wp_enqueue_script('codemirror-helper-css', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror/css.js', array('codemirror-main'), CSCS_CURRENT_VERSION, true);
|
180 |
-
wp_enqueue_script('codemirror-helper-js', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror/javascript.js', array('codemirror-main'), CSCS_CURRENT_VERSION, true);
|
181 |
-
wp_enqueue_script('codemirror-helper-xml', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror/xml.js', array('codemirror-main'), CSCS_CURRENT_VERSION, true);
|
182 |
-
wp_enqueue_script('codemirror-helper-html', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror/htmlmixed.js', array('codemirror-main', 'codemirror-helper-css', 'codemirror-helper-js', 'codemirror-helper-xml'), CSCS_CURRENT_VERSION, true);
|
183 |
wp_enqueue_media();
|
184 |
}
|
185 |
}
|
@@ -200,8 +195,8 @@ class CSComingSoonCreator
|
|
200 |
{
|
201 |
if (!isset($_POST['activate_template']) || empty($_POST['activate_template']) || !is_super_admin())
|
202 |
return;
|
203 |
-
update_option(CSCS_DEFTEMP_OPTION, $_POST['activate_template']);
|
204 |
-
header('Location: ' . $_SERVER['REQUEST_URI'] . '&activated=yes');
|
205 |
}
|
206 |
|
207 |
private function getActiveTemplateObject()
|
@@ -330,15 +325,15 @@ class CSComingSoonCreator
|
|
330 |
|
331 |
public function subscribeEmail()
|
332 |
{
|
333 |
-
$email = isset($_REQUEST['cs_email']) ? trim($_REQUEST['cs_email']) : '';
|
334 |
$errorInput = CSAdminOptions::getDefaultStrings('alert_error_invalid_email');
|
335 |
-
if (
|
336 |
echo json_encode(array('status' => FALSE, 'error' => TRUE, 'message' => wp_kses_post($errorInput)));
|
337 |
wp_die();
|
338 |
}
|
339 |
$name = '';
|
340 |
if (!empty($_REQUEST['cs_name']))
|
341 |
-
$name =
|
342 |
|
343 |
global $wpdb;
|
344 |
$errorAlreadyExists = CSAdminOptions::getDefaultStrings('alert_error_already_exists');
|
@@ -358,19 +353,19 @@ class CSComingSoonCreator
|
|
358 |
|
359 |
public function sendContactForm()
|
360 |
{
|
361 |
-
$name =
|
362 |
-
$email =
|
363 |
-
$subject =
|
364 |
-
$message =
|
365 |
// Create the email and send the message
|
366 |
$cs_receive_email_addr = CSCS_GENEROPTION_PREFIX . 'receive_email_addr';
|
367 |
$admin_email = get_bloginfo('admin_email');
|
368 |
$to = get_option($cs_receive_email_addr, $admin_email);
|
369 |
$email_subject = sprintf(__('%1$s Sent you a Message via %2$s Contact Form', CSCS_TEXT_DOMAIN), $name, get_bloginfo('name'));
|
370 |
-
$subjectHTML = isset($subject) ? "<h3>" . nl2br(str_replace("\'", "'",
|
371 |
$email_body = "<html><body>" .
|
372 |
$subjectHTML .
|
373 |
-
"<p>" . nl2br(
|
374 |
"<h4>" . __('This message was sent to you via IgniteUp Contact Form', CSCS_TEXT_DOMAIN) . "</h4>" .
|
375 |
"<p>" . __('Name:', CSCS_TEXT_DOMAIN) . " $name<br>" .
|
376 |
__('Email:', CSCS_TEXT_DOMAIN) . " $email</p>" .
|
@@ -543,198 +538,196 @@ class CSComingSoonCreator
|
|
543 |
* Custom CSS and Header scritps field
|
544 |
*/
|
545 |
$custom_css = get_option(CSCS_GENEROPTION_PREFIX . 'customcss', '');
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
}
|
560 |
-
|
561 |
-
<?php echo $custom_css;
|
562 |
-
?>
|
563 |
-
</style>
|
564 |
-
<?php
|
565 |
}
|
566 |
|
567 |
-
|
568 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
569 |
* WP Head elements for older theme versions
|
570 |
-
*
|
571 |
*/
|
572 |
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
|
581 |
-
|
582 |
-
*
|
583 |
* Publish footer scripts
|
584 |
-
*
|
585 |
*/
|
586 |
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
* Do action for template scripts
|
591 |
*/
|
592 |
|
593 |
-
|
594 |
-
|
595 |
|
596 |
-
|
597 |
-
*
|
598 |
* Enable an admin notice if there are incompatible templates
|
599 |
-
*
|
600 |
*/
|
601 |
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
|
613 |
-
|
614 |
-
*
|
615 |
* Help page subscription form action
|
616 |
-
*
|
617 |
*/
|
618 |
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
if (is_wp_error($resp)) {
|
644 |
-
$error = TRUE;
|
645 |
-
$message = 'Something went wrong. Please try again!';
|
646 |
-
}
|
647 |
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
|
653 |
-
|
654 |
-
|
|
|
655 |
}
|
656 |
|
657 |
-
|
658 |
-
|
|
|
|
|
|
|
|
|
659 |
* Notify admin about a new subscriber
|
660 |
-
*
|
661 |
*/
|
662 |
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
$status = wp_mail($to, $email_subject, $email_body, array("MIME-Version: 1.0", "Content-Type: text/html; charset=UTF-8"));
|
677 |
-
return $status;
|
678 |
-
}
|
679 |
|
680 |
-
|
681 |
-
|
|
|
|
|
|
|
|
|
682 |
* Igniteup_head action
|
683 |
-
*
|
684 |
*/
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
|
691 |
-
|
692 |
-
*
|
693 |
* Igniteup_footer action
|
694 |
-
*
|
695 |
*/
|
696 |
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
|
702 |
-
|
703 |
-
*
|
704 |
* Read theme options
|
705 |
-
*
|
706 |
*/
|
707 |
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
/**
|
716 |
-
*
|
717 |
-
* Clean all custom options saved in the database on plugin deactivation
|
718 |
-
*
|
719 |
-
*/
|
720 |
-
|
721 |
-
public function deactivationCleanp()
|
722 |
-
{
|
723 |
-
$temps = CSAdminOptions::getTemplates();
|
724 |
-
foreach($temps as $temp){
|
725 |
-
foreach($temp['options'] as $key => $opt){
|
726 |
-
delete_option(CSCS_TEMPLATEOPTION_PREFIX . $temp['folder_name'] . "_" . $key);
|
727 |
-
}
|
728 |
-
}
|
729 |
|
730 |
-
|
731 |
-
|
732 |
-
|
|
|
|
|
733 |
|
734 |
-
|
735 |
-
|
|
|
|
|
|
|
|
|
736 |
}
|
|
|
737 |
|
|
|
|
|
|
|
738 |
|
|
|
|
|
739 |
}
|
740 |
}
|
|
163 |
if (isset($_GET['page']) && ($_GET['page'] == 'cscs_options' || $_GET['page'] == 'cscs_subscribers')) {
|
164 |
wp_enqueue_style('wp-color-picker');
|
165 |
|
166 |
+
wp_enqueue_style('codemirror-main', plugin_dir_url(CSCS_FILE) . 'includes/css/codemirror.min.css');
|
|
|
167 |
wp_enqueue_style('jquery-timepicker-css', plugin_dir_url(CSCS_FILE) . 'includes/css/jquery.timepicker.min.css');
|
168 |
+
wp_enqueue_style('jquery-ui-custom', plugin_dir_url(CSCS_FILE) . 'includes/css/jquery-ui.min.css');
|
169 |
|
170 |
+
wp_enqueue_script('jquery');
|
171 |
wp_enqueue_script('jquery-form', false, array('jquery'));
|
172 |
wp_enqueue_script('jquery-timepicker', plugin_dir_url(CSCS_FILE) . 'includes/js/jquery.timepicker.min.js', array('jquery'), CSCS_CURRENT_VERSION, true);
|
173 |
wp_enqueue_script('jquery-ui-accordion', false, array('jquery'));
|
174 |
wp_enqueue_script('jquery-ui-datepicker');
|
|
|
175 |
wp_enqueue_script('bootstrap-switch', plugin_dir_url(CSCS_FILE) . 'includes/js/bootstrap-switch.min.js', array('jquery'), CSCS_CURRENT_VERSION, true);
|
176 |
wp_enqueue_script('igniteup', plugin_dir_url(CSCS_FILE) . 'includes/js/main.js', array('jquery', 'wp-color-picker', 'jquery-timepicker'), CSCS_CURRENT_VERSION, true);
|
177 |
+
wp_enqueue_script('codemirror-main', plugin_dir_url(CSCS_FILE) . 'includes/js/codemirror.min.js', array(), CSCS_CURRENT_VERSION, true);
|
|
|
|
|
|
|
|
|
178 |
wp_enqueue_media();
|
179 |
}
|
180 |
}
|
195 |
{
|
196 |
if (!isset($_POST['activate_template']) || empty($_POST['activate_template']) || !is_super_admin())
|
197 |
return;
|
198 |
+
update_option(CSCS_DEFTEMP_OPTION, sanitize_key($_POST['activate_template']));
|
199 |
+
header('Location: ' . sanitize_url($_SERVER['REQUEST_URI'] . '&activated=yes'));
|
200 |
}
|
201 |
|
202 |
private function getActiveTemplateObject()
|
325 |
|
326 |
public function subscribeEmail()
|
327 |
{
|
328 |
+
$email = sanitize_email(isset($_REQUEST['cs_email']) ? trim($_REQUEST['cs_email']) : '');
|
329 |
$errorInput = CSAdminOptions::getDefaultStrings('alert_error_invalid_email');
|
330 |
+
if (empty($email)) {
|
331 |
echo json_encode(array('status' => FALSE, 'error' => TRUE, 'message' => wp_kses_post($errorInput)));
|
332 |
wp_die();
|
333 |
}
|
334 |
$name = '';
|
335 |
if (!empty($_REQUEST['cs_name']))
|
336 |
+
$name = sanitize_text_field($_REQUEST['cs_name']);
|
337 |
|
338 |
global $wpdb;
|
339 |
$errorAlreadyExists = CSAdminOptions::getDefaultStrings('alert_error_already_exists');
|
353 |
|
354 |
public function sendContactForm()
|
355 |
{
|
356 |
+
$name = sanitize_text_field($_REQUEST['contact_name']);
|
357 |
+
$email = sanitize_email($_REQUEST['contact_email']);
|
358 |
+
$subject = sanitize_text_field($_REQUEST['contact_subject']) ? trim($_REQUEST['contact_subject']) : NULL;
|
359 |
+
$message = sanitize_textarea_field($_REQUEST['contact_message']);
|
360 |
// Create the email and send the message
|
361 |
$cs_receive_email_addr = CSCS_GENEROPTION_PREFIX . 'receive_email_addr';
|
362 |
$admin_email = get_bloginfo('admin_email');
|
363 |
$to = get_option($cs_receive_email_addr, $admin_email);
|
364 |
$email_subject = sprintf(__('%1$s Sent you a Message via %2$s Contact Form', CSCS_TEXT_DOMAIN), $name, get_bloginfo('name'));
|
365 |
+
$subjectHTML = isset($subject) ? "<h3>" . nl2br(str_replace("\'", "'", $subject)) . "</h3>" : '';
|
366 |
$email_body = "<html><body>" .
|
367 |
$subjectHTML .
|
368 |
+
"<p>" . nl2br($message) . "</p><hr>" .
|
369 |
"<h4>" . __('This message was sent to you via IgniteUp Contact Form', CSCS_TEXT_DOMAIN) . "</h4>" .
|
370 |
"<p>" . __('Name:', CSCS_TEXT_DOMAIN) . " $name<br>" .
|
371 |
__('Email:', CSCS_TEXT_DOMAIN) . " $email</p>" .
|
538 |
* Custom CSS and Header scritps field
|
539 |
*/
|
540 |
$custom_css = get_option(CSCS_GENEROPTION_PREFIX . 'customcss', '');
|
541 |
+
?>
|
542 |
+
<style>
|
543 |
+
#wp-admin-bar-igniteup_enabled {
|
544 |
+
background-color: #C70000 !important;
|
545 |
+
}
|
546 |
+
|
547 |
+
#wp-admin-bar-igniteup_enabled:hover a {
|
548 |
+
background: #A20A0A !important;
|
549 |
+
color: #FFFFFF !important;
|
550 |
+
}
|
551 |
+
|
552 |
+
body::before {
|
553 |
+
background: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
}
|
555 |
|
556 |
+
<?php echo $custom_css;
|
557 |
+
?>
|
558 |
+
</style>
|
559 |
+
<?php
|
560 |
+
}
|
561 |
+
|
562 |
+
/*
|
563 |
+
*
|
564 |
* WP Head elements for older theme versions
|
565 |
+
*
|
566 |
*/
|
567 |
|
568 |
+
public function wpHeadForOldThemes()
|
569 |
+
{
|
570 |
+
$favicon_url = get_option(CSCS_GENEROPTION_PREFIX . 'favicon_url');
|
571 |
+
if (!empty($favicon_url))
|
572 |
+
echo '<link rel="shortcut icon" href="' . esc_url($favicon_url) . '" />';
|
573 |
+
echo '<script type="text/javascript">igniteup_ajaxurl = "' . admin_url('admin-ajax.php') . '";</script>';
|
574 |
+
}
|
575 |
|
576 |
+
/*
|
577 |
+
*
|
578 |
* Publish footer scripts
|
579 |
+
*
|
580 |
*/
|
581 |
|
582 |
+
public function footerScripts()
|
583 |
+
{
|
584 |
+
/*
|
585 |
* Do action for template scripts
|
586 |
*/
|
587 |
|
588 |
+
do_action('igniteup_scripts_' . CSCS_DEFAULT_TEMPLATE);
|
589 |
+
}
|
590 |
|
591 |
+
/*
|
592 |
+
*
|
593 |
* Enable an admin notice if there are incompatible templates
|
594 |
+
*
|
595 |
*/
|
596 |
|
597 |
+
public function noncompatible_theme_notice()
|
598 |
+
{
|
599 |
+
if (!CSAdminOptions::getTemplates(TRUE)) //Check if any non-compatible theme exists.
|
600 |
+
return;
|
601 |
+
?>
|
602 |
+
<div class="error">
|
603 |
+
<p><?php printf(__('There\'re themes not supporting current IgniteUp version (%1$s). To fix <a href="%2$s">Update IgniteUp</a> now!', CSCS_TEXT_DOMAIN), 'v' . CSCS_CURRENT_VERSION, admin_url('update-core.php')); ?></p>
|
604 |
+
</div>
|
605 |
+
<?php
|
606 |
+
}
|
607 |
|
608 |
+
/*
|
609 |
+
*
|
610 |
* Help page subscription form action
|
611 |
+
*
|
612 |
*/
|
613 |
|
614 |
+
public function adminSubscribe()
|
615 |
+
{
|
616 |
+
header('Content-type: application/json; charset=utf-8');
|
617 |
+
$email = sanitize_email($_POST['admin_filled_email']);
|
618 |
+
$error = FALSE;
|
619 |
+
$message = '';
|
620 |
+
if (empty($email)) {
|
621 |
+
echo json_encode(array('error' => TRUE, 'message' => 'Please provide your email address!'));
|
622 |
+
wp_die();
|
623 |
+
}
|
624 |
|
625 |
+
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
626 |
+
echo json_encode(array('error' => TRUE, 'message' => 'Please enter a valid email address!'));
|
627 |
+
wp_die();
|
628 |
+
}
|
629 |
|
630 |
+
$resp = wp_remote_post(
|
631 |
+
'http://getigniteup.com/api/subscribe',
|
632 |
+
array(
|
633 |
+
'body' => array('ignitmailsubscr' => TRUE, 'ignitmailaddress' => $email),
|
634 |
+
'timeout' => 20
|
635 |
+
)
|
636 |
+
);
|
|
|
|
|
|
|
|
|
|
|
637 |
|
638 |
+
if (is_wp_error($resp)) {
|
639 |
+
$error = TRUE;
|
640 |
+
$message = 'Something went wrong. Please try again!';
|
641 |
+
}
|
642 |
|
643 |
+
$curr_user = get_current_user_id();
|
644 |
+
if (!$error && !empty($curr_user)) {
|
645 |
+
update_user_meta($curr_user, 'igniteup_admin_subscribed', '1');
|
646 |
}
|
647 |
|
648 |
+
echo json_encode(array('error' => $error, 'message' => $message));
|
649 |
+
wp_die();
|
650 |
+
}
|
651 |
+
|
652 |
+
/*
|
653 |
+
*
|
654 |
* Notify admin about a new subscriber
|
655 |
+
*
|
656 |
*/
|
657 |
|
658 |
+
public function notifySubscriber($email, $name = NULL)
|
659 |
+
{
|
660 |
+
$cs_receive_email_addr = CSCS_GENEROPTION_PREFIX . 'receive_email_addr';
|
661 |
+
$admin_email = get_bloginfo('admin_email');
|
662 |
+
$to = get_option($cs_receive_email_addr, $admin_email);
|
663 |
+
$email_subject = __("You have a new subscriber!", CSCS_TEXT_DOMAIN);
|
664 |
+
$email_body = "<html><body>" .
|
665 |
+
"<h4>" . __('You have a new subscriber to your website via IgniteUp subscribe form.', CSCS_TEXT_DOMAIN) . "</h4>" .
|
666 |
+
"<p>" . __('Name:', CSCS_TEXT_DOMAIN) . " $name<br>" .
|
667 |
+
__('Email:', CSCS_TEXT_DOMAIN) . " $email</p>" .
|
668 |
+
"<p><a href='" . admin_url('admin.php?page=cscs_subscribers') . "'>View all subscribers</a></p>" .
|
669 |
+
"</body></html>";
|
|
|
|
|
|
|
|
|
670 |
|
671 |
+
$status = wp_mail($to, $email_subject, $email_body, array("MIME-Version: 1.0", "Content-Type: text/html; charset=UTF-8"));
|
672 |
+
return $status;
|
673 |
+
}
|
674 |
+
|
675 |
+
/*
|
676 |
+
*
|
677 |
* Igniteup_head action
|
678 |
+
*
|
679 |
*/
|
680 |
|
681 |
+
public static function perfomIgniteUpHead()
|
682 |
+
{
|
683 |
+
do_action('igniteup_head');
|
684 |
+
}
|
685 |
|
686 |
+
/*
|
687 |
+
*
|
688 |
* Igniteup_footer action
|
689 |
+
*
|
690 |
*/
|
691 |
|
692 |
+
public static function perfomIgniteUpFooter()
|
693 |
+
{
|
694 |
+
do_action('igniteup_footer');
|
695 |
+
}
|
696 |
|
697 |
+
/*
|
698 |
+
*
|
699 |
* Read theme options
|
700 |
+
*
|
701 |
*/
|
702 |
|
703 |
+
public static function igniteUpGetOption($key, $default = NULL)
|
704 |
+
{
|
705 |
+
global $the_cs_template_options;
|
706 |
+
$value = !empty($the_cs_template_options[$key]) ? $the_cs_template_options[$key] : $default;
|
707 |
+
return $value;
|
708 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
|
710 |
+
/**
|
711 |
+
*
|
712 |
+
* Clean all custom options saved in the database on plugin deactivation
|
713 |
+
*
|
714 |
+
*/
|
715 |
|
716 |
+
public function deactivationCleanp()
|
717 |
+
{
|
718 |
+
$temps = CSAdminOptions::getTemplates();
|
719 |
+
foreach ($temps as $temp) {
|
720 |
+
foreach ($temp['options'] as $key => $opt) {
|
721 |
+
delete_option(CSCS_TEMPLATEOPTION_PREFIX . $temp['folder_name'] . "_" . $key);
|
722 |
}
|
723 |
+
}
|
724 |
|
725 |
+
foreach (CSAdminOptions::$gener_options as $opt) {
|
726 |
+
delete_option(CSCS_GENEROPTION_PREFIX . $opt);
|
727 |
+
}
|
728 |
|
729 |
+
foreach (CSAdminOptions::$common_options as $opt) {
|
730 |
+
delete_option(CSCS_GENEROPTION_PREFIX . $opt);
|
731 |
}
|
732 |
}
|
733 |
+
}
|
includes/css/bootstrap-switch.min.css
CHANGED
@@ -1,22 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
* you may not use this file except in compliance with the License.
|
10 |
-
* You may obtain a copy of the License at
|
11 |
-
*
|
12 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13 |
-
*
|
14 |
-
* Unless required by applicable law or agreed to in writing, software
|
15 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
16 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17 |
-
* See the License for the specific language governing permissions and
|
18 |
-
* limitations under the License.
|
19 |
-
* ========================================================================
|
20 |
-
*/
|
21 |
|
22 |
-
.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid #ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:
|
1 |
+
/**
|
2 |
+
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
|
3 |
+
*
|
4 |
+
* @version v3.3.5
|
5 |
+
* @homepage https://bttstrp.github.io/bootstrap-switch
|
6 |
+
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
|
7 |
+
* @license MIT
|
8 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid #ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table-cell;vertical-align:middle;padding:6px 12px;font-size:14px;line-height:20px}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on{text-align:center;z-index:1}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{color:#fff;background:#337ab7}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info{color:#fff;background:#5bc0de}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success{color:#fff;background:#5cb85c}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning{background:#f0ad4e;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger{color:#fff;background:#d9534f}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default{color:#000;background:#eee}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;color:#333;background:#fff}.bootstrap-switch span::before{content:"\200b"}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0);visibility:hidden}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.3333333}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-indeterminate,.bootstrap-switch.bootstrap-switch-readonly{cursor:default!important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label{opacity:.5;filter:alpha(opacity=50);cursor:default!important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;-o-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-radius:0 3px 3px 0}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-radius:3px 0 0 3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px}
|
includes/css/bootstrap.min.css
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
/*!
|
2 |
-
* Bootstrap v3.
|
3 |
-
* Copyright 2011-
|
4 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
5 |
-
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px \9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.form-group-sm .form-control{height:30px;line-height:30px}select[multiple].form-group-sm .form-control,textarea.form-group-sm .form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:5px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.form-group-lg .form-control{height:46px;line-height:46px}select[multiple].form-group-lg .form-control,textarea.form-group-lg .form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:10px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.active,.btn-default.focus,.btn-default:active,.btn-default:focus,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.active,.btn-primary.focus,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.active,.btn-success.focus,.btn-success:active,.btn-success:focus,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.active,.btn-info.focus,.btn-info:active,.btn-info:focus,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.active,.btn-warning.focus,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.active,.btn-danger.focus,.btn-danger:active,.btn-danger:focus,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px)and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.4;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px)and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px)and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px)and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px)and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
|
|
1 |
/*!
|
2 |
+
* Bootstrap v3.4.1 (https://getbootstrap.com/)
|
3 |
+
* Copyright 2011-2019 Twitter, Inc.
|
4 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
5 |
+
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:"Glyphicons Halflings";src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:"Glyphicons Halflings";font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \00A0"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\00A0 \2014"}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.row-no-gutters{margin-right:0;margin-left:0}.row-no-gutters [class*=col-]{padding-right:0;padding-left:0}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);opacity:.65;-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;background-image:none;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;background-image:none;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;background-image:none;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;background-image:none;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;background-image:none;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;background-image:none;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-right:15px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-right:-15px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out,-o-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:12px;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover>.arrow{border-width:11px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out,-o-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;outline:0;filter:alpha(opacity=90);opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:"\2039"}.carousel-control .icon-next:before{content:"\203a"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
|
6 |
+
/*# sourceMappingURL=bootstrap.min.css.map */
|
includes/css/codemirror.min.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}
|
2 |
+
/*# sourceMappingURL=codemirror.min.css.map */
|
includes/css/codemirror/codemirror.css
DELETED
@@ -1,340 +0,0 @@
|
|
1 |
-
/* BASICS */
|
2 |
-
|
3 |
-
.CodeMirror {
|
4 |
-
/* Set height, width, borders, and global font properties here */
|
5 |
-
font-family: monospace;
|
6 |
-
height: 300px;
|
7 |
-
color: black;
|
8 |
-
}
|
9 |
-
|
10 |
-
/* PADDING */
|
11 |
-
|
12 |
-
.CodeMirror-lines {
|
13 |
-
padding: 4px 0; /* Vertical padding around content */
|
14 |
-
}
|
15 |
-
.CodeMirror pre {
|
16 |
-
padding: 0 4px; /* Horizontal padding of content */
|
17 |
-
}
|
18 |
-
|
19 |
-
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
20 |
-
background-color: white; /* The little square between H and V scrollbars */
|
21 |
-
}
|
22 |
-
|
23 |
-
/* GUTTER */
|
24 |
-
|
25 |
-
.CodeMirror-gutters {
|
26 |
-
border-right: 1px solid #ddd;
|
27 |
-
background-color: #f7f7f7;
|
28 |
-
white-space: nowrap;
|
29 |
-
}
|
30 |
-
.CodeMirror-linenumbers {}
|
31 |
-
.CodeMirror-linenumber {
|
32 |
-
padding: 0 3px 0 5px;
|
33 |
-
min-width: 20px;
|
34 |
-
text-align: right;
|
35 |
-
color: #999;
|
36 |
-
white-space: nowrap;
|
37 |
-
}
|
38 |
-
|
39 |
-
.CodeMirror-guttermarker { color: black; }
|
40 |
-
.CodeMirror-guttermarker-subtle { color: #999; }
|
41 |
-
|
42 |
-
/* CURSOR */
|
43 |
-
|
44 |
-
.CodeMirror-cursor {
|
45 |
-
border-left: 1px solid black;
|
46 |
-
border-right: none;
|
47 |
-
width: 0;
|
48 |
-
}
|
49 |
-
/* Shown when moving in bi-directional text */
|
50 |
-
.CodeMirror div.CodeMirror-secondarycursor {
|
51 |
-
border-left: 1px solid silver;
|
52 |
-
}
|
53 |
-
.cm-fat-cursor .CodeMirror-cursor {
|
54 |
-
width: auto;
|
55 |
-
border: 0 !important;
|
56 |
-
background: #7e7;
|
57 |
-
}
|
58 |
-
.cm-fat-cursor div.CodeMirror-cursors {
|
59 |
-
z-index: 1;
|
60 |
-
}
|
61 |
-
|
62 |
-
.cm-animate-fat-cursor {
|
63 |
-
width: auto;
|
64 |
-
border: 0;
|
65 |
-
-webkit-animation: blink 1.06s steps(1) infinite;
|
66 |
-
-moz-animation: blink 1.06s steps(1) infinite;
|
67 |
-
animation: blink 1.06s steps(1) infinite;
|
68 |
-
background-color: #7e7;
|
69 |
-
}
|
70 |
-
@-moz-keyframes blink {
|
71 |
-
0% {}
|
72 |
-
50% { background-color: transparent; }
|
73 |
-
100% {}
|
74 |
-
}
|
75 |
-
@-webkit-keyframes blink {
|
76 |
-
0% {}
|
77 |
-
50% { background-color: transparent; }
|
78 |
-
100% {}
|
79 |
-
}
|
80 |
-
@keyframes blink {
|
81 |
-
0% {}
|
82 |
-
50% { background-color: transparent; }
|
83 |
-
100% {}
|
84 |
-
}
|
85 |
-
|
86 |
-
/* Can style cursor different in overwrite (non-insert) mode */
|
87 |
-
.CodeMirror-overwrite .CodeMirror-cursor {}
|
88 |
-
|
89 |
-
.cm-tab { display: inline-block; text-decoration: inherit; }
|
90 |
-
|
91 |
-
.CodeMirror-rulers {
|
92 |
-
position: absolute;
|
93 |
-
left: 0; right: 0; top: -50px; bottom: -20px;
|
94 |
-
overflow: hidden;
|
95 |
-
}
|
96 |
-
.CodeMirror-ruler {
|
97 |
-
border-left: 1px solid #ccc;
|
98 |
-
top: 0; bottom: 0;
|
99 |
-
position: absolute;
|
100 |
-
}
|
101 |
-
|
102 |
-
/* DEFAULT THEME */
|
103 |
-
|
104 |
-
.cm-s-default .cm-header {color: blue;}
|
105 |
-
.cm-s-default .cm-quote {color: #090;}
|
106 |
-
.cm-negative {color: #d44;}
|
107 |
-
.cm-positive {color: #292;}
|
108 |
-
.cm-header, .cm-strong {font-weight: bold;}
|
109 |
-
.cm-em {font-style: italic;}
|
110 |
-
.cm-link {text-decoration: underline;}
|
111 |
-
.cm-strikethrough {text-decoration: line-through;}
|
112 |
-
|
113 |
-
.cm-s-default .cm-keyword {color: #708;}
|
114 |
-
.cm-s-default .cm-atom {color: #219;}
|
115 |
-
.cm-s-default .cm-number {color: #164;}
|
116 |
-
.cm-s-default .cm-def {color: #00f;}
|
117 |
-
.cm-s-default .cm-variable,
|
118 |
-
.cm-s-default .cm-punctuation,
|
119 |
-
.cm-s-default .cm-property,
|
120 |
-
.cm-s-default .cm-operator {}
|
121 |
-
.cm-s-default .cm-variable-2 {color: #05a;}
|
122 |
-
.cm-s-default .cm-variable-3 {color: #085;}
|
123 |
-
.cm-s-default .cm-comment {color: #a50;}
|
124 |
-
.cm-s-default .cm-string {color: #a11;}
|
125 |
-
.cm-s-default .cm-string-2 {color: #f50;}
|
126 |
-
.cm-s-default .cm-meta {color: #555;}
|
127 |
-
.cm-s-default .cm-qualifier {color: #555;}
|
128 |
-
.cm-s-default .cm-builtin {color: #30a;}
|
129 |
-
.cm-s-default .cm-bracket {color: #997;}
|
130 |
-
.cm-s-default .cm-tag {color: #170;}
|
131 |
-
.cm-s-default .cm-attribute {color: #00c;}
|
132 |
-
.cm-s-default .cm-hr {color: #999;}
|
133 |
-
.cm-s-default .cm-link {color: #00c;}
|
134 |
-
|
135 |
-
.cm-s-default .cm-error {color: #f00;}
|
136 |
-
.cm-invalidchar {color: #f00;}
|
137 |
-
|
138 |
-
.CodeMirror-composing { border-bottom: 2px solid; }
|
139 |
-
|
140 |
-
/* Default styles for common addons */
|
141 |
-
|
142 |
-
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
143 |
-
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
144 |
-
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
145 |
-
.CodeMirror-activeline-background {background: #e8f2ff;}
|
146 |
-
|
147 |
-
/* STOP */
|
148 |
-
|
149 |
-
/* The rest of this file contains styles related to the mechanics of
|
150 |
-
the editor. You probably shouldn't touch them. */
|
151 |
-
|
152 |
-
.CodeMirror {
|
153 |
-
position: relative;
|
154 |
-
overflow: hidden;
|
155 |
-
background: white;
|
156 |
-
}
|
157 |
-
|
158 |
-
.CodeMirror-scroll {
|
159 |
-
overflow: scroll !important; /* Things will break if this is overridden */
|
160 |
-
/* 30px is the magic margin used to hide the element's real scrollbars */
|
161 |
-
/* See overflow: hidden in .CodeMirror */
|
162 |
-
margin-bottom: -30px; margin-right: -30px;
|
163 |
-
padding-bottom: 30px;
|
164 |
-
height: 100%;
|
165 |
-
outline: none; /* Prevent dragging from highlighting the element */
|
166 |
-
position: relative;
|
167 |
-
}
|
168 |
-
.CodeMirror-sizer {
|
169 |
-
position: relative;
|
170 |
-
border-right: 30px solid transparent;
|
171 |
-
}
|
172 |
-
|
173 |
-
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
174 |
-
before actual scrolling happens, thus preventing shaking and
|
175 |
-
flickering artifacts. */
|
176 |
-
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
177 |
-
position: absolute;
|
178 |
-
z-index: 6;
|
179 |
-
display: none;
|
180 |
-
}
|
181 |
-
.CodeMirror-vscrollbar {
|
182 |
-
right: 0; top: 0;
|
183 |
-
overflow-x: hidden;
|
184 |
-
overflow-y: scroll;
|
185 |
-
}
|
186 |
-
.CodeMirror-hscrollbar {
|
187 |
-
bottom: 0; left: 0;
|
188 |
-
overflow-y: hidden;
|
189 |
-
overflow-x: scroll;
|
190 |
-
}
|
191 |
-
.CodeMirror-scrollbar-filler {
|
192 |
-
right: 0; bottom: 0;
|
193 |
-
}
|
194 |
-
.CodeMirror-gutter-filler {
|
195 |
-
left: 0; bottom: 0;
|
196 |
-
}
|
197 |
-
|
198 |
-
.CodeMirror-gutters {
|
199 |
-
position: absolute; left: 0; top: 0;
|
200 |
-
min-height: 100%;
|
201 |
-
z-index: 3;
|
202 |
-
}
|
203 |
-
.CodeMirror-gutter {
|
204 |
-
white-space: normal;
|
205 |
-
height: 100%;
|
206 |
-
display: inline-block;
|
207 |
-
vertical-align: top;
|
208 |
-
margin-bottom: -30px;
|
209 |
-
}
|
210 |
-
.CodeMirror-gutter-wrapper {
|
211 |
-
position: absolute;
|
212 |
-
z-index: 4;
|
213 |
-
background: none !important;
|
214 |
-
border: none !important;
|
215 |
-
}
|
216 |
-
.CodeMirror-gutter-background {
|
217 |
-
position: absolute;
|
218 |
-
top: 0; bottom: 0;
|
219 |
-
z-index: 4;
|
220 |
-
}
|
221 |
-
.CodeMirror-gutter-elt {
|
222 |
-
position: absolute;
|
223 |
-
cursor: default;
|
224 |
-
z-index: 4;
|
225 |
-
}
|
226 |
-
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
|
227 |
-
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
|
228 |
-
|
229 |
-
.CodeMirror-lines {
|
230 |
-
cursor: text;
|
231 |
-
min-height: 1px; /* prevents collapsing before first draw */
|
232 |
-
}
|
233 |
-
.CodeMirror pre {
|
234 |
-
/* Reset some styles that the rest of the page might have set */
|
235 |
-
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
236 |
-
border-width: 0;
|
237 |
-
background: transparent;
|
238 |
-
font-family: inherit;
|
239 |
-
font-size: inherit;
|
240 |
-
margin: 0;
|
241 |
-
white-space: pre;
|
242 |
-
word-wrap: normal;
|
243 |
-
line-height: inherit;
|
244 |
-
color: inherit;
|
245 |
-
z-index: 2;
|
246 |
-
position: relative;
|
247 |
-
overflow: visible;
|
248 |
-
-webkit-tap-highlight-color: transparent;
|
249 |
-
-webkit-font-variant-ligatures: contextual;
|
250 |
-
font-variant-ligatures: contextual;
|
251 |
-
}
|
252 |
-
.CodeMirror-wrap pre {
|
253 |
-
word-wrap: break-word;
|
254 |
-
white-space: pre-wrap;
|
255 |
-
word-break: normal;
|
256 |
-
}
|
257 |
-
|
258 |
-
.CodeMirror-linebackground {
|
259 |
-
position: absolute;
|
260 |
-
left: 0; right: 0; top: 0; bottom: 0;
|
261 |
-
z-index: 0;
|
262 |
-
}
|
263 |
-
|
264 |
-
.CodeMirror-linewidget {
|
265 |
-
position: relative;
|
266 |
-
z-index: 2;
|
267 |
-
overflow: auto;
|
268 |
-
}
|
269 |
-
|
270 |
-
.CodeMirror-widget {}
|
271 |
-
|
272 |
-
.CodeMirror-rtl pre { direction: rtl; }
|
273 |
-
|
274 |
-
.CodeMirror-code {
|
275 |
-
outline: none;
|
276 |
-
}
|
277 |
-
|
278 |
-
/* Force content-box sizing for the elements where we expect it */
|
279 |
-
.CodeMirror-scroll,
|
280 |
-
.CodeMirror-sizer,
|
281 |
-
.CodeMirror-gutter,
|
282 |
-
.CodeMirror-gutters,
|
283 |
-
.CodeMirror-linenumber {
|
284 |
-
-moz-box-sizing: content-box;
|
285 |
-
box-sizing: content-box;
|
286 |
-
}
|
287 |
-
|
288 |
-
.CodeMirror-measure {
|
289 |
-
position: absolute;
|
290 |
-
width: 100%;
|
291 |
-
height: 0;
|
292 |
-
overflow: hidden;
|
293 |
-
visibility: hidden;
|
294 |
-
}
|
295 |
-
|
296 |
-
.CodeMirror-cursor {
|
297 |
-
position: absolute;
|
298 |
-
pointer-events: none;
|
299 |
-
}
|
300 |
-
.CodeMirror-measure pre { position: static; }
|
301 |
-
|
302 |
-
div.CodeMirror-cursors {
|
303 |
-
visibility: hidden;
|
304 |
-
position: relative;
|
305 |
-
z-index: 3;
|
306 |
-
}
|
307 |
-
div.CodeMirror-dragcursors {
|
308 |
-
visibility: visible;
|
309 |
-
}
|
310 |
-
|
311 |
-
.CodeMirror-focused div.CodeMirror-cursors {
|
312 |
-
visibility: visible;
|
313 |
-
}
|
314 |
-
|
315 |
-
.CodeMirror-selected { background: #d9d9d9; }
|
316 |
-
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
317 |
-
.CodeMirror-crosshair { cursor: crosshair; }
|
318 |
-
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
319 |
-
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
320 |
-
|
321 |
-
.cm-searching {
|
322 |
-
background: #ffa;
|
323 |
-
background: rgba(255, 255, 0, .4);
|
324 |
-
}
|
325 |
-
|
326 |
-
/* Used to force a border model for a node */
|
327 |
-
.cm-force-border { padding-right: .1px; }
|
328 |
-
|
329 |
-
@media print {
|
330 |
-
/* Hide the cursor when printing */
|
331 |
-
.CodeMirror div.CodeMirror-cursors {
|
332 |
-
visibility: hidden;
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
/* See issue #2901 */
|
337 |
-
.cm-tab-wrap-hack:after { content: ''; }
|
338 |
-
|
339 |
-
/* Help users use markselection to safely style text background */
|
340 |
-
span.CodeMirror-selectedtext { background: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/css/codemirror/ttcn.css
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
.cm-s-ttcn .cm-quote { color: #090; }
|
2 |
-
.cm-s-ttcn .cm-negative { color: #d44; }
|
3 |
-
.cm-s-ttcn .cm-positive { color: #292; }
|
4 |
-
.cm-s-ttcn .cm-header, .cm-strong { font-weight: bold; }
|
5 |
-
.cm-s-ttcn .cm-em { font-style: italic; }
|
6 |
-
.cm-s-ttcn .cm-link { text-decoration: underline; }
|
7 |
-
.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; }
|
8 |
-
.cm-s-ttcn .cm-header { color: #00f; font-weight: bold; }
|
9 |
-
|
10 |
-
.cm-s-ttcn .cm-atom { color: #219; }
|
11 |
-
.cm-s-ttcn .cm-attribute { color: #00c; }
|
12 |
-
.cm-s-ttcn .cm-bracket { color: #997; }
|
13 |
-
.cm-s-ttcn .cm-comment { color: #333333; }
|
14 |
-
.cm-s-ttcn .cm-def { color: #00f; }
|
15 |
-
.cm-s-ttcn .cm-em { font-style: italic; }
|
16 |
-
.cm-s-ttcn .cm-error { color: #f00; }
|
17 |
-
.cm-s-ttcn .cm-hr { color: #999; }
|
18 |
-
.cm-s-ttcn .cm-invalidchar { color: #f00; }
|
19 |
-
.cm-s-ttcn .cm-keyword { font-weight:bold; }
|
20 |
-
.cm-s-ttcn .cm-link { color: #00c; text-decoration: underline; }
|
21 |
-
.cm-s-ttcn .cm-meta { color: #555; }
|
22 |
-
.cm-s-ttcn .cm-negative { color: #d44; }
|
23 |
-
.cm-s-ttcn .cm-positive { color: #292; }
|
24 |
-
.cm-s-ttcn .cm-qualifier { color: #555; }
|
25 |
-
.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; }
|
26 |
-
.cm-s-ttcn .cm-string { color: #006400; }
|
27 |
-
.cm-s-ttcn .cm-string-2 { color: #f50; }
|
28 |
-
.cm-s-ttcn .cm-strong { font-weight: bold; }
|
29 |
-
.cm-s-ttcn .cm-tag { color: #170; }
|
30 |
-
.cm-s-ttcn .cm-variable { color: #8B2252; }
|
31 |
-
.cm-s-ttcn .cm-variable-2 { color: #05a; }
|
32 |
-
.cm-s-ttcn .cm-variable-3 { color: #085; }
|
33 |
-
|
34 |
-
.cm-s-ttcn .cm-invalidchar { color: #f00; }
|
35 |
-
|
36 |
-
/* ASN */
|
37 |
-
.cm-s-ttcn .cm-accessTypes,
|
38 |
-
.cm-s-ttcn .cm-compareTypes { color: #27408B; }
|
39 |
-
.cm-s-ttcn .cm-cmipVerbs { color: #8B2252; }
|
40 |
-
.cm-s-ttcn .cm-modifier { color:#D2691E; }
|
41 |
-
.cm-s-ttcn .cm-status { color:#8B4545; }
|
42 |
-
.cm-s-ttcn .cm-storage { color:#A020F0; }
|
43 |
-
.cm-s-ttcn .cm-tags { color:#006400; }
|
44 |
-
|
45 |
-
/* CFG */
|
46 |
-
.cm-s-ttcn .cm-externalCommands { color: #8B4545; font-weight:bold; }
|
47 |
-
.cm-s-ttcn .cm-fileNCtrlMaskOptions,
|
48 |
-
.cm-s-ttcn .cm-sectionTitle { color: #2E8B57; font-weight:bold; }
|
49 |
-
|
50 |
-
/* TTCN */
|
51 |
-
.cm-s-ttcn .cm-booleanConsts,
|
52 |
-
.cm-s-ttcn .cm-otherConsts,
|
53 |
-
.cm-s-ttcn .cm-verdictConsts { color: #006400; }
|
54 |
-
.cm-s-ttcn .cm-configOps,
|
55 |
-
.cm-s-ttcn .cm-functionOps,
|
56 |
-
.cm-s-ttcn .cm-portOps,
|
57 |
-
.cm-s-ttcn .cm-sutOps,
|
58 |
-
.cm-s-ttcn .cm-timerOps,
|
59 |
-
.cm-s-ttcn .cm-verdictOps { color: #0000FF; }
|
60 |
-
.cm-s-ttcn .cm-preprocessor,
|
61 |
-
.cm-s-ttcn .cm-templateMatch,
|
62 |
-
.cm-s-ttcn .cm-ttcn3Macros { color: #27408B; }
|
63 |
-
.cm-s-ttcn .cm-types { color: #A52A2A; font-weight:bold; }
|
64 |
-
.cm-s-ttcn .cm-visibilityModifiers { font-weight:bold; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/css/jquery-ui.min.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.13.2 - 2022-07-14
|
2 |
+
* http://jqueryui.com
|
3 |
+
* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
|
5 |
+
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
6 |
+
|
7 |
+
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;-ms-filter:"alpha(opacity=25)";opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;-ms-filter:"alpha(opacity=70)";font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;-ms-filter:"alpha(opacity=35)";background-image:none}.ui-state-disabled .ui-icon{-ms-filter:"alpha(opacity=35)"}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank.ui-icon-blank.ui-icon-blank{background-image:none}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.003;-ms-filter:Alpha(Opacity=.3)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
|
includes/css/jquery.timepicker.min.css
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
/**
|
2 |
-
* jQuery Timepicker - v1.3.
|
3 |
* http://timepicker.co
|
4 |
*
|
5 |
* Enhances standard form input fields helping users to select (or type) times.
|
6 |
*
|
7 |
-
* Copyright (c)
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.ui-timepicker-container{position:absolute;overflow:hidden;box-sizing:border-box}.ui-timepicker{box-sizing:content-box;display:block;height:205px;list-style:none outside none;margin:0;padding:0 1px;text-align:center}.ui-timepicker-viewport{box-sizing:content-box;display:block;height:205px;margin:0;padding:0;overflow:auto;overflow-x:hidden}.ui-timepicker-standard{font-family:Verdana,Arial,sans-serif;background-color:#FFF;border:1px solid #AAA;color:#222;margin:0;padding:2px}.ui-timepicker-standard a{border:1px solid transparent;color:#222;display:block;text-decoration:none}.ui-timepicker-standard .ui-state-hover{background-color:#DADADA;border:1px solid #999;font-weight:400;color:#212121}.ui-timepicker-standard .ui-menu-item{margin:0;padding:0}.ui-timepicker-corners,.ui-timepicker-corners .ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.ui-timepicker-hidden{display:none}.ui-timepicker-no-scrollbar .ui-timepicker{border:0}
|
1 |
/**
|
2 |
+
* jQuery Timepicker - v1.3.5 - 2016-07-10
|
3 |
* http://timepicker.co
|
4 |
*
|
5 |
* Enhances standard form input fields helping users to select (or type) times.
|
6 |
*
|
7 |
+
* Copyright (c) 2016 Willington Vega; Licensed MIT, GPL
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.ui-timepicker-container{position:absolute;overflow:hidden;box-sizing:border-box}.ui-timepicker{box-sizing:content-box;display:block;height:205px;list-style:none outside none;margin:0;padding:0 1px;text-align:center}.ui-timepicker-viewport{box-sizing:content-box;display:block;height:205px;margin:0;padding:0;overflow:auto;overflow-x:hidden}.ui-timepicker-standard{font-family:Verdana,Arial,sans-serif;font-size:1.1em;background-color:#FFF;border:1px solid #AAA;color:#222;margin:0;padding:2px}.ui-timepicker-standard a{border:1px solid transparent;color:#222;display:block;padding:.2em .4em;text-decoration:none}.ui-timepicker-standard .ui-state-hover{background-color:#DADADA;border:1px solid #999;font-weight:400;color:#212121}.ui-timepicker-standard .ui-menu-item{margin:0;padding:0}.ui-timepicker-corners,.ui-timepicker-corners .ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.ui-timepicker-hidden{display:none}.ui-timepicker-no-scrollbar .ui-timepicker{border:0}
|
includes/js/bootstrap-switch.min.js
CHANGED
@@ -1,22 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
* you may not use this file except in compliance with the License.
|
10 |
-
* You may obtain a copy of the License at
|
11 |
-
*
|
12 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13 |
-
*
|
14 |
-
* Unless required by applicable law or agreed to in writing, software
|
15 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
16 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17 |
-
* See the License for the specific language governing permissions and
|
18 |
-
* limitations under the License.
|
19 |
-
* ========================================================================
|
20 |
-
*/
|
21 |
|
22 |
-
(function(){var t=[].slice;!function(e,i){"use strict";var n;return n=function(){function t(t,i){null==i&&(i={}),this.$element=e(t),this.options=e.extend({},e.fn.bootstrapSwitch.defaults,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioAllOff:this.$element.data("radio-all-off"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),handleWidth:this.$element.data("handle-width"),labelWidth:this.$element.data("label-width"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")},i),this.prevOptions={},this.$wrapper=e("<div>",{"class":function(t){return function(){var e;return e=[""+t.options.baseClass].concat(t._getClasses(t.options.wrapperClass)),e.push(t.options.state?t.options.baseClass+"-on":t.options.baseClass+"-off"),null!=t.options.size&&e.push(t.options.baseClass+"-"+t.options.size),t.options.disabled&&e.push(t.options.baseClass+"-disabled"),t.options.readonly&&e.push(t.options.baseClass+"-readonly"),t.options.indeterminate&&e.push(t.options.baseClass+"-indeterminate"),t.options.inverse&&e.push(t.options.baseClass+"-inverse"),t.$element.attr("id")&&e.push(t.options.baseClass+"-id-"+t.$element.attr("id")),e.join(" ")}}(this)()}),this.$container=e("<div>",{"class":this.options.baseClass+"-container"}),this.$on=e("<span>",{html:this.options.onText,"class":this.options.baseClass+"-handle-on "+this.options.baseClass+"-"+this.options.onColor}),this.$off=e("<span>",{html:this.options.offText,"class":this.options.baseClass+"-handle-off "+this.options.baseClass+"-"+this.options.offColor}),this.$label=e("<span>",{html:this.options.labelText,"class":this.options.baseClass+"-label"}),this.$element.on("init.bootstrapSwitch",function(e){return function(){return e.options.onInit.apply(t,arguments)}}(this)),this.$element.on("switchChange.bootstrapSwitch",function(i){return function(n){return!1===i.options.onSwitchChange.apply(t,arguments)?i.$element.is(":radio")?e("[name='"+i.$element.attr("name")+"']").trigger("previousState.bootstrapSwitch",!0):i.$element.trigger("previousState.bootstrapSwitch",!0):void 0}}(this)),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this._init(),this._elementHandlers(),this._handleHandlers(),this._labelHandlers(),this._formHandler(),this._externalLabelHandler(),this.$element.trigger("init.bootstrapSwitch",this.options.state)}return t.prototype._constructor=t,t.prototype.setPrevOptions=function(){return this.prevOptions=e.extend(!0,{},this.options)},t.prototype.state=function(t,i){return"undefined"==typeof t?this.options.state:this.options.disabled||this.options.readonly?this.$element:this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")?this.$element:(this.$element.is(":radio")?e("[name='"+this.$element.attr("name")+"']").trigger("setPreviousOptions.bootstrapSwitch"):this.$element.trigger("setPreviousOptions.bootstrapSwitch"),this.options.indeterminate&&this.indeterminate(!1),t=!!t,this.$element.prop("checked",t).trigger("change.bootstrapSwitch",i),this.$element)},t.prototype.toggleState=function(t){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",t)},t.prototype.size=function(t){return"undefined"==typeof t?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(this.options.baseClass+"-"+this.options.size),t&&this.$wrapper.addClass(this.options.baseClass+"-"+t),this._width(),this._containerPosition(),this.options.size=t,this.$element)},t.prototype.animate=function(t){return"undefined"==typeof t?this.options.animate:(t=!!t,t===this.options.animate?this.$element:this.toggleAnimate())},t.prototype.toggleAnimate=function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(this.options.baseClass+"-animate"),this.$element},t.prototype.disabled=function(t){return"undefined"==typeof t?this.options.disabled:(t=!!t,t===this.options.disabled?this.$element:this.toggleDisabled())},t.prototype.toggleDisabled=function(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleClass(this.options.baseClass+"-disabled"),this.$element},t.prototype.readonly=function(t){return"undefined"==typeof t?this.options.readonly:(t=!!t,t===this.options.readonly?this.$element:this.toggleReadonly())},t.prototype.toggleReadonly=function(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleClass(this.options.baseClass+"-readonly"),this.$element},t.prototype.indeterminate=function(t){return"undefined"==typeof t?this.options.indeterminate:(t=!!t,t===this.options.indeterminate?this.$element:this.toggleIndeterminate())},t.prototype.toggleIndeterminate=function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleClass(this.options.baseClass+"-indeterminate"),this._containerPosition(),this.$element},t.prototype.inverse=function(t){return"undefined"==typeof t?this.options.inverse:(t=!!t,t===this.options.inverse?this.$element:this.toggleInverse())},t.prototype.toggleInverse=function(){var t,e;return this.$wrapper.toggleClass(this.options.baseClass+"-inverse"),e=this.$on.clone(!0),t=this.$off.clone(!0),this.$on.replaceWith(t),this.$off.replaceWith(e),this.$on=t,this.$off=e,this.options.inverse=!this.options.inverse,this.$element},t.prototype.onColor=function(t){var e;return e=this.options.onColor,"undefined"==typeof t?e:(null!=e&&this.$on.removeClass(this.options.baseClass+"-"+e),this.$on.addClass(this.options.baseClass+"-"+t),this.options.onColor=t,this.$element)},t.prototype.offColor=function(t){var e;return e=this.options.offColor,"undefined"==typeof t?e:(null!=e&&this.$off.removeClass(this.options.baseClass+"-"+e),this.$off.addClass(this.options.baseClass+"-"+t),this.options.offColor=t,this.$element)},t.prototype.onText=function(t){return"undefined"==typeof t?this.options.onText:(this.$on.html(t),this._width(),this._containerPosition(),this.options.onText=t,this.$element)},t.prototype.offText=function(t){return"undefined"==typeof t?this.options.offText:(this.$off.html(t),this._width(),this._containerPosition(),this.options.offText=t,this.$element)},t.prototype.labelText=function(t){return"undefined"==typeof t?this.options.labelText:(this.$label.html(t),this._width(),this.options.labelText=t,this.$element)},t.prototype.handleWidth=function(t){return"undefined"==typeof t?this.options.handleWidth:(this.options.handleWidth=t,this._width(),this._containerPosition(),this.$element)},t.prototype.labelWidth=function(t){return"undefined"==typeof t?this.options.labelWidth:(this.options.labelWidth=t,this._width(),this._containerPosition(),this.$element)},t.prototype.baseClass=function(t){return this.options.baseClass},t.prototype.wrapperClass=function(t){return"undefined"==typeof t?this.options.wrapperClass:(t||(t=e.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(t).join(" ")),this.options.wrapperClass=t,this.$element)},t.prototype.radioAllOff=function(t){return"undefined"==typeof t?this.options.radioAllOff:(t=!!t,t===this.options.radioAllOff?this.$element:(this.options.radioAllOff=t,this.$element))},t.prototype.onInit=function(t){return"undefined"==typeof t?this.options.onInit:(t||(t=e.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=t,this.$element)},t.prototype.onSwitchChange=function(t){return"undefined"==typeof t?this.options.onSwitchChange:(t||(t=e.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=t,this.$element)},t.prototype.destroy=function(){var t;return t=this.$element.closest("form"),t.length&&t.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element},t.prototype._width=function(){var t,e;return t=this.$on.add(this.$off),t.add(this.$label).css("width",""),e="auto"===this.options.handleWidth?Math.max(this.$on.width(),this.$off.width()):this.options.handleWidth,t.width(e),this.$label.width(function(t){return function(i,n){return"auto"!==t.options.labelWidth?t.options.labelWidth:e>n?e:n}}(this)),this._handleWidth=this.$on.outerWidth(),this._labelWidth=this.$label.outerWidth(),this.$container.width(2*this._handleWidth+this._labelWidth),this.$wrapper.width(this._handleWidth+this._labelWidth)},t.prototype._containerPosition=function(t,e){return null==t&&(t=this.options.state),this.$container.css("margin-left",function(e){return function(){var i;return i=[0,"-"+e._handleWidth+"px"],e.options.indeterminate?"-"+e._handleWidth/2+"px":t?e.options.inverse?i[1]:i[0]:e.options.inverse?i[0]:i[1]}}(this)),e?setTimeout(function(){return e()},50):void 0},t.prototype._init=function(){var t,e;return t=function(t){return function(){return t.setPrevOptions(),t._width(),t._containerPosition(null,function(){return t.options.animate?t.$wrapper.addClass(t.options.baseClass+"-animate"):void 0})}}(this),this.$wrapper.is(":visible")?t():e=i.setInterval(function(n){return function(){return n.$wrapper.is(":visible")?(t(),i.clearInterval(e)):void 0}}(this),50)},t.prototype._elementHandlers=function(){return this.$element.on({"setPreviousOptions.bootstrapSwitch":function(t){return function(e){return t.setPrevOptions()}}(this),"previousState.bootstrapSwitch":function(t){return function(e){return t.options=t.prevOptions,t.options.indeterminate&&t.$wrapper.addClass(t.options.baseClass+"-indeterminate"),t.$element.prop("checked",t.options.state).trigger("change.bootstrapSwitch",!0)}}(this),"change.bootstrapSwitch":function(t){return function(i,n){var o;return i.preventDefault(),i.stopImmediatePropagation(),o=t.$element.is(":checked"),t._containerPosition(o),o!==t.options.state?(t.options.state=o,t.$wrapper.toggleClass(t.options.baseClass+"-off").toggleClass(t.options.baseClass+"-on"),n?void 0:(t.$element.is(":radio")&&e("[name='"+t.$element.attr("name")+"']").not(t.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),t.$element.trigger("switchChange.bootstrapSwitch",[o]))):void 0}}(this),"focus.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),t.$wrapper.addClass(t.options.baseClass+"-focused")}}(this),"blur.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),t.$wrapper.removeClass(t.options.baseClass+"-focused")}}(this),"keydown.bootstrapSwitch":function(t){return function(e){if(e.which&&!t.options.disabled&&!t.options.readonly)switch(e.which){case 37:return e.preventDefault(),e.stopImmediatePropagation(),t.state(!1);case 39:return e.preventDefault(),e.stopImmediatePropagation(),t.state(!0)}}}(this)})},t.prototype._handleHandlers=function(){return this.$on.on("click.bootstrapSwitch",function(t){return function(e){return e.preventDefault(),e.stopPropagation(),t.state(!1),t.$element.trigger("focus.bootstrapSwitch")}}(this)),this.$off.on("click.bootstrapSwitch",function(t){return function(e){return e.preventDefault(),e.stopPropagation(),t.state(!0),t.$element.trigger("focus.bootstrapSwitch")}}(this))},t.prototype._labelHandlers=function(){return this.$label.on({click:function(t){return t.stopPropagation()},"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(t){return function(e){return t._dragStart||t.options.disabled||t.options.readonly?void 0:(e.preventDefault(),e.stopPropagation(),t._dragStart=(e.pageX||e.originalEvent.touches[0].pageX)-parseInt(t.$container.css("margin-left"),10),t.options.animate&&t.$wrapper.removeClass(t.options.baseClass+"-animate"),t.$element.trigger("focus.bootstrapSwitch"))}}(this),"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(t){return function(e){var i;if(null!=t._dragStart&&(e.preventDefault(),i=(e.pageX||e.originalEvent.touches[0].pageX)-t._dragStart,!(i<-t._handleWidth||i>0)))return t._dragEnd=i,t.$container.css("margin-left",t._dragEnd+"px")}}(this),"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(t){return function(e){var i;if(t._dragStart)return e.preventDefault(),t.options.animate&&t.$wrapper.addClass(t.options.baseClass+"-animate"),t._dragEnd?(i=t._dragEnd>-(t._handleWidth/2),t._dragEnd=!1,t.state(t.options.inverse?!i:i)):t.state(!t.options.state),t._dragStart=!1}}(this),"mouseleave.bootstrapSwitch":function(t){return function(e){return t.$label.trigger("mouseup.bootstrapSwitch")}}(this)})},t.prototype._externalLabelHandler=function(){var t;return t=this.$element.closest("label"),t.on("click",function(e){return function(i){return i.preventDefault(),i.stopImmediatePropagation(),i.target===t[0]?e.toggleState():void 0}}(this))},t.prototype._formHandler=function(){var t;return t=this.$element.closest("form"),t.data("bootstrap-switch")?void 0:t.on("reset.bootstrapSwitch",function(){return i.setTimeout(function(){return t.find("input").filter(function(){return e(this).data("bootstrap-switch")}).each(function(){return e(this).bootstrapSwitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},t.prototype._getClasses=function(t){var i,n,o,s;if(!e.isArray(t))return[this.options.baseClass+"-"+t];for(n=[],o=0,s=t.length;s>o;o++)i=t[o],n.push(this.options.baseClass+"-"+i);return n},t}(),e.fn.bootstrapSwitch=function(){var i,o,s;return o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],s=this,this.each(function(){var t,a;return t=e(this),a=t.data("bootstrap-switch"),a||t.data("bootstrap-switch",a=new n(this,o)),"string"==typeof o?s=a[o].apply(a,i):void 0}),s},e.fn.bootstrapSwitch.Constructor=n,e.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:" ",handleWidth:"auto",labelWidth:"auto",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function(){},onSwitchChange:function(){}}}(window.jQuery,window)}).call(this);
|
1 |
+
/**
|
2 |
+
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
|
3 |
+
*
|
4 |
+
* @version v3.3.5
|
5 |
+
* @homepage https://bttstrp.github.io/bootstrap-switch
|
6 |
+
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
|
7 |
+
* @license MIT
|
8 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
(function(a,b){if('function'==typeof define&&define.amd)define(['jquery'],b);else if('undefined'!=typeof exports)b(require('jquery'));else{b(a.jquery),a.bootstrapSwitch={exports:{}}.exports}})(this,function(a){'use strict';function c(x,y){if(!(x instanceof y))throw new TypeError('Cannot call a class as a function')}function d(x,y){var z=x.state,A=x.size,B=x.disabled,C=x.readonly,D=x.indeterminate,E=x.inverse;return[z?'on':'off',A,B?'disabled':void 0,C?'readonly':void 0,D?'indeterminate':void 0,E?'inverse':void 0,y?'id-'+y:void 0].filter(function(F){return null==F})}function e(){return{state:this.$element.is(':checked'),size:this.$element.data('size'),animate:this.$element.data('animate'),disabled:this.$element.is(':disabled'),readonly:this.$element.is('[readonly]'),indeterminate:this.$element.data('indeterminate'),inverse:this.$element.data('inverse'),radioAllOff:this.$element.data('radio-all-off'),onColor:this.$element.data('on-color'),offColor:this.$element.data('off-color'),onText:this.$element.data('on-text'),offText:this.$element.data('off-text'),labelText:this.$element.data('label-text'),handleWidth:this.$element.data('handle-width'),labelWidth:this.$element.data('label-width'),baseClass:this.$element.data('base-class'),wrapperClass:this.$element.data('wrapper-class')}}function f(){var x=this,y=this.$on.add(this.$off).add(this.$label).css('width',''),z='auto'===this.options.handleWidth?Math.round(Math.max(this.$on.width(),this.$off.width())):this.options.handleWidth;return y.width(z),this.$label.width(function(A,B){return'auto'===x.options.labelWidth?B<z?z:B:x.options.labelWidth}),this.privateHandleWidth=this.$on.outerWidth(),this.privateLabelWidth=this.$label.outerWidth(),this.$container.width(2*this.privateHandleWidth+this.privateLabelWidth),this.$wrapper.width(this.privateHandleWidth+this.privateLabelWidth)}function g(){var x=this,y=0<arguments.length&&arguments[0]!==void 0?arguments[0]:this.ope;this.$container.css('margin-left',function(){var z=[0,'-'+x.privateHandleWidth+'px'];return x.options.indeterminate?'-'+x.privateHandleWidth/2+'px':y?x.options.inverse?z[1]:z[0]:x.options.inverse?z[0]:z[1]})}function h(x){return this.options.baseClass+'-'+x}function j(){var x=this,y=function(){x.setPrevOptions(),f.call(x),g.call(x),setTimeout(function(){return x.options.animate&&x.$wrapper.addClass(h.call(x,'animate'))},50)};if(this.$wrapper.is(':visible'))return void y();var z=window.setInterval(function(){return x.$wrapper.is(':visible')&&(y()||!0)&&window.clearInterval(z)},50)}function k(){var x=this;return this.$element.on({'setPreviousOptions.bootstrapSwitch':function(){return x.setPrevOptions()},'previousState.bootstrapSwitch':function(){x.options=x.prevOptions,x.options.indeterminate&&x.$wrapper.addClass(h.call(x,'indeterminate')),x.$element.prop('checked',x.options.state).trigger('change.bootstrapSwitch',!0)},'change.bootstrapSwitch':function(z,A){z.preventDefault(),z.stopImmediatePropagation();var B=x.$element.is(':checked');g.call(x,B);B===x.options.state||(x.options.state=B,x.$wrapper.toggleClass(h.call(x,'off')).toggleClass(h.call(x,'on')),!A&&(x.$element.is(':radio')&&u('[name="'+x.$element.attr('name')+'"]').not(x.$element).prop('checked',!1).trigger('change.bootstrapSwitch',!0),x.$element.trigger('switchChange.bootstrapSwitch',[B])))},'focus.bootstrapSwitch':function(z){z.preventDefault(),x.$wrapper.addClass(h.call(x,'focused'))},'blur.bootstrapSwitch':function(z){z.preventDefault(),x.$wrapper.removeClass(h.call(x,'focused'))},'keydown.bootstrapSwitch':function(z){!z.which||x.options.disabled||x.options.readonly||(37===z.which||39===z.which)&&(z.preventDefault(),z.stopImmediatePropagation(),x.state(39===z.which))}})}function l(){var x=this;return this.$on.on('click.bootstrapSwitch',function(y){return y.preventDefault(),y.stopPropagation(),x.state(!1),x.$element.trigger('focus.bootstrapSwitch')}),this.$off.on('click.bootstrapSwitch',function(y){return y.preventDefault(),y.stopPropagation(),x.state(!0),x.$element.trigger('focus.bootstrapSwitch')})}function m(){var x=this,y=void 0,z=void 0;this.$label.on({click:function(C){C.stopPropagation()},'mousedown.bootstrapSwitch touchstart.bootstrapSwitch':function(C){y||x.options.disabled||x.options.readonly||(C.preventDefault(),C.stopPropagation(),y=(C.pageX||C.originalEvent.touches[0].pageX)-parseInt(x.$container.css('margin-left'),10),x.options.animate&&x.$wrapper.removeClass(h.call(x,'animate')),x.$element.trigger('focus.bootstrapSwitch'))},'mousemove.bootstrapSwitch touchmove.bootstrapSwitch':function(C){if(null!=y){var D=(C.pageX||C.originalEvent.touches[0].pageX)-y;C.preventDefault(),D<-x.privateHandleWidth||0<D||(z=D,x.$container.css('margin-left',z+'px'))}},'mouseup.bootstrapSwitch touchend.bootstrapSwitch':function(C){if(y){if(C.preventDefault(),x.options.animate&&x.$wrapper.addClass(h.call(x,'animate')),z){var D=z>-(x.privateHandleWidth/2);z=!1,x.state(x.options.inverse?!D:D)}else x.state(!x.options.state);y=!1}},'mouseleave.bootstrapSwitch':function(){x.$label.trigger('mouseup.bootstrapSwitch')}})}function n(){var x=this,y=this.$element.closest('label');y.on('click',function(z){z.preventDefault(),z.stopImmediatePropagation(),z.target===y[0]&&x.toggleState()})}function o(){function x(){return u(this).data('bootstrap-switch')}function y(){return u(this).bootstrapSwitch('state',this.checked)}var z=this.$element.closest('form');z.data('bootstrap-switch')||z.on('reset.bootstrapSwitch',function(){window.setTimeout(function(){z.find('input').filter(x).each(y)},1)}).data('bootstrap-switch',!0)}function p(x){var y=this;return u.isArray(x)?x.map(function(z){return h.call(y,z)}):[h.call(this,x)]}var r=function(x){return x&&x.__esModule?x:{default:x}}(a),s=Object.assign||function(x){for(var z,y=1;y<arguments.length;y++)for(var A in z=arguments[y],z)Object.prototype.hasOwnProperty.call(z,A)&&(x[A]=z[A]);return x},t=function(){function x(y,z){for(var B,A=0;A<z.length;A++)B=z[A],B.enumerable=B.enumerable||!1,B.configurable=!0,'value'in B&&(B.writable=!0),Object.defineProperty(y,B.key,B)}return function(y,z,A){return z&&x(y.prototype,z),A&&x(y,A),y}}(),u=r.default||window.jQuery||window.$,w=function(){function x(y){var z=this,A=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};c(this,x),this.$element=u(y),this.options=u.extend({},u.fn.bootstrapSwitch.defaults,e.call(this),A),this.prevOptions={},this.$wrapper=u('<div>',{class:function(){return d(z.options,z.$element.attr('id')).map(function(C){return h.call(z,C)}).concat([z.options.baseClass],p.call(z,z.options.wrapperClass)).join(' ')}}),this.$container=u('<div>',{class:h.call(this,'container')}),this.$on=u('<span>',{html:this.options.onText,class:h.call(this,'handle-on')+' '+h.call(this,this.options.onColor)}),this.$off=u('<span>',{html:this.options.offText,class:h.call(this,'handle-off')+' '+h.call(this,this.options.offColor)}),this.$label=u('<span>',{html:this.options.labelText,class:h.call(this,'label')}),this.$element.on('init.bootstrapSwitch',function(){return z.options.onInit(y)}),this.$element.on('switchChange.bootstrapSwitch',function(){for(var B=arguments.length,C=Array(B),D=0;D<B;D++)C[D]=arguments[D];var E=z.options.onSwitchChange.apply(y,C);!1===E&&(z.$element.is(':radio')?u('[name="'+z.$element.attr('name')+'"]').trigger('previousState.bootstrapSwitch',!0):z.$element.trigger('previousState.bootstrapSwitch',!0))}),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop('indeterminate',!0),j.call(this),k.call(this),l.call(this),m.call(this),o.call(this),n.call(this),this.$element.trigger('init.bootstrapSwitch',this.options.state)}return t(x,[{key:'setPrevOptions',value:function(){this.prevOptions=s({},this.options)}},{key:'state',value:function(z,A){return'undefined'==typeof z?this.options.state:this.options.disabled||this.options.readonly||this.options.state&&!this.options.radioAllOff&&this.$element.is(':radio')?this.$element:(this.$element.is(':radio')?u('[name="'+this.$element.attr('name')+'"]').trigger('setPreviousOptions.bootstrapSwitch'):this.$element.trigger('setPreviousOptions.bootstrapSwitch'),this.options.indeterminate&&this.indeterminate(!1),this.$element.prop('checked',!!z).trigger('change.bootstrapSwitch',A),this.$element)}},{key:'toggleState',value:function(z){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop('checked',!this.options.state).trigger('change.bootstrapSwitch',z)}},{key:'size',value:function(z){return'undefined'==typeof z?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(h.call(this,this.options.size)),z&&this.$wrapper.addClass(h.call(this,z)),f.call(this),g.call(this),this.options.size=z,this.$element)}},{key:'animate',value:function(z){return'undefined'==typeof z?this.options.animate:this.options.animate===!!z?this.$element:this.toggleAnimate()}},{key:'toggleAnimate',value:function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(h.call(this,'animate')),this.$element}},{key:'disabled',value:function(z){return'undefined'==typeof z?this.options.disabled:this.options.disabled===!!z?this.$element:this.toggleDisabled()}},{key:'toggleDisabled',value:function(){return this.options.disabled=!this.options.disabled,this.$element.prop('disabled',this.options.disabled),this.$wrapper.toggleClass(h.call(this,'disabled')),this.$element}},{key:'readonly',value:function(z){return'undefined'==typeof z?this.options.readonly:this.options.readonly===!!z?this.$element:this.toggleReadonly()}},{key:'toggleReadonly',value:function(){return this.options.readonly=!this.options.readonly,this.$element.prop('readonly',this.options.readonly),this.$wrapper.toggleClass(h.call(this,'readonly')),this.$element}},{key:'indeterminate',value:function(z){return'undefined'==typeof z?this.options.indeterminate:this.options.indeterminate===!!z?this.$element:this.toggleIndeterminate()}},{key:'toggleIndeterminate',value:function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop('indeterminate',this.options.indeterminate),this.$wrapper.toggleClass(h.call(this,'indeterminate')),g.call(this),this.$element}},{key:'inverse',value:function(z){return'undefined'==typeof z?this.options.inverse:this.options.inverse===!!z?this.$element:this.toggleInverse()}},{key:'toggleInverse',value:function(){this.$wrapper.toggleClass(h.call(this,'inverse'));var z=this.$on.clone(!0),A=this.$off.clone(!0);return this.$on.replaceWith(A),this.$off.replaceWith(z),this.$on=A,this.$off=z,this.options.inverse=!this.options.inverse,this.$element}},{key:'onColor',value:function(z){return'undefined'==typeof z?this.options.onColor:(this.options.onColor&&this.$on.removeClass(h.call(this,this.options.onColor)),this.$on.addClass(h.call(this,z)),this.options.onColor=z,this.$element)}},{key:'offColor',value:function(z){return'undefined'==typeof z?this.options.offColor:(this.options.offColor&&this.$off.removeClass(h.call(this,this.options.offColor)),this.$off.addClass(h.call(this,z)),this.options.offColor=z,this.$element)}},{key:'onText',value:function(z){return'undefined'==typeof z?this.options.onText:(this.$on.html(z),f.call(this),g.call(this),this.options.onText=z,this.$element)}},{key:'offText',value:function(z){return'undefined'==typeof z?this.options.offText:(this.$off.html(z),f.call(this),g.call(this),this.options.offText=z,this.$element)}},{key:'labelText',value:function(z){return'undefined'==typeof z?this.options.labelText:(this.$label.html(z),f.call(this),this.options.labelText=z,this.$element)}},{key:'handleWidth',value:function(z){return'undefined'==typeof z?this.options.handleWidth:(this.options.handleWidth=z,f.call(this),g.call(this),this.$element)}},{key:'labelWidth',value:function(z){return'undefined'==typeof z?this.options.labelWidth:(this.options.labelWidth=z,f.call(this),g.call(this),this.$element)}},{key:'baseClass',value:function(){return this.options.baseClass}},{key:'wrapperClass',value:function(z){if('undefined'==typeof z)return this.options.wrapperClass;var y=z||u.fn.bootstrapSwitch.defaults.wrapperClass;return this.$wrapper.removeClass(p.call(this,this.options.wrapperClass).join(' ')),this.$wrapper.addClass(p.call(this,y).join(' ')),this.options.wrapperClass=y,this.$element}},{key:'radioAllOff',value:function(z){if('undefined'==typeof z)return this.options.radioAllOff;var A=!!z;return this.options.radioAllOff===A?this.$element:(this.options.radioAllOff=A,this.$element)}},{key:'onInit',value:function(z){return'undefined'==typeof z?this.options.onInit:(this.options.onInit=z||u.fn.bootstrapSwitch.defaults.onInit,this.$element)}},{key:'onSwitchChange',value:function(z){return'undefined'==typeof z?this.options.onSwitchChange:(this.options.onSwitchChange=z||u.fn.bootstrapSwitch.defaults.onSwitchChange,this.$element)}},{key:'destroy',value:function(){var z=this.$element.closest('form');return z.length&&z.off('reset.bootstrapSwitch').removeData('bootstrap-switch'),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off('.bootstrapSwitch').removeData('bootstrap-switch'),this.$element}}]),x}();u.fn.bootstrapSwitch=function(x){for(var z=arguments.length,A=Array(1<z?z-1:0),B=1;B<z;B++)A[B-1]=arguments[B];return Array.prototype.reduce.call(this,function(C,D){var E=u(D),F=E.data('bootstrap-switch'),G=F||new w(D,x);return F||E.data('bootstrap-switch',G),'string'==typeof x?G[x].apply(G,A):C},this)},u.fn.bootstrapSwitch.Constructor=w,u.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:'primary',offColor:'default',onText:'ON',offText:'OFF',labelText:' ',handleWidth:'auto',labelWidth:'auto',baseClass:'bootstrap-switch',wrapperClass:'wrapper',onInit:function(){},onSwitchChange:function(){}}});
|
includes/js/codemirror.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,g=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=r||n||i,C=x&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),l=!i&&/Chrome\//.test(e),v=/Opera\//.test(e),a=/Apple Computer/.test(navigator.vendor),s=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),u=/PhantomJS/.test(e),c=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),h=/Android/.test(e),f=c||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),w=c||/Mac/.test(t),d=/\bCrOS\b/.test(e),p=/win/i.test(t),m=v&&e.match(/Version\/(\d*\.\d*)/);(m=m&&Number(m[1]))&&15<=m&&(b=!(v=!1));var y=w&&(o||v&&(null==m||m<12.11)),S=g||x&&9<=C;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,T=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function A(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,r,n){var i=A(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function W(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function H(e,t){var r=e.className;L(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!L(r[n]).test(t)&&(t+=" "+r[n]);return t}k=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var P=function(e){e.select()};function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,r){for(var n in t=t||{},e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function z(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||t<=s)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}c?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(P=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=E(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},R.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var G=30,U={toString:function(){return"CodeMirror.Pass"}},V={scroll:!1},K={origin:"*mouse"},j={origin:"+move"};function X(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||t<=i+l)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var Y=[""];function _(e){for(;Y.length<=e;)Y.push($(Y)+" ");return Y[e]}function $(e){return e[e.length-1]}function q(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function Q(e,t){var r;return r=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&I(t,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function le(e,t,r){for(var n=r<t?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var se=null;function ae(e,t,r){var n;se=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:se=i)}return null!=n?n:se}var ue,ce,he,fe,de,pe,ge,ve=(ue="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ce="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",he=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,fe=/[stwN]/,de=/[LRr]/,pe=/[Lb1n]/,ge=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!he.test(e))return!1;for(var n,i=e.length,o=[],l=0;l<i;++l)o.push((n=e.charCodeAt(l))<=247?ue.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?ce.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var s=0,a=r;s<i;++s){var u=o[s];"m"==u?o[s]=a:a=u}for(var c=0,h=r;c<i;++c){var f=o[c];"1"==f&&"r"==h?o[c]="n":de.test(f)&&"r"==(h=f)&&(o[c]="R")}for(var d=1,p=o[0];d<i-1;++d){var g=o[d];"+"==g&&"1"==p&&"1"==o[d+1]?o[d]="1":","!=g||p!=o[d+1]||"1"!=p&&"n"!=p||(o[d]=p),p=g}for(var v=0;v<i;++v){var m=o[v];if(","==m)o[v]="N";else if("%"==m){var y=void 0;for(y=v+1;y<i&&"%"==o[y];++y);for(var b=v&&"!"==o[v-1]||y<i&&"1"==o[y]?"1":"N",w=v;w<y;++w)o[w]=b;v=y-1}}for(var x=0,C=r;x<i;++x){var S=o[x];"L"==C&&"1"==S?o[x]="L":de.test(S)&&(C=S)}for(var L=0;L<i;++L)if(fe.test(o[L])){var k=void 0;for(k=L+1;k<i&&fe.test(o[k]);++k);for(var T="L"==(L?o[L-1]:r),M=T==("L"==(k<i?o[k]:r))?T?"L":"R":r,N=L;N<k;++N)o[N]=M;L=k-1}for(var O,A=[],D=0;D<i;)if(pe.test(o[D])){var W=D;for(++D;D<i&&pe.test(o[D]);++D);A.push(new me(0,W,D))}else{var H=D,F=A.length,P="rtl"==t?1:0;for(++D;D<i&&"L"!=o[D];++D);for(var E=H;E<D;)if(ge.test(o[E])){H<E&&(A.splice(F,0,new me(1,H,E)),F+=P);var I=E;for(++E;E<D&&ge.test(o[E]);++E);A.splice(F,0,new me(2,I,E)),F+=P,H=E}else++E;H<D&&A.splice(F,0,new me(1,H,D))}return"ltr"==t&&(1==A[0].level&&(O=e.match(/^\s+/))&&(A[0].from=O[0].length,A.unshift(new me(0,0,O[0].length))),1==$(A).level&&(O=e.match(/\s+$/))&&($(A).to-=O[0].length,A.push(new me(0,i-O[0].length,i)))),"rtl"==t?A.reverse():A});function me(e,t,r){this.level=e,this.from=t,this.to=r}function ye(e,t){var r=e.order;return null==r&&(r=e.order=ve(e.text,t)),r}var be=[],we=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||be).concat(r)}};function xe(e,t){return e._handlers&&e._handlers[t]||be}function Ce(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Se(e,t){var r=xe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Le(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Se(e,r||t.type,e,t),Ae(t)||t.codemirrorIgnore}function ke(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function Te(e,t){return 0<xe(e,t).length}function Me(e){e.prototype.on=function(e,t){we(this,e,t)},e.prototype.off=function(e,t){Ce(this,e,t)}}function Ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){Ne(e),Oe(e)}function We(e){return e.target||e.srcElement}function He(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),w&&e.ctrlKey&&1==t&&(t=3),t}var Fe,Pe,Ee=function(){if(x&&C<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ie(e){if(null==Fe){var t=A("span","");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Fe=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&C<8))}var r=Fe?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function ze(e){if(null!=Pe)return Pe;var t=N(e,document.createTextNode("AخA")),r=k(t,0,1).getBoundingClientRect(),n=k(t,1,2).getBoundingClientRect();return M(e),r&&r.left!=r.right&&(Pe=n.right-r.right<3)}var Re,Be=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ge=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ue="oncopy"in(Re=A("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Ve=null;var Ke={},je={};function Xe(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=Xe(t);var r=Ke[t.name];if(!r)return Ye(e,"text/plain");var n=r(e,t);if(_e.hasOwnProperty(t.name)){var i=_e[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var _e={};function $e(e,t){I(t,_e.hasOwnProperty(e)?_e[e]:_e[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ze(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Qe(e,t,r){return!e.startState||e.startState(t,r)}var Je=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function et(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function tt(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function rt(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function nt(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function it(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ot(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function lt(e,t){return t>=e.first&&t<e.first+e.size}function st(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function at(e,t,r){if(void 0===r&&(r=null),!(this instanceof at))return new at(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ut(e,t){return e.line-t.line||e.ch-t.ch}function ct(e,t){return e.sticky==t.sticky&&0==ut(e,t)}function ht(e){return at(e.line,e.ch)}function ft(e,t){return ut(e,t)<0?t:e}function dt(e,t){return ut(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return at(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?at(o,et(e,o).text.length):(n=et(e,(r=t).line).text.length,null==(i=r.ch)||n<i?at(r.line,n):i<0?at(r.line,0):r)}function vt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=gt(e,t[n]);return r}Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}function i(e){return r?e.toLowerCase():e}if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},yt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function bt(t,r,n,e){var a=[t.state.modeGen],i={};Nt(t,r.text,t.doc.mode,n,function(e,t){return a.push(e,t)},i,e);for(var u=n.state,o=function(e){n.baseTokens=a;var o=t.state.overlays[e],l=1,s=0;n.state=!0,Nt(t,r.text,o.mode,n,function(e,t){for(var r=l;s<e;){var n=a[l];e<n&&a.splice(l,1,e,a[l+1],n),l+=2,s=Math.min(e,n)}if(t)if(o.opaque)a.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var i=a[r+1];a[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=u,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)o(l);return{styles:a,classes:i.bgClass||i.textClass?i:null}}function wt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=xt(e,it(t)),i=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,n.state),o=bt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xt(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new yt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;l<s;--s){if(s<=o.first)return o.first;var a=et(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof mt?u.lookAhead:0)<=o.modeFrontier))return s;var c=z(a.text,null,e.options.tabSize);(null==i||c<n)&&(i=s-1,n=c)}return i}(r,n,e),l=o>t.first&&et(t,o-1).stateAfter,s=l?yt.fromSaved(t,l,o):new yt(t,Qe(t.mode),o);return t.iter(o,n,function(e){Ct(r,e.text,s);var t=s.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?s.save():null,s.nextLine()}),e&&(t.modeFrontier=s.line),s}function Ct(e,t,r,n){var i=e.doc.mode,o=new Je(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&St(i,r.state);!o.eol();)Lt(i,o,r.state),o.start=o.pos}function St(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ze(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Lt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ze(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},yt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},yt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},yt.fromSaved=function(e,t,r){return t instanceof mt?new yt(e,qe(e.mode,t.state),r,t.lookAhead):new yt(e,qe(e.mode,t),r)},yt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new mt(t,this.maxLookAhead):t};var kt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Tt(e,t,r,n){var i,o,l=e.doc,s=l.mode,a=et(l,(t=gt(l,t)).line),u=xt(e,t.line,r),c=new Je(a.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Lt(s,c,u.state),n&&o.push(new kt(c,i,qe(l.mode,u.state)));return n?o:new kt(c,i,u.state)}function Mt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Nt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new Je(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Mt(St(r,n.state),o);!h.eol();){if(a=h.pos>e.options.maxHighlightLength?(s=!1,l&&Ct(e,t,n,h.pos),h.pos=t.length,null):Mt(Lt(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var Ot=!1,At=!1;function Dt(e,t,r){this.marker=e,this.from=t,this.to=r}function Wt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ht(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r=r||[]).push(e[n]);return r}function Ft(e,t){if(t.full)return null;var r=lt(e,t.from.line)&&et(e,t.from.line).markedSpans,n=lt(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==ut(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n=n||[]).push(new Dt(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n=n||[]).push(new Dt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=$(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Wt(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];if(null!=g.to&&(g.to+=c),null==g.from)Wt(s,g.marker)||(g.from=c,u&&(s=s||[]).push(g));else g.from+=c,u&&(s=s||[]).push(g)}s=s&&Pt(s),a&&a!=s&&(a=Pt(a));var v=[s];if(!u){var m,y=t.text.length-2;if(0<y&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m=m||[]).push(new Dt(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(a)}return v}function Pt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Et(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function It(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function zt(e){return e.inclusiveLeft?-1:0}function Rt(e){return e.inclusiveRight?1:0}function Bt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ut(n.from,i.from)||zt(e)-zt(t);if(o)return-o;var l=ut(n.to,i.to)||Rt(e)-Rt(t);return l||t.id-e.id}function Gt(e,t){var r,n=At&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Bt(r,i.marker)<0)&&(r=i.marker);return r}function Ut(e){return Gt(e,!0)}function Vt(e){return Gt(e,!1)}function Kt(e,t){var r,n=At&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Bt(r,o.marker)<0)&&(r=o.marker)}return r}function jt(e,t,r,n,i){var o=et(e,t),l=At&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=ut(u.from,r)||zt(a.marker)-zt(i),h=ut(u.to,n)||Rt(a.marker)-Rt(i);if(!(0<=c&&h<=0||c<=0&&0<=h)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?0<=ut(u.to,r):0<ut(u.to,r))||0<=c&&(a.marker.inclusiveRight&&i.inclusiveLeft?ut(u.from,n)<=0:ut(u.from,n)<0)))return 1}}}function Xt(e){for(var t;t=Ut(e);)e=t.find(-1,!0).line;return e}function Yt(e,t){var r=et(e,t),n=Xt(r);return r==n?t:it(n)}function _t(e,t){if(t>e.lastLine())return t;var r,n=et(e,t);if(!$t(e,n))return t;for(;r=Vt(n);)n=r.find(1,!0).line;return it(n)+1}function $t(e,t){var r=At&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&qt(e,t,n))return!0}}function qt(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return qt(e,n.line,Wt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&qt(e,t,i))return!0}function Zt(e){for(var t=0,r=(e=Xt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function Qt(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ut(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Vt(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Jt(e){var r=e.display,t=e.doc;r.maxLine=et(t,t.first),r.maxLineLength=Qt(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=Qt(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var er=function(e,t,r){this.text=e,It(this,t),this.height=r?r(this):1};er.prototype.lineNo=function(){return it(this)},Me(er);var tr={},rr={};function nr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?rr:tr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ir(e,t){var r=O("span",null,null,b?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=lr,ze(e.display.measure)&&(l=ye(o,e.doc.direction))&&(n.addToken=sr(n.addToken,l)),n.map=[],ur(o,n,wt(e,o,t!=e.display.externalMeasured&&it(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ie(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Se(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function or(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function lr(e,t,r,n,i,o,l){if(t){var s,a=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,u=e.cm.state.specialChars,c=!1;if(u.test(t)){s=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var f=u.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(a.slice(h,h+d));x&&C<9?s.appendChild(A("span",[p])):s.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;h+=1+d;var g=void 0;if("\t"==f[0]){var v=e.cm.options.tabSize,m=v-e.col%v;(g=s.appendChild(A("span",_(m),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=m}else"\r"==f[0]||"\n"==f[0]?(g=s.appendChild(A("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),x&&C<9?s.appendChild(A("span",[g])):s.appendChild(g)),e.col+=1;e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,s=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,s),x&&C<9&&(c=!0),e.pos+=t.length;if(e.trailingSpace=32==a.charCodeAt(t.length-1),r||n||i||c||o){var y=r||"";n&&(y+=n),i&&(y+=i);var b=A("span",[s],y,o);if(l)for(var w in l)l.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&b.setAttribute(w,l[w]);return e.content.appendChild(b)}e.content.appendChild(s)}}function sr(h,f){return function(e,t,r,n,i,o,l){r=r?r+" cm-force-border":"cm-force-border";for(var s=e.pos,a=s+t.length;;){for(var u=void 0,c=0;c<f.length&&!((u=f[c]).to>s&&u.from<=s);c++);if(u.to>=a)return h(e,t,r,n,i,o,l);h(e,t.slice(0,u.to-s),r,n,null,o,l),n=null,t=t.slice(u.to-s),s=u.to}}}function ar(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",r.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ur(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=s="",h=f=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b=b||[]).push(C.endStyle,x.to),C.title&&((f=f||{}).title=C.title),C.attributes)for(var S in C.attributes)(f=f||{})[S]=C.attributes[S];C.collapsed&&(!h||Bt(h.marker,C)<0)&&(h=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var L=0;L<b.length;L+=2)b[L+1]==m&&(u+=" "+b[L]);if(!h||h.from==p)for(var k=0;k<y.length;++k)ar(t,0,y[k]);if(h&&(h.from||0)==p){if(ar(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(d<=p)break;for(var T=Math.min(d,m);;){if(v){var M=p+v.length;if(!h){var N=T<M?v.slice(0,T-p):v;t.addToken(t,N,l?l+a:a,c,p+N.length==m?u:"",s,f)}if(T<=M){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=r[g++]),l=nr(r[g++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,i.slice(o,o=r[O]),nr(r[O+1],t.cm.options))}function cr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Vt(e);)e=t.find(1,!0).line,(r=r||[]).push(e);return r}(t),this.size=this.rest?it($(this.rest))-r+1:1,this.node=this.text=null,this.hidden=$t(e,t)}function hr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new cr(e.doc,et(e.doc,o),o);n=o+l.size,i.push(l)}return i}var fr=null;function dr(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{fr=null,t(r)}}var pr=null;function gr(e,t){var r=xe(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);fr?n=fr.delayedCallbacks:pr?n=pr:(n=pr=[],setTimeout(vr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function vr(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function mr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?wr(e,t):"gutter"==o?Cr(e,t,r,n):"class"==o?xr(e,t):"widget"==o&&Sr(e,t,n)}t.changes=null}function yr(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),x&&C<8&&(e.node.style.zIndex=2)),e.node}function br(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ir(e,t)}function wr(e,t){var r=t.text.className,n=br(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,xr(e,t)):r&&(t.text.className=r)}function xr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=yr(t);t.background=n.insertBefore(A("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?yr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Cr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=yr(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=yr(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",st(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var u=e.display.gutterSpecs[a].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function Sr(e,t,r){t.alignable&&(t.alignable=null);for(var n=L("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Lr(e,t,r)}function Lr(e,t,r){if(kr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)kr(e,t.rest[n],t,r,!1)}function kr(e,t,r,n,i){if(t.widgets)for(var o=yr(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=A("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Tr(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),gr(a,"redraw")}}function Tr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Mr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Nr(e,t){for(var r=We(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return 1}function Or(e){return e.lineSpace.offsetTop}function Ar(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Dr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Wr(e){return G-e.display.nativeBarWidth}function Hr(e){return e.display.scroller.clientWidth-Wr(e)-e.display.barWidth}function Fr(e){return e.display.scroller.clientHeight-Wr(e)-e.display.barHeight}function Pr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(it(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Er(e,t,r,n){return Rr(e,zr(e,t),r,n)}function Ir(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function zr(e,t){var r=it(t),n=Ir(e,r);n&&!n.text?n=null:n&&n.changes&&(mr(e,n,r,cn(e)),e.curOp.forceUpdate=!0);var i=Pr(n=n||function(e,t){var r=it(t=Xt(t)),n=e.display.externalMeasured=new cr(e.doc,t,r);n.lineN=r;var i=n.built=ir(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t),t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Rr(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Hr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];2<Math.abs(a.bottom-u.bottom)&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Ur(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;s&&ie(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+a));)++a;if((i=x&&C<9&&0==s&&a==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Vr(k(l,s,a).getClientRects(),n)).left||i.right||0==s)break;a=s,--s,u="right"}x&&C<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ve)return Ve;var t=N(e,A("span","x")),r=t.getBoundingClientRect(),n=k(t,0,1).getBoundingClientRect();return Ve=1<Math.abs(r.left-n.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var h;0<s&&(u=n="right"),i=e.options.lineWrapping&&1<(h=l.getClientRects()).length?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(x&&C<9&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+un(e.display),top:f.top,bottom:f.bottom}:Gr}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;m<v.length-1&&!(g<v[m]);m++);var y=m?v[m-1]:0,b=v[m],w={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:y,bottom:b};i.left||i.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=p);return w}(e,t,r,n)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Br,Gr={left:0,right:0,top:0,bottom:0};function Ur(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?o=(i=t-s)+1:(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-s)-1,a<=t&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Vr(e,t){var r=Gr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function Kr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function jr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Kr(e.display.view[t])}function Xr(e){jr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Yr(){return l&&h?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function _r(){return l&&h?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function $r(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Mr(e.widgets[r]));return t}function qr(e,t,r,n,i){if(!i){var o=$r(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n=n||"local";var l=Zt(t);if("local"==n?l+=Or(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:_r());var a=s.left+("window"==n?0:Yr());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function Zr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Yr(),i-=_r();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function Qr(e,t,r,n,i){return qr(e,n=n||et(e.doc,t.line),Er(e,n,t.ch,i),r)}function Jr(n,e,i,o,l,s){function a(e,t){var r=Rr(n,l,e,t?"right":"left",s);return t?r.left=r.right:r.right=r.left,qr(n,o,r,i)}o=o||et(n.doc,e.line),l=l||zr(n,o);var u=ye(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!u)return a("before"==r?t-1:t,"before"==r);function c(e,t,r){return a(r?e-1:e,1==u[t].level!=r)}var h=ae(u,t,r),f=se,d=c(t,h,"before"==r);return null!=f&&(d.other=c(t,f,"before"!=r)),d}function en(e,t){var r=0;t=gt(e.doc,t),e.options.lineWrapping||(r=un(e.display)*t.ch);var n=et(e.doc,t.line),i=Zt(n)+Or(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function tn(e,t,r,n,i){var o=at(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function rn(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return tn(n.first,0,null,-1,-1);var i=ot(n,r),o=n.first+n.size-1;if(o<i)return tn(n.first+n.size-1,et(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=et(n,i);;){var s=sn(e,l,i,t,r),a=Kt(l,s.ch+(0<s.xRel||0<s.outside?1:0));if(!a)return s;var u=a.find(1);if(u.line==i)return u;l=et(n,i=u.line)}}function nn(t,e,r,n){n-=$r(e);var i=e.text.length,o=le(function(e){return Rr(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=le(function(e){return Rr(t,r,e).top>n},o,i)}}function on(e,t,r,n){return nn(e,t,r=r||zr(e,t),qr(e,t,Rr(e,r,n),"line").top)}function ln(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function sn(r,e,t,n,i){i-=Zt(e);var o=zr(r,e),l=$r(e),s=0,a=e.text.length,u=!0,c=ye(e,r.doc.direction);if(c){var h=(r.options.lineWrapping?function(e,t,r,n,i,o,l){var s=nn(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=u||d.to<=a)){var p=1!=d.level,g=Rr(e,n,p?Math.min(u,d.to)-1:Math.max(a,d.from)).right,v=g<o?o-g+1e9:g-o;(!c||v<h)&&(c=d,h=v)}}c=c||i[i.length-1];c.from<a&&(c={from:a,to:c.to,level:c.level});c.to>u&&(c={from:c.from,to:u,level:c.level});return c}:function(n,i,o,l,s,a,u){var e=le(function(e){var t=s[e],r=1!=t.level;return ln(Jr(n,at(o,r?t.to:t.from,r?"before":"after"),"line",i,l),a,u,!0)},0,s.length-1),t=s[e];if(0<e){var r=1!=t.level,c=Jr(n,at(o,r?t.from:t.to,r?"after":"before"),"line",i,l);ln(c,a,u,!0)&&c.top>u&&(t=s[e-1])}return t})(r,e,t,o,c,n,i);s=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var f,d,p=null,g=null,v=le(function(e){var t=Rr(r,o,e);return t.top+=l,t.bottom+=l,ln(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,g=t),1)},s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{u||v!=a&&v!=s||v++,d=0==v?"after":v==e.text.length?"before":Rr(r,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Jr(r,at(t,v,d),"line",e,o);f=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return tn(t,v=oe(e.text,v,1),d,m,n-f)}function an(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Br){Br=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Br.appendChild(document.createTextNode("x")),Br.appendChild(A("br"));Br.appendChild(document.createTextNode("x"))}N(e.measure,Br);var r=Br.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function un(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),r=A("pre",[t],"CodeMirror-line-like");N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function cn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:hn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function hn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fn(n){var i=an(n.display),o=n.options.lineWrapping,l=o&&Math.max(5,n.display.scroller.clientWidth/un(n.display)-3);return function(e){if($t(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/l)||1)*i:t+i}}function dn(e){var t=e.doc,r=fn(e);t.iter(function(e){var t=r(e);t!=e.height&&nt(e,t)})}function pn(e,t,r,n){var i=e.display;if(!r&&"true"==We(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=rn(e,o,l);if(n&&0<u.xRel&&(a=et(e.doc,u.line).text).length==u.ch){var c=z(a,a.length,e.options.tabSize)-a.length;u=at(u.line,Math.max(0,Math.round((o-Dr(e.display).left)/un(e.display))-c))}return u}function gn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function vn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n=n||0;var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)At&&Yt(e.doc,t)<i.viewTo&&yn(e);else if(r<=i.viewFrom)At&&_t(e.doc,r+n)>i.viewFrom?yn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)yn(e);else if(t<=i.viewFrom){var o=bn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):yn(e)}else if(r>=i.viewTo){var l=bn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):yn(e)}else{var s=bn(e,t,t,-1),a=bn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(hr(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):yn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function mn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[gn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function bn(e,t,r,n){var i,o=gn(e,t),l=e.display.view;if(!At||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(0<n){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Yt(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function wn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function xn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Cn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&Sn(e,s.head,i),a||kn(e,s,o)}}return n}function Sn(e,t,r){var n=Jr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Ln(e,t){return e.top-t.top||e.left-t.left}function kn(l,e,t){var r=l.display,n=l.doc,i=document.createDocumentFragment(),o=Dr(l.display),T=o.left,M=Math.max(r.sizerWidth,Hr(l)-r.sizer.offsetLeft)-o.right,N="ltr"==n.direction;function O(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function s(r,y,b){var w,x,o=et(n,r),C=o.text.length;function S(e,t){return Qr(l,at(r,e),"div",o,t)}function L(e,t,r){var n=on(l,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return S("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var k=ye(o,n.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(k,y||0,null==b?C:b,function(e,t,r,n){var i="ltr"==r,o=S(e,i?"left":"right"),l=S(t-1,i?"right":"left"),s=null==y&&0==e,a=null==b&&t==C,u=0==n,c=!k||n==k.length-1;if(l.top-o.top<=3){var h=(N?a:s)&&c,f=(N?s:a)&&u?T:(i?o:l).left,d=h?M:(i?l:o).right;O(f,o.top,d-f,o.bottom)}else{var p,g,v,m;m=i?(p=N&&s&&u?T:o.left,g=N?M:L(e,r,"before"),v=N?T:L(t,r,"after"),N&&a&&c?M:l.right):(p=N?L(e,r,"before"):T,g=!N&&s&&u?M:o.right,v=!N&&a&&c?T:l.left,N?L(t,r,"after"):M),O(p,o.top,g-p,o.bottom),o.bottom<l.top&&O(T,o.bottom,null,l.top),O(v,l.top,m-v,l.bottom)}(!w||Ln(o,w)<0)&&(w=o),Ln(l,w)<0&&(w=l),(!x||Ln(o,x)<0)&&(x=o),Ln(l,x)<0&&(x=l)}),{start:w,end:x}}var a=e.from(),u=e.to();if(a.line==u.line)s(a.line,a.ch,u.ch);else{var c=et(n,a.line),h=et(n,u.line),f=Xt(c)==Xt(h),d=s(a.line,a.ch,f?c.text.length+1:null).end,p=s(u.line,f?0:null,u.ch).start;f&&(d.top<p.top-2?(O(d.right,d.top,null,d.bottom),O(T,p.top,p.left,p.bottom)):O(d.right,d.top,p.left-d.right,d.bottom)),d.bottom<p.top&&O(T,d.bottom,null,p.top)}t.appendChild(i)}function Tn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Mn(e){e.state.focused||(e.display.input.focus(),On(e))}function Nn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,An(e))},100)}function On(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Se(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Tn(e))}function An(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Se(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Dn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,l=void 0,s=0;if(!i.hidden){if(x&&C<8){var a=i.node.offsetTop+i.node.offsetHeight;l=a-r,r=a}else{var u=i.node.getBoundingClientRect();l=u.bottom-u.top,!o&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var c=i.line.height-l;if((.005<c||c<-.005)&&(nt(i.line,l),Wn(i.line),i.rest))for(var h=0;h<i.rest.length;h++)Wn(i.rest[h]);if(s>e.display.sizerWidth){var f=Math.ceil(s/un(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Wn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Hn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Or(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ot(t,n),l=ot(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?l=ot(t,Zt(et(t,o=s))+e.wrapper.clientHeight):Math.min(a,t.lastLine())>=l&&(o=ot(t,Zt(et(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function Fn(e,t){var r=e.display,n=an(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Fr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Ar(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Hr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function Pn(e,t){null!=t&&(zn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function En(e){zn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function In(e,t,r){null==t&&null==r||zn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function zn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Rn(e,en(e,t.from),en(e,t.to),t.margin))}function Rn(e,t,r,n){var i=Fn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});In(e,i.scrollLeft,i.scrollTop)}function Bn(e,t){Math.abs(e.doc.scrollTop-t)<2||(g||fi(e,{top:t}),Gn(e,t,!0),g&&fi(e),si(e,100))}function Gn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Un(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Vn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ar(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Wr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Kn(e,t,r){this.cm=r;var n=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),we(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),we(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}Kn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Kn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Kn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Kn.prototype.zeroWidthHack=function(){var e=w&&!s?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Kn.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},Kn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};function jn(){}function Xn(e,t){t=t||Vn(e);var r=e.display.barWidth,n=e.display.barHeight;Yn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Dn(e),Yn(e,Vn(e)),r=e.display.barWidth,n=e.display.barHeight}function Yn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}jn.prototype.update=function(){return{bottom:0,right:0}},jn.prototype.setScrollLeft=function(){},jn.prototype.setScrollTop=function(){},jn.prototype.clear=function(){};var _n={native:Kn,null:jn};function $n(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&T(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new _n[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),we(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?Un:Bn)(r,e)},r),r.display.scrollbars.addClass&&H(r.display.wrapper,r.display.scrollbars.addClass)}var qn=0;function Zn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qn},t=e.curOp,fr?fr.ops.push(t):t.ownsGroup=fr={ops:[t],delayedCallbacks:[]}}function Qn(e){var t=e.curOp;t&&dr(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Jn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ci(i.cm,i.update);var i;for(var o=0;o<t.length;o++)ei(t[o]);for(var l=0;l<t.length;l++)ti(t[l]);for(var s=0;s<t.length;s++)ri(t[s])}(e)})}function Jn(e){var t,r,n=e.cm,i=n.display;!(r=(t=n).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Wr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Wr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Jt(n),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ui(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ei(e){var t=e.cm,r=t.display;e.updatedDisplay&&Dn(t),e.barMeasure=Vn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Er(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Wr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Hr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ti(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Un(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),!e.updatedDisplay&&e.startHeight==t.doc.height||Xn(t,e.barMeasure),e.updatedDisplay&&pi(t,e.barMeasure),e.selectionChanged&&Tn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Mn(e.cm)}function ri(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&hi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Gn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Un(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!Le(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!u){var o=A("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Or(e.display))+"px;\n height: "+(t.bottom-t.top+Wr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?at(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?at(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=Jr(e,t),a=r&&r!=t?Jr(e,r):s,u=Fn(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Bn(e,u.scrollTop),1<Math.abs(e.doc.scrollTop-c)&&(l=!0)),null!=u.scrollLeft&&(Un(e,u.scrollLeft),1<Math.abs(e.doc.scrollLeft-h)&&(l=!0)),!l)break}return i}(t,gt(n,e.scrollToPos.from),gt(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||Se(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Se(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();Zn(e);try{return t()}finally{Qn(e)}}function ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Zn(e);try{return t.apply(e,arguments)}finally{Qn(e)}}}function oi(e){return function(){if(this.curOp)return e.apply(this,arguments);Zn(this);try{return e.apply(this,arguments)}finally{Qn(this)}}}function li(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Zn(e);try{return t.apply(this,arguments)}finally{Qn(e)}}}function si(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(ai,e))}function ai(a){var u=a.doc;if(!(u.highlightFrontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,h=xt(a,u.highlightFrontier),f=[];u.iter(h.line,Math.min(u.first+u.size,a.display.viewTo+500),function(e){if(h.line>=a.display.viewFrom){var t=e.styles,r=e.text.length>a.options.maxHighlightLength?qe(u.mode,h.state):null,n=bt(a,e,h,!0);r&&(h.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var l=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),s=0;!l&&s<t.length;++s)l=t[s]!=e.styles[s];l&&f.push(h.line),e.stateAfter=h.save(),h.nextLine()}else e.text.length<=a.options.maxHighlightLength&&Ct(a,e.text,h),e.stateAfter=h.line%5==0?h.save():null,h.nextLine();if(+new Date>c)return si(a,a.options.workDelay),!0}),u.highlightFrontier=h.line,u.modeFrontier=Math.max(u.modeFrontier,h.line),f.length&&ni(a,function(){for(var e=0;e<f.length;e++)mn(a,f[e],"text")})}}var ui=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Hn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Hr(e),this.force=r,this.dims=cn(e),this.events=[]};function ci(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return yn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==wn(e))return!1;vi(e)&&(yn(e),t.dims=cn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),At&&(o=Yt(e.doc,o),l=_t(e.doc,l));var s,a,u,c,h=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;a=o,u=l,0==(c=(s=e).display).view.length||a>=c.viewTo||u<=c.viewFrom?(c.view=hr(s,a,u),c.viewFrom=a):(c.viewFrom>a?c.view=hr(s,a,c.viewFrom).concat(c.view):c.viewFrom<a&&(c.view=c.view.slice(gn(s,a))),c.viewFrom=a,c.viewTo<u?c.view=c.view.concat(hr(s,c.viewTo,u)):c.viewTo>u&&(c.view=c.view.slice(0,gn(s,u)))),c.viewTo=u,r.viewOffset=Zt(et(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=wn(e);if(!h&&0==f&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var d=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<f&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(e){var t=e.nextSibling;return b&&w&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var a=n.view,u=n.viewFrom,c=0;c<a.length;c++){var h=a[c];if(!h.hidden)if(h.node&&h.node.parentNode==o){for(;l!=h.node;)l=s(l);var f=i&&null!=e&&e<=u&&h.lineNumber;h.changes&&(-1<B(h.changes,"gutter")&&(f=!1),mr(r,h,u,t)),f&&(M(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(st(r.options,u)))),l=h.node.nextSibling}else{var d=(v=u,m=t,y=br(p=r,g=h),g.text=g.node=y.pre,y.bgClass&&(g.bgClass=y.bgClass),y.textClass&&(g.textClass=y.textClass),xr(p,g),Cr(p,g,v,m),Lr(p,g,m),g.node);o.insertBefore(d,l)}u+=h.size}var p,g,v,m,y;for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),4<f&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(d),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,h&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,si(e,400)),!(r.updateLineNumbers=null)}function hi(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Hr(e))n&&(t.visible=Hn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ar(e.display)-Fr(e),r.top)}),t.visible=Hn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ci(e,t))break;Dn(e);var i=Vn(e);xn(e),Xn(e,i),pi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function fi(e,t){var r=new ui(e,t);if(ci(e,r)){Dn(e),hi(e,r);var n=Vn(e);xn(e),Xn(e,n),pi(e,n),r.finish()}}function di(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function pi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Wr(e)+"px"}function gi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=hn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function vi(e){if(e.options.lineNumbers){var t=e.doc,r=st(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(A("div",[A("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",di(e.display),1}}}function mi(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function yi(e){var t=e.gutters,r=e.gutterSpecs;M(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,l=i.style,s=t.appendChild(A("div",null,"CodeMirror-gutter "+o));l&&(s.style.cssText=l),"CodeMirror-linenumbers"==o&&((e.lineGutter=s).style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",di(e)}function bi(e){yi(e.display),vn(e),gi(e)}function wi(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=O("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+G+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),x&&C<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),b||g&&f||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=mi(n.gutters,n.lineNumbers),yi(i),r.init(i)}ui.prototype.signal=function(e,t){Te(e,t)&&this.events.push(arguments)},ui.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Se.apply(null,this.events[e])};var xi=0,Ci=null;function Si(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Li(e){var t=Si(e);return t.x*=Ci,t.y*=Ci,t}function ki(e,t){var r=Si(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&w&&b)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==u){e.display.currentWheelTarget=u;break e}if(n&&!g&&!v&&null!=Ci)return i&&a&&Bn(e,Math.max(0,l.scrollTop+i*Ci)),Un(e,Math.max(0,l.scrollLeft+n*Ci)),(!i||i&&a)&&Ne(t),void(o.wheelStartX=null);if(i&&null!=Ci){var f=i*Ci,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;f<0?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),fi(e,{top:d,bottom:p})}xi<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ci=(Ci*xi+r)/(xi+1),++xi)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}x?Ci=-.53:g?Ci=15:l?Ci=-.7:a&&(Ci=-1/3);var Ti=function(e,t){this.ranges=e,this.primIndex=t};Ti.prototype.primary=function(){return this.ranges[this.primIndex]},Ti.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ct(r.anchor,n.anchor)||!ct(r.head,n.head))return!1}return!0},Ti.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mi(ht(this.ranges[t].anchor),ht(this.ranges[t].head));return new Ti(e,this.primIndex)},Ti.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ti.prototype.contains=function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ut(t,n.from())&&ut(e,n.to())<=0)return r}return-1};var Mi=function(e,t){this.anchor=e,this.head=t};function Ni(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ut(e.from(),t.from())}),r=B(t,i);for(var o=1;o<t.length;o++){var l=t[o],s=t[o-1],a=ut(s.to(),l.from());if(n&&!l.empty()?0<a:0<=a){var u=dt(s.from(),l.from()),c=ft(s.to(),l.to()),h=s.empty()?l.from()==l.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new Mi(h?c:u,h?u:c))}}return new Ti(t,r)}function Oi(e,t){return new Ti([new Mi(e,t||e)],0)}function Ai(e){return e.text?at(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Di(e,t){if(ut(e,t.from)<0)return e;if(ut(e,t.to)<=0)return Ai(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ai(t).ch-t.to.ch),at(r,n)}function Wi(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Mi(Di(i.anchor,t),Di(i.head,t)))}return Ni(e.cm,r,e.sel.primIndex)}function Hi(e,t,r){return e.line==t.line?at(r.line,e.ch-t.ch+r.ch):at(r.line+(e.line-t.line),e.ch)}function Fi(e){e.doc.mode=Ye(e.options,e.doc.modeOption),Pi(e)}function Pi(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,si(e,100),e.state.modeGen++,e.curOp&&vn(e)}function Ei(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Et(e),It(e,r);var i=n?n(e):1;i!=e.height&&nt(e,i)}(e,t,r,i),gr(e,"change",e,n)}function l(e,t){for(var r=[],n=e;n<t;++n)r.push(new er(u[n],o(n),i));return r}var s=n.from,a=n.to,u=n.text,c=et(e,s.line),h=et(e,a.line),f=$(u),d=o(u.length-1),p=a.line-s.line;if(n.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Ei(e,n)){var g=l(0,u.length-1);r(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)r(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var v=l(1,u.length-1);v.push(new er(f+c.text.slice(a.ch),d,i)),r(c,c.text.slice(0,s.ch)+u[0],o(0)),e.insert(s.line+1,v)}else if(1==u.length)r(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),o(0)),e.remove(s.line+1,p);else{r(c,c.text.slice(0,s.ch)+u[0],o(0)),r(h,f+h.text.slice(a.ch),d);var m=l(1,u.length-1);1<p&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}gr(e,"change",e,n)}function zi(e,s,a){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var l=n&&o.sharedHist;a&&!l||(s(o.doc,l),e(o.doc,t,l))}}}(e,null,!0)}function Ri(e,t){if(t.cm)throw new Error("This document is already in use.");dn((e.doc=t).cm=e),Fi(e),Bi(e),e.options.lineWrapping||Jt(e),e.options.mode=t.modeOption,vn(e)}function Bi(e){("rtl"==e.doc.direction?H:T)(e.display.lineDiv,"CodeMirror-rtl")}function Gi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ui(e,t){var r={from:ht(t.from),to:Ai(t),text:tt(e,t.from,t.to)};return Yi(e,r,t.from.line,t.to.line+1),zi(e,function(e){return Yi(e,r,t.from.line,t.to.line+1)},!0),r}function Vi(e){for(;e.length;){if(!$(e).ranges)break;e.pop()}}function Ki(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(s=i).lastOp==n?(Vi(s.done),$(s.done)):s.done.length&&!$(s.done).ranges?$(s.done):1<s.done.length&&!s.done[s.done.length-2].ranges?(s.done.pop(),$(s.done)):void 0))l=$(o.changes),0==ut(t.from,t.to)&&0==ut(t.from,l.to)?l.to=Ai(t):o.changes.push(Ui(e,t));else{var u=$(i.done);for(u&&u.ranges||Xi(e.sel,i.done),o={changes:[Ui(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||Se(e,"historyAdded")}function ji(e,t,r,n){var i,o,l,s,a,u=e.history,c=n&&n.origin;r==u.lastSelOp||c&&u.lastSelOrigin==c&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==c||(i=e,o=c,l=$(u.done),s=t,"*"==(a=o.charAt(0))||"+"==a&&l.ranges.length==s.ranges.length&&l.somethingSelected()==s.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?u.done[u.done.length-1]=t:Xi(t,u.done),u.lastSelTime=+new Date,u.lastSelOrigin=c,u.lastSelOp=r,n&&!1!==n.clearRedo&&Vi(u.undone)}function Xi(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Yi(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i=i||(r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function _i(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t=t||e.slice(0,r):t&&t.push(e[r]);return t?t.length?t:null:e}function $i(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(_i(r[i]));return n}(e,t),n=Ft(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function qi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Ti.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&-1<B(t,Number(c[1]))&&($(s)[h]=u[h],delete u[h])}}}return n}function Zi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ut(t,i)<0;o!=ut(r,i)<0?(i=t,t=r):o!=ut(t,r)<0&&(t=r)}return new Mi(i,t)}return new Mi(r||t,t)}function Qi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),no(e,new Ti([Zi(e.sel.primary(),t,r,i)],0),n)}function Ji(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Zi(e.sel.ranges[o],t[o],null,i);no(e,Ni(e.cm,n,e.sel.primIndex),r)}function eo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,no(e,Ni(e.cm,i,e.sel.primIndex),n)}function to(e,t,r,n){no(e,Oi(t,r),n)}function ro(e,t,r){var n=e.history.done,i=$(n);i&&i.ranges?io(e,n[n.length-1]=t,r):no(e,t,r)}function no(e,t,r){io(e,t,r),ji(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function io(e,t,r){var n,i,o,l;(Te(e,"beforeSelectionChange")||e.cm&&Te(e.cm,"beforeSelectionChange"))&&(n=e,o=r,l={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new Mi(gt(n,e[t].anchor),gt(n,e[t].head))},origin:o&&o.origin},Se(n,"beforeSelectionChange",n,l),n.cm&&Se(n.cm,"beforeSelectionChange",n.cm,l),t=l.ranges!=i.ranges?Ni(n.cm,l.ranges,l.ranges.length-1):i);var s=r&&r.bias||(ut(t.primary().head,e.sel.primary().head)<0?-1:1);oo(e,so(e,t,s,!0)),r&&!1===r.scroll||!e.cm||En(e.cm)}function oo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ke(e.cm)),gr(e,"cursorActivity",e))}function lo(e){oo(e,so(e,e.sel,null,!1))}function so(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=uo(e,l.anchor,s&&s.anchor,r,n),u=uo(e,l.head,s&&s.head,r,n);!i&&a==l.anchor&&u==l.head||((i=i||t.ranges.slice(0,o))[o]=new Mi(a,u))}return i?Ni(e.cm,i,t.primIndex):t}function ao(e,t,r,n,i){var o=et(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker,u="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(Se(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var h=a.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(h=co(e,h,-n,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(f=ut(h,r))&&(n<0?f<0:0<f))return ao(e,h,t,n,i)}var d=a.find(n<0?-1:1);return(n<0?u:c)&&(d=co(e,d,n,d.line==t.line?o:null)),d?ao(e,d,t,n,i):null}}return t}function uo(e,t,r,n,i){var o=n||1,l=ao(e,t,r,o,i)||!i&&ao(e,t,r,o,!0)||ao(e,t,r,-o,i)||!i&&ao(e,t,r,-o,!0);return l||(e.cantEdit=!0,at(e.first,0))}function co(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?gt(e,at(t.line-1)):null:0<r&&t.ch==(n||et(e,t.line)).text.length?t.line<e.first+e.size-1?at(t.line+1,0):null:new at(t.line,t.ch+r)}function ho(e){e.setSelection(at(e.firstLine(),0),at(e.lastLine()),V)}function fo(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=gt(i,e)),t&&(o.to=gt(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),Se(i,"beforeChange",i,o),i.cm&&Se(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function po(e,t,r){if(e.cm){if(!e.cm.curOp)return ii(e.cm,po)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Te(e,"beforeChange")||e.cm&&Te(e.cm,"beforeChange"))||(t=fo(e,t,!0))){var n=Ot&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n=n||[]).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(ut(u.to,s.from)<0||0<ut(u.from,s.to))){var c=[a,1],h=ut(u.from,s.from),f=ut(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(0<f||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)go(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else go(e,t)}}function go(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ut(r.from,r.to)){var t=Wi(e,r);Ki(e,r,t,e.cm?e.cm.curOp.id:NaN),yo(e,r,t,Ft(e,r));var n=[];zi(e,function(e,t){t||-1!=B(n,e.history)||(Co(e.history,r),n.push(e.history)),yo(e,r,null,Ft(e,r))})}}function vo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var l,r=i.history,n=i.sel,s="undo"==o?r.done:r.undone,a="undo"==o?r.undone:r.done,u=0;u<s.length&&(l=s[u],e?!l.ranges||l.equals(i.sel):l.ranges);u++);if(u!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(l=s.pop()).ranges){if(t)return void s.push(l);break}if(Xi(l,a),e&&!l.equals(i.sel))return void no(i,l,{clearRedo:!1});n=l}var c=[];Xi(n,a),a.push({changes:c,generation:r.generation}),r.generation=l.generation||++r.maxGeneration;for(var h=Te(i,"beforeChange")||i.cm&&Te(i.cm,"beforeChange"),f=function(e){var r=l.changes[e];if(r.origin=o,h&&!fo(i,r,!1))return s.length=0,{};c.push(Ui(i,r));var t=e?Wi(i,r):$(s);yo(i,r,t,$i(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:Ai(r)});var n=[];zi(i,function(e,t){t||-1!=B(n,e.history)||(Co(e.history,r),n.push(e.history)),yo(e,r,null,$i(e,r))})},d=l.changes.length-1;0<=d;--d){var p=f(d);if(p)return p.v}}}}function mo(e,t){if(0!=t&&(e.first+=t,e.sel=new Ti(q(e.sel.ranges,function(e){return new Mi(at(e.anchor.line+t,e.anchor.ch),at(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){vn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)mn(e.cm,n,"gutter")}}function yo(e,t,r,n){if(e.cm&&!e.cm.curOp)return ii(e.cm,yo)(e,t,r,n);if(t.to.line<e.first)mo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);mo(e,i),t={from:at(e.first,0),to:at(t.to.line+i,t.to.ch),text:[$(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:at(o,et(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tt(e,t.from,t.to),r=r||Wi(e,t),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=it(Xt(et(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0}));-1<n.sel.contains(t.from,t.to)&&ke(e);Ii(n,t,r,fn(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=Qt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;r<n;n--){var i=et(e,n).stateAfter;if(i&&(!(i instanceof mt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),si(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?vn(e):o.line!=l.line||1!=t.text.length||Ei(e.doc,t)?vn(e,o.line,l.line+1,u):mn(e,o.line,"text");var c=Te(e,"changes"),h=Te(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&gr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Ii(e,t,n),io(e,r,V),e.cantEdit&&uo(e,at(e.firstLine(),0))&&(e.cantEdit=!1)}}function bo(e,t,r,n,i){var o;ut(n=n||r,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),po(e,{from:r,to:n,text:t,origin:i})}function wo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function xo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)wo(o.ranges[s].anchor,t,r,n),wo(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=at(u.from.line+n,u.from.ch),u.to=at(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function Co(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;xo(e.done,r,n,i),xo(e.undone,r,n,i)}function So(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=et(e,pt(e,t)):i=it(t),null==i?null:(n(o,i)&&e.cm&&mn(e.cm,i,r),o)}function Lo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function ko(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Mi.prototype.from=function(){return dt(this.anchor,this.head)},Mi.prototype.to=function(){return ft(this.anchor,this.head)},Mi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Lo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,(o=i).parent=null,Et(o),gr(i,"delete")}var o;this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof Lo))){var s=[];this.collapse(s),this.children=[new Lo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new Lo(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ko(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ko(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};function To(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t}function Mo(e,t,r){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pn(e,r)}To.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=it(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Mr(this);nt(r,Math.max(0,r.height-o)),e&&(ni(e,function(){Mo(e,r,-o),mn(e,n,"widget")}),gr(e,"lineWidgetCleared",e,this,n))}},To.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Mr(this)-t;i&&($t(this.doc,n)||nt(n,n.height+i),r&&ni(r,function(){r.curOp.forceUpdate=!0,Mo(r,n,i),gr(r,"lineWidgetChanged",r,e,it(n))}))},Me(To);var No=0,Oo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++No};function Ao(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=I(i)).shared=!1;var l=[Ao(e,r,n,i,o)],s=l[0],a=i.widgetNode;return zi(e,function(e){a&&(i.widgetNode=a.cloneNode(!0)),l.push(Ao(e,gt(e,r),gt(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;s=$(l)}),new Do(l,s)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return ii(t.cm,Ao)(t,n,i,e,r);var o=new Oo(t,r),l=ut(n,i);if(e&&I(e,o,!1),0<l||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(jt(t,n.line,n,i,o)||n.line!=i.line&&jt(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At=!0}o.addToHistory&&Ki(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var s,a=n.line,u=t.cm;if(t.iter(a,i.line+1,function(e){var t,r;u&&o.collapsed&&!u.options.lineWrapping&&Xt(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=n.line&&nt(e,0),t=e,r=new Dt(o,a==n.line?n.ch:null,a==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++a}),o.collapsed&&t.iter(n.line,i.line+1,function(e){$t(t,e)&&nt(e,0)}),o.clearOnEnter&&we(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ot=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++No,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)vn(u,n.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=n.line;c<=i.line;c++)mn(u,c,"text");o.atomic&&lo(u.doc),gr(u,"markerAdded",u,o)}return o}Oo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Zn(e),Te(this,"clear")){var r=this.find();r&&gr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Wt(l.markedSpans,this);e&&!this.collapsed?mn(e,it(l),"text"):e&&(null!=s.to&&(i=it(l)),null!=s.from&&(n=it(l))),l.markedSpans=Ht(l.markedSpans,s),null==s.from&&this.collapsed&&!$t(this.doc,l)&&e&&nt(l,an(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var u=Xt(this.lines[a]),c=Qt(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&vn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&gr(e,"markerCleared",e,this,n,i),t&&Qn(e),this.parent&&this.parent.clear()}},Oo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Wt(o.markedSpans,this);if(null!=l.from&&(r=at(t?o:it(o),l.from),-1==e))return r;if(null!=l.to&&(n=at(t?o:it(o),l.to),1==e))return n}return r&&{from:r,to:n}},Oo.prototype.changed=function(){var o=this,l=this.find(-1,!0),s=this,a=this.doc.cm;l&&a&&ni(a,function(){var e=l.line,t=it(l.line),r=Ir(a,t);if(r&&(Kr(r),a.curOp.selectionChanged=a.curOp.forceUpdate=!0),a.curOp.updateMaxLine=!0,!$t(s.doc,e)&&null!=s.height){var n=s.height;s.height=null;var i=Mr(s)-n;i&&nt(e,e.height+i)}gr(a,"markerChanged",a,o)})},Oo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oo.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Me(Oo);var Do=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Wo(e){return e.findMarks(at(e.first,0),e.clipPos(at(e.lastLine())),function(e){return e.parent})}function Ho(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];zi(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==B(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}Do.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();gr(this,"clear")}},Do.prototype.find=function(e,t){return this.primary.find(e,t)},Me(Do);var Fo=0,Po=function(e,t,r,n,i){if(!(this instanceof Po))return new Po(e,t,r,n,i);null==r&&(r=0),ko.call(this,[new Lo([new er("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=at(r,0);this.sel=Oi(o),this.history=new Gi(null),this.id=++Fo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ii(this,{from:o,to:o,text:e}),no(this,Oi(o),V)};Po.prototype=Q(ko.prototype,{constructor:Po,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=rt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:li(function(e){var t=at(this.first,0),r=this.first+this.size-1;po(this,{from:t,to:at(r,et(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&In(this.cm,0,0),no(this,Oi(t),V)}),replaceRange:function(e,t,r,n){bo(this,e,t=gt(this,t),r=r?gt(this,r):t,n)},getRange:function(e,t,r){var n=tt(this,gt(this,e),gt(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(lt(this,e))return et(this,e)},getLineNumber:function(e){return it(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=et(this,e)),Xt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:li(function(e,t,r){to(this,gt(this,"number"==typeof e?at(e,t||0):e),null,r)}),setSelection:li(function(e,t,r){to(this,gt(this,e),gt(this,t||e),r)}),extendSelection:li(function(e,t,r){Qi(this,gt(this,e),t&>(this,t),r)}),extendSelections:li(function(e,t){Ji(this,vt(this,e),t)}),extendSelectionsBy:li(function(e,t){Ji(this,vt(this,q(this.sel.ranges,e)),t)}),setSelections:li(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Mi(gt(this,e[i].anchor),gt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),no(this,Ni(this.cm,n,t),r)}}),addSelection:li(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Mi(gt(this,e),gt(this,t||e))),no(this,Ni(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=tt(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=tt(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:li(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=at(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Hi(s.from,i,o),u=Hi(Ai(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=ut(c.head,c.anchor)<0;n[l]=new Mi(h?u:a,h?a:u)}else n[l]=new Mi(a,a)}return new Ti(n,e.sel.primIndex)}(this,n,t),a=n.length-1;0<=a;a--)po(this,n[a]);s?ro(this,s):this.cm&&En(this.cm)}),undo:li(function(){vo(this,"undo")}),redo:li(function(){vo(this,"redo")}),undoSelection:li(function(){vo(this,"undo",!0)}),redoSelection:li(function(){vo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var t=this;this.history=new Gi(this.history.maxGeneration),zi(this,function(e){return e.history=t.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(e){var t=this.history=new Gi(this.history.maxGeneration);t.done=qi(e.done.slice(0),null,!0),t.undone=qi(e.undone.slice(0),null,!0)},setGutterMarker:li(function(e,r,n){return So(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),1})}),clearGutter:li(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&So(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),1})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!lt(this,e))return null;if(!(e=et(this,t=e)))return null}else if(null==(t=it(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:li(function(e,r,n){return So(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(L(n).test(e[t]))return;e[t]+=" "+n}else e[t]=n;return 1})}),removeLineClass:li(function(e,o,l){return So(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(r){if(null==l)e[t]=null;else{var n=r.match(L(l));if(!n)return;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return 1}})}),addLineWidget:li(function(e,t,r){return i=e,o=new To(n=this,t,r),(l=n.cm)&&o.noHScroll&&(l.display.alignWidgets=!0),So(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,l&&!$t(n,e)){var r=Zt(e)<n.scrollTop;nt(e,e.height+Mr(o)),r&&Pn(l,o.height),l.curOp.forceUpdate=!0}return 1}),l&&gr(l,"lineWidgetAdded",l,o,"number"==typeof i?i:it(i)),o;var n,i,o,l}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ao(this,gt(this,e),gt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Ao(this,e=gt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=et(this,(e=gt(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,l){i=gt(this,i),o=gt(this,o);var s=[],a=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&a==i.line&&i.ch>=n.to||null==n.from&&a!=i.line||null!=n.from&&a==o.line&&n.from>=o.ch||l&&!l(n.marker)||s.push(n.marker.parent||n.marker)}++a}),s},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),gt(this,at(i,n))},indexFromPos:function(e){var t=(e=gt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new Po(rt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Po(rt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ut(o,l)){var s=Ao(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,Wo(this)),n},unlinkDoc:function(e){if(e instanceof Wl&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ho(Wo(this));break}}if(e.history==this.history){var r=[e.id];zi(e,function(e){return r.push(e.id)},!0),e.history=new Gi(null),e.history.done=qi(this.history.done,r),e.history.undone=qi(this.history.undone,r)}},iterLinkedDocs:function(e){zi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Be(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:li(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&ni(t=this.cm,function(){Bi(t),vn(t)}))})}),Po.prototype.eachLine=Po.prototype.iter;var Eo=0;function Io(e){var n=this;if(zo(n),!Le(n,e)&&!Nr(n.display,e)){Ne(e),x&&(Eo=+new Date);var t=pn(n,e,!0),r=e.dataTransfer.files;if(t&&!n.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,s=function(){++l==i&&ii(n,function(){var e={from:t=gt(n.doc,t),to:t,text:n.doc.splitLines(o.filter(function(e){return null!=e}).join(n.doc.lineSeparator())),origin:"paste"};po(n.doc,e),ro(n.doc,Oi(gt(n.doc,t),gt(n.doc,Ai(e))))})()},a=function(e,t){if(n.options.allowDropFileTypes&&-1==B(n.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[t]=e),s()},r.readAsText(e)}},u=0;u<r.length;u++)a(r[u],u);else{if(n.state.draggingText&&-1<n.doc.sel.contains(t))return n.state.draggingText(e),void setTimeout(function(){return n.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var h;if(n.state.draggingText&&!n.state.draggingText.copy&&(h=n.listSelections()),io(n.doc,Oi(t,t)),h)for(var f=0;f<h.length;++f)bo(n.doc,"",h[f].anchor,h[f].head,"drag");n.replaceSelection(c,"around","paste"),n.display.input.focus()}}catch(e){}}}}function zo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ro(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var e=0;e<r.length;e++)t(r[e])})}}var Bo=!1;function Go(){var e;Bo||(we(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ro(Uo)},100))}),we(window,"blur",function(){return Ro(An)}),Bo=!0)}function Uo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vo={3:"Pause",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:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ko=0;Ko<10;Ko++)Vo[Ko+48]=Vo[Ko+96]=String(Ko);for(var jo=65;jo<=90;jo++)Vo[jo]=String.fromCharCode(jo);for(var Xo=1;Xo<=12;Xo++)Vo[Xo+111]=Vo[Xo+63235]="F"+Xo;var Yo={};function _o(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function $o(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=q(r.split(" "),_o),o=0;o<i.length;o++){var l=void 0,s=void 0;l=o==i.length-1?(s=i.join(" "),n):(s=i.slice(0,o+1).join(" "),"...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function qo(e,t,r,n){var i=(t=el(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return qo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=qo(e,t.fallthrough[o],r,n);if(l)return l}}}function Zo(e){var t="string"==typeof e?e:Vo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Qo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Jo(e,t){if(v&&34==e.keyCode&&e.char)return!1;var r=Vo[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Qo(r,e,t))}function el(e){return"string"==typeof e?Yo[e]:e}function tl(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ut(o.from,$(n).to)<=0;){var l=n.pop();if(ut(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}ni(t,function(){for(var e=n.length-1;0<=e;e--)bo(t.doc,"",n[e].from,n[e].to,"+delete");En(t)})}function rl(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function nl(e,t,r){var n=rl(e,t.ch,r);return null==n?null:new at(t.line,n,r<0?"after":"before")}function il(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ye(r,t.doc.direction);if(o){var l,s=i<0?$(o):o[0],a=i<0==(1==s.level)?"after":"before";if(0<s.level||"rtl"==t.doc.direction){var u=zr(t,r);l=i<0?r.text.length-1:0;var c=Rr(t,u,l).top;l=le(function(e){return Rr(t,u,e).top==c},i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=rl(r,l,1))}else l=i<0?s.to:s.from;return new at(n,l,a)}}return new at(n,i<0?r.text.length:0,i<0?"before":"after")}function ol(t,r,s,e){var a=ye(r,t.doc.direction);if(!a)return nl(r,s,e);s.ch>=r.text.length?(s.ch=r.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var n=ae(a,s.ch,s.sticky),i=a[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>s.ch:i.from<s.ch))return nl(r,s,e);function u(e,t){return rl(r,e instanceof at?e.ch:e,t)}function o(e){return t.options.lineWrapping?(l=l||zr(t,r),on(t,r,l,e)):{begin:0,end:r.text.length}}var l,c=o("before"==s.sticky?u(s,-1):s.ch);if("rtl"==t.doc.direction||1==i.level){var h=1==i.level==e<0,f=u(s,h?1:-1);if(null!=f&&(h?f<=i.to&&f<=c.end:f>=i.from&&f>=c.begin)){var d=h?"before":"after";return new at(s.line,f,d)}}function p(e,t,r){for(var n=function(e,t){return t?new at(s.line,u(e,1),"before"):new at(s.line,e,"after")};0<=e&&e<a.length;e+=t){var i=a[e],o=0<t==(1!=i.level),l=o?r.begin:u(r.end,-1);if(i.from<=l&&l<i.to)return n(l,o);if(l=o?i.from:u(i.to,-1),r.begin<=l&&l<r.end)return n(l,o)}}var g=p(n+e,e,c);if(g)return g;var v=0<e?c.end:u(c.begin,-1);return null==v||0<e&&v==r.text.length||!(g=p(0<e?0:a.length-1,e,o(v)))?null:g}Yo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Yo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","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","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Yo.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","Ctrl-O":"openLine"},Yo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","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":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Yo.default=w?Yo.macDefault:Yo.pcDefault;var ll={selectAll:ho,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(r){return tl(r,function(e){if(e.empty()){var t=et(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:at(e.head.line+1,0)}:{from:e.head,to:at(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return tl(t,function(e){return{from:at(e.from().line,0),to:gt(t.doc,at(e.to().line+1,0))}})},delLineLeft:function(e){return tl(e,function(e){return{from:at(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return tl(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return tl(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(at(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(at(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return sl(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return al(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=et(e.doc,t),n=function(e){for(var t;t=Vt(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=it(n));return il(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},j)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},j)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?al(n,e.head):r},j)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=z(e.getLine(o.line),o.ch,n);t.push(_(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(l){return ni(l,function(){for(var e=l.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=et(l.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new at(n.line,n.ch-1)),0<n.ch)n=new at(n.line,n.ch+1),l.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),at(n.line,n.ch-2),n,"+transpose");else if(n.line>l.doc.first){var o=et(l.doc,n.line-1).text;o&&(n=new at(n.line,1),l.replaceRange(i.charAt(0)+l.doc.lineSeparator()+o.charAt(o.length-1),at(n.line-1,o.length-1),n,"+transpose"))}t.push(new Mi(n,n))}l.setSelections(t)})},newlineAndIndent:function(n){return ni(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);En(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function sl(e,t){var r=et(e.doc,t),n=Xt(r);return n!=r&&(t=it(n)),il(!0,e,n,t,1)}function al(e,t){var r=sl(e,t.line),n=et(e.doc,r.line),i=ye(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return at(r.line,l?0:o,r.sticky)}function ul(e,t,r){if("string"==typeof t&&!(t=ll[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var cl=new R;function hl(e,t,r,n){var i=e.state.keySeq;if(i){if(Zo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:cl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fl(e,i+" "+t,r,n))return!0}return fl(e,t,r,n)}function fl(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=qo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&qo(t,e.options.extraKeys,r,e)||qo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&gr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(Ne(r),Tn(e)),!!i}function dl(t,e){var r=Jo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?hl(t,"Shift-"+r,e,function(e){return ul(t,e,!0)})||hl(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return ul(t,e)}):hl(t,r,e,function(e){return ul(t,e)}))}var pl=null;function gl(e){var t=this;if(t.curOp.focus=W(),!Le(t,e)){x&&C<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n,i=dl(t,e);v&&(pl=i?r:null,!i&&88==r&&!Ue&&(w?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),g&&!w&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||(H(n=t.display.lineDiv,"CodeMirror-crosshair"),we(document,"keyup",o),we(document,"mouseover",o))}function o(e){18!=e.keyCode&&e.altKey||(T(n,"CodeMirror-crosshair"),Ce(document,"keyup",o),Ce(document,"mouseover",o))}}function vl(e){16==e.keyCode&&(this.doc.sel.shift=!1),Le(this,e)}function ml(e){var t=this;if(!(Nr(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(v&&r==pl)return pl=null,void Ne(e);if(!v||e.which&&!(e.which<10)||!dl(t,e)){var i,o=String.fromCharCode(null==n?r:n);if("\b"!=o)if(!hl(i=t,"'"+o+"'",e,function(e){return ul(i,e,!0)}))t.display.input.onKeyPress(e)}}}var yl,bl,wl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function xl(e){var t=this,r=t.display;if(!(Le(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Nr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!Ll(t,e)){var n,i,o,l=pn(t,e),s=He(e),a=l?(n=l,i=s,o=+new Date,bl&&bl.compare(o,n,i)?(yl=bl=null,"triple"):yl&&yl.compare(o,n,i)?(bl=new wl(o,n,i),yl=null,"double"):(yl=new wl(o,n,i),bl=null,"single")):"single";window.focus(),1==s&&t.state.selectingText&&t.state.selectingText(e),l&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return hl(r,Qo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=ll[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=U}finally{r.state.suppressEdits=!1}return t})}(t,s,l,a,e)||(1==s?l?function(e,t,r,n){x?setTimeout(E(Mn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=d?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}null!=i.extend&&!e.doc.extend||(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=w?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?r.altKey:r.ctrlKey));return i}(e,r,n),l=e.doc.sel;(e.options.dragDrop&&Ee&&!e.isReadOnly()&&"single"==r&&-1<(i=l.contains(t))&&(ut((i=l.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ut(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,l=!1,s=ii(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,Ce(o.wrapper.ownerDocument,"mouseup",s),Ce(o.wrapper.ownerDocument,"mousemove",a),Ce(o.scroller,"dragstart",u),Ce(o.scroller,"drop",s),l||(Ne(e),i.addNew||Qi(t.doc,n,null,null,i.extend),b||x&&9==C?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),a=function(e){l=l||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},u=function(){return l=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=s).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();we(o.wrapper.ownerDocument,"mouseup",s),we(o.wrapper.ownerDocument,"mousemove",a),we(o.scroller,"dragstart",u),we(o.scroller,"drop",s),Nn(t),setTimeout(function(){return o.input.focus()},20)}:function(v,e,m,y){var l=v.display,b=v.doc;Ne(e);var w,x,C=b.sel,t=C.ranges;y.addNew&&!y.extend?(x=b.sel.contains(m),w=-1<x?t[x]:new Mi(m,m)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new Mi(m,m)),m=pn(v,e,!0,!0),x=-1;else{var r=Cl(v,m,y.unit);w=y.extend?Zi(w,r.anchor,r.head,y.extend):r}y.addNew?-1==x?(x=t.length,no(b,Ni(v,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(no(b,Ni(v,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),C=b.sel):eo(b,x,w,K):(no(b,new Ti([w],x=0),K),C=b.sel);var S=m;function s(e){if(0!=ut(S,e))if(S=e,"rectangle"==y.unit){for(var t=[],r=v.options.tabSize,n=z(et(b,m.line).text,m.ch,r),i=z(et(b,e.line).text,e.ch,r),o=Math.min(n,i),l=Math.max(n,i),s=Math.min(m.line,e.line),a=Math.min(v.lastLine(),Math.max(m.line,e.line));s<=a;s++){var u=et(b,s).text,c=X(u,o,r);o==l?t.push(new Mi(at(s,c),at(s,c))):u.length>c&&t.push(new Mi(at(s,c),at(s,X(u,l,r))))}t.length||t.push(new Mi(m,m)),no(b,Ni(v,C.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),v.scrollIntoView(e)}else{var h,f=w,d=Cl(v,e,y.unit),p=f.anchor;p=0<ut(d.anchor,p)?(h=d.head,dt(f.from(),d.anchor)):(h=d.anchor,ft(f.to(),d.head));var g=C.ranges.slice(0);g[x]=function(e,t){var r=t.anchor,n=t.head,i=et(e.doc,r.line);if(0==ut(r,n)&&r.sticky==n.sticky)return t;var o=ye(i);if(!o)return t;var l=ae(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a,u=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)a=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var c=ae(o,n.ch,n.sticky),h=c-l||(n.ch-r.ch)*(1==s.level?-1:1);a=c==u-1||c==u?h<0:0<h}var f=o[u+(a?-1:0)],d=a==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new Mi(new at(r.line,p,g),n)}(v,new Mi(gt(b,p),h)),no(b,Ni(v,g,x),K)}}var a=l.wrapper.getBoundingClientRect(),u=0;function n(e){v.state.selectingText=!1,u=1/0,e&&(Ne(e),l.input.focus()),Ce(l.wrapper.ownerDocument,"mousemove",i),Ce(l.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=ii(v,function(e){(0!==e.buttons&&He(e)?function e(t){var r=++u,n=pn(v,t,!0,"rectangle"==y.unit);if(n)if(0!=ut(n,S)){v.curOp.focus=W(),s(n);var i=Hn(l,b);(n.line>=i.to||n.line<i.from)&&setTimeout(ii(v,function(){u==r&&e(t)}),150)}else{var o=t.clientY<a.top?-20:t.clientY>a.bottom?20:0;o&&setTimeout(ii(v,function(){u==r&&(l.scroller.scrollTop+=o,e(t))}),50)}}:n)(e)}),o=ii(v,n);v.state.selectingText=o,we(l.wrapper.ownerDocument,"mousemove",i),we(l.wrapper.ownerDocument,"mouseup",o)})(e,n,t,o)}(t,l,a,e):We(e)==r.scroller&&Ne(e):2==s?(l&&Qi(t.doc,l),setTimeout(function(){return r.input.focus()},20)):3==s&&(S?t.display.input.onContextMenu(e):Nn(t)))}}function Cl(e,t,r){if("char"==r)return new Mi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Mi(at(t.line,0),gt(e.doc,at(t.line+1,0)));var n=r(e,t);return new Mi(n.from,n.to)}function Sl(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ne(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Te(e,r))return Ae(t);o-=s.top-l.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i)return Se(e,r,e,ot(e.doc,o),e.display.gutterSpecs[a].className,t),Ae(t)}}function Ll(e,t){return Sl(e,t,"gutterClick",!0)}function kl(e,t){var r,n;Nr(e.display,t)||(n=t,Te(r=e,"gutterContextMenu")&&Sl(r,n,"gutterContextMenu",!1))||Le(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Tl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Xr(e)}wl.prototype.compare=function(e,t,r){return this.time+400>e&&0==ut(t,this.pos)&&r==this.button};var Ml={toString:function(){return"CodeMirror.Init"}},Nl={},Ol={};function Al(e,t,r){if(!t!=!(r&&r!=Ml)){var n=e.display.dragFunctions,i=t?we:Ce;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Dl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),Jt(e)),dn(e),vn(e),Xr(e),setTimeout(function(){return Xn(e)},100)}function Wl(e,t){var r=this;if(!(this instanceof Wl))return new Wl(e,t);this.options=t=t?I(t):{},I(Nl,t,!1);var n=t.value;"string"==typeof n?n=new Po(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Wl.inputStyles[t.inputStyle](this),o=this.display=new wi(e,n,i,t);for(var l in Tl(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$n(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&C<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;we(o.scroller,"mousedown",ii(i,xl)),we(o.scroller,"dblclick",x&&C<11?ii(i,function(e){if(!Le(i,e)){var t=pn(i,e);if(t&&!Ll(i,e)&&!Nr(i.display,e)){Ne(e);var r=i.findWordAt(t);Qi(i.doc,r.anchor,r.head)}}}):function(e){return Le(i,e)||Ne(e)});we(o.scroller,"contextmenu",function(e){return kl(i,e)}),we(o.input.getField(),"contextmenu",function(e){o.scroller.contains(e.target)||kl(i,e)});var r,n={end:0};function l(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return 1;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}we(o.scroller,"touchstart",function(e){if(!Le(i,e)&&!function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(e)&&!Ll(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),we(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),we(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!Nr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||s(t,t.prev)?new Mi(n,n):!t.prev.prev||s(t,t.prev.prev)?i.findWordAt(n):new Mi(at(n.line,0),gt(i.doc,at(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),Ne(e)}l()}),we(o.scroller,"touchcancel",l),we(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Bn(i,o.scroller.scrollTop),Un(i,o.scroller.scrollLeft,!0),Se(i,"scroll",i))}),we(o.scroller,"mousewheel",function(e){return ki(i,e)}),we(o.scroller,"DOMMouseScroll",function(e){return ki(i,e)}),we(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){Le(i,e)||De(e)},over:function(e){Le(i,e)||(function(e,t){var r=pn(e,t);if(r){var n=document.createDocumentFragment();Sn(e,r,n),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(i,e),De(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||new Date-Eo<100))De(t);else if(!Le(e,t)&&!Nr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!a)){var r=A("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),v&&r.parentNode.removeChild(r)}}(i,e)},drop:ii(i,Io),leave:function(e){Le(i,e)||zo(i)}};var e=o.input.getField();we(e,"keyup",function(e){return vl.call(i,e)}),we(e,"keydown",ii(i,gl)),we(e,"keypress",ii(i,ml)),we(e,"focus",function(e){return On(i,e)}),we(e,"blur",function(e){return An(i,e)})}(this),Go(),Zn(this),this.curOp.forceUpdate=!0,Ri(this,n),t.autofocus&&!f||this.hasFocus()?setTimeout(E(On,this),20):An(this),Ol)Ol.hasOwnProperty(l)&&Ol[l](this,t[l],Ml);vi(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Hl.length;++s)Hl[s](this);Qn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Wl.defaults=Nl,Wl.optionHandlers=Ol;var Hl=[];function Fl(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=xt(e,t).state:r="prev");var l=e.options.tabSize,s=et(o,t),a=z(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==U||150<u)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?z(et(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f<u&&(h+=_(u-f)),h!=c)return bo(o,h,at(t,0),at(t,c.length),"+input"),!(s.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=at(t,c.length);eo(o,p,new Mi(v,v));break}}}Wl.defineInitHook=function(e){return Hl.push(e)};var Pl=null;function El(e){Pl=e}function Il(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n=n||o.sel;var l=new Date-200,s="paste"==i||e.state.pasteIncoming>l,a=Be(t),u=null;if(s&&1<n.ranges.length)if(Pl&&Pl.text.join("\n")==t){if(n.ranges.length%Pl.text.length==0){u=[];for(var c=0;c<Pl.text.length;c++)u.push(o.splitLines(Pl.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=q(a,function(e){return[e]}));for(var h=e.curOp.updateInput,f=n.ranges.length-1;0<=f;f--){var d=n.ranges[f],p=d.from(),g=d.to();d.empty()&&(r&&0<r?p=at(p.line,p.ch-r):e.state.overwrite&&!s?g=at(g.line,Math.min(et(o,g.line).text.length,g.ch+$(a).length)):s&&Pl&&Pl.lineWise&&Pl.text.join("\n")==t&&(p=g=at(p.line,0)));var v={from:p,to:g,text:u?u[f%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};po(e.doc,v),gr(e,"inputRead",e,v)}t&&!s&&Rl(e,t),En(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function zl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");return r&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||ni(t,function(){return Il(t,r,0,null,"paste")}),1)}function Rl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<t.indexOf(o.electricChars.charAt(s))){l=Fl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(et(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Fl(e,i.head.line,"smart"));l&&gr(e,"electricInput",e,i.head.line)}}}function Bl(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:at(i,0),head:at(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Gl(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ul(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),c&&(e.style.border="1px solid black"),Gl(e),t}function Vl(n,i,o,e,l){var t=i,r=o,s=et(n,i.line),a=l&&"rtl"==n.direction?-o:o;function u(e){var t,r;if(null==(t=l?ol(n.cm,s,i,o):nl(s,i,o))){if(e||(r=i.line+a)<n.first||r>=n.first+n.size||(i=new at(r,i.ch,i.sticky),!(s=et(n,r))))return;i=il(l,n.cm,s,i.line,a)}else i=t;return 1}if("char"==e)u();else if("column"==e)u(!0);else if("word"==e||"group"==e)for(var c=null,h="group"==e,f=n.cm&&n.cm.getHelper(i,"wordChars"),d=!0;!(o<0)||u(!d);d=!1){var p=s.text.charAt(i.ch)||"\n",g=te(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){o<0&&(o=1,u(),i.sticky="after");break}if(g&&(c=g),0<o&&!u(!d))break}var v=uo(n,i,t,r,!0);return ct(t,v)&&(v.hitSide=!0),v}function Kl(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*an(e.display),3);i=(0<r?t.bottom:t.top)+r*u}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=rn(e,s,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}function jl(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Xl(e,t){var r=Ir(e,t.line);if(!r||r.hidden)return null;var n=et(e.doc,t.line),i=Pr(r,n,t.line),o=ye(n,e.doc.direction),l="left";o&&(l=ae(o,t.ch)%2?"right":"left");var s=Ur(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Yl(e,t){return t&&(e.bad=!0),e}function _l(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Yl(e.clipPos(at(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return $l(o,t,r)}}function $l(u,e,t){var r=u.text.firstChild,n=!1;if(!e||!D(r,e))return Yl(at(it(u.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=u.rest?$(u.rest):u.line;return Yl(at(it(i),i.text.length),n)}var o=3==e.nodeType?e:null,l=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t=t&&o.nodeValue.length);l.parentNode!=r;)l=l.parentNode;var c=u.measure,h=c.maps;function s(e,t,r){for(var n=-1;n<(h?h.length:0);n++)for(var i=n<0?c.map:h[n],o=0;o<i.length;o+=3){var l=i[o+2];if(l==e||l==t){var s=it(n<0?u.line:u.rest[n]),a=i[o]+r;return(r<0||l!=e)&&(a=i[o+(r?1:0)]),at(s,a)}}}var a=s(o,l,t);if(a)return Yl(a,n);for(var f=l.nextSibling,d=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(a=s(f,f.firstChild,0))return Yl(at(a.line,a.ch-d),n);d+=f.textContent.length}for(var p=l.previousSibling,g=t;p;p=p.previousSibling){if(a=s(p,p.firstChild,-1))return Yl(at(a.line,a.ch+g),n);g+=p.textContent.length}}jl.prototype.init=function(e){var t=this,l=this,s=l.cm,a=l.div=e.lineDiv;function r(e){if(!Le(s,e)){if(s.somethingSelected())El({lineWise:!1,text:s.getSelections()}),"cut"==e.type&&s.replaceSelection("",null,"cut");else{if(!s.options.lineWiseCopyCut)return;var t=Bl(s);El({lineWise:!0,text:t.text}),"cut"==e.type&&s.operation(function(){s.setSelections(t.ranges,0,V),s.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Pl.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Ul(),i=n.firstChild;s.display.lineSpace.insertBefore(n,s.display.lineSpace.firstChild),i.value=Pl.text.join("\n");var o=document.activeElement;P(i),setTimeout(function(){s.display.lineSpace.removeChild(n),o.focus(),o==a&&l.showPrimarySelection()},50)}}Gl(a,s.options.spellcheck,s.options.autocorrect,s.options.autocapitalize),we(a,"paste",function(e){Le(s,e)||zl(e,s)||C<=11&&setTimeout(ii(s,function(){return t.updateFromDOM()}),20)}),we(a,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),we(a,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),we(a,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(a,"touchstart",function(){return l.forceCompositionEnd()}),we(a,"input",function(){t.composing||t.readFromDOMSoon()}),we(a,"copy",r),we(a,"cut",r)},jl.prototype.prepareSelection=function(){var e=Cn(this.cm,!1);return e.focus=document.activeElement==this.div,e},jl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},jl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},jl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=_l(t,e.anchorNode,e.anchorOffset),l=_l(t,e.focusNode,e.focusOffset);if(!o||o.bad||!l||l.bad||0!=ut(dt(o,l),n)||0!=ut(ft(o,l),i)){var s=t.display.view,a=n.line>=t.display.viewFrom&&Xl(t,n)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Xl(t,i);if(!u){var c=s[s.length-1].measure,h=c.maps?c.maps[c.maps.length-1]:c.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(a&&u){var f,d=e.rangeCount&&e.getRangeAt(0);try{f=k(a.node,a.offset,u.offset,u.node)}catch(e){}f&&(!g&&t.state.focused?(e.collapse(a.node,a.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),d&&null==e.anchorNode?e.addRange(d):g&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},jl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},jl.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},jl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},jl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},jl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},jl.prototype.blur=function(){this.div.blur()},jl.prototype.getField=function(){return this.div},jl.prototype.supportsTouch=function(){return!0},jl.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():ni(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},jl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},jl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(h&&l&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return 1;return}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=_l(t,e.anchorNode,e.anchorOffset),n=_l(t,e.focusNode,e.focusOffset);r&&n&&ni(t,function(){no(t.doc,Oi(r,n),V),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},jl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),l=o.from(),s=o.to();if(0==l.ch&&l.line>n.firstLine()&&(l=at(l.line-1,et(n.doc,l.line-1).length)),s.ch==et(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=at(s.line+1,0)),l.line<i.viewFrom||s.line>i.viewTo-1)return!1;r=l.line==i.viewFrom||0==(e=gn(n,l.line))?(t=it(i.view[0].line),i.view[0].node):(t=it(i.view[e].line),i.view[e-1].node.nextSibling);var a,u,c=gn(n,s.line);if(u=c==i.view.length-1?(a=i.viewTo-1,i.lineDiv.lastChild):(a=it(i.view[c+1].line)-1,i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(a,e,t,u,c){var r="",h=!1,f=a.doc.lineSeparator(),d=!1;function p(){h&&(r+=f,d&&(r+=f),h=d=!1)}function g(e){e&&(p(),r+=e)}function v(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void g(t);var r,n=e.getAttribute("cm-marker");if(n){var i=a.findMarks(at(u,0),at(c+1,0),(s=+n,function(e){return e.id==s}));return void(i.length&&(r=i[0].find(0))&&g(tt(a.doc,r.from,r.to).join(f)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&p();for(var l=0;l<e.childNodes.length;l++)v(e.childNodes[l]);/^(pre|p)$/i.test(e.nodeName)&&(d=!0),o&&(h=!0)}else 3==e.nodeType&&g(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var s}for(;v(e),e!=t;)e=e.nextSibling,d=!1;return r}(n,r,u,t,a)),f=tt(n.doc,at(t,0),at(a,et(n.doc,a).text.length));1<h.length&&1<f.length;)if($(h)==$(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),t++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=$(h),b=$(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==f.length&&t==l.line)for(;d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=at(t,d),C=at(a,f.length?$(f).length-p:0);return 1<h.length||h[0]||ut(x,C)?(bo(n.doc,h,x,C,"+input"),!0):void 0},jl.prototype.ensurePolled=function(){this.forceCompositionEnd()},jl.prototype.reset=function(){this.forceCompositionEnd()},jl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},jl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ni(this.cm,function(){return vn(e.cm)})},jl.prototype.setUneditable=function(e){e.contentEditable="false"},jl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ii(this.cm,Il)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},jl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},jl.prototype.onContextMenu=function(){},jl.prototype.resetPosition=function(){},jl.prototype.needsContentAttribute=!0;function ql(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null}var Zl,Ql,Jl,es,ts;function rs(e,t,n,r){Zl.defaults[e]=t,n&&(Ql[e]=r?function(e,t,r){r!=Ml&&n(e,t,r)}:n)}ql.prototype.init=function(r){var e=this,n=this,i=this.cm;this.createField(r);var o=this.textarea;function t(e){if(!Le(i,e)){if(i.somethingSelected())El({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Bl(i);El({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,V):(n.prevInput="",o.value=t.text.join("\n"),P(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),c&&(o.style.width="0px"),we(o,"input",function(){x&&9<=C&&e.hasSelection&&(e.hasSelection=null),n.poll()}),we(o,"paste",function(e){Le(i,e)||zl(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())}),we(o,"cut",t),we(o,"copy",t),we(r.scroller,"paste",function(e){if(!Nr(r,e)&&!Le(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),we(r.lineSpace,"selectstart",function(e){Nr(r,e)||Ne(e)}),we(o,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),we(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ql.prototype.createField=function(e){this.wrapper=Ul(),this.textarea=this.wrapper.firstChild},ql.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Cn(e);if(e.options.moveInputWithCursor){var i=Jr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},ql.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ql.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&P(this.textarea),x&&9<=C&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",x&&9<=C&&(this.hasSelection=null))}},ql.prototype.getField=function(){return this.textarea},ql.prototype.supportsTouch=function(){return!1},ql.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},ql.prototype.blur=function(){this.textarea.blur()},ql.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ql.prototype.receivedFocus=function(){this.slowPoll()},ql.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ql.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},ql.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(x&&9<=C&&this.hasSelection===i||w&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return ni(t,function(){Il(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ql.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ql.prototype.onKeyPress=function(){x&&9<=C&&(this.hasSelection=null),this.fastPoll()},ql.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var t=pn(n,e),l=i.scroller.scrollTop;if(t&&!v){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&ii(n,no)(n.doc,Oi(t),V);var s,a=o.style.cssText,u=r.wrapper.style.cssText,c=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-c.top-5)+"px; left: "+(e.clientX-c.left-5)+"px;\n z-index: 1000; background: "+(x?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(s=window.scrollY),i.input.focus(),b&&window.scrollTo(null,s),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=d,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=C&&f(),S){De(e);var h=function(){Ce(window,"mouseup",h),setTimeout(d,20)};we(window,"mouseup",h)}else setTimeout(d,50)}function f(){if(null!=o.selectionStart){var e=n.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function d(){if(r.contextMenuPending==d&&(r.contextMenuPending=!1,r.wrapper.style.cssText=u,o.style.cssText=a,x&&C<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),null!=o.selectionStart)){(!x||x&&C<9)&&f();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?ii(n,ho)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},ql.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ql.prototype.setUneditable=function(){},ql.prototype.needsContentAttribute=!1,Ql=(Zl=Wl).optionHandlers,Zl.defineOption=rs,Zl.Init=Ml,rs("value","",function(e,t){return e.setValue(t)},!0),rs("mode",null,function(e,t){e.doc.modeOption=t,Fi(e)},!0),rs("indentUnit",2,Fi,!0),rs("indentWithTabs",!1),rs("smartIndent",!0),rs("tabSize",4,function(e){Pi(e),Xr(e),vn(e)},!0),rs("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(at(o,r))}o++});for(var t=i.length-1;0<=t;t--)bo(e.doc,n,i[t],at(i[t].line,i[t].ch+n.length))}}),rs("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ml&&e.refresh()}),rs("specialCharPlaceholder",or,function(e){return e.refresh()},!0),rs("electricChars",!0),rs("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),rs("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),rs("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),rs("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),rs("rtlMoveVisually",!p),rs("wholeLineUpdateBefore",!0),rs("theme","default",function(e){Tl(e),bi(e)},!0),rs("keyMap","default",function(e,t,r){var n=el(t),i=r!=Ml&&el(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),rs("extraKeys",null),rs("configureMouse",null),rs("lineWrapping",!1,Dl,!0),rs("gutters",[],function(e,t){e.display.gutterSpecs=mi(t,e.options.lineNumbers),bi(e)},!0),rs("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?hn(e.display)+"px":"0",e.refresh()},!0),rs("coverGutterNextToScrollbar",!1,function(e){return Xn(e)},!0),rs("scrollbarStyle","native",function(e){$n(e),Xn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),rs("lineNumbers",!1,function(e,t){e.display.gutterSpecs=mi(e.options.gutters,t),bi(e)},!0),rs("firstLineNumber",1,bi,!0),rs("lineNumberFormatter",function(e){return e},bi,!0),rs("showCursorWhenSelecting",!1,xn,!0),rs("resetSelectionOnContextMenu",!0),rs("lineWiseCopyCut",!0),rs("pasteLinesPerSelection",!0),rs("selectionsMayTouch",!1),rs("readOnly",!1,function(e,t){"nocursor"==t&&(An(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),rs("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),rs("dragDrop",!0,Al),rs("allowDropFileTypes",null),rs("cursorBlinkRate",530),rs("cursorScrollMargin",0),rs("cursorHeight",1,xn,!0),rs("singleCursorHeightPerLine",!0,xn,!0),rs("workTime",100),rs("workDelay",100),rs("flattenSpans",!0,Pi,!0),rs("addModeClass",!1,Pi,!0),rs("pollInterval",100),rs("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),rs("historyEventDelay",1250),rs("viewportMargin",10,function(e){return e.refresh()},!0),rs("maxHighlightLength",1e4,Pi,!0),rs("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),rs("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),rs("autofocus",null),rs("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),rs("phrases",null),es=(Jl=Wl).optionHandlers,ts=Jl.helpers={},Jl.prototype={constructor:Jl,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,es.hasOwnProperty(e)&&ii(this,es[e])(this,t,n),Se(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](el(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:oi(function(e,t){var r=e.token?e:Jl.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,vn(this)}),removeOverlay:oi(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void vn(this)}}),indentLine:oi(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),lt(this.doc,e)&&Fl(this,e,t,r)}),indentSelection:oi(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Fl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&En(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<r;++a)Fl(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&0<u[n].from().ch&&eo(this.doc,n,new Mi(o,u[n].to()),V)}}}),getTokenAt:function(e,t){return Tt(this,e,t)},getLineTokens:function(e,t){return Tt(this,at(e),t,!0)},getTokenTypeAt:function(e){e=gt(this.doc,e);var t,r=wt(this,et(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=1+l}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Jl.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ts.hasOwnProperty(t))return r;var n=ts[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var l=n[i[t][o]];l&&r.push(l)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var s=0;s<n._global.length;s++){var a=n._global[s];a.pred(i,this)&&-1==B(r,a.val)&&r.push(a.val)}return r},getStateAfter:function(e,t){var r=this.doc;return xt(this,(e=pt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Jr(this,null==e?r.head:"object"==typeof e?gt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Qr(this,gt(this.doc,e),t||"page")},coordsChar:function(e,t){return rn(this,(e=Zr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Zr(this,{top:e,left:0},t||"page").top,ot(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:o<e&&(e=o,i=!0),n=et(this.doc,e)}else n=e;return qr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Zt(n):0)},defaultTextHeight:function(){return an(this.display)},defaultCharWidth:function(){return un(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,s,a=this.display,u=(e=Jr(this,gt(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var h=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Fn(o,l)).scrollTop&&Bn(o,s.scrollTop),null!=s.scrollLeft&&Un(o,s.scrollLeft))},triggerOnKeyDown:oi(gl),triggerOnKeyPress:oi(ml),triggerOnKeyUp:vl,triggerOnMouseDown:oi(xl),execCommand:function(e){if(ll.hasOwnProperty(e))return ll[e].call(null,this)},triggerElectric:oi(function(e){Rl(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=gt(this.doc,e),l=0;l<t&&!(o=Vl(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:oi(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Vl(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},j)}),deleteH:oi(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):tl(this,function(e){var t=Vl(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=gt(this.doc,e),s=0;s<t;++s){var a=Jr(this,l,"div");if(null==o?o=a.left:a.left=o,(l=Kl(this,a,i,r)).hitSide)break}return l},moveV:oi(function(n,i){var o=this,l=this.doc,s=[],a=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(e){if(a)return n<0?e.from():e.to();var t=Jr(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),s.push(t.left);var r=Kl(o,t,n,i);return"page"==i&&e==l.sel.primary()&&Pn(o,Qr(o,r,"div").top-t.top),r},j),s.length)for(var e=0;e<l.sel.ranges.length;e++)l.sel.ranges[e].goalColumn=s[e]}),findWordAt:function(e){var t=et(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new Mi(at(e.line,r),at(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?H:T)(this.display.cursorDiv,"CodeMirror-overwrite"),Se(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:oi(function(e,t){In(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Wr(this)-this.display.barHeight,width:e.scrollWidth-Wr(this)-this.display.barWidth,clientHeight:Fr(this),clientWidth:Hr(this)}},scrollIntoView:oi(function(e,t){var r,n;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:at(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(n=e,zn(r=this),r.curOp.scrollToPos=n):Rn(this,e.from,e.to,e.margin)}),setSize:oi(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&jr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mn(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Se(this,"refresh",this)}),operation:function(e){return ni(this,e)},startOperation:function(){return Zn(this)},endOperation:function(){return Qn(this)},refresh:oi(function(){var e=this.display.cachedTextHeight;vn(this),this.curOp.forceUpdate=!0,Xr(this),In(this,this.doc.scrollLeft,this.doc.scrollTop),di(this.display),(null==e||.5<Math.abs(e-an(this.display)))&&dn(this),Se(this,"refresh",this)}),swapDoc:oi(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ri(this,e),Xr(this),this.display.input.reset(),In(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,gr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Me(Jl),Jl.registerHelper=function(e,t,r){ts.hasOwnProperty(e)||(ts[e]=Jl[e]={_global:[]}),ts[e][t]=r},Jl.registerGlobalHelper=function(e,t,r,n){Jl.registerHelper(e,t,n),ts[e]._global.push({pred:r,val:n})};var ns,is="iter insert remove copy getEditor constructor".split(" ");for(var os in Po.prototype)Po.prototype.hasOwnProperty(os)&&B(is,os)<0&&(Wl.prototype[os]=function(e){return function(){return e.apply(this.doc,arguments)}}(Po.prototype[os]));return Me(Po),Wl.inputStyles={textarea:ql,contenteditable:jl},Wl.defineMode=function(e){Wl.defaults.mode||"null"==e||(Wl.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ke[e]=t}.apply(this,arguments)},Wl.defineMIME=function(e,t){je[e]=t},Wl.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wl.defineMIME("text/plain","null"),Wl.defineExtension=function(e,t){Wl.prototype[e]=t},Wl.defineDocExtension=function(e,t){Po.prototype[e]=t},Wl.fromTextArea=function(t,r){if((r=r?I(r):{}).value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var e=W();r.autofocus=e==t||null!=t.getAttribute("autofocus")&&e==document.body}function n(){t.value=s.getValue()}var i;if(t.form&&(we(t.form,"submit",n),!r.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}r.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ce(t.form,"submit",n),r.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Wl(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},r);return s},(ns=Wl).off=Ce,ns.on=we,ns.wheelEventPixels=Li,ns.Doc=Po,ns.splitLines=Be,ns.countColumn=z,ns.findColumn=X,ns.isWordChar=ee,ns.Pass=U,ns.signal=Se,ns.Line=er,ns.changeEnd=Ai,ns.scrollbarModel=_n,ns.Pos=at,ns.cmpPos=ut,ns.modes=Ke,ns.mimeModes=je,ns.resolveMode=Xe,ns.getMode=Ye,ns.modeExtensions=_e,ns.extendMode=$e,ns.copyState=qe,ns.startState=Qe,ns.innerMode=Ze,ns.commands=ll,ns.keyMap=Yo,ns.keyName=Jo,ns.isModifierKey=Zo,ns.lookupKey=qo,ns.normalizeKeyMap=$o,ns.StringStream=Je,ns.SharedTextMarker=Do,ns.TextMarker=Oo,ns.LineWidget=To,ns.e_preventDefault=Ne,ns.e_stopPropagation=Oe,ns.e_stop=De,ns.addClass=H,ns.contains=D,ns.rmClass=T,ns.keyNames=Vo,Wl.version="5.52.2",Wl});
|
includes/js/codemirror/codemirror.js
DELETED
@@ -1,9351 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// This is CodeMirror (http://codemirror.net), a code editor
|
5 |
-
// implemented in JavaScript on top of the browser's DOM.
|
6 |
-
//
|
7 |
-
// You can find some technical background for some of the code below
|
8 |
-
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
9 |
-
|
10 |
-
(function (global, factory) {
|
11 |
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
12 |
-
typeof define === 'function' && define.amd ? define(factory) :
|
13 |
-
(global.CodeMirror = factory());
|
14 |
-
}(this, (function () { 'use strict';
|
15 |
-
|
16 |
-
// Kludges for bugs and behavior differences that can't be feature
|
17 |
-
// detected are enabled based on userAgent etc sniffing.
|
18 |
-
var userAgent = navigator.userAgent
|
19 |
-
var platform = navigator.platform
|
20 |
-
|
21 |
-
var gecko = /gecko\/\d/i.test(userAgent)
|
22 |
-
var ie_upto10 = /MSIE \d/.test(userAgent)
|
23 |
-
var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent)
|
24 |
-
var edge = /Edge\/(\d+)/.exec(userAgent)
|
25 |
-
var ie = ie_upto10 || ie_11up || edge
|
26 |
-
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])
|
27 |
-
var webkit = !edge && /WebKit\//.test(userAgent)
|
28 |
-
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent)
|
29 |
-
var chrome = !edge && /Chrome\//.test(userAgent)
|
30 |
-
var presto = /Opera\//.test(userAgent)
|
31 |
-
var safari = /Apple Computer/.test(navigator.vendor)
|
32 |
-
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
|
33 |
-
var phantom = /PhantomJS/.test(userAgent)
|
34 |
-
|
35 |
-
var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
|
36 |
-
var android = /Android/.test(userAgent)
|
37 |
-
// This is woefully incomplete. Suggestions for alternative methods welcome.
|
38 |
-
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
|
39 |
-
var mac = ios || /Mac/.test(platform)
|
40 |
-
var chromeOS = /\bCrOS\b/.test(userAgent)
|
41 |
-
var windows = /win/i.test(platform)
|
42 |
-
|
43 |
-
var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/)
|
44 |
-
if (presto_version) { presto_version = Number(presto_version[1]) }
|
45 |
-
if (presto_version && presto_version >= 15) { presto = false; webkit = true }
|
46 |
-
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
|
47 |
-
var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))
|
48 |
-
var captureRightClick = gecko || (ie && ie_version >= 9)
|
49 |
-
|
50 |
-
function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
|
51 |
-
|
52 |
-
var rmClass = function(node, cls) {
|
53 |
-
var current = node.className
|
54 |
-
var match = classTest(cls).exec(current)
|
55 |
-
if (match) {
|
56 |
-
var after = current.slice(match.index + match[0].length)
|
57 |
-
node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
function removeChildren(e) {
|
62 |
-
for (var count = e.childNodes.length; count > 0; --count)
|
63 |
-
{ e.removeChild(e.firstChild) }
|
64 |
-
return e
|
65 |
-
}
|
66 |
-
|
67 |
-
function removeChildrenAndAdd(parent, e) {
|
68 |
-
return removeChildren(parent).appendChild(e)
|
69 |
-
}
|
70 |
-
|
71 |
-
function elt(tag, content, className, style) {
|
72 |
-
var e = document.createElement(tag)
|
73 |
-
if (className) { e.className = className }
|
74 |
-
if (style) { e.style.cssText = style }
|
75 |
-
if (typeof content == "string") { e.appendChild(document.createTextNode(content)) }
|
76 |
-
else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
|
77 |
-
return e
|
78 |
-
}
|
79 |
-
// wrapper for elt, which removes the elt from the accessibility tree
|
80 |
-
function eltP(tag, content, className, style) {
|
81 |
-
var e = elt(tag, content, className, style)
|
82 |
-
e.setAttribute("role", "presentation")
|
83 |
-
return e
|
84 |
-
}
|
85 |
-
|
86 |
-
var range
|
87 |
-
if (document.createRange) { range = function(node, start, end, endNode) {
|
88 |
-
var r = document.createRange()
|
89 |
-
r.setEnd(endNode || node, end)
|
90 |
-
r.setStart(node, start)
|
91 |
-
return r
|
92 |
-
} }
|
93 |
-
else { range = function(node, start, end) {
|
94 |
-
var r = document.body.createTextRange()
|
95 |
-
try { r.moveToElementText(node.parentNode) }
|
96 |
-
catch(e) { return r }
|
97 |
-
r.collapse(true)
|
98 |
-
r.moveEnd("character", end)
|
99 |
-
r.moveStart("character", start)
|
100 |
-
return r
|
101 |
-
} }
|
102 |
-
|
103 |
-
function contains(parent, child) {
|
104 |
-
if (child.nodeType == 3) // Android browser always returns false when child is a textnode
|
105 |
-
{ child = child.parentNode }
|
106 |
-
if (parent.contains)
|
107 |
-
{ return parent.contains(child) }
|
108 |
-
do {
|
109 |
-
if (child.nodeType == 11) { child = child.host }
|
110 |
-
if (child == parent) { return true }
|
111 |
-
} while (child = child.parentNode)
|
112 |
-
}
|
113 |
-
|
114 |
-
function activeElt() {
|
115 |
-
// IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
|
116 |
-
// IE < 10 will throw when accessed while the page is loading or in an iframe.
|
117 |
-
// IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
|
118 |
-
var activeElement
|
119 |
-
try {
|
120 |
-
activeElement = document.activeElement
|
121 |
-
} catch(e) {
|
122 |
-
activeElement = document.body || null
|
123 |
-
}
|
124 |
-
while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
|
125 |
-
{ activeElement = activeElement.shadowRoot.activeElement }
|
126 |
-
return activeElement
|
127 |
-
}
|
128 |
-
|
129 |
-
function addClass(node, cls) {
|
130 |
-
var current = node.className
|
131 |
-
if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls }
|
132 |
-
}
|
133 |
-
function joinClasses(a, b) {
|
134 |
-
var as = a.split(" ")
|
135 |
-
for (var i = 0; i < as.length; i++)
|
136 |
-
{ if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } }
|
137 |
-
return b
|
138 |
-
}
|
139 |
-
|
140 |
-
var selectInput = function(node) { node.select() }
|
141 |
-
if (ios) // Mobile Safari apparently has a bug where select() is broken.
|
142 |
-
{ selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }
|
143 |
-
else if (ie) // Suppress mysterious IE10 errors
|
144 |
-
{ selectInput = function(node) { try { node.select() } catch(_e) {} } }
|
145 |
-
|
146 |
-
function bind(f) {
|
147 |
-
var args = Array.prototype.slice.call(arguments, 1)
|
148 |
-
return function(){return f.apply(null, args)}
|
149 |
-
}
|
150 |
-
|
151 |
-
function copyObj(obj, target, overwrite) {
|
152 |
-
if (!target) { target = {} }
|
153 |
-
for (var prop in obj)
|
154 |
-
{ if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
|
155 |
-
{ target[prop] = obj[prop] } }
|
156 |
-
return target
|
157 |
-
}
|
158 |
-
|
159 |
-
// Counts the column offset in a string, taking tabs into account.
|
160 |
-
// Used mostly to find indentation.
|
161 |
-
function countColumn(string, end, tabSize, startIndex, startValue) {
|
162 |
-
if (end == null) {
|
163 |
-
end = string.search(/[^\s\u00a0]/)
|
164 |
-
if (end == -1) { end = string.length }
|
165 |
-
}
|
166 |
-
for (var i = startIndex || 0, n = startValue || 0;;) {
|
167 |
-
var nextTab = string.indexOf("\t", i)
|
168 |
-
if (nextTab < 0 || nextTab >= end)
|
169 |
-
{ return n + (end - i) }
|
170 |
-
n += nextTab - i
|
171 |
-
n += tabSize - (n % tabSize)
|
172 |
-
i = nextTab + 1
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
var Delayed = function() {this.id = null};
|
177 |
-
Delayed.prototype.set = function (ms, f) {
|
178 |
-
clearTimeout(this.id)
|
179 |
-
this.id = setTimeout(f, ms)
|
180 |
-
};
|
181 |
-
|
182 |
-
function indexOf(array, elt) {
|
183 |
-
for (var i = 0; i < array.length; ++i)
|
184 |
-
{ if (array[i] == elt) { return i } }
|
185 |
-
return -1
|
186 |
-
}
|
187 |
-
|
188 |
-
// Number of pixels added to scroller and sizer to hide scrollbar
|
189 |
-
var scrollerGap = 30
|
190 |
-
|
191 |
-
// Returned or thrown by various protocols to signal 'I'm not
|
192 |
-
// handling this'.
|
193 |
-
var Pass = {toString: function(){return "CodeMirror.Pass"}}
|
194 |
-
|
195 |
-
// Reused option objects for setSelection & friends
|
196 |
-
var sel_dontScroll = {scroll: false};
|
197 |
-
var sel_mouse = {origin: "*mouse"};
|
198 |
-
var sel_move = {origin: "+move"};
|
199 |
-
// The inverse of countColumn -- find the offset that corresponds to
|
200 |
-
// a particular column.
|
201 |
-
function findColumn(string, goal, tabSize) {
|
202 |
-
for (var pos = 0, col = 0;;) {
|
203 |
-
var nextTab = string.indexOf("\t", pos)
|
204 |
-
if (nextTab == -1) { nextTab = string.length }
|
205 |
-
var skipped = nextTab - pos
|
206 |
-
if (nextTab == string.length || col + skipped >= goal)
|
207 |
-
{ return pos + Math.min(skipped, goal - col) }
|
208 |
-
col += nextTab - pos
|
209 |
-
col += tabSize - (col % tabSize)
|
210 |
-
pos = nextTab + 1
|
211 |
-
if (col >= goal) { return pos }
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
var spaceStrs = [""]
|
216 |
-
function spaceStr(n) {
|
217 |
-
while (spaceStrs.length <= n)
|
218 |
-
{ spaceStrs.push(lst(spaceStrs) + " ") }
|
219 |
-
return spaceStrs[n]
|
220 |
-
}
|
221 |
-
|
222 |
-
function lst(arr) { return arr[arr.length-1] }
|
223 |
-
|
224 |
-
function map(array, f) {
|
225 |
-
var out = []
|
226 |
-
for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }
|
227 |
-
return out
|
228 |
-
}
|
229 |
-
|
230 |
-
function insertSorted(array, value, score) {
|
231 |
-
var pos = 0, priority = score(value)
|
232 |
-
while (pos < array.length && score(array[pos]) <= priority) { pos++ }
|
233 |
-
array.splice(pos, 0, value)
|
234 |
-
}
|
235 |
-
|
236 |
-
function nothing() {}
|
237 |
-
|
238 |
-
function createObj(base, props) {
|
239 |
-
var inst
|
240 |
-
if (Object.create) {
|
241 |
-
inst = Object.create(base)
|
242 |
-
} else {
|
243 |
-
nothing.prototype = base
|
244 |
-
inst = new nothing()
|
245 |
-
}
|
246 |
-
if (props) { copyObj(props, inst) }
|
247 |
-
return inst
|
248 |
-
}
|
249 |
-
|
250 |
-
var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
|
251 |
-
function isWordCharBasic(ch) {
|
252 |
-
return /\w/.test(ch) || ch > "\x80" &&
|
253 |
-
(ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
|
254 |
-
}
|
255 |
-
function isWordChar(ch, helper) {
|
256 |
-
if (!helper) { return isWordCharBasic(ch) }
|
257 |
-
if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
|
258 |
-
return helper.test(ch)
|
259 |
-
}
|
260 |
-
|
261 |
-
function isEmpty(obj) {
|
262 |
-
for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
|
263 |
-
return true
|
264 |
-
}
|
265 |
-
|
266 |
-
// Extending unicode characters. A series of a non-extending char +
|
267 |
-
// any number of extending chars is treated as a single unit as far
|
268 |
-
// as editing and measuring is concerned. This is not fully correct,
|
269 |
-
// since some scripts/fonts/browsers also treat other configurations
|
270 |
-
// of code points as a group.
|
271 |
-
var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
|
272 |
-
function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
|
273 |
-
|
274 |
-
// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
|
275 |
-
function skipExtendingChars(str, pos, dir) {
|
276 |
-
while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }
|
277 |
-
return pos
|
278 |
-
}
|
279 |
-
|
280 |
-
// Returns the value from the range [`from`; `to`] that satisfies
|
281 |
-
// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.
|
282 |
-
function findFirst(pred, from, to) {
|
283 |
-
for (;;) {
|
284 |
-
if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }
|
285 |
-
var mid = Math.floor((from + to) / 2)
|
286 |
-
if (pred(mid)) { to = mid }
|
287 |
-
else { from = mid }
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
// The display handles the DOM integration, both for input reading
|
292 |
-
// and content drawing. It holds references to DOM nodes and
|
293 |
-
// display-related state.
|
294 |
-
|
295 |
-
function Display(place, doc, input) {
|
296 |
-
var d = this
|
297 |
-
this.input = input
|
298 |
-
|
299 |
-
// Covers bottom-right square when both scrollbars are present.
|
300 |
-
d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
|
301 |
-
d.scrollbarFiller.setAttribute("cm-not-content", "true")
|
302 |
-
// Covers bottom of gutter when coverGutterNextToScrollbar is on
|
303 |
-
// and h scrollbar is present.
|
304 |
-
d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
|
305 |
-
d.gutterFiller.setAttribute("cm-not-content", "true")
|
306 |
-
// Will contain the actual code, positioned to cover the viewport.
|
307 |
-
d.lineDiv = eltP("div", null, "CodeMirror-code")
|
308 |
-
// Elements are added to these to represent selection and cursors.
|
309 |
-
d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
|
310 |
-
d.cursorDiv = elt("div", null, "CodeMirror-cursors")
|
311 |
-
// A visibility: hidden element used to find the size of things.
|
312 |
-
d.measure = elt("div", null, "CodeMirror-measure")
|
313 |
-
// When lines outside of the viewport are measured, they are drawn in this.
|
314 |
-
d.lineMeasure = elt("div", null, "CodeMirror-measure")
|
315 |
-
// Wraps everything that needs to exist inside the vertically-padded coordinate system
|
316 |
-
d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
|
317 |
-
null, "position: relative; outline: none")
|
318 |
-
var lines = eltP("div", [d.lineSpace], "CodeMirror-lines")
|
319 |
-
// Moved around its parent to cover visible view.
|
320 |
-
d.mover = elt("div", [lines], null, "position: relative")
|
321 |
-
// Set to the height of the document, allowing scrolling.
|
322 |
-
d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
|
323 |
-
d.sizerWidth = null
|
324 |
-
// Behavior of elts with overflow: auto and padding is
|
325 |
-
// inconsistent across browsers. This is used to ensure the
|
326 |
-
// scrollable area is big enough.
|
327 |
-
d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
|
328 |
-
// Will contain the gutters, if any.
|
329 |
-
d.gutters = elt("div", null, "CodeMirror-gutters")
|
330 |
-
d.lineGutter = null
|
331 |
-
// Actual scrollable element.
|
332 |
-
d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
|
333 |
-
d.scroller.setAttribute("tabIndex", "-1")
|
334 |
-
// The element in which the editor lives.
|
335 |
-
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
|
336 |
-
|
337 |
-
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
|
338 |
-
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
|
339 |
-
if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }
|
340 |
-
|
341 |
-
if (place) {
|
342 |
-
if (place.appendChild) { place.appendChild(d.wrapper) }
|
343 |
-
else { place(d.wrapper) }
|
344 |
-
}
|
345 |
-
|
346 |
-
// Current rendered range (may be bigger than the view window).
|
347 |
-
d.viewFrom = d.viewTo = doc.first
|
348 |
-
d.reportedViewFrom = d.reportedViewTo = doc.first
|
349 |
-
// Information about the rendered lines.
|
350 |
-
d.view = []
|
351 |
-
d.renderedView = null
|
352 |
-
// Holds info about a single rendered line when it was rendered
|
353 |
-
// for measurement, while not in view.
|
354 |
-
d.externalMeasured = null
|
355 |
-
// Empty space (in pixels) above the view
|
356 |
-
d.viewOffset = 0
|
357 |
-
d.lastWrapHeight = d.lastWrapWidth = 0
|
358 |
-
d.updateLineNumbers = null
|
359 |
-
|
360 |
-
d.nativeBarWidth = d.barHeight = d.barWidth = 0
|
361 |
-
d.scrollbarsClipped = false
|
362 |
-
|
363 |
-
// Used to only resize the line number gutter when necessary (when
|
364 |
-
// the amount of lines crosses a boundary that makes its width change)
|
365 |
-
d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
|
366 |
-
// Set to true when a non-horizontal-scrolling line widget is
|
367 |
-
// added. As an optimization, line widget aligning is skipped when
|
368 |
-
// this is false.
|
369 |
-
d.alignWidgets = false
|
370 |
-
|
371 |
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
372 |
-
|
373 |
-
// Tracks the maximum line length so that the horizontal scrollbar
|
374 |
-
// can be kept static when scrolling.
|
375 |
-
d.maxLine = null
|
376 |
-
d.maxLineLength = 0
|
377 |
-
d.maxLineChanged = false
|
378 |
-
|
379 |
-
// Used for measuring wheel scrolling granularity
|
380 |
-
d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null
|
381 |
-
|
382 |
-
// True when shift is held down.
|
383 |
-
d.shift = false
|
384 |
-
|
385 |
-
// Used to track whether anything happened since the context menu
|
386 |
-
// was opened.
|
387 |
-
d.selForContextMenu = null
|
388 |
-
|
389 |
-
d.activeTouch = null
|
390 |
-
|
391 |
-
input.init(d)
|
392 |
-
}
|
393 |
-
|
394 |
-
// Find the line object corresponding to the given line number.
|
395 |
-
function getLine(doc, n) {
|
396 |
-
n -= doc.first
|
397 |
-
if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
|
398 |
-
var chunk = doc
|
399 |
-
while (!chunk.lines) {
|
400 |
-
for (var i = 0;; ++i) {
|
401 |
-
var child = chunk.children[i], sz = child.chunkSize()
|
402 |
-
if (n < sz) { chunk = child; break }
|
403 |
-
n -= sz
|
404 |
-
}
|
405 |
-
}
|
406 |
-
return chunk.lines[n]
|
407 |
-
}
|
408 |
-
|
409 |
-
// Get the part of a document between two positions, as an array of
|
410 |
-
// strings.
|
411 |
-
function getBetween(doc, start, end) {
|
412 |
-
var out = [], n = start.line
|
413 |
-
doc.iter(start.line, end.line + 1, function (line) {
|
414 |
-
var text = line.text
|
415 |
-
if (n == end.line) { text = text.slice(0, end.ch) }
|
416 |
-
if (n == start.line) { text = text.slice(start.ch) }
|
417 |
-
out.push(text)
|
418 |
-
++n
|
419 |
-
})
|
420 |
-
return out
|
421 |
-
}
|
422 |
-
// Get the lines between from and to, as array of strings.
|
423 |
-
function getLines(doc, from, to) {
|
424 |
-
var out = []
|
425 |
-
doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value
|
426 |
-
return out
|
427 |
-
}
|
428 |
-
|
429 |
-
// Update the height of a line, propagating the height change
|
430 |
-
// upwards to parent nodes.
|
431 |
-
function updateLineHeight(line, height) {
|
432 |
-
var diff = height - line.height
|
433 |
-
if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }
|
434 |
-
}
|
435 |
-
|
436 |
-
// Given a line object, find its line number by walking up through
|
437 |
-
// its parent links.
|
438 |
-
function lineNo(line) {
|
439 |
-
if (line.parent == null) { return null }
|
440 |
-
var cur = line.parent, no = indexOf(cur.lines, line)
|
441 |
-
for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
|
442 |
-
for (var i = 0;; ++i) {
|
443 |
-
if (chunk.children[i] == cur) { break }
|
444 |
-
no += chunk.children[i].chunkSize()
|
445 |
-
}
|
446 |
-
}
|
447 |
-
return no + cur.first
|
448 |
-
}
|
449 |
-
|
450 |
-
// Find the line at the given vertical position, using the height
|
451 |
-
// information in the document tree.
|
452 |
-
function lineAtHeight(chunk, h) {
|
453 |
-
var n = chunk.first
|
454 |
-
outer: do {
|
455 |
-
for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
|
456 |
-
var child = chunk.children[i$1], ch = child.height
|
457 |
-
if (h < ch) { chunk = child; continue outer }
|
458 |
-
h -= ch
|
459 |
-
n += child.chunkSize()
|
460 |
-
}
|
461 |
-
return n
|
462 |
-
} while (!chunk.lines)
|
463 |
-
var i = 0
|
464 |
-
for (; i < chunk.lines.length; ++i) {
|
465 |
-
var line = chunk.lines[i], lh = line.height
|
466 |
-
if (h < lh) { break }
|
467 |
-
h -= lh
|
468 |
-
}
|
469 |
-
return n + i
|
470 |
-
}
|
471 |
-
|
472 |
-
function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
|
473 |
-
|
474 |
-
function lineNumberFor(options, i) {
|
475 |
-
return String(options.lineNumberFormatter(i + options.firstLineNumber))
|
476 |
-
}
|
477 |
-
|
478 |
-
// A Pos instance represents a position within the text.
|
479 |
-
function Pos(line, ch, sticky) {
|
480 |
-
if ( sticky === void 0 ) sticky = null;
|
481 |
-
|
482 |
-
if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
|
483 |
-
this.line = line
|
484 |
-
this.ch = ch
|
485 |
-
this.sticky = sticky
|
486 |
-
}
|
487 |
-
|
488 |
-
// Compare two positions, return 0 if they are the same, a negative
|
489 |
-
// number when a is less, and a positive number otherwise.
|
490 |
-
function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
|
491 |
-
|
492 |
-
function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }
|
493 |
-
|
494 |
-
function copyPos(x) {return Pos(x.line, x.ch)}
|
495 |
-
function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
|
496 |
-
function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
|
497 |
-
|
498 |
-
// Most of the external API clips given positions to make sure they
|
499 |
-
// actually exist within the document.
|
500 |
-
function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
|
501 |
-
function clipPos(doc, pos) {
|
502 |
-
if (pos.line < doc.first) { return Pos(doc.first, 0) }
|
503 |
-
var last = doc.first + doc.size - 1
|
504 |
-
if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
|
505 |
-
return clipToLen(pos, getLine(doc, pos.line).text.length)
|
506 |
-
}
|
507 |
-
function clipToLen(pos, linelen) {
|
508 |
-
var ch = pos.ch
|
509 |
-
if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
|
510 |
-
else if (ch < 0) { return Pos(pos.line, 0) }
|
511 |
-
else { return pos }
|
512 |
-
}
|
513 |
-
function clipPosArray(doc, array) {
|
514 |
-
var out = []
|
515 |
-
for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }
|
516 |
-
return out
|
517 |
-
}
|
518 |
-
|
519 |
-
// Optimize some code when these features are not used.
|
520 |
-
var sawReadOnlySpans = false;
|
521 |
-
var sawCollapsedSpans = false;
|
522 |
-
function seeReadOnlySpans() {
|
523 |
-
sawReadOnlySpans = true
|
524 |
-
}
|
525 |
-
|
526 |
-
function seeCollapsedSpans() {
|
527 |
-
sawCollapsedSpans = true
|
528 |
-
}
|
529 |
-
|
530 |
-
// TEXTMARKER SPANS
|
531 |
-
|
532 |
-
function MarkedSpan(marker, from, to) {
|
533 |
-
this.marker = marker
|
534 |
-
this.from = from; this.to = to
|
535 |
-
}
|
536 |
-
|
537 |
-
// Search an array of spans for a span matching the given marker.
|
538 |
-
function getMarkedSpanFor(spans, marker) {
|
539 |
-
if (spans) { for (var i = 0; i < spans.length; ++i) {
|
540 |
-
var span = spans[i]
|
541 |
-
if (span.marker == marker) { return span }
|
542 |
-
} }
|
543 |
-
}
|
544 |
-
// Remove a span from an array, returning undefined if no spans are
|
545 |
-
// left (we don't store arrays for lines without spans).
|
546 |
-
function removeMarkedSpan(spans, span) {
|
547 |
-
var r
|
548 |
-
for (var i = 0; i < spans.length; ++i)
|
549 |
-
{ if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }
|
550 |
-
return r
|
551 |
-
}
|
552 |
-
// Add a span to a line.
|
553 |
-
function addMarkedSpan(line, span) {
|
554 |
-
line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
|
555 |
-
span.marker.attachLine(line)
|
556 |
-
}
|
557 |
-
|
558 |
-
// Used for the algorithm that adjusts markers for a change in the
|
559 |
-
// document. These functions cut an array of spans at a given
|
560 |
-
// character position, returning an array of remaining chunks (or
|
561 |
-
// undefined if nothing remains).
|
562 |
-
function markedSpansBefore(old, startCh, isInsert) {
|
563 |
-
var nw
|
564 |
-
if (old) { for (var i = 0; i < old.length; ++i) {
|
565 |
-
var span = old[i], marker = span.marker
|
566 |
-
var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)
|
567 |
-
if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
|
568 |
-
var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
|
569 |
-
;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))
|
570 |
-
}
|
571 |
-
} }
|
572 |
-
return nw
|
573 |
-
}
|
574 |
-
function markedSpansAfter(old, endCh, isInsert) {
|
575 |
-
var nw
|
576 |
-
if (old) { for (var i = 0; i < old.length; ++i) {
|
577 |
-
var span = old[i], marker = span.marker
|
578 |
-
var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)
|
579 |
-
if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
|
580 |
-
var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
|
581 |
-
;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
|
582 |
-
span.to == null ? null : span.to - endCh))
|
583 |
-
}
|
584 |
-
} }
|
585 |
-
return nw
|
586 |
-
}
|
587 |
-
|
588 |
-
// Given a change object, compute the new set of marker spans that
|
589 |
-
// cover the line in which the change took place. Removes spans
|
590 |
-
// entirely within the change, reconnects spans belonging to the
|
591 |
-
// same marker that appear on both sides of the change, and cuts off
|
592 |
-
// spans partially within the change. Returns an array of span
|
593 |
-
// arrays with one element for each line in (after) the change.
|
594 |
-
function stretchSpansOverChange(doc, change) {
|
595 |
-
if (change.full) { return null }
|
596 |
-
var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
|
597 |
-
var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
|
598 |
-
if (!oldFirst && !oldLast) { return null }
|
599 |
-
|
600 |
-
var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0
|
601 |
-
// Get the spans that 'stick out' on both sides
|
602 |
-
var first = markedSpansBefore(oldFirst, startCh, isInsert)
|
603 |
-
var last = markedSpansAfter(oldLast, endCh, isInsert)
|
604 |
-
|
605 |
-
// Next, merge those two ends
|
606 |
-
var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)
|
607 |
-
if (first) {
|
608 |
-
// Fix up .to properties of first
|
609 |
-
for (var i = 0; i < first.length; ++i) {
|
610 |
-
var span = first[i]
|
611 |
-
if (span.to == null) {
|
612 |
-
var found = getMarkedSpanFor(last, span.marker)
|
613 |
-
if (!found) { span.to = startCh }
|
614 |
-
else if (sameLine) { span.to = found.to == null ? null : found.to + offset }
|
615 |
-
}
|
616 |
-
}
|
617 |
-
}
|
618 |
-
if (last) {
|
619 |
-
// Fix up .from in last (or move them into first in case of sameLine)
|
620 |
-
for (var i$1 = 0; i$1 < last.length; ++i$1) {
|
621 |
-
var span$1 = last[i$1]
|
622 |
-
if (span$1.to != null) { span$1.to += offset }
|
623 |
-
if (span$1.from == null) {
|
624 |
-
var found$1 = getMarkedSpanFor(first, span$1.marker)
|
625 |
-
if (!found$1) {
|
626 |
-
span$1.from = offset
|
627 |
-
if (sameLine) { (first || (first = [])).push(span$1) }
|
628 |
-
}
|
629 |
-
} else {
|
630 |
-
span$1.from += offset
|
631 |
-
if (sameLine) { (first || (first = [])).push(span$1) }
|
632 |
-
}
|
633 |
-
}
|
634 |
-
}
|
635 |
-
// Make sure we didn't create any zero-length spans
|
636 |
-
if (first) { first = clearEmptySpans(first) }
|
637 |
-
if (last && last != first) { last = clearEmptySpans(last) }
|
638 |
-
|
639 |
-
var newMarkers = [first]
|
640 |
-
if (!sameLine) {
|
641 |
-
// Fill gap with whole-line-spans
|
642 |
-
var gap = change.text.length - 2, gapMarkers
|
643 |
-
if (gap > 0 && first)
|
644 |
-
{ for (var i$2 = 0; i$2 < first.length; ++i$2)
|
645 |
-
{ if (first[i$2].to == null)
|
646 |
-
{ (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }
|
647 |
-
for (var i$3 = 0; i$3 < gap; ++i$3)
|
648 |
-
{ newMarkers.push(gapMarkers) }
|
649 |
-
newMarkers.push(last)
|
650 |
-
}
|
651 |
-
return newMarkers
|
652 |
-
}
|
653 |
-
|
654 |
-
// Remove spans that are empty and don't have a clearWhenEmpty
|
655 |
-
// option of false.
|
656 |
-
function clearEmptySpans(spans) {
|
657 |
-
for (var i = 0; i < spans.length; ++i) {
|
658 |
-
var span = spans[i]
|
659 |
-
if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
|
660 |
-
{ spans.splice(i--, 1) }
|
661 |
-
}
|
662 |
-
if (!spans.length) { return null }
|
663 |
-
return spans
|
664 |
-
}
|
665 |
-
|
666 |
-
// Used to 'clip' out readOnly ranges when making a change.
|
667 |
-
function removeReadOnlyRanges(doc, from, to) {
|
668 |
-
var markers = null
|
669 |
-
doc.iter(from.line, to.line + 1, function (line) {
|
670 |
-
if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
|
671 |
-
var mark = line.markedSpans[i].marker
|
672 |
-
if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
|
673 |
-
{ (markers || (markers = [])).push(mark) }
|
674 |
-
} }
|
675 |
-
})
|
676 |
-
if (!markers) { return null }
|
677 |
-
var parts = [{from: from, to: to}]
|
678 |
-
for (var i = 0; i < markers.length; ++i) {
|
679 |
-
var mk = markers[i], m = mk.find(0)
|
680 |
-
for (var j = 0; j < parts.length; ++j) {
|
681 |
-
var p = parts[j]
|
682 |
-
if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
|
683 |
-
var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)
|
684 |
-
if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
|
685 |
-
{ newParts.push({from: p.from, to: m.from}) }
|
686 |
-
if (dto > 0 || !mk.inclusiveRight && !dto)
|
687 |
-
{ newParts.push({from: m.to, to: p.to}) }
|
688 |
-
parts.splice.apply(parts, newParts)
|
689 |
-
j += newParts.length - 3
|
690 |
-
}
|
691 |
-
}
|
692 |
-
return parts
|
693 |
-
}
|
694 |
-
|
695 |
-
// Connect or disconnect spans from a line.
|
696 |
-
function detachMarkedSpans(line) {
|
697 |
-
var spans = line.markedSpans
|
698 |
-
if (!spans) { return }
|
699 |
-
for (var i = 0; i < spans.length; ++i)
|
700 |
-
{ spans[i].marker.detachLine(line) }
|
701 |
-
line.markedSpans = null
|
702 |
-
}
|
703 |
-
function attachMarkedSpans(line, spans) {
|
704 |
-
if (!spans) { return }
|
705 |
-
for (var i = 0; i < spans.length; ++i)
|
706 |
-
{ spans[i].marker.attachLine(line) }
|
707 |
-
line.markedSpans = spans
|
708 |
-
}
|
709 |
-
|
710 |
-
// Helpers used when computing which overlapping collapsed span
|
711 |
-
// counts as the larger one.
|
712 |
-
function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
|
713 |
-
function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
|
714 |
-
|
715 |
-
// Returns a number indicating which of two overlapping collapsed
|
716 |
-
// spans is larger (and thus includes the other). Falls back to
|
717 |
-
// comparing ids when the spans cover exactly the same range.
|
718 |
-
function compareCollapsedMarkers(a, b) {
|
719 |
-
var lenDiff = a.lines.length - b.lines.length
|
720 |
-
if (lenDiff != 0) { return lenDiff }
|
721 |
-
var aPos = a.find(), bPos = b.find()
|
722 |
-
var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)
|
723 |
-
if (fromCmp) { return -fromCmp }
|
724 |
-
var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)
|
725 |
-
if (toCmp) { return toCmp }
|
726 |
-
return b.id - a.id
|
727 |
-
}
|
728 |
-
|
729 |
-
// Find out whether a line ends or starts in a collapsed span. If
|
730 |
-
// so, return the marker for that span.
|
731 |
-
function collapsedSpanAtSide(line, start) {
|
732 |
-
var sps = sawCollapsedSpans && line.markedSpans, found
|
733 |
-
if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
|
734 |
-
sp = sps[i]
|
735 |
-
if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
|
736 |
-
(!found || compareCollapsedMarkers(found, sp.marker) < 0))
|
737 |
-
{ found = sp.marker }
|
738 |
-
} }
|
739 |
-
return found
|
740 |
-
}
|
741 |
-
function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
|
742 |
-
function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
|
743 |
-
|
744 |
-
// Test whether there exists a collapsed span that partially
|
745 |
-
// overlaps (covers the start or end, but not both) of a new span.
|
746 |
-
// Such overlap is not allowed.
|
747 |
-
function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
|
748 |
-
var line = getLine(doc, lineNo)
|
749 |
-
var sps = sawCollapsedSpans && line.markedSpans
|
750 |
-
if (sps) { for (var i = 0; i < sps.length; ++i) {
|
751 |
-
var sp = sps[i]
|
752 |
-
if (!sp.marker.collapsed) { continue }
|
753 |
-
var found = sp.marker.find(0)
|
754 |
-
var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)
|
755 |
-
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)
|
756 |
-
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
|
757 |
-
if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
|
758 |
-
fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
|
759 |
-
{ return true }
|
760 |
-
} }
|
761 |
-
}
|
762 |
-
|
763 |
-
// A visual line is a line as drawn on the screen. Folding, for
|
764 |
-
// example, can cause multiple logical lines to appear on the same
|
765 |
-
// visual line. This finds the start of the visual line that the
|
766 |
-
// given line is part of (usually that is the line itself).
|
767 |
-
function visualLine(line) {
|
768 |
-
var merged
|
769 |
-
while (merged = collapsedSpanAtStart(line))
|
770 |
-
{ line = merged.find(-1, true).line }
|
771 |
-
return line
|
772 |
-
}
|
773 |
-
|
774 |
-
function visualLineEnd(line) {
|
775 |
-
var merged
|
776 |
-
while (merged = collapsedSpanAtEnd(line))
|
777 |
-
{ line = merged.find(1, true).line }
|
778 |
-
return line
|
779 |
-
}
|
780 |
-
|
781 |
-
// Returns an array of logical lines that continue the visual line
|
782 |
-
// started by the argument, or undefined if there are no such lines.
|
783 |
-
function visualLineContinued(line) {
|
784 |
-
var merged, lines
|
785 |
-
while (merged = collapsedSpanAtEnd(line)) {
|
786 |
-
line = merged.find(1, true).line
|
787 |
-
;(lines || (lines = [])).push(line)
|
788 |
-
}
|
789 |
-
return lines
|
790 |
-
}
|
791 |
-
|
792 |
-
// Get the line number of the start of the visual line that the
|
793 |
-
// given line number is part of.
|
794 |
-
function visualLineNo(doc, lineN) {
|
795 |
-
var line = getLine(doc, lineN), vis = visualLine(line)
|
796 |
-
if (line == vis) { return lineN }
|
797 |
-
return lineNo(vis)
|
798 |
-
}
|
799 |
-
|
800 |
-
// Get the line number of the start of the next visual line after
|
801 |
-
// the given line.
|
802 |
-
function visualLineEndNo(doc, lineN) {
|
803 |
-
if (lineN > doc.lastLine()) { return lineN }
|
804 |
-
var line = getLine(doc, lineN), merged
|
805 |
-
if (!lineIsHidden(doc, line)) { return lineN }
|
806 |
-
while (merged = collapsedSpanAtEnd(line))
|
807 |
-
{ line = merged.find(1, true).line }
|
808 |
-
return lineNo(line) + 1
|
809 |
-
}
|
810 |
-
|
811 |
-
// Compute whether a line is hidden. Lines count as hidden when they
|
812 |
-
// are part of a visual line that starts with another line, or when
|
813 |
-
// they are entirely covered by collapsed, non-widget span.
|
814 |
-
function lineIsHidden(doc, line) {
|
815 |
-
var sps = sawCollapsedSpans && line.markedSpans
|
816 |
-
if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
|
817 |
-
sp = sps[i]
|
818 |
-
if (!sp.marker.collapsed) { continue }
|
819 |
-
if (sp.from == null) { return true }
|
820 |
-
if (sp.marker.widgetNode) { continue }
|
821 |
-
if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
|
822 |
-
{ return true }
|
823 |
-
} }
|
824 |
-
}
|
825 |
-
function lineIsHiddenInner(doc, line, span) {
|
826 |
-
if (span.to == null) {
|
827 |
-
var end = span.marker.find(1, true)
|
828 |
-
return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
|
829 |
-
}
|
830 |
-
if (span.marker.inclusiveRight && span.to == line.text.length)
|
831 |
-
{ return true }
|
832 |
-
for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
|
833 |
-
sp = line.markedSpans[i]
|
834 |
-
if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
|
835 |
-
(sp.to == null || sp.to != span.from) &&
|
836 |
-
(sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
|
837 |
-
lineIsHiddenInner(doc, line, sp)) { return true }
|
838 |
-
}
|
839 |
-
}
|
840 |
-
|
841 |
-
// Find the height above the given line.
|
842 |
-
function heightAtLine(lineObj) {
|
843 |
-
lineObj = visualLine(lineObj)
|
844 |
-
|
845 |
-
var h = 0, chunk = lineObj.parent
|
846 |
-
for (var i = 0; i < chunk.lines.length; ++i) {
|
847 |
-
var line = chunk.lines[i]
|
848 |
-
if (line == lineObj) { break }
|
849 |
-
else { h += line.height }
|
850 |
-
}
|
851 |
-
for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
|
852 |
-
for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
|
853 |
-
var cur = p.children[i$1]
|
854 |
-
if (cur == chunk) { break }
|
855 |
-
else { h += cur.height }
|
856 |
-
}
|
857 |
-
}
|
858 |
-
return h
|
859 |
-
}
|
860 |
-
|
861 |
-
// Compute the character length of a line, taking into account
|
862 |
-
// collapsed ranges (see markText) that might hide parts, and join
|
863 |
-
// other lines onto it.
|
864 |
-
function lineLength(line) {
|
865 |
-
if (line.height == 0) { return 0 }
|
866 |
-
var len = line.text.length, merged, cur = line
|
867 |
-
while (merged = collapsedSpanAtStart(cur)) {
|
868 |
-
var found = merged.find(0, true)
|
869 |
-
cur = found.from.line
|
870 |
-
len += found.from.ch - found.to.ch
|
871 |
-
}
|
872 |
-
cur = line
|
873 |
-
while (merged = collapsedSpanAtEnd(cur)) {
|
874 |
-
var found$1 = merged.find(0, true)
|
875 |
-
len -= cur.text.length - found$1.from.ch
|
876 |
-
cur = found$1.to.line
|
877 |
-
len += cur.text.length - found$1.to.ch
|
878 |
-
}
|
879 |
-
return len
|
880 |
-
}
|
881 |
-
|
882 |
-
// Find the longest line in the document.
|
883 |
-
function findMaxLine(cm) {
|
884 |
-
var d = cm.display, doc = cm.doc
|
885 |
-
d.maxLine = getLine(doc, doc.first)
|
886 |
-
d.maxLineLength = lineLength(d.maxLine)
|
887 |
-
d.maxLineChanged = true
|
888 |
-
doc.iter(function (line) {
|
889 |
-
var len = lineLength(line)
|
890 |
-
if (len > d.maxLineLength) {
|
891 |
-
d.maxLineLength = len
|
892 |
-
d.maxLine = line
|
893 |
-
}
|
894 |
-
})
|
895 |
-
}
|
896 |
-
|
897 |
-
// BIDI HELPERS
|
898 |
-
|
899 |
-
function iterateBidiSections(order, from, to, f) {
|
900 |
-
if (!order) { return f(from, to, "ltr") }
|
901 |
-
var found = false
|
902 |
-
for (var i = 0; i < order.length; ++i) {
|
903 |
-
var part = order[i]
|
904 |
-
if (part.from < to && part.to > from || from == to && part.to == from) {
|
905 |
-
f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr")
|
906 |
-
found = true
|
907 |
-
}
|
908 |
-
}
|
909 |
-
if (!found) { f(from, to, "ltr") }
|
910 |
-
}
|
911 |
-
|
912 |
-
var bidiOther = null
|
913 |
-
function getBidiPartAt(order, ch, sticky) {
|
914 |
-
var found
|
915 |
-
bidiOther = null
|
916 |
-
for (var i = 0; i < order.length; ++i) {
|
917 |
-
var cur = order[i]
|
918 |
-
if (cur.from < ch && cur.to > ch) { return i }
|
919 |
-
if (cur.to == ch) {
|
920 |
-
if (cur.from != cur.to && sticky == "before") { found = i }
|
921 |
-
else { bidiOther = i }
|
922 |
-
}
|
923 |
-
if (cur.from == ch) {
|
924 |
-
if (cur.from != cur.to && sticky != "before") { found = i }
|
925 |
-
else { bidiOther = i }
|
926 |
-
}
|
927 |
-
}
|
928 |
-
return found != null ? found : bidiOther
|
929 |
-
}
|
930 |
-
|
931 |
-
// Bidirectional ordering algorithm
|
932 |
-
// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
|
933 |
-
// that this (partially) implements.
|
934 |
-
|
935 |
-
// One-char codes used for character types:
|
936 |
-
// L (L): Left-to-Right
|
937 |
-
// R (R): Right-to-Left
|
938 |
-
// r (AL): Right-to-Left Arabic
|
939 |
-
// 1 (EN): European Number
|
940 |
-
// + (ES): European Number Separator
|
941 |
-
// % (ET): European Number Terminator
|
942 |
-
// n (AN): Arabic Number
|
943 |
-
// , (CS): Common Number Separator
|
944 |
-
// m (NSM): Non-Spacing Mark
|
945 |
-
// b (BN): Boundary Neutral
|
946 |
-
// s (B): Paragraph Separator
|
947 |
-
// t (S): Segment Separator
|
948 |
-
// w (WS): Whitespace
|
949 |
-
// N (ON): Other Neutrals
|
950 |
-
|
951 |
-
// Returns null if characters are ordered as they appear
|
952 |
-
// (left-to-right), or an array of sections ({from, to, level}
|
953 |
-
// objects) in the order in which they occur visually.
|
954 |
-
var bidiOrdering = (function() {
|
955 |
-
// Character types for codepoints 0 to 0xff
|
956 |
-
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
|
957 |
-
// Character types for codepoints 0x600 to 0x6f9
|
958 |
-
var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
|
959 |
-
function charType(code) {
|
960 |
-
if (code <= 0xf7) { return lowTypes.charAt(code) }
|
961 |
-
else if (0x590 <= code && code <= 0x5f4) { return "R" }
|
962 |
-
else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
|
963 |
-
else if (0x6ee <= code && code <= 0x8ac) { return "r" }
|
964 |
-
else if (0x2000 <= code && code <= 0x200b) { return "w" }
|
965 |
-
else if (code == 0x200c) { return "b" }
|
966 |
-
else { return "L" }
|
967 |
-
}
|
968 |
-
|
969 |
-
var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
|
970 |
-
var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/
|
971 |
-
|
972 |
-
function BidiSpan(level, from, to) {
|
973 |
-
this.level = level
|
974 |
-
this.from = from; this.to = to
|
975 |
-
}
|
976 |
-
|
977 |
-
return function(str, direction) {
|
978 |
-
var outerType = direction == "ltr" ? "L" : "R"
|
979 |
-
|
980 |
-
if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
|
981 |
-
var len = str.length, types = []
|
982 |
-
for (var i = 0; i < len; ++i)
|
983 |
-
{ types.push(charType(str.charCodeAt(i))) }
|
984 |
-
|
985 |
-
// W1. Examine each non-spacing mark (NSM) in the level run, and
|
986 |
-
// change the type of the NSM to the type of the previous
|
987 |
-
// character. If the NSM is at the start of the level run, it will
|
988 |
-
// get the type of sor.
|
989 |
-
for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
|
990 |
-
var type = types[i$1]
|
991 |
-
if (type == "m") { types[i$1] = prev }
|
992 |
-
else { prev = type }
|
993 |
-
}
|
994 |
-
|
995 |
-
// W2. Search backwards from each instance of a European number
|
996 |
-
// until the first strong type (R, L, AL, or sor) is found. If an
|
997 |
-
// AL is found, change the type of the European number to Arabic
|
998 |
-
// number.
|
999 |
-
// W3. Change all ALs to R.
|
1000 |
-
for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
|
1001 |
-
var type$1 = types[i$2]
|
1002 |
-
if (type$1 == "1" && cur == "r") { types[i$2] = "n" }
|
1003 |
-
else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } }
|
1004 |
-
}
|
1005 |
-
|
1006 |
-
// W4. A single European separator between two European numbers
|
1007 |
-
// changes to a European number. A single common separator between
|
1008 |
-
// two numbers of the same type changes to that type.
|
1009 |
-
for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
|
1010 |
-
var type$2 = types[i$3]
|
1011 |
-
if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" }
|
1012 |
-
else if (type$2 == "," && prev$1 == types[i$3+1] &&
|
1013 |
-
(prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 }
|
1014 |
-
prev$1 = type$2
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
// W5. A sequence of European terminators adjacent to European
|
1018 |
-
// numbers changes to all European numbers.
|
1019 |
-
// W6. Otherwise, separators and terminators change to Other
|
1020 |
-
// Neutral.
|
1021 |
-
for (var i$4 = 0; i$4 < len; ++i$4) {
|
1022 |
-
var type$3 = types[i$4]
|
1023 |
-
if (type$3 == ",") { types[i$4] = "N" }
|
1024 |
-
else if (type$3 == "%") {
|
1025 |
-
var end = (void 0)
|
1026 |
-
for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
|
1027 |
-
var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"
|
1028 |
-
for (var j = i$4; j < end; ++j) { types[j] = replace }
|
1029 |
-
i$4 = end - 1
|
1030 |
-
}
|
1031 |
-
}
|
1032 |
-
|
1033 |
-
// W7. Search backwards from each instance of a European number
|
1034 |
-
// until the first strong type (R, L, or sor) is found. If an L is
|
1035 |
-
// found, then change the type of the European number to L.
|
1036 |
-
for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
|
1037 |
-
var type$4 = types[i$5]
|
1038 |
-
if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" }
|
1039 |
-
else if (isStrong.test(type$4)) { cur$1 = type$4 }
|
1040 |
-
}
|
1041 |
-
|
1042 |
-
// N1. A sequence of neutrals takes the direction of the
|
1043 |
-
// surrounding strong text if the text on both sides has the same
|
1044 |
-
// direction. European and Arabic numbers act as if they were R in
|
1045 |
-
// terms of their influence on neutrals. Start-of-level-run (sor)
|
1046 |
-
// and end-of-level-run (eor) are used at level run boundaries.
|
1047 |
-
// N2. Any remaining neutrals take the embedding direction.
|
1048 |
-
for (var i$6 = 0; i$6 < len; ++i$6) {
|
1049 |
-
if (isNeutral.test(types[i$6])) {
|
1050 |
-
var end$1 = (void 0)
|
1051 |
-
for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
|
1052 |
-
var before = (i$6 ? types[i$6-1] : outerType) == "L"
|
1053 |
-
var after = (end$1 < len ? types[end$1] : outerType) == "L"
|
1054 |
-
var replace$1 = before == after ? (before ? "L" : "R") : outerType
|
1055 |
-
for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
|
1056 |
-
i$6 = end$1 - 1
|
1057 |
-
}
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
// Here we depart from the documented algorithm, in order to avoid
|
1061 |
-
// building up an actual levels array. Since there are only three
|
1062 |
-
// levels (0, 1, 2) in an implementation that doesn't take
|
1063 |
-
// explicit embedding into account, we can build up the order on
|
1064 |
-
// the fly, without following the level-based algorithm.
|
1065 |
-
var order = [], m
|
1066 |
-
for (var i$7 = 0; i$7 < len;) {
|
1067 |
-
if (countsAsLeft.test(types[i$7])) {
|
1068 |
-
var start = i$7
|
1069 |
-
for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
|
1070 |
-
order.push(new BidiSpan(0, start, i$7))
|
1071 |
-
} else {
|
1072 |
-
var pos = i$7, at = order.length
|
1073 |
-
for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
|
1074 |
-
for (var j$2 = pos; j$2 < i$7;) {
|
1075 |
-
if (countsAsNum.test(types[j$2])) {
|
1076 |
-
if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }
|
1077 |
-
var nstart = j$2
|
1078 |
-
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
|
1079 |
-
order.splice(at, 0, new BidiSpan(2, nstart, j$2))
|
1080 |
-
pos = j$2
|
1081 |
-
} else { ++j$2 }
|
1082 |
-
}
|
1083 |
-
if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
|
1084 |
-
}
|
1085 |
-
}
|
1086 |
-
if (order[0].level == 1 && (m = str.match(/^\s+/))) {
|
1087 |
-
order[0].from = m[0].length
|
1088 |
-
order.unshift(new BidiSpan(0, 0, m[0].length))
|
1089 |
-
}
|
1090 |
-
if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
|
1091 |
-
lst(order).to -= m[0].length
|
1092 |
-
order.push(new BidiSpan(0, len - m[0].length, len))
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
return direction == "rtl" ? order.reverse() : order
|
1096 |
-
}
|
1097 |
-
})()
|
1098 |
-
|
1099 |
-
// Get the bidi ordering for the given line (and cache it). Returns
|
1100 |
-
// false for lines that are fully left-to-right, and an array of
|
1101 |
-
// BidiSpan objects otherwise.
|
1102 |
-
function getOrder(line, direction) {
|
1103 |
-
var order = line.order
|
1104 |
-
if (order == null) { order = line.order = bidiOrdering(line.text, direction) }
|
1105 |
-
return order
|
1106 |
-
}
|
1107 |
-
|
1108 |
-
function moveCharLogically(line, ch, dir) {
|
1109 |
-
var target = skipExtendingChars(line.text, ch + dir, dir)
|
1110 |
-
return target < 0 || target > line.text.length ? null : target
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
function moveLogically(line, start, dir) {
|
1114 |
-
var ch = moveCharLogically(line, start.ch, dir)
|
1115 |
-
return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
|
1116 |
-
}
|
1117 |
-
|
1118 |
-
function endOfLine(visually, cm, lineObj, lineNo, dir) {
|
1119 |
-
if (visually) {
|
1120 |
-
var order = getOrder(lineObj, cm.doc.direction)
|
1121 |
-
if (order) {
|
1122 |
-
var part = dir < 0 ? lst(order) : order[0]
|
1123 |
-
var moveInStorageOrder = (dir < 0) == (part.level == 1)
|
1124 |
-
var sticky = moveInStorageOrder ? "after" : "before"
|
1125 |
-
var ch
|
1126 |
-
// With a wrapped rtl chunk (possibly spanning multiple bidi parts),
|
1127 |
-
// it could be that the last bidi part is not on the last visual line,
|
1128 |
-
// since visual lines contain content order-consecutive chunks.
|
1129 |
-
// Thus, in rtl, we are looking for the first (content-order) character
|
1130 |
-
// in the rtl chunk that is on the last line (that is, the same line
|
1131 |
-
// as the last (content-order) character).
|
1132 |
-
if (part.level > 0) {
|
1133 |
-
var prep = prepareMeasureForLine(cm, lineObj)
|
1134 |
-
ch = dir < 0 ? lineObj.text.length - 1 : 0
|
1135 |
-
var targetTop = measureCharPrepared(cm, prep, ch).top
|
1136 |
-
ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
|
1137 |
-
if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) }
|
1138 |
-
} else { ch = dir < 0 ? part.to : part.from }
|
1139 |
-
return new Pos(lineNo, ch, sticky)
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
function moveVisually(cm, line, start, dir) {
|
1146 |
-
var bidi = getOrder(line, cm.doc.direction)
|
1147 |
-
if (!bidi) { return moveLogically(line, start, dir) }
|
1148 |
-
if (start.ch >= line.text.length) {
|
1149 |
-
start.ch = line.text.length
|
1150 |
-
start.sticky = "before"
|
1151 |
-
} else if (start.ch <= 0) {
|
1152 |
-
start.ch = 0
|
1153 |
-
start.sticky = "after"
|
1154 |
-
}
|
1155 |
-
var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
|
1156 |
-
if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
|
1157 |
-
// Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
|
1158 |
-
// nothing interesting happens.
|
1159 |
-
return moveLogically(line, start, dir)
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
|
1163 |
-
var prep
|
1164 |
-
var getWrappedLineExtent = function (ch) {
|
1165 |
-
if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
|
1166 |
-
prep = prep || prepareMeasureForLine(cm, line)
|
1167 |
-
return wrappedLineExtentChar(cm, line, prep, ch)
|
1168 |
-
}
|
1169 |
-
var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)
|
1170 |
-
|
1171 |
-
if (cm.doc.direction == "rtl" || part.level == 1) {
|
1172 |
-
var moveInStorageOrder = (part.level == 1) == (dir < 0)
|
1173 |
-
var ch = mv(start, moveInStorageOrder ? 1 : -1)
|
1174 |
-
if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
|
1175 |
-
// Case 2: We move within an rtl part or in an rtl editor on the same visual line
|
1176 |
-
var sticky = moveInStorageOrder ? "before" : "after"
|
1177 |
-
return new Pos(start.line, ch, sticky)
|
1178 |
-
}
|
1179 |
-
}
|
1180 |
-
|
1181 |
-
// Case 3: Could not move within this bidi part in this visual line, so leave
|
1182 |
-
// the current bidi part
|
1183 |
-
|
1184 |
-
var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
|
1185 |
-
var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
|
1186 |
-
? new Pos(start.line, mv(ch, 1), "before")
|
1187 |
-
: new Pos(start.line, ch, "after"); }
|
1188 |
-
|
1189 |
-
for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
|
1190 |
-
var part = bidi[partPos]
|
1191 |
-
var moveInStorageOrder = (dir > 0) == (part.level != 1)
|
1192 |
-
var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
|
1193 |
-
if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
|
1194 |
-
ch = moveInStorageOrder ? part.from : mv(part.to, -1)
|
1195 |
-
if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
|
1196 |
-
}
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
// Case 3a: Look for other bidi parts on the same visual line
|
1200 |
-
var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
|
1201 |
-
if (res) { return res }
|
1202 |
-
|
1203 |
-
// Case 3b: Look for other bidi parts on the next visual line
|
1204 |
-
var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
|
1205 |
-
if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
|
1206 |
-
res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
|
1207 |
-
if (res) { return res }
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
// Case 4: Nowhere to move
|
1211 |
-
return null
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
// EVENT HANDLING
|
1215 |
-
|
1216 |
-
// Lightweight event framework. on/off also work on DOM nodes,
|
1217 |
-
// registering native DOM handlers.
|
1218 |
-
|
1219 |
-
var noHandlers = []
|
1220 |
-
|
1221 |
-
var on = function(emitter, type, f) {
|
1222 |
-
if (emitter.addEventListener) {
|
1223 |
-
emitter.addEventListener(type, f, false)
|
1224 |
-
} else if (emitter.attachEvent) {
|
1225 |
-
emitter.attachEvent("on" + type, f)
|
1226 |
-
} else {
|
1227 |
-
var map = emitter._handlers || (emitter._handlers = {})
|
1228 |
-
map[type] = (map[type] || noHandlers).concat(f)
|
1229 |
-
}
|
1230 |
-
}
|
1231 |
-
|
1232 |
-
function getHandlers(emitter, type) {
|
1233 |
-
return emitter._handlers && emitter._handlers[type] || noHandlers
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
function off(emitter, type, f) {
|
1237 |
-
if (emitter.removeEventListener) {
|
1238 |
-
emitter.removeEventListener(type, f, false)
|
1239 |
-
} else if (emitter.detachEvent) {
|
1240 |
-
emitter.detachEvent("on" + type, f)
|
1241 |
-
} else {
|
1242 |
-
var map = emitter._handlers, arr = map && map[type]
|
1243 |
-
if (arr) {
|
1244 |
-
var index = indexOf(arr, f)
|
1245 |
-
if (index > -1)
|
1246 |
-
{ map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }
|
1247 |
-
}
|
1248 |
-
}
|
1249 |
-
}
|
1250 |
-
|
1251 |
-
function signal(emitter, type /*, values...*/) {
|
1252 |
-
var handlers = getHandlers(emitter, type)
|
1253 |
-
if (!handlers.length) { return }
|
1254 |
-
var args = Array.prototype.slice.call(arguments, 2)
|
1255 |
-
for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }
|
1256 |
-
}
|
1257 |
-
|
1258 |
-
// The DOM events that CodeMirror handles can be overridden by
|
1259 |
-
// registering a (non-DOM) handler on the editor for the event name,
|
1260 |
-
// and preventDefault-ing the event in that handler.
|
1261 |
-
function signalDOMEvent(cm, e, override) {
|
1262 |
-
if (typeof e == "string")
|
1263 |
-
{ e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }
|
1264 |
-
signal(cm, override || e.type, cm, e)
|
1265 |
-
return e_defaultPrevented(e) || e.codemirrorIgnore
|
1266 |
-
}
|
1267 |
-
|
1268 |
-
function signalCursorActivity(cm) {
|
1269 |
-
var arr = cm._handlers && cm._handlers.cursorActivity
|
1270 |
-
if (!arr) { return }
|
1271 |
-
var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])
|
1272 |
-
for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
|
1273 |
-
{ set.push(arr[i]) } }
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
function hasHandler(emitter, type) {
|
1277 |
-
return getHandlers(emitter, type).length > 0
|
1278 |
-
}
|
1279 |
-
|
1280 |
-
// Add on and off methods to a constructor's prototype, to make
|
1281 |
-
// registering events on such objects more convenient.
|
1282 |
-
function eventMixin(ctor) {
|
1283 |
-
ctor.prototype.on = function(type, f) {on(this, type, f)}
|
1284 |
-
ctor.prototype.off = function(type, f) {off(this, type, f)}
|
1285 |
-
}
|
1286 |
-
|
1287 |
-
// Due to the fact that we still support jurassic IE versions, some
|
1288 |
-
// compatibility wrappers are needed.
|
1289 |
-
|
1290 |
-
function e_preventDefault(e) {
|
1291 |
-
if (e.preventDefault) { e.preventDefault() }
|
1292 |
-
else { e.returnValue = false }
|
1293 |
-
}
|
1294 |
-
function e_stopPropagation(e) {
|
1295 |
-
if (e.stopPropagation) { e.stopPropagation() }
|
1296 |
-
else { e.cancelBubble = true }
|
1297 |
-
}
|
1298 |
-
function e_defaultPrevented(e) {
|
1299 |
-
return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
|
1300 |
-
}
|
1301 |
-
function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
|
1302 |
-
|
1303 |
-
function e_target(e) {return e.target || e.srcElement}
|
1304 |
-
function e_button(e) {
|
1305 |
-
var b = e.which
|
1306 |
-
if (b == null) {
|
1307 |
-
if (e.button & 1) { b = 1 }
|
1308 |
-
else if (e.button & 2) { b = 3 }
|
1309 |
-
else if (e.button & 4) { b = 2 }
|
1310 |
-
}
|
1311 |
-
if (mac && e.ctrlKey && b == 1) { b = 3 }
|
1312 |
-
return b
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
// Detect drag-and-drop
|
1316 |
-
var dragAndDrop = function() {
|
1317 |
-
// There is *some* kind of drag-and-drop support in IE6-8, but I
|
1318 |
-
// couldn't get it to work yet.
|
1319 |
-
if (ie && ie_version < 9) { return false }
|
1320 |
-
var div = elt('div')
|
1321 |
-
return "draggable" in div || "dragDrop" in div
|
1322 |
-
}()
|
1323 |
-
|
1324 |
-
var zwspSupported
|
1325 |
-
function zeroWidthElement(measure) {
|
1326 |
-
if (zwspSupported == null) {
|
1327 |
-
var test = elt("span", "\u200b")
|
1328 |
-
removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]))
|
1329 |
-
if (measure.firstChild.offsetHeight != 0)
|
1330 |
-
{ zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }
|
1331 |
-
}
|
1332 |
-
var node = zwspSupported ? elt("span", "\u200b") :
|
1333 |
-
elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px")
|
1334 |
-
node.setAttribute("cm-text", "")
|
1335 |
-
return node
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
// Feature-detect IE's crummy client rect reporting for bidi text
|
1339 |
-
var badBidiRects
|
1340 |
-
function hasBadBidiRects(measure) {
|
1341 |
-
if (badBidiRects != null) { return badBidiRects }
|
1342 |
-
var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"))
|
1343 |
-
var r0 = range(txt, 0, 1).getBoundingClientRect()
|
1344 |
-
var r1 = range(txt, 1, 2).getBoundingClientRect()
|
1345 |
-
removeChildren(measure)
|
1346 |
-
if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
|
1347 |
-
return badBidiRects = (r1.right - r0.right < 3)
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
// See if "".split is the broken IE version, if so, provide an
|
1351 |
-
// alternative way to split lines.
|
1352 |
-
var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
|
1353 |
-
var pos = 0, result = [], l = string.length
|
1354 |
-
while (pos <= l) {
|
1355 |
-
var nl = string.indexOf("\n", pos)
|
1356 |
-
if (nl == -1) { nl = string.length }
|
1357 |
-
var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl)
|
1358 |
-
var rt = line.indexOf("\r")
|
1359 |
-
if (rt != -1) {
|
1360 |
-
result.push(line.slice(0, rt))
|
1361 |
-
pos += rt + 1
|
1362 |
-
} else {
|
1363 |
-
result.push(line)
|
1364 |
-
pos = nl + 1
|
1365 |
-
}
|
1366 |
-
}
|
1367 |
-
return result
|
1368 |
-
} : function (string) { return string.split(/\r\n?|\n/); }
|
1369 |
-
|
1370 |
-
var hasSelection = window.getSelection ? function (te) {
|
1371 |
-
try { return te.selectionStart != te.selectionEnd }
|
1372 |
-
catch(e) { return false }
|
1373 |
-
} : function (te) {
|
1374 |
-
var range
|
1375 |
-
try {range = te.ownerDocument.selection.createRange()}
|
1376 |
-
catch(e) {}
|
1377 |
-
if (!range || range.parentElement() != te) { return false }
|
1378 |
-
return range.compareEndPoints("StartToEnd", range) != 0
|
1379 |
-
}
|
1380 |
-
|
1381 |
-
var hasCopyEvent = (function () {
|
1382 |
-
var e = elt("div")
|
1383 |
-
if ("oncopy" in e) { return true }
|
1384 |
-
e.setAttribute("oncopy", "return;")
|
1385 |
-
return typeof e.oncopy == "function"
|
1386 |
-
})()
|
1387 |
-
|
1388 |
-
var badZoomedRects = null
|
1389 |
-
function hasBadZoomedRects(measure) {
|
1390 |
-
if (badZoomedRects != null) { return badZoomedRects }
|
1391 |
-
var node = removeChildrenAndAdd(measure, elt("span", "x"))
|
1392 |
-
var normal = node.getBoundingClientRect()
|
1393 |
-
var fromRange = range(node, 0, 1).getBoundingClientRect()
|
1394 |
-
return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
|
1395 |
-
}
|
1396 |
-
|
1397 |
-
var modes = {};
|
1398 |
-
var mimeModes = {};
|
1399 |
-
// Extra arguments are stored as the mode's dependencies, which is
|
1400 |
-
// used by (legacy) mechanisms like loadmode.js to automatically
|
1401 |
-
// load a mode. (Preferred mechanism is the require/define calls.)
|
1402 |
-
function defineMode(name, mode) {
|
1403 |
-
if (arguments.length > 2)
|
1404 |
-
{ mode.dependencies = Array.prototype.slice.call(arguments, 2) }
|
1405 |
-
modes[name] = mode
|
1406 |
-
}
|
1407 |
-
|
1408 |
-
function defineMIME(mime, spec) {
|
1409 |
-
mimeModes[mime] = spec
|
1410 |
-
}
|
1411 |
-
|
1412 |
-
// Given a MIME type, a {name, ...options} config object, or a name
|
1413 |
-
// string, return a mode config object.
|
1414 |
-
function resolveMode(spec) {
|
1415 |
-
if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
|
1416 |
-
spec = mimeModes[spec]
|
1417 |
-
} else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
|
1418 |
-
var found = mimeModes[spec.name]
|
1419 |
-
if (typeof found == "string") { found = {name: found} }
|
1420 |
-
spec = createObj(found, spec)
|
1421 |
-
spec.name = found.name
|
1422 |
-
} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
|
1423 |
-
return resolveMode("application/xml")
|
1424 |
-
} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
|
1425 |
-
return resolveMode("application/json")
|
1426 |
-
}
|
1427 |
-
if (typeof spec == "string") { return {name: spec} }
|
1428 |
-
else { return spec || {name: "null"} }
|
1429 |
-
}
|
1430 |
-
|
1431 |
-
// Given a mode spec (anything that resolveMode accepts), find and
|
1432 |
-
// initialize an actual mode object.
|
1433 |
-
function getMode(options, spec) {
|
1434 |
-
spec = resolveMode(spec)
|
1435 |
-
var mfactory = modes[spec.name]
|
1436 |
-
if (!mfactory) { return getMode(options, "text/plain") }
|
1437 |
-
var modeObj = mfactory(options, spec)
|
1438 |
-
if (modeExtensions.hasOwnProperty(spec.name)) {
|
1439 |
-
var exts = modeExtensions[spec.name]
|
1440 |
-
for (var prop in exts) {
|
1441 |
-
if (!exts.hasOwnProperty(prop)) { continue }
|
1442 |
-
if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] }
|
1443 |
-
modeObj[prop] = exts[prop]
|
1444 |
-
}
|
1445 |
-
}
|
1446 |
-
modeObj.name = spec.name
|
1447 |
-
if (spec.helperType) { modeObj.helperType = spec.helperType }
|
1448 |
-
if (spec.modeProps) { for (var prop$1 in spec.modeProps)
|
1449 |
-
{ modeObj[prop$1] = spec.modeProps[prop$1] } }
|
1450 |
-
|
1451 |
-
return modeObj
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
// This can be used to attach properties to mode objects from
|
1455 |
-
// outside the actual mode definition.
|
1456 |
-
var modeExtensions = {}
|
1457 |
-
function extendMode(mode, properties) {
|
1458 |
-
var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})
|
1459 |
-
copyObj(properties, exts)
|
1460 |
-
}
|
1461 |
-
|
1462 |
-
function copyState(mode, state) {
|
1463 |
-
if (state === true) { return state }
|
1464 |
-
if (mode.copyState) { return mode.copyState(state) }
|
1465 |
-
var nstate = {}
|
1466 |
-
for (var n in state) {
|
1467 |
-
var val = state[n]
|
1468 |
-
if (val instanceof Array) { val = val.concat([]) }
|
1469 |
-
nstate[n] = val
|
1470 |
-
}
|
1471 |
-
return nstate
|
1472 |
-
}
|
1473 |
-
|
1474 |
-
// Given a mode and a state (for that mode), find the inner mode and
|
1475 |
-
// state at the position that the state refers to.
|
1476 |
-
function innerMode(mode, state) {
|
1477 |
-
var info
|
1478 |
-
while (mode.innerMode) {
|
1479 |
-
info = mode.innerMode(state)
|
1480 |
-
if (!info || info.mode == mode) { break }
|
1481 |
-
state = info.state
|
1482 |
-
mode = info.mode
|
1483 |
-
}
|
1484 |
-
return info || {mode: mode, state: state}
|
1485 |
-
}
|
1486 |
-
|
1487 |
-
function startState(mode, a1, a2) {
|
1488 |
-
return mode.startState ? mode.startState(a1, a2) : true
|
1489 |
-
}
|
1490 |
-
|
1491 |
-
// STRING STREAM
|
1492 |
-
|
1493 |
-
// Fed to the mode parsers, provides helper functions to make
|
1494 |
-
// parsers more succinct.
|
1495 |
-
|
1496 |
-
var StringStream = function(string, tabSize) {
|
1497 |
-
this.pos = this.start = 0
|
1498 |
-
this.string = string
|
1499 |
-
this.tabSize = tabSize || 8
|
1500 |
-
this.lastColumnPos = this.lastColumnValue = 0
|
1501 |
-
this.lineStart = 0
|
1502 |
-
};
|
1503 |
-
|
1504 |
-
StringStream.prototype.eol = function () {return this.pos >= this.string.length};
|
1505 |
-
StringStream.prototype.sol = function () {return this.pos == this.lineStart};
|
1506 |
-
StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
|
1507 |
-
StringStream.prototype.next = function () {
|
1508 |
-
if (this.pos < this.string.length)
|
1509 |
-
{ return this.string.charAt(this.pos++) }
|
1510 |
-
};
|
1511 |
-
StringStream.prototype.eat = function (match) {
|
1512 |
-
var ch = this.string.charAt(this.pos)
|
1513 |
-
var ok
|
1514 |
-
if (typeof match == "string") { ok = ch == match }
|
1515 |
-
else { ok = ch && (match.test ? match.test(ch) : match(ch)) }
|
1516 |
-
if (ok) {++this.pos; return ch}
|
1517 |
-
};
|
1518 |
-
StringStream.prototype.eatWhile = function (match) {
|
1519 |
-
var start = this.pos
|
1520 |
-
while (this.eat(match)){}
|
1521 |
-
return this.pos > start
|
1522 |
-
};
|
1523 |
-
StringStream.prototype.eatSpace = function () {
|
1524 |
-
var this$1 = this;
|
1525 |
-
|
1526 |
-
var start = this.pos
|
1527 |
-
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }
|
1528 |
-
return this.pos > start
|
1529 |
-
};
|
1530 |
-
StringStream.prototype.skipToEnd = function () {this.pos = this.string.length};
|
1531 |
-
StringStream.prototype.skipTo = function (ch) {
|
1532 |
-
var found = this.string.indexOf(ch, this.pos)
|
1533 |
-
if (found > -1) {this.pos = found; return true}
|
1534 |
-
};
|
1535 |
-
StringStream.prototype.backUp = function (n) {this.pos -= n};
|
1536 |
-
StringStream.prototype.column = function () {
|
1537 |
-
if (this.lastColumnPos < this.start) {
|
1538 |
-
this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)
|
1539 |
-
this.lastColumnPos = this.start
|
1540 |
-
}
|
1541 |
-
return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
|
1542 |
-
};
|
1543 |
-
StringStream.prototype.indentation = function () {
|
1544 |
-
return countColumn(this.string, null, this.tabSize) -
|
1545 |
-
(this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
|
1546 |
-
};
|
1547 |
-
StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
|
1548 |
-
if (typeof pattern == "string") {
|
1549 |
-
var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }
|
1550 |
-
var substr = this.string.substr(this.pos, pattern.length)
|
1551 |
-
if (cased(substr) == cased(pattern)) {
|
1552 |
-
if (consume !== false) { this.pos += pattern.length }
|
1553 |
-
return true
|
1554 |
-
}
|
1555 |
-
} else {
|
1556 |
-
var match = this.string.slice(this.pos).match(pattern)
|
1557 |
-
if (match && match.index > 0) { return null }
|
1558 |
-
if (match && consume !== false) { this.pos += match[0].length }
|
1559 |
-
return match
|
1560 |
-
}
|
1561 |
-
};
|
1562 |
-
StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
|
1563 |
-
StringStream.prototype.hideFirstChars = function (n, inner) {
|
1564 |
-
this.lineStart += n
|
1565 |
-
try { return inner() }
|
1566 |
-
finally { this.lineStart -= n }
|
1567 |
-
};
|
1568 |
-
|
1569 |
-
// Compute a style array (an array starting with a mode generation
|
1570 |
-
// -- for invalidation -- followed by pairs of end positions and
|
1571 |
-
// style strings), which is used to highlight the tokens on the
|
1572 |
-
// line.
|
1573 |
-
function highlightLine(cm, line, state, forceToEnd) {
|
1574 |
-
// A styles array always starts with a number identifying the
|
1575 |
-
// mode/overlays that it is based on (for easy invalidation).
|
1576 |
-
var st = [cm.state.modeGen], lineClasses = {}
|
1577 |
-
// Compute the base array of styles
|
1578 |
-
runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },
|
1579 |
-
lineClasses, forceToEnd)
|
1580 |
-
|
1581 |
-
// Run overlays, adjust style array.
|
1582 |
-
var loop = function ( o ) {
|
1583 |
-
var overlay = cm.state.overlays[o], i = 1, at = 0
|
1584 |
-
runMode(cm, line.text, overlay.mode, true, function (end, style) {
|
1585 |
-
var start = i
|
1586 |
-
// Ensure there's a token end at the current position, and that i points at it
|
1587 |
-
while (at < end) {
|
1588 |
-
var i_end = st[i]
|
1589 |
-
if (i_end > end)
|
1590 |
-
{ st.splice(i, 1, end, st[i+1], i_end) }
|
1591 |
-
i += 2
|
1592 |
-
at = Math.min(end, i_end)
|
1593 |
-
}
|
1594 |
-
if (!style) { return }
|
1595 |
-
if (overlay.opaque) {
|
1596 |
-
st.splice(start, i - start, end, "overlay " + style)
|
1597 |
-
i = start + 2
|
1598 |
-
} else {
|
1599 |
-
for (; start < i; start += 2) {
|
1600 |
-
var cur = st[start+1]
|
1601 |
-
st[start+1] = (cur ? cur + " " : "") + "overlay " + style
|
1602 |
-
}
|
1603 |
-
}
|
1604 |
-
}, lineClasses)
|
1605 |
-
};
|
1606 |
-
|
1607 |
-
for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
|
1608 |
-
|
1609 |
-
return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
|
1610 |
-
}
|
1611 |
-
|
1612 |
-
function getLineStyles(cm, line, updateFrontier) {
|
1613 |
-
if (!line.styles || line.styles[0] != cm.state.modeGen) {
|
1614 |
-
var state = getStateBefore(cm, lineNo(line))
|
1615 |
-
var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)
|
1616 |
-
line.stateAfter = state
|
1617 |
-
line.styles = result.styles
|
1618 |
-
if (result.classes) { line.styleClasses = result.classes }
|
1619 |
-
else if (line.styleClasses) { line.styleClasses = null }
|
1620 |
-
if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }
|
1621 |
-
}
|
1622 |
-
return line.styles
|
1623 |
-
}
|
1624 |
-
|
1625 |
-
function getStateBefore(cm, n, precise) {
|
1626 |
-
var doc = cm.doc, display = cm.display
|
1627 |
-
if (!doc.mode.startState) { return true }
|
1628 |
-
var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter
|
1629 |
-
if (!state) { state = startState(doc.mode) }
|
1630 |
-
else { state = copyState(doc.mode, state) }
|
1631 |
-
doc.iter(pos, n, function (line) {
|
1632 |
-
processLine(cm, line.text, state)
|
1633 |
-
var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo
|
1634 |
-
line.stateAfter = save ? copyState(doc.mode, state) : null
|
1635 |
-
++pos
|
1636 |
-
})
|
1637 |
-
if (precise) { doc.frontier = pos }
|
1638 |
-
return state
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
// Lightweight form of highlight -- proceed over this line and
|
1642 |
-
// update state, but don't save a style array. Used for lines that
|
1643 |
-
// aren't currently visible.
|
1644 |
-
function processLine(cm, text, state, startAt) {
|
1645 |
-
var mode = cm.doc.mode
|
1646 |
-
var stream = new StringStream(text, cm.options.tabSize)
|
1647 |
-
stream.start = stream.pos = startAt || 0
|
1648 |
-
if (text == "") { callBlankLine(mode, state) }
|
1649 |
-
while (!stream.eol()) {
|
1650 |
-
readToken(mode, stream, state)
|
1651 |
-
stream.start = stream.pos
|
1652 |
-
}
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
function callBlankLine(mode, state) {
|
1656 |
-
if (mode.blankLine) { return mode.blankLine(state) }
|
1657 |
-
if (!mode.innerMode) { return }
|
1658 |
-
var inner = innerMode(mode, state)
|
1659 |
-
if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
|
1660 |
-
}
|
1661 |
-
|
1662 |
-
function readToken(mode, stream, state, inner) {
|
1663 |
-
for (var i = 0; i < 10; i++) {
|
1664 |
-
if (inner) { inner[0] = innerMode(mode, state).mode }
|
1665 |
-
var style = mode.token(stream, state)
|
1666 |
-
if (stream.pos > stream.start) { return style }
|
1667 |
-
}
|
1668 |
-
throw new Error("Mode " + mode.name + " failed to advance stream.")
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
// Utility for getTokenAt and getLineTokens
|
1672 |
-
function takeToken(cm, pos, precise, asArray) {
|
1673 |
-
var getObj = function (copy) { return ({
|
1674 |
-
start: stream.start, end: stream.pos,
|
1675 |
-
string: stream.current(),
|
1676 |
-
type: style || null,
|
1677 |
-
state: copy ? copyState(doc.mode, state) : state
|
1678 |
-
}); }
|
1679 |
-
|
1680 |
-
var doc = cm.doc, mode = doc.mode, style
|
1681 |
-
pos = clipPos(doc, pos)
|
1682 |
-
var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)
|
1683 |
-
var stream = new StringStream(line.text, cm.options.tabSize), tokens
|
1684 |
-
if (asArray) { tokens = [] }
|
1685 |
-
while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
|
1686 |
-
stream.start = stream.pos
|
1687 |
-
style = readToken(mode, stream, state)
|
1688 |
-
if (asArray) { tokens.push(getObj(true)) }
|
1689 |
-
}
|
1690 |
-
return asArray ? tokens : getObj()
|
1691 |
-
}
|
1692 |
-
|
1693 |
-
function extractLineClasses(type, output) {
|
1694 |
-
if (type) { for (;;) {
|
1695 |
-
var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/)
|
1696 |
-
if (!lineClass) { break }
|
1697 |
-
type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)
|
1698 |
-
var prop = lineClass[1] ? "bgClass" : "textClass"
|
1699 |
-
if (output[prop] == null)
|
1700 |
-
{ output[prop] = lineClass[2] }
|
1701 |
-
else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
|
1702 |
-
{ output[prop] += " " + lineClass[2] }
|
1703 |
-
} }
|
1704 |
-
return type
|
1705 |
-
}
|
1706 |
-
|
1707 |
-
// Run the given mode's parser over a line, calling f for each token.
|
1708 |
-
function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
|
1709 |
-
var flattenSpans = mode.flattenSpans
|
1710 |
-
if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
|
1711 |
-
var curStart = 0, curStyle = null
|
1712 |
-
var stream = new StringStream(text, cm.options.tabSize), style
|
1713 |
-
var inner = cm.options.addModeClass && [null]
|
1714 |
-
if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses) }
|
1715 |
-
while (!stream.eol()) {
|
1716 |
-
if (stream.pos > cm.options.maxHighlightLength) {
|
1717 |
-
flattenSpans = false
|
1718 |
-
if (forceToEnd) { processLine(cm, text, state, stream.pos) }
|
1719 |
-
stream.pos = text.length
|
1720 |
-
style = null
|
1721 |
-
} else {
|
1722 |
-
style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)
|
1723 |
-
}
|
1724 |
-
if (inner) {
|
1725 |
-
var mName = inner[0].name
|
1726 |
-
if (mName) { style = "m-" + (style ? mName + " " + style : mName) }
|
1727 |
-
}
|
1728 |
-
if (!flattenSpans || curStyle != style) {
|
1729 |
-
while (curStart < stream.start) {
|
1730 |
-
curStart = Math.min(stream.start, curStart + 5000)
|
1731 |
-
f(curStart, curStyle)
|
1732 |
-
}
|
1733 |
-
curStyle = style
|
1734 |
-
}
|
1735 |
-
stream.start = stream.pos
|
1736 |
-
}
|
1737 |
-
while (curStart < stream.pos) {
|
1738 |
-
// Webkit seems to refuse to render text nodes longer than 57444
|
1739 |
-
// characters, and returns inaccurate measurements in nodes
|
1740 |
-
// starting around 5000 chars.
|
1741 |
-
var pos = Math.min(stream.pos, curStart + 5000)
|
1742 |
-
f(pos, curStyle)
|
1743 |
-
curStart = pos
|
1744 |
-
}
|
1745 |
-
}
|
1746 |
-
|
1747 |
-
// Finds the line to start with when starting a parse. Tries to
|
1748 |
-
// find a line with a stateAfter, so that it can start with a
|
1749 |
-
// valid state. If that fails, it returns the line with the
|
1750 |
-
// smallest indentation, which tends to need the least context to
|
1751 |
-
// parse correctly.
|
1752 |
-
function findStartLine(cm, n, precise) {
|
1753 |
-
var minindent, minline, doc = cm.doc
|
1754 |
-
var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
|
1755 |
-
for (var search = n; search > lim; --search) {
|
1756 |
-
if (search <= doc.first) { return doc.first }
|
1757 |
-
var line = getLine(doc, search - 1)
|
1758 |
-
if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }
|
1759 |
-
var indented = countColumn(line.text, null, cm.options.tabSize)
|
1760 |
-
if (minline == null || minindent > indented) {
|
1761 |
-
minline = search - 1
|
1762 |
-
minindent = indented
|
1763 |
-
}
|
1764 |
-
}
|
1765 |
-
return minline
|
1766 |
-
}
|
1767 |
-
|
1768 |
-
// LINE DATA STRUCTURE
|
1769 |
-
|
1770 |
-
// Line objects. These hold state related to a line, including
|
1771 |
-
// highlighting info (the styles array).
|
1772 |
-
var Line = function(text, markedSpans, estimateHeight) {
|
1773 |
-
this.text = text
|
1774 |
-
attachMarkedSpans(this, markedSpans)
|
1775 |
-
this.height = estimateHeight ? estimateHeight(this) : 1
|
1776 |
-
};
|
1777 |
-
|
1778 |
-
Line.prototype.lineNo = function () { return lineNo(this) };
|
1779 |
-
eventMixin(Line)
|
1780 |
-
|
1781 |
-
// Change the content (text, markers) of a line. Automatically
|
1782 |
-
// invalidates cached information and tries to re-estimate the
|
1783 |
-
// line's height.
|
1784 |
-
function updateLine(line, text, markedSpans, estimateHeight) {
|
1785 |
-
line.text = text
|
1786 |
-
if (line.stateAfter) { line.stateAfter = null }
|
1787 |
-
if (line.styles) { line.styles = null }
|
1788 |
-
if (line.order != null) { line.order = null }
|
1789 |
-
detachMarkedSpans(line)
|
1790 |
-
attachMarkedSpans(line, markedSpans)
|
1791 |
-
var estHeight = estimateHeight ? estimateHeight(line) : 1
|
1792 |
-
if (estHeight != line.height) { updateLineHeight(line, estHeight) }
|
1793 |
-
}
|
1794 |
-
|
1795 |
-
// Detach a line from the document tree and its markers.
|
1796 |
-
function cleanUpLine(line) {
|
1797 |
-
line.parent = null
|
1798 |
-
detachMarkedSpans(line)
|
1799 |
-
}
|
1800 |
-
|
1801 |
-
// Convert a style as returned by a mode (either null, or a string
|
1802 |
-
// containing one or more styles) to a CSS style. This is cached,
|
1803 |
-
// and also looks for line-wide styles.
|
1804 |
-
var styleToClassCache = {};
|
1805 |
-
var styleToClassCacheWithMode = {};
|
1806 |
-
function interpretTokenStyle(style, options) {
|
1807 |
-
if (!style || /^\s*$/.test(style)) { return null }
|
1808 |
-
var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
|
1809 |
-
return cache[style] ||
|
1810 |
-
(cache[style] = style.replace(/\S+/g, "cm-$&"))
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
// Render the DOM representation of the text of a line. Also builds
|
1814 |
-
// up a 'line map', which points at the DOM nodes that represent
|
1815 |
-
// specific stretches of text, and is used by the measuring code.
|
1816 |
-
// The returned object contains the DOM node, this map, and
|
1817 |
-
// information about line-wide styles that were set by the mode.
|
1818 |
-
function buildLineContent(cm, lineView) {
|
1819 |
-
// The padding-right forces the element to have a 'border', which
|
1820 |
-
// is needed on Webkit to be able to get line-level bounding
|
1821 |
-
// rectangles for it (in measureChar).
|
1822 |
-
var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null)
|
1823 |
-
var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
|
1824 |
-
col: 0, pos: 0, cm: cm,
|
1825 |
-
trailingSpace: false,
|
1826 |
-
splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
|
1827 |
-
lineView.measure = {}
|
1828 |
-
|
1829 |
-
// Iterate over the logical lines that make up this visual line.
|
1830 |
-
for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
|
1831 |
-
var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)
|
1832 |
-
builder.pos = 0
|
1833 |
-
builder.addToken = buildToken
|
1834 |
-
// Optionally wire in some hacks into the token-rendering
|
1835 |
-
// algorithm, to deal with browser quirks.
|
1836 |
-
if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
|
1837 |
-
{ builder.addToken = buildTokenBadBidi(builder.addToken, order) }
|
1838 |
-
builder.map = []
|
1839 |
-
var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
|
1840 |
-
insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))
|
1841 |
-
if (line.styleClasses) {
|
1842 |
-
if (line.styleClasses.bgClass)
|
1843 |
-
{ builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") }
|
1844 |
-
if (line.styleClasses.textClass)
|
1845 |
-
{ builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") }
|
1846 |
-
}
|
1847 |
-
|
1848 |
-
// Ensure at least a single node is present, for measuring.
|
1849 |
-
if (builder.map.length == 0)
|
1850 |
-
{ builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }
|
1851 |
-
|
1852 |
-
// Store the map and a cache object for the current logical line
|
1853 |
-
if (i == 0) {
|
1854 |
-
lineView.measure.map = builder.map
|
1855 |
-
lineView.measure.cache = {}
|
1856 |
-
} else {
|
1857 |
-
;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
|
1858 |
-
;(lineView.measure.caches || (lineView.measure.caches = [])).push({})
|
1859 |
-
}
|
1860 |
-
}
|
1861 |
-
|
1862 |
-
// See issue #2901
|
1863 |
-
if (webkit) {
|
1864 |
-
var last = builder.content.lastChild
|
1865 |
-
if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
|
1866 |
-
{ builder.content.className = "cm-tab-wrap-hack" }
|
1867 |
-
}
|
1868 |
-
|
1869 |
-
signal(cm, "renderLine", cm, lineView.line, builder.pre)
|
1870 |
-
if (builder.pre.className)
|
1871 |
-
{ builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") }
|
1872 |
-
|
1873 |
-
return builder
|
1874 |
-
}
|
1875 |
-
|
1876 |
-
function defaultSpecialCharPlaceholder(ch) {
|
1877 |
-
var token = elt("span", "\u2022", "cm-invalidchar")
|
1878 |
-
token.title = "\\u" + ch.charCodeAt(0).toString(16)
|
1879 |
-
token.setAttribute("aria-label", token.title)
|
1880 |
-
return token
|
1881 |
-
}
|
1882 |
-
|
1883 |
-
// Build up the DOM representation for a single token, and add it to
|
1884 |
-
// the line map. Takes care to render special characters separately.
|
1885 |
-
function buildToken(builder, text, style, startStyle, endStyle, title, css) {
|
1886 |
-
if (!text) { return }
|
1887 |
-
var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
|
1888 |
-
var special = builder.cm.state.specialChars, mustWrap = false
|
1889 |
-
var content
|
1890 |
-
if (!special.test(text)) {
|
1891 |
-
builder.col += text.length
|
1892 |
-
content = document.createTextNode(displayText)
|
1893 |
-
builder.map.push(builder.pos, builder.pos + text.length, content)
|
1894 |
-
if (ie && ie_version < 9) { mustWrap = true }
|
1895 |
-
builder.pos += text.length
|
1896 |
-
} else {
|
1897 |
-
content = document.createDocumentFragment()
|
1898 |
-
var pos = 0
|
1899 |
-
while (true) {
|
1900 |
-
special.lastIndex = pos
|
1901 |
-
var m = special.exec(text)
|
1902 |
-
var skipped = m ? m.index - pos : text.length - pos
|
1903 |
-
if (skipped) {
|
1904 |
-
var txt = document.createTextNode(displayText.slice(pos, pos + skipped))
|
1905 |
-
if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) }
|
1906 |
-
else { content.appendChild(txt) }
|
1907 |
-
builder.map.push(builder.pos, builder.pos + skipped, txt)
|
1908 |
-
builder.col += skipped
|
1909 |
-
builder.pos += skipped
|
1910 |
-
}
|
1911 |
-
if (!m) { break }
|
1912 |
-
pos += skipped + 1
|
1913 |
-
var txt$1 = (void 0)
|
1914 |
-
if (m[0] == "\t") {
|
1915 |
-
var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize
|
1916 |
-
txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"))
|
1917 |
-
txt$1.setAttribute("role", "presentation")
|
1918 |
-
txt$1.setAttribute("cm-text", "\t")
|
1919 |
-
builder.col += tabWidth
|
1920 |
-
} else if (m[0] == "\r" || m[0] == "\n") {
|
1921 |
-
txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"))
|
1922 |
-
txt$1.setAttribute("cm-text", m[0])
|
1923 |
-
builder.col += 1
|
1924 |
-
} else {
|
1925 |
-
txt$1 = builder.cm.options.specialCharPlaceholder(m[0])
|
1926 |
-
txt$1.setAttribute("cm-text", m[0])
|
1927 |
-
if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) }
|
1928 |
-
else { content.appendChild(txt$1) }
|
1929 |
-
builder.col += 1
|
1930 |
-
}
|
1931 |
-
builder.map.push(builder.pos, builder.pos + 1, txt$1)
|
1932 |
-
builder.pos++
|
1933 |
-
}
|
1934 |
-
}
|
1935 |
-
builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
|
1936 |
-
if (style || startStyle || endStyle || mustWrap || css) {
|
1937 |
-
var fullStyle = style || ""
|
1938 |
-
if (startStyle) { fullStyle += startStyle }
|
1939 |
-
if (endStyle) { fullStyle += endStyle }
|
1940 |
-
var token = elt("span", [content], fullStyle, css)
|
1941 |
-
if (title) { token.title = title }
|
1942 |
-
return builder.content.appendChild(token)
|
1943 |
-
}
|
1944 |
-
builder.content.appendChild(content)
|
1945 |
-
}
|
1946 |
-
|
1947 |
-
function splitSpaces(text, trailingBefore) {
|
1948 |
-
if (text.length > 1 && !/ /.test(text)) { return text }
|
1949 |
-
var spaceBefore = trailingBefore, result = ""
|
1950 |
-
for (var i = 0; i < text.length; i++) {
|
1951 |
-
var ch = text.charAt(i)
|
1952 |
-
if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
|
1953 |
-
{ ch = "\u00a0" }
|
1954 |
-
result += ch
|
1955 |
-
spaceBefore = ch == " "
|
1956 |
-
}
|
1957 |
-
return result
|
1958 |
-
}
|
1959 |
-
|
1960 |
-
// Work around nonsense dimensions being reported for stretches of
|
1961 |
-
// right-to-left text.
|
1962 |
-
function buildTokenBadBidi(inner, order) {
|
1963 |
-
return function (builder, text, style, startStyle, endStyle, title, css) {
|
1964 |
-
style = style ? style + " cm-force-border" : "cm-force-border"
|
1965 |
-
var start = builder.pos, end = start + text.length
|
1966 |
-
for (;;) {
|
1967 |
-
// Find the part that overlaps with the start of this text
|
1968 |
-
var part = (void 0)
|
1969 |
-
for (var i = 0; i < order.length; i++) {
|
1970 |
-
part = order[i]
|
1971 |
-
if (part.to > start && part.from <= start) { break }
|
1972 |
-
}
|
1973 |
-
if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }
|
1974 |
-
inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)
|
1975 |
-
startStyle = null
|
1976 |
-
text = text.slice(part.to - start)
|
1977 |
-
start = part.to
|
1978 |
-
}
|
1979 |
-
}
|
1980 |
-
}
|
1981 |
-
|
1982 |
-
function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
|
1983 |
-
var widget = !ignoreWidget && marker.widgetNode
|
1984 |
-
if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }
|
1985 |
-
if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
|
1986 |
-
if (!widget)
|
1987 |
-
{ widget = builder.content.appendChild(document.createElement("span")) }
|
1988 |
-
widget.setAttribute("cm-marker", marker.id)
|
1989 |
-
}
|
1990 |
-
if (widget) {
|
1991 |
-
builder.cm.display.input.setUneditable(widget)
|
1992 |
-
builder.content.appendChild(widget)
|
1993 |
-
}
|
1994 |
-
builder.pos += size
|
1995 |
-
builder.trailingSpace = false
|
1996 |
-
}
|
1997 |
-
|
1998 |
-
// Outputs a number of spans to make up a line, taking highlighting
|
1999 |
-
// and marked text into account.
|
2000 |
-
function insertLineContent(line, builder, styles) {
|
2001 |
-
var spans = line.markedSpans, allText = line.text, at = 0
|
2002 |
-
if (!spans) {
|
2003 |
-
for (var i$1 = 1; i$1 < styles.length; i$1+=2)
|
2004 |
-
{ builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }
|
2005 |
-
return
|
2006 |
-
}
|
2007 |
-
|
2008 |
-
var len = allText.length, pos = 0, i = 1, text = "", style, css
|
2009 |
-
var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed
|
2010 |
-
for (;;) {
|
2011 |
-
if (nextChange == pos) { // Update current marker set
|
2012 |
-
spanStyle = spanEndStyle = spanStartStyle = title = css = ""
|
2013 |
-
collapsed = null; nextChange = Infinity
|
2014 |
-
var foundBookmarks = [], endStyles = (void 0)
|
2015 |
-
for (var j = 0; j < spans.length; ++j) {
|
2016 |
-
var sp = spans[j], m = sp.marker
|
2017 |
-
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
|
2018 |
-
foundBookmarks.push(m)
|
2019 |
-
} else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
|
2020 |
-
if (sp.to != null && sp.to != pos && nextChange > sp.to) {
|
2021 |
-
nextChange = sp.to
|
2022 |
-
spanEndStyle = ""
|
2023 |
-
}
|
2024 |
-
if (m.className) { spanStyle += " " + m.className }
|
2025 |
-
if (m.css) { css = (css ? css + ";" : "") + m.css }
|
2026 |
-
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle }
|
2027 |
-
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }
|
2028 |
-
if (m.title && !title) { title = m.title }
|
2029 |
-
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
2030 |
-
{ collapsed = sp }
|
2031 |
-
} else if (sp.from > pos && nextChange > sp.from) {
|
2032 |
-
nextChange = sp.from
|
2033 |
-
}
|
2034 |
-
}
|
2035 |
-
if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
|
2036 |
-
{ if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } }
|
2037 |
-
|
2038 |
-
if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
|
2039 |
-
{ buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }
|
2040 |
-
if (collapsed && (collapsed.from || 0) == pos) {
|
2041 |
-
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
|
2042 |
-
collapsed.marker, collapsed.from == null)
|
2043 |
-
if (collapsed.to == null) { return }
|
2044 |
-
if (collapsed.to == pos) { collapsed = false }
|
2045 |
-
}
|
2046 |
-
}
|
2047 |
-
if (pos >= len) { break }
|
2048 |
-
|
2049 |
-
var upto = Math.min(len, nextChange)
|
2050 |
-
while (true) {
|
2051 |
-
if (text) {
|
2052 |
-
var end = pos + text.length
|
2053 |
-
if (!collapsed) {
|
2054 |
-
var tokenText = end > upto ? text.slice(0, upto - pos) : text
|
2055 |
-
builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
|
2056 |
-
spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css)
|
2057 |
-
}
|
2058 |
-
if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
|
2059 |
-
pos = end
|
2060 |
-
spanStartStyle = ""
|
2061 |
-
}
|
2062 |
-
text = allText.slice(at, at = styles[i++])
|
2063 |
-
style = interpretTokenStyle(styles[i++], builder.cm.options)
|
2064 |
-
}
|
2065 |
-
}
|
2066 |
-
}
|
2067 |
-
|
2068 |
-
|
2069 |
-
// These objects are used to represent the visible (currently drawn)
|
2070 |
-
// part of the document. A LineView may correspond to multiple
|
2071 |
-
// logical lines, if those are connected by collapsed ranges.
|
2072 |
-
function LineView(doc, line, lineN) {
|
2073 |
-
// The starting line
|
2074 |
-
this.line = line
|
2075 |
-
// Continuing lines, if any
|
2076 |
-
this.rest = visualLineContinued(line)
|
2077 |
-
// Number of logical lines in this visual line
|
2078 |
-
this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1
|
2079 |
-
this.node = this.text = null
|
2080 |
-
this.hidden = lineIsHidden(doc, line)
|
2081 |
-
}
|
2082 |
-
|
2083 |
-
// Create a range of LineView objects for the given lines.
|
2084 |
-
function buildViewArray(cm, from, to) {
|
2085 |
-
var array = [], nextPos
|
2086 |
-
for (var pos = from; pos < to; pos = nextPos) {
|
2087 |
-
var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)
|
2088 |
-
nextPos = pos + view.size
|
2089 |
-
array.push(view)
|
2090 |
-
}
|
2091 |
-
return array
|
2092 |
-
}
|
2093 |
-
|
2094 |
-
var operationGroup = null
|
2095 |
-
|
2096 |
-
function pushOperation(op) {
|
2097 |
-
if (operationGroup) {
|
2098 |
-
operationGroup.ops.push(op)
|
2099 |
-
} else {
|
2100 |
-
op.ownsGroup = operationGroup = {
|
2101 |
-
ops: [op],
|
2102 |
-
delayedCallbacks: []
|
2103 |
-
}
|
2104 |
-
}
|
2105 |
-
}
|
2106 |
-
|
2107 |
-
function fireCallbacksForOps(group) {
|
2108 |
-
// Calls delayed callbacks and cursorActivity handlers until no
|
2109 |
-
// new ones appear
|
2110 |
-
var callbacks = group.delayedCallbacks, i = 0
|
2111 |
-
do {
|
2112 |
-
for (; i < callbacks.length; i++)
|
2113 |
-
{ callbacks[i].call(null) }
|
2114 |
-
for (var j = 0; j < group.ops.length; j++) {
|
2115 |
-
var op = group.ops[j]
|
2116 |
-
if (op.cursorActivityHandlers)
|
2117 |
-
{ while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
|
2118 |
-
{ op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }
|
2119 |
-
}
|
2120 |
-
} while (i < callbacks.length)
|
2121 |
-
}
|
2122 |
-
|
2123 |
-
function finishOperation(op, endCb) {
|
2124 |
-
var group = op.ownsGroup
|
2125 |
-
if (!group) { return }
|
2126 |
-
|
2127 |
-
try { fireCallbacksForOps(group) }
|
2128 |
-
finally {
|
2129 |
-
operationGroup = null
|
2130 |
-
endCb(group)
|
2131 |
-
}
|
2132 |
-
}
|
2133 |
-
|
2134 |
-
var orphanDelayedCallbacks = null
|
2135 |
-
|
2136 |
-
// Often, we want to signal events at a point where we are in the
|
2137 |
-
// middle of some work, but don't want the handler to start calling
|
2138 |
-
// other methods on the editor, which might be in an inconsistent
|
2139 |
-
// state or simply not expect any other events to happen.
|
2140 |
-
// signalLater looks whether there are any handlers, and schedules
|
2141 |
-
// them to be executed when the last operation ends, or, if no
|
2142 |
-
// operation is active, when a timeout fires.
|
2143 |
-
function signalLater(emitter, type /*, values...*/) {
|
2144 |
-
var arr = getHandlers(emitter, type)
|
2145 |
-
if (!arr.length) { return }
|
2146 |
-
var args = Array.prototype.slice.call(arguments, 2), list
|
2147 |
-
if (operationGroup) {
|
2148 |
-
list = operationGroup.delayedCallbacks
|
2149 |
-
} else if (orphanDelayedCallbacks) {
|
2150 |
-
list = orphanDelayedCallbacks
|
2151 |
-
} else {
|
2152 |
-
list = orphanDelayedCallbacks = []
|
2153 |
-
setTimeout(fireOrphanDelayed, 0)
|
2154 |
-
}
|
2155 |
-
var loop = function ( i ) {
|
2156 |
-
list.push(function () { return arr[i].apply(null, args); })
|
2157 |
-
};
|
2158 |
-
|
2159 |
-
for (var i = 0; i < arr.length; ++i)
|
2160 |
-
loop( i );
|
2161 |
-
}
|
2162 |
-
|
2163 |
-
function fireOrphanDelayed() {
|
2164 |
-
var delayed = orphanDelayedCallbacks
|
2165 |
-
orphanDelayedCallbacks = null
|
2166 |
-
for (var i = 0; i < delayed.length; ++i) { delayed[i]() }
|
2167 |
-
}
|
2168 |
-
|
2169 |
-
// When an aspect of a line changes, a string is added to
|
2170 |
-
// lineView.changes. This updates the relevant part of the line's
|
2171 |
-
// DOM structure.
|
2172 |
-
function updateLineForChanges(cm, lineView, lineN, dims) {
|
2173 |
-
for (var j = 0; j < lineView.changes.length; j++) {
|
2174 |
-
var type = lineView.changes[j]
|
2175 |
-
if (type == "text") { updateLineText(cm, lineView) }
|
2176 |
-
else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
|
2177 |
-
else if (type == "class") { updateLineClasses(cm, lineView) }
|
2178 |
-
else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
|
2179 |
-
}
|
2180 |
-
lineView.changes = null
|
2181 |
-
}
|
2182 |
-
|
2183 |
-
// Lines with gutter elements, widgets or a background class need to
|
2184 |
-
// be wrapped, and have the extra elements added to the wrapper div
|
2185 |
-
function ensureLineWrapped(lineView) {
|
2186 |
-
if (lineView.node == lineView.text) {
|
2187 |
-
lineView.node = elt("div", null, null, "position: relative")
|
2188 |
-
if (lineView.text.parentNode)
|
2189 |
-
{ lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }
|
2190 |
-
lineView.node.appendChild(lineView.text)
|
2191 |
-
if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }
|
2192 |
-
}
|
2193 |
-
return lineView.node
|
2194 |
-
}
|
2195 |
-
|
2196 |
-
function updateLineBackground(cm, lineView) {
|
2197 |
-
var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
|
2198 |
-
if (cls) { cls += " CodeMirror-linebackground" }
|
2199 |
-
if (lineView.background) {
|
2200 |
-
if (cls) { lineView.background.className = cls }
|
2201 |
-
else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }
|
2202 |
-
} else if (cls) {
|
2203 |
-
var wrap = ensureLineWrapped(lineView)
|
2204 |
-
lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
|
2205 |
-
cm.display.input.setUneditable(lineView.background)
|
2206 |
-
}
|
2207 |
-
}
|
2208 |
-
|
2209 |
-
// Wrapper around buildLineContent which will reuse the structure
|
2210 |
-
// in display.externalMeasured when possible.
|
2211 |
-
function getLineContent(cm, lineView) {
|
2212 |
-
var ext = cm.display.externalMeasured
|
2213 |
-
if (ext && ext.line == lineView.line) {
|
2214 |
-
cm.display.externalMeasured = null
|
2215 |
-
lineView.measure = ext.measure
|
2216 |
-
return ext.built
|
2217 |
-
}
|
2218 |
-
return buildLineContent(cm, lineView)
|
2219 |
-
}
|
2220 |
-
|
2221 |
-
// Redraw the line's text. Interacts with the background and text
|
2222 |
-
// classes because the mode may output tokens that influence these
|
2223 |
-
// classes.
|
2224 |
-
function updateLineText(cm, lineView) {
|
2225 |
-
var cls = lineView.text.className
|
2226 |
-
var built = getLineContent(cm, lineView)
|
2227 |
-
if (lineView.text == lineView.node) { lineView.node = built.pre }
|
2228 |
-
lineView.text.parentNode.replaceChild(built.pre, lineView.text)
|
2229 |
-
lineView.text = built.pre
|
2230 |
-
if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
|
2231 |
-
lineView.bgClass = built.bgClass
|
2232 |
-
lineView.textClass = built.textClass
|
2233 |
-
updateLineClasses(cm, lineView)
|
2234 |
-
} else if (cls) {
|
2235 |
-
lineView.text.className = cls
|
2236 |
-
}
|
2237 |
-
}
|
2238 |
-
|
2239 |
-
function updateLineClasses(cm, lineView) {
|
2240 |
-
updateLineBackground(cm, lineView)
|
2241 |
-
if (lineView.line.wrapClass)
|
2242 |
-
{ ensureLineWrapped(lineView).className = lineView.line.wrapClass }
|
2243 |
-
else if (lineView.node != lineView.text)
|
2244 |
-
{ lineView.node.className = "" }
|
2245 |
-
var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass
|
2246 |
-
lineView.text.className = textClass || ""
|
2247 |
-
}
|
2248 |
-
|
2249 |
-
function updateLineGutter(cm, lineView, lineN, dims) {
|
2250 |
-
if (lineView.gutter) {
|
2251 |
-
lineView.node.removeChild(lineView.gutter)
|
2252 |
-
lineView.gutter = null
|
2253 |
-
}
|
2254 |
-
if (lineView.gutterBackground) {
|
2255 |
-
lineView.node.removeChild(lineView.gutterBackground)
|
2256 |
-
lineView.gutterBackground = null
|
2257 |
-
}
|
2258 |
-
if (lineView.line.gutterClass) {
|
2259 |
-
var wrap = ensureLineWrapped(lineView)
|
2260 |
-
lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
|
2261 |
-
("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
|
2262 |
-
cm.display.input.setUneditable(lineView.gutterBackground)
|
2263 |
-
wrap.insertBefore(lineView.gutterBackground, lineView.text)
|
2264 |
-
}
|
2265 |
-
var markers = lineView.line.gutterMarkers
|
2266 |
-
if (cm.options.lineNumbers || markers) {
|
2267 |
-
var wrap$1 = ensureLineWrapped(lineView)
|
2268 |
-
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"))
|
2269 |
-
cm.display.input.setUneditable(gutterWrap)
|
2270 |
-
wrap$1.insertBefore(gutterWrap, lineView.text)
|
2271 |
-
if (lineView.line.gutterClass)
|
2272 |
-
{ gutterWrap.className += " " + lineView.line.gutterClass }
|
2273 |
-
if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
|
2274 |
-
{ lineView.lineNumber = gutterWrap.appendChild(
|
2275 |
-
elt("div", lineNumberFor(cm.options, lineN),
|
2276 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt",
|
2277 |
-
("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) }
|
2278 |
-
if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
|
2279 |
-
var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]
|
2280 |
-
if (found)
|
2281 |
-
{ gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
|
2282 |
-
("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) }
|
2283 |
-
} }
|
2284 |
-
}
|
2285 |
-
}
|
2286 |
-
|
2287 |
-
function updateLineWidgets(cm, lineView, dims) {
|
2288 |
-
if (lineView.alignable) { lineView.alignable = null }
|
2289 |
-
for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
|
2290 |
-
next = node.nextSibling
|
2291 |
-
if (node.className == "CodeMirror-linewidget")
|
2292 |
-
{ lineView.node.removeChild(node) }
|
2293 |
-
}
|
2294 |
-
insertLineWidgets(cm, lineView, dims)
|
2295 |
-
}
|
2296 |
-
|
2297 |
-
// Build a line's DOM representation from scratch
|
2298 |
-
function buildLineElement(cm, lineView, lineN, dims) {
|
2299 |
-
var built = getLineContent(cm, lineView)
|
2300 |
-
lineView.text = lineView.node = built.pre
|
2301 |
-
if (built.bgClass) { lineView.bgClass = built.bgClass }
|
2302 |
-
if (built.textClass) { lineView.textClass = built.textClass }
|
2303 |
-
|
2304 |
-
updateLineClasses(cm, lineView)
|
2305 |
-
updateLineGutter(cm, lineView, lineN, dims)
|
2306 |
-
insertLineWidgets(cm, lineView, dims)
|
2307 |
-
return lineView.node
|
2308 |
-
}
|
2309 |
-
|
2310 |
-
// A lineView may contain multiple logical lines (when merged by
|
2311 |
-
// collapsed spans). The widgets for all of them need to be drawn.
|
2312 |
-
function insertLineWidgets(cm, lineView, dims) {
|
2313 |
-
insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)
|
2314 |
-
if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
|
2315 |
-
{ insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }
|
2316 |
-
}
|
2317 |
-
|
2318 |
-
function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
|
2319 |
-
if (!line.widgets) { return }
|
2320 |
-
var wrap = ensureLineWrapped(lineView)
|
2321 |
-
for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
|
2322 |
-
var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget")
|
2323 |
-
if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") }
|
2324 |
-
positionLineWidget(widget, node, lineView, dims)
|
2325 |
-
cm.display.input.setUneditable(node)
|
2326 |
-
if (allowAbove && widget.above)
|
2327 |
-
{ wrap.insertBefore(node, lineView.gutter || lineView.text) }
|
2328 |
-
else
|
2329 |
-
{ wrap.appendChild(node) }
|
2330 |
-
signalLater(widget, "redraw")
|
2331 |
-
}
|
2332 |
-
}
|
2333 |
-
|
2334 |
-
function positionLineWidget(widget, node, lineView, dims) {
|
2335 |
-
if (widget.noHScroll) {
|
2336 |
-
;(lineView.alignable || (lineView.alignable = [])).push(node)
|
2337 |
-
var width = dims.wrapperWidth
|
2338 |
-
node.style.left = dims.fixedPos + "px"
|
2339 |
-
if (!widget.coverGutter) {
|
2340 |
-
width -= dims.gutterTotalWidth
|
2341 |
-
node.style.paddingLeft = dims.gutterTotalWidth + "px"
|
2342 |
-
}
|
2343 |
-
node.style.width = width + "px"
|
2344 |
-
}
|
2345 |
-
if (widget.coverGutter) {
|
2346 |
-
node.style.zIndex = 5
|
2347 |
-
node.style.position = "relative"
|
2348 |
-
if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" }
|
2349 |
-
}
|
2350 |
-
}
|
2351 |
-
|
2352 |
-
function widgetHeight(widget) {
|
2353 |
-
if (widget.height != null) { return widget.height }
|
2354 |
-
var cm = widget.doc.cm
|
2355 |
-
if (!cm) { return 0 }
|
2356 |
-
if (!contains(document.body, widget.node)) {
|
2357 |
-
var parentStyle = "position: relative;"
|
2358 |
-
if (widget.coverGutter)
|
2359 |
-
{ parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" }
|
2360 |
-
if (widget.noHScroll)
|
2361 |
-
{ parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" }
|
2362 |
-
removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
|
2363 |
-
}
|
2364 |
-
return widget.height = widget.node.parentNode.offsetHeight
|
2365 |
-
}
|
2366 |
-
|
2367 |
-
// Return true when the given mouse event happened in a widget
|
2368 |
-
function eventInWidget(display, e) {
|
2369 |
-
for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
|
2370 |
-
if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
|
2371 |
-
(n.parentNode == display.sizer && n != display.mover))
|
2372 |
-
{ return true }
|
2373 |
-
}
|
2374 |
-
}
|
2375 |
-
|
2376 |
-
// POSITION MEASUREMENT
|
2377 |
-
|
2378 |
-
function paddingTop(display) {return display.lineSpace.offsetTop}
|
2379 |
-
function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
|
2380 |
-
function paddingH(display) {
|
2381 |
-
if (display.cachedPaddingH) { return display.cachedPaddingH }
|
2382 |
-
var e = removeChildrenAndAdd(display.measure, elt("pre", "x"))
|
2383 |
-
var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
|
2384 |
-
var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}
|
2385 |
-
if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }
|
2386 |
-
return data
|
2387 |
-
}
|
2388 |
-
|
2389 |
-
function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
|
2390 |
-
function displayWidth(cm) {
|
2391 |
-
return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
|
2392 |
-
}
|
2393 |
-
function displayHeight(cm) {
|
2394 |
-
return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
|
2395 |
-
}
|
2396 |
-
|
2397 |
-
// Ensure the lineView.wrapping.heights array is populated. This is
|
2398 |
-
// an array of bottom offsets for the lines that make up a drawn
|
2399 |
-
// line. When lineWrapping is on, there might be more than one
|
2400 |
-
// height.
|
2401 |
-
function ensureLineHeights(cm, lineView, rect) {
|
2402 |
-
var wrapping = cm.options.lineWrapping
|
2403 |
-
var curWidth = wrapping && displayWidth(cm)
|
2404 |
-
if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
|
2405 |
-
var heights = lineView.measure.heights = []
|
2406 |
-
if (wrapping) {
|
2407 |
-
lineView.measure.width = curWidth
|
2408 |
-
var rects = lineView.text.firstChild.getClientRects()
|
2409 |
-
for (var i = 0; i < rects.length - 1; i++) {
|
2410 |
-
var cur = rects[i], next = rects[i + 1]
|
2411 |
-
if (Math.abs(cur.bottom - next.bottom) > 2)
|
2412 |
-
{ heights.push((cur.bottom + next.top) / 2 - rect.top) }
|
2413 |
-
}
|
2414 |
-
}
|
2415 |
-
heights.push(rect.bottom - rect.top)
|
2416 |
-
}
|
2417 |
-
}
|
2418 |
-
|
2419 |
-
// Find a line map (mapping character offsets to text nodes) and a
|
2420 |
-
// measurement cache for the given line number. (A line view might
|
2421 |
-
// contain multiple lines when collapsed ranges are present.)
|
2422 |
-
function mapFromLineView(lineView, line, lineN) {
|
2423 |
-
if (lineView.line == line)
|
2424 |
-
{ return {map: lineView.measure.map, cache: lineView.measure.cache} }
|
2425 |
-
for (var i = 0; i < lineView.rest.length; i++)
|
2426 |
-
{ if (lineView.rest[i] == line)
|
2427 |
-
{ return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
|
2428 |
-
for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
|
2429 |
-
{ if (lineNo(lineView.rest[i$1]) > lineN)
|
2430 |
-
{ return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
|
2431 |
-
}
|
2432 |
-
|
2433 |
-
// Render a line into the hidden node display.externalMeasured. Used
|
2434 |
-
// when measurement is needed for a line that's not in the viewport.
|
2435 |
-
function updateExternalMeasurement(cm, line) {
|
2436 |
-
line = visualLine(line)
|
2437 |
-
var lineN = lineNo(line)
|
2438 |
-
var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)
|
2439 |
-
view.lineN = lineN
|
2440 |
-
var built = view.built = buildLineContent(cm, view)
|
2441 |
-
view.text = built.pre
|
2442 |
-
removeChildrenAndAdd(cm.display.lineMeasure, built.pre)
|
2443 |
-
return view
|
2444 |
-
}
|
2445 |
-
|
2446 |
-
// Get a {top, bottom, left, right} box (in line-local coordinates)
|
2447 |
-
// for a given character.
|
2448 |
-
function measureChar(cm, line, ch, bias) {
|
2449 |
-
return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
|
2450 |
-
}
|
2451 |
-
|
2452 |
-
// Find a line view that corresponds to the given line number.
|
2453 |
-
function findViewForLine(cm, lineN) {
|
2454 |
-
if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
|
2455 |
-
{ return cm.display.view[findViewIndex(cm, lineN)] }
|
2456 |
-
var ext = cm.display.externalMeasured
|
2457 |
-
if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
|
2458 |
-
{ return ext }
|
2459 |
-
}
|
2460 |
-
|
2461 |
-
// Measurement can be split in two steps, the set-up work that
|
2462 |
-
// applies to the whole line, and the measurement of the actual
|
2463 |
-
// character. Functions like coordsChar, that need to do a lot of
|
2464 |
-
// measurements in a row, can thus ensure that the set-up work is
|
2465 |
-
// only done once.
|
2466 |
-
function prepareMeasureForLine(cm, line) {
|
2467 |
-
var lineN = lineNo(line)
|
2468 |
-
var view = findViewForLine(cm, lineN)
|
2469 |
-
if (view && !view.text) {
|
2470 |
-
view = null
|
2471 |
-
} else if (view && view.changes) {
|
2472 |
-
updateLineForChanges(cm, view, lineN, getDimensions(cm))
|
2473 |
-
cm.curOp.forceUpdate = true
|
2474 |
-
}
|
2475 |
-
if (!view)
|
2476 |
-
{ view = updateExternalMeasurement(cm, line) }
|
2477 |
-
|
2478 |
-
var info = mapFromLineView(view, line, lineN)
|
2479 |
-
return {
|
2480 |
-
line: line, view: view, rect: null,
|
2481 |
-
map: info.map, cache: info.cache, before: info.before,
|
2482 |
-
hasHeights: false
|
2483 |
-
}
|
2484 |
-
}
|
2485 |
-
|
2486 |
-
// Given a prepared measurement object, measures the position of an
|
2487 |
-
// actual character (or fetches it from the cache).
|
2488 |
-
function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
|
2489 |
-
if (prepared.before) { ch = -1 }
|
2490 |
-
var key = ch + (bias || ""), found
|
2491 |
-
if (prepared.cache.hasOwnProperty(key)) {
|
2492 |
-
found = prepared.cache[key]
|
2493 |
-
} else {
|
2494 |
-
if (!prepared.rect)
|
2495 |
-
{ prepared.rect = prepared.view.text.getBoundingClientRect() }
|
2496 |
-
if (!prepared.hasHeights) {
|
2497 |
-
ensureLineHeights(cm, prepared.view, prepared.rect)
|
2498 |
-
prepared.hasHeights = true
|
2499 |
-
}
|
2500 |
-
found = measureCharInner(cm, prepared, ch, bias)
|
2501 |
-
if (!found.bogus) { prepared.cache[key] = found }
|
2502 |
-
}
|
2503 |
-
return {left: found.left, right: found.right,
|
2504 |
-
top: varHeight ? found.rtop : found.top,
|
2505 |
-
bottom: varHeight ? found.rbottom : found.bottom}
|
2506 |
-
}
|
2507 |
-
|
2508 |
-
var nullRect = {left: 0, right: 0, top: 0, bottom: 0}
|
2509 |
-
|
2510 |
-
function nodeAndOffsetInLineMap(map, ch, bias) {
|
2511 |
-
var node, start, end, collapse, mStart, mEnd
|
2512 |
-
// First, search the line map for the text node corresponding to,
|
2513 |
-
// or closest to, the target character.
|
2514 |
-
for (var i = 0; i < map.length; i += 3) {
|
2515 |
-
mStart = map[i]
|
2516 |
-
mEnd = map[i + 1]
|
2517 |
-
if (ch < mStart) {
|
2518 |
-
start = 0; end = 1
|
2519 |
-
collapse = "left"
|
2520 |
-
} else if (ch < mEnd) {
|
2521 |
-
start = ch - mStart
|
2522 |
-
end = start + 1
|
2523 |
-
} else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
|
2524 |
-
end = mEnd - mStart
|
2525 |
-
start = end - 1
|
2526 |
-
if (ch >= mEnd) { collapse = "right" }
|
2527 |
-
}
|
2528 |
-
if (start != null) {
|
2529 |
-
node = map[i + 2]
|
2530 |
-
if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
|
2531 |
-
{ collapse = bias }
|
2532 |
-
if (bias == "left" && start == 0)
|
2533 |
-
{ while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
|
2534 |
-
node = map[(i -= 3) + 2]
|
2535 |
-
collapse = "left"
|
2536 |
-
} }
|
2537 |
-
if (bias == "right" && start == mEnd - mStart)
|
2538 |
-
{ while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
|
2539 |
-
node = map[(i += 3) + 2]
|
2540 |
-
collapse = "right"
|
2541 |
-
} }
|
2542 |
-
break
|
2543 |
-
}
|
2544 |
-
}
|
2545 |
-
return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
|
2546 |
-
}
|
2547 |
-
|
2548 |
-
function getUsefulRect(rects, bias) {
|
2549 |
-
var rect = nullRect
|
2550 |
-
if (bias == "left") { for (var i = 0; i < rects.length; i++) {
|
2551 |
-
if ((rect = rects[i]).left != rect.right) { break }
|
2552 |
-
} } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
|
2553 |
-
if ((rect = rects[i$1]).left != rect.right) { break }
|
2554 |
-
} }
|
2555 |
-
return rect
|
2556 |
-
}
|
2557 |
-
|
2558 |
-
function measureCharInner(cm, prepared, ch, bias) {
|
2559 |
-
var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)
|
2560 |
-
var node = place.node, start = place.start, end = place.end, collapse = place.collapse
|
2561 |
-
|
2562 |
-
var rect
|
2563 |
-
if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
|
2564 |
-
for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
|
2565 |
-
while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }
|
2566 |
-
while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }
|
2567 |
-
if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
|
2568 |
-
{ rect = node.parentNode.getBoundingClientRect() }
|
2569 |
-
else
|
2570 |
-
{ rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }
|
2571 |
-
if (rect.left || rect.right || start == 0) { break }
|
2572 |
-
end = start
|
2573 |
-
start = start - 1
|
2574 |
-
collapse = "right"
|
2575 |
-
}
|
2576 |
-
if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }
|
2577 |
-
} else { // If it is a widget, simply get the box for the whole widget.
|
2578 |
-
if (start > 0) { collapse = bias = "right" }
|
2579 |
-
var rects
|
2580 |
-
if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
|
2581 |
-
{ rect = rects[bias == "right" ? rects.length - 1 : 0] }
|
2582 |
-
else
|
2583 |
-
{ rect = node.getBoundingClientRect() }
|
2584 |
-
}
|
2585 |
-
if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
|
2586 |
-
var rSpan = node.parentNode.getClientRects()[0]
|
2587 |
-
if (rSpan)
|
2588 |
-
{ rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }
|
2589 |
-
else
|
2590 |
-
{ rect = nullRect }
|
2591 |
-
}
|
2592 |
-
|
2593 |
-
var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top
|
2594 |
-
var mid = (rtop + rbot) / 2
|
2595 |
-
var heights = prepared.view.measure.heights
|
2596 |
-
var i = 0
|
2597 |
-
for (; i < heights.length - 1; i++)
|
2598 |
-
{ if (mid < heights[i]) { break } }
|
2599 |
-
var top = i ? heights[i - 1] : 0, bot = heights[i]
|
2600 |
-
var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
|
2601 |
-
right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
|
2602 |
-
top: top, bottom: bot}
|
2603 |
-
if (!rect.left && !rect.right) { result.bogus = true }
|
2604 |
-
if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }
|
2605 |
-
|
2606 |
-
return result
|
2607 |
-
}
|
2608 |
-
|
2609 |
-
// Work around problem with bounding client rects on ranges being
|
2610 |
-
// returned incorrectly when zoomed on IE10 and below.
|
2611 |
-
function maybeUpdateRectForZooming(measure, rect) {
|
2612 |
-
if (!window.screen || screen.logicalXDPI == null ||
|
2613 |
-
screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
|
2614 |
-
{ return rect }
|
2615 |
-
var scaleX = screen.logicalXDPI / screen.deviceXDPI
|
2616 |
-
var scaleY = screen.logicalYDPI / screen.deviceYDPI
|
2617 |
-
return {left: rect.left * scaleX, right: rect.right * scaleX,
|
2618 |
-
top: rect.top * scaleY, bottom: rect.bottom * scaleY}
|
2619 |
-
}
|
2620 |
-
|
2621 |
-
function clearLineMeasurementCacheFor(lineView) {
|
2622 |
-
if (lineView.measure) {
|
2623 |
-
lineView.measure.cache = {}
|
2624 |
-
lineView.measure.heights = null
|
2625 |
-
if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
|
2626 |
-
{ lineView.measure.caches[i] = {} } }
|
2627 |
-
}
|
2628 |
-
}
|
2629 |
-
|
2630 |
-
function clearLineMeasurementCache(cm) {
|
2631 |
-
cm.display.externalMeasure = null
|
2632 |
-
removeChildren(cm.display.lineMeasure)
|
2633 |
-
for (var i = 0; i < cm.display.view.length; i++)
|
2634 |
-
{ clearLineMeasurementCacheFor(cm.display.view[i]) }
|
2635 |
-
}
|
2636 |
-
|
2637 |
-
function clearCaches(cm) {
|
2638 |
-
clearLineMeasurementCache(cm)
|
2639 |
-
cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null
|
2640 |
-
if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }
|
2641 |
-
cm.display.lineNumChars = null
|
2642 |
-
}
|
2643 |
-
|
2644 |
-
function pageScrollX() {
|
2645 |
-
// Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
|
2646 |
-
// which causes page_Offset and bounding client rects to use
|
2647 |
-
// different reference viewports and invalidate our calculations.
|
2648 |
-
if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
|
2649 |
-
return window.pageXOffset || (document.documentElement || document.body).scrollLeft
|
2650 |
-
}
|
2651 |
-
function pageScrollY() {
|
2652 |
-
if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
|
2653 |
-
return window.pageYOffset || (document.documentElement || document.body).scrollTop
|
2654 |
-
}
|
2655 |
-
|
2656 |
-
// Converts a {top, bottom, left, right} box from line-local
|
2657 |
-
// coordinates into another coordinate system. Context may be one of
|
2658 |
-
// "line", "div" (display.lineDiv), "local"./null (editor), "window",
|
2659 |
-
// or "page".
|
2660 |
-
function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
|
2661 |
-
if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {
|
2662 |
-
var size = widgetHeight(lineObj.widgets[i])
|
2663 |
-
rect.top += size; rect.bottom += size
|
2664 |
-
} } }
|
2665 |
-
if (context == "line") { return rect }
|
2666 |
-
if (!context) { context = "local" }
|
2667 |
-
var yOff = heightAtLine(lineObj)
|
2668 |
-
if (context == "local") { yOff += paddingTop(cm.display) }
|
2669 |
-
else { yOff -= cm.display.viewOffset }
|
2670 |
-
if (context == "page" || context == "window") {
|
2671 |
-
var lOff = cm.display.lineSpace.getBoundingClientRect()
|
2672 |
-
yOff += lOff.top + (context == "window" ? 0 : pageScrollY())
|
2673 |
-
var xOff = lOff.left + (context == "window" ? 0 : pageScrollX())
|
2674 |
-
rect.left += xOff; rect.right += xOff
|
2675 |
-
}
|
2676 |
-
rect.top += yOff; rect.bottom += yOff
|
2677 |
-
return rect
|
2678 |
-
}
|
2679 |
-
|
2680 |
-
// Coverts a box from "div" coords to another coordinate system.
|
2681 |
-
// Context may be "window", "page", "div", or "local"./null.
|
2682 |
-
function fromCoordSystem(cm, coords, context) {
|
2683 |
-
if (context == "div") { return coords }
|
2684 |
-
var left = coords.left, top = coords.top
|
2685 |
-
// First move into "page" coordinate system
|
2686 |
-
if (context == "page") {
|
2687 |
-
left -= pageScrollX()
|
2688 |
-
top -= pageScrollY()
|
2689 |
-
} else if (context == "local" || !context) {
|
2690 |
-
var localBox = cm.display.sizer.getBoundingClientRect()
|
2691 |
-
left += localBox.left
|
2692 |
-
top += localBox.top
|
2693 |
-
}
|
2694 |
-
|
2695 |
-
var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()
|
2696 |
-
return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
|
2697 |
-
}
|
2698 |
-
|
2699 |
-
function charCoords(cm, pos, context, lineObj, bias) {
|
2700 |
-
if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }
|
2701 |
-
return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
|
2702 |
-
}
|
2703 |
-
|
2704 |
-
// Returns a box for a given cursor position, which may have an
|
2705 |
-
// 'other' property containing the position of the secondary cursor
|
2706 |
-
// on a bidi boundary.
|
2707 |
-
// A cursor Pos(line, char, "before") is on the same visual line as `char - 1`
|
2708 |
-
// and after `char - 1` in writing order of `char - 1`
|
2709 |
-
// A cursor Pos(line, char, "after") is on the same visual line as `char`
|
2710 |
-
// and before `char` in writing order of `char`
|
2711 |
-
// Examples (upper-case letters are RTL, lower-case are LTR):
|
2712 |
-
// Pos(0, 1, ...)
|
2713 |
-
// before after
|
2714 |
-
// ab a|b a|b
|
2715 |
-
// aB a|B aB|
|
2716 |
-
// Ab |Ab A|b
|
2717 |
-
// AB B|A B|A
|
2718 |
-
// Every position after the last character on a line is considered to stick
|
2719 |
-
// to the last character on the line.
|
2720 |
-
function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
|
2721 |
-
lineObj = lineObj || getLine(cm.doc, pos.line)
|
2722 |
-
if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
|
2723 |
-
function get(ch, right) {
|
2724 |
-
var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight)
|
2725 |
-
if (right) { m.left = m.right; } else { m.right = m.left }
|
2726 |
-
return intoCoordSystem(cm, lineObj, m, context)
|
2727 |
-
}
|
2728 |
-
var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky
|
2729 |
-
if (ch >= lineObj.text.length) {
|
2730 |
-
ch = lineObj.text.length
|
2731 |
-
sticky = "before"
|
2732 |
-
} else if (ch <= 0) {
|
2733 |
-
ch = 0
|
2734 |
-
sticky = "after"
|
2735 |
-
}
|
2736 |
-
if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
|
2737 |
-
|
2738 |
-
function getBidi(ch, partPos, invert) {
|
2739 |
-
var part = order[partPos], right = (part.level % 2) != 0
|
2740 |
-
return get(invert ? ch - 1 : ch, right != invert)
|
2741 |
-
}
|
2742 |
-
var partPos = getBidiPartAt(order, ch, sticky)
|
2743 |
-
var other = bidiOther
|
2744 |
-
var val = getBidi(ch, partPos, sticky == "before")
|
2745 |
-
if (other != null) { val.other = getBidi(ch, other, sticky != "before") }
|
2746 |
-
return val
|
2747 |
-
}
|
2748 |
-
|
2749 |
-
// Used to cheaply estimate the coordinates for a position. Used for
|
2750 |
-
// intermediate scroll updates.
|
2751 |
-
function estimateCoords(cm, pos) {
|
2752 |
-
var left = 0
|
2753 |
-
pos = clipPos(cm.doc, pos)
|
2754 |
-
if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }
|
2755 |
-
var lineObj = getLine(cm.doc, pos.line)
|
2756 |
-
var top = heightAtLine(lineObj) + paddingTop(cm.display)
|
2757 |
-
return {left: left, right: left, top: top, bottom: top + lineObj.height}
|
2758 |
-
}
|
2759 |
-
|
2760 |
-
// Positions returned by coordsChar contain some extra information.
|
2761 |
-
// xRel is the relative x position of the input coordinates compared
|
2762 |
-
// to the found position (so xRel > 0 means the coordinates are to
|
2763 |
-
// the right of the character position, for example). When outside
|
2764 |
-
// is true, that means the coordinates lie outside the line's
|
2765 |
-
// vertical range.
|
2766 |
-
function PosWithInfo(line, ch, sticky, outside, xRel) {
|
2767 |
-
var pos = Pos(line, ch, sticky)
|
2768 |
-
pos.xRel = xRel
|
2769 |
-
if (outside) { pos.outside = true }
|
2770 |
-
return pos
|
2771 |
-
}
|
2772 |
-
|
2773 |
-
// Compute the character position closest to the given coordinates.
|
2774 |
-
// Input must be lineSpace-local ("div" coordinate system).
|
2775 |
-
function coordsChar(cm, x, y) {
|
2776 |
-
var doc = cm.doc
|
2777 |
-
y += cm.display.viewOffset
|
2778 |
-
if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }
|
2779 |
-
var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1
|
2780 |
-
if (lineN > last)
|
2781 |
-
{ return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }
|
2782 |
-
if (x < 0) { x = 0 }
|
2783 |
-
|
2784 |
-
var lineObj = getLine(doc, lineN)
|
2785 |
-
for (;;) {
|
2786 |
-
var found = coordsCharInner(cm, lineObj, lineN, x, y)
|
2787 |
-
var merged = collapsedSpanAtEnd(lineObj)
|
2788 |
-
var mergedPos = merged && merged.find(0, true)
|
2789 |
-
if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
|
2790 |
-
{ lineN = lineNo(lineObj = mergedPos.to.line) }
|
2791 |
-
else
|
2792 |
-
{ return found }
|
2793 |
-
}
|
2794 |
-
}
|
2795 |
-
|
2796 |
-
function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
|
2797 |
-
var measure = function (ch) { return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); }
|
2798 |
-
var end = lineObj.text.length
|
2799 |
-
var begin = findFirst(function (ch) { return measure(ch - 1).bottom <= y; }, end, 0)
|
2800 |
-
end = findFirst(function (ch) { return measure(ch).top > y; }, begin, end)
|
2801 |
-
return {begin: begin, end: end}
|
2802 |
-
}
|
2803 |
-
|
2804 |
-
function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
|
2805 |
-
var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top
|
2806 |
-
return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
|
2807 |
-
}
|
2808 |
-
|
2809 |
-
function coordsCharInner(cm, lineObj, lineNo, x, y) {
|
2810 |
-
y -= heightAtLine(lineObj)
|
2811 |
-
var begin = 0, end = lineObj.text.length
|
2812 |
-
var preparedMeasure = prepareMeasureForLine(cm, lineObj)
|
2813 |
-
var pos
|
2814 |
-
var order = getOrder(lineObj, cm.doc.direction)
|
2815 |
-
if (order) {
|
2816 |
-
if (cm.options.lineWrapping) {
|
2817 |
-
;var assign;
|
2818 |
-
((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign))
|
2819 |
-
}
|
2820 |
-
pos = new Pos(lineNo, begin)
|
2821 |
-
var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left
|
2822 |
-
var dir = beginLeft < x ? 1 : -1
|
2823 |
-
var prevDiff, diff = beginLeft - x, prevPos
|
2824 |
-
do {
|
2825 |
-
prevDiff = diff
|
2826 |
-
prevPos = pos
|
2827 |
-
pos = moveVisually(cm, lineObj, pos, dir)
|
2828 |
-
if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) {
|
2829 |
-
pos = prevPos
|
2830 |
-
break
|
2831 |
-
}
|
2832 |
-
diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x
|
2833 |
-
} while ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))
|
2834 |
-
if (Math.abs(diff) > Math.abs(prevDiff)) {
|
2835 |
-
if ((diff < 0) == (prevDiff < 0)) { throw new Error("Broke out of infinite loop in coordsCharInner") }
|
2836 |
-
pos = prevPos
|
2837 |
-
}
|
2838 |
-
} else {
|
2839 |
-
var ch = findFirst(function (ch) {
|
2840 |
-
var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line")
|
2841 |
-
if (box.top > y) {
|
2842 |
-
// For the cursor stickiness
|
2843 |
-
end = Math.min(ch, end)
|
2844 |
-
return true
|
2845 |
-
}
|
2846 |
-
else if (box.bottom <= y) { return false }
|
2847 |
-
else if (box.left > x) { return true }
|
2848 |
-
else if (box.right < x) { return false }
|
2849 |
-
else { return (x - box.left < box.right - x) }
|
2850 |
-
}, begin, end)
|
2851 |
-
ch = skipExtendingChars(lineObj.text, ch, 1)
|
2852 |
-
pos = new Pos(lineNo, ch, ch == end ? "before" : "after")
|
2853 |
-
}
|
2854 |
-
var coords = cursorCoords(cm, pos, "line", lineObj, preparedMeasure)
|
2855 |
-
if (y < coords.top || coords.bottom < y) { pos.outside = true }
|
2856 |
-
pos.xRel = x < coords.left ? -1 : (x > coords.right ? 1 : 0)
|
2857 |
-
return pos
|
2858 |
-
}
|
2859 |
-
|
2860 |
-
var measureText
|
2861 |
-
// Compute the default text height.
|
2862 |
-
function textHeight(display) {
|
2863 |
-
if (display.cachedTextHeight != null) { return display.cachedTextHeight }
|
2864 |
-
if (measureText == null) {
|
2865 |
-
measureText = elt("pre")
|
2866 |
-
// Measure a bunch of lines, for browsers that compute
|
2867 |
-
// fractional heights.
|
2868 |
-
for (var i = 0; i < 49; ++i) {
|
2869 |
-
measureText.appendChild(document.createTextNode("x"))
|
2870 |
-
measureText.appendChild(elt("br"))
|
2871 |
-
}
|
2872 |
-
measureText.appendChild(document.createTextNode("x"))
|
2873 |
-
}
|
2874 |
-
removeChildrenAndAdd(display.measure, measureText)
|
2875 |
-
var height = measureText.offsetHeight / 50
|
2876 |
-
if (height > 3) { display.cachedTextHeight = height }
|
2877 |
-
removeChildren(display.measure)
|
2878 |
-
return height || 1
|
2879 |
-
}
|
2880 |
-
|
2881 |
-
// Compute the default character width.
|
2882 |
-
function charWidth(display) {
|
2883 |
-
if (display.cachedCharWidth != null) { return display.cachedCharWidth }
|
2884 |
-
var anchor = elt("span", "xxxxxxxxxx")
|
2885 |
-
var pre = elt("pre", [anchor])
|
2886 |
-
removeChildrenAndAdd(display.measure, pre)
|
2887 |
-
var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10
|
2888 |
-
if (width > 2) { display.cachedCharWidth = width }
|
2889 |
-
return width || 10
|
2890 |
-
}
|
2891 |
-
|
2892 |
-
// Do a bulk-read of the DOM positions and sizes needed to draw the
|
2893 |
-
// view, so that we don't interleave reading and writing to the DOM.
|
2894 |
-
function getDimensions(cm) {
|
2895 |
-
var d = cm.display, left = {}, width = {}
|
2896 |
-
var gutterLeft = d.gutters.clientLeft
|
2897 |
-
for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
|
2898 |
-
left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft
|
2899 |
-
width[cm.options.gutters[i]] = n.clientWidth
|
2900 |
-
}
|
2901 |
-
return {fixedPos: compensateForHScroll(d),
|
2902 |
-
gutterTotalWidth: d.gutters.offsetWidth,
|
2903 |
-
gutterLeft: left,
|
2904 |
-
gutterWidth: width,
|
2905 |
-
wrapperWidth: d.wrapper.clientWidth}
|
2906 |
-
}
|
2907 |
-
|
2908 |
-
// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
|
2909 |
-
// but using getBoundingClientRect to get a sub-pixel-accurate
|
2910 |
-
// result.
|
2911 |
-
function compensateForHScroll(display) {
|
2912 |
-
return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
|
2913 |
-
}
|
2914 |
-
|
2915 |
-
// Returns a function that estimates the height of a line, to use as
|
2916 |
-
// first approximation until the line becomes visible (and is thus
|
2917 |
-
// properly measurable).
|
2918 |
-
function estimateHeight(cm) {
|
2919 |
-
var th = textHeight(cm.display), wrapping = cm.options.lineWrapping
|
2920 |
-
var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)
|
2921 |
-
return function (line) {
|
2922 |
-
if (lineIsHidden(cm.doc, line)) { return 0 }
|
2923 |
-
|
2924 |
-
var widgetsHeight = 0
|
2925 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
|
2926 |
-
if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }
|
2927 |
-
} }
|
2928 |
-
|
2929 |
-
if (wrapping)
|
2930 |
-
{ return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
|
2931 |
-
else
|
2932 |
-
{ return widgetsHeight + th }
|
2933 |
-
}
|
2934 |
-
}
|
2935 |
-
|
2936 |
-
function estimateLineHeights(cm) {
|
2937 |
-
var doc = cm.doc, est = estimateHeight(cm)
|
2938 |
-
doc.iter(function (line) {
|
2939 |
-
var estHeight = est(line)
|
2940 |
-
if (estHeight != line.height) { updateLineHeight(line, estHeight) }
|
2941 |
-
})
|
2942 |
-
}
|
2943 |
-
|
2944 |
-
// Given a mouse event, find the corresponding position. If liberal
|
2945 |
-
// is false, it checks whether a gutter or scrollbar was clicked,
|
2946 |
-
// and returns null if it was. forRect is used by rectangular
|
2947 |
-
// selections, and tries to estimate a character position even for
|
2948 |
-
// coordinates beyond the right of the text.
|
2949 |
-
function posFromMouse(cm, e, liberal, forRect) {
|
2950 |
-
var display = cm.display
|
2951 |
-
if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
|
2952 |
-
|
2953 |
-
var x, y, space = display.lineSpace.getBoundingClientRect()
|
2954 |
-
// Fails unpredictably on IE[67] when mouse is dragged around quickly.
|
2955 |
-
try { x = e.clientX - space.left; y = e.clientY - space.top }
|
2956 |
-
catch (e) { return null }
|
2957 |
-
var coords = coordsChar(cm, x, y), line
|
2958 |
-
if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
|
2959 |
-
var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length
|
2960 |
-
coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))
|
2961 |
-
}
|
2962 |
-
return coords
|
2963 |
-
}
|
2964 |
-
|
2965 |
-
// Find the view element corresponding to a given line. Return null
|
2966 |
-
// when the line isn't visible.
|
2967 |
-
function findViewIndex(cm, n) {
|
2968 |
-
if (n >= cm.display.viewTo) { return null }
|
2969 |
-
n -= cm.display.viewFrom
|
2970 |
-
if (n < 0) { return null }
|
2971 |
-
var view = cm.display.view
|
2972 |
-
for (var i = 0; i < view.length; i++) {
|
2973 |
-
n -= view[i].size
|
2974 |
-
if (n < 0) { return i }
|
2975 |
-
}
|
2976 |
-
}
|
2977 |
-
|
2978 |
-
function updateSelection(cm) {
|
2979 |
-
cm.display.input.showSelection(cm.display.input.prepareSelection())
|
2980 |
-
}
|
2981 |
-
|
2982 |
-
function prepareSelection(cm, primary) {
|
2983 |
-
var doc = cm.doc, result = {}
|
2984 |
-
var curFragment = result.cursors = document.createDocumentFragment()
|
2985 |
-
var selFragment = result.selection = document.createDocumentFragment()
|
2986 |
-
|
2987 |
-
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
2988 |
-
if (primary === false && i == doc.sel.primIndex) { continue }
|
2989 |
-
var range = doc.sel.ranges[i]
|
2990 |
-
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
|
2991 |
-
var collapsed = range.empty()
|
2992 |
-
if (collapsed || cm.options.showCursorWhenSelecting)
|
2993 |
-
{ drawSelectionCursor(cm, range.head, curFragment) }
|
2994 |
-
if (!collapsed)
|
2995 |
-
{ drawSelectionRange(cm, range, selFragment) }
|
2996 |
-
}
|
2997 |
-
return result
|
2998 |
-
}
|
2999 |
-
|
3000 |
-
// Draws a cursor for the given range
|
3001 |
-
function drawSelectionCursor(cm, head, output) {
|
3002 |
-
var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine)
|
3003 |
-
|
3004 |
-
var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"))
|
3005 |
-
cursor.style.left = pos.left + "px"
|
3006 |
-
cursor.style.top = pos.top + "px"
|
3007 |
-
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
|
3008 |
-
|
3009 |
-
if (pos.other) {
|
3010 |
-
// Secondary cursor, shown when on a 'jump' in bi-directional text
|
3011 |
-
var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
|
3012 |
-
otherCursor.style.display = ""
|
3013 |
-
otherCursor.style.left = pos.other.left + "px"
|
3014 |
-
otherCursor.style.top = pos.other.top + "px"
|
3015 |
-
otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"
|
3016 |
-
}
|
3017 |
-
}
|
3018 |
-
|
3019 |
-
// Draws the given range as a highlighted selection
|
3020 |
-
function drawSelectionRange(cm, range, output) {
|
3021 |
-
var display = cm.display, doc = cm.doc
|
3022 |
-
var fragment = document.createDocumentFragment()
|
3023 |
-
var padding = paddingH(cm.display), leftSide = padding.left
|
3024 |
-
var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
|
3025 |
-
|
3026 |
-
function add(left, top, width, bottom) {
|
3027 |
-
if (top < 0) { top = 0 }
|
3028 |
-
top = Math.round(top)
|
3029 |
-
bottom = Math.round(bottom)
|
3030 |
-
fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")))
|
3031 |
-
}
|
3032 |
-
|
3033 |
-
function drawForLine(line, fromArg, toArg) {
|
3034 |
-
var lineObj = getLine(doc, line)
|
3035 |
-
var lineLen = lineObj.text.length
|
3036 |
-
var start, end
|
3037 |
-
function coords(ch, bias) {
|
3038 |
-
return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
|
3039 |
-
}
|
3040 |
-
|
3041 |
-
iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {
|
3042 |
-
var leftPos = coords(from, "left"), rightPos, left, right
|
3043 |
-
if (from == to) {
|
3044 |
-
rightPos = leftPos
|
3045 |
-
left = right = leftPos.left
|
3046 |
-
} else {
|
3047 |
-
rightPos = coords(to - 1, "right")
|
3048 |
-
if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }
|
3049 |
-
left = leftPos.left
|
3050 |
-
right = rightPos.right
|
3051 |
-
}
|
3052 |
-
if (fromArg == null && from == 0) { left = leftSide }
|
3053 |
-
if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
|
3054 |
-
add(left, leftPos.top, null, leftPos.bottom)
|
3055 |
-
left = leftSide
|
3056 |
-
if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }
|
3057 |
-
}
|
3058 |
-
if (toArg == null && to == lineLen) { right = rightSide }
|
3059 |
-
if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
|
3060 |
-
{ start = leftPos }
|
3061 |
-
if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
|
3062 |
-
{ end = rightPos }
|
3063 |
-
if (left < leftSide + 1) { left = leftSide }
|
3064 |
-
add(left, rightPos.top, right - left, rightPos.bottom)
|
3065 |
-
})
|
3066 |
-
return {start: start, end: end}
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
var sFrom = range.from(), sTo = range.to()
|
3070 |
-
if (sFrom.line == sTo.line) {
|
3071 |
-
drawForLine(sFrom.line, sFrom.ch, sTo.ch)
|
3072 |
-
} else {
|
3073 |
-
var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)
|
3074 |
-
var singleVLine = visualLine(fromLine) == visualLine(toLine)
|
3075 |
-
var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end
|
3076 |
-
var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start
|
3077 |
-
if (singleVLine) {
|
3078 |
-
if (leftEnd.top < rightStart.top - 2) {
|
3079 |
-
add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)
|
3080 |
-
add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)
|
3081 |
-
} else {
|
3082 |
-
add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)
|
3083 |
-
}
|
3084 |
-
}
|
3085 |
-
if (leftEnd.bottom < rightStart.top)
|
3086 |
-
{ add(leftSide, leftEnd.bottom, null, rightStart.top) }
|
3087 |
-
}
|
3088 |
-
|
3089 |
-
output.appendChild(fragment)
|
3090 |
-
}
|
3091 |
-
|
3092 |
-
// Cursor-blinking
|
3093 |
-
function restartBlink(cm) {
|
3094 |
-
if (!cm.state.focused) { return }
|
3095 |
-
var display = cm.display
|
3096 |
-
clearInterval(display.blinker)
|
3097 |
-
var on = true
|
3098 |
-
display.cursorDiv.style.visibility = ""
|
3099 |
-
if (cm.options.cursorBlinkRate > 0)
|
3100 |
-
{ display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
|
3101 |
-
cm.options.cursorBlinkRate) }
|
3102 |
-
else if (cm.options.cursorBlinkRate < 0)
|
3103 |
-
{ display.cursorDiv.style.visibility = "hidden" }
|
3104 |
-
}
|
3105 |
-
|
3106 |
-
function ensureFocus(cm) {
|
3107 |
-
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }
|
3108 |
-
}
|
3109 |
-
|
3110 |
-
function delayBlurEvent(cm) {
|
3111 |
-
cm.state.delayingBlurEvent = true
|
3112 |
-
setTimeout(function () { if (cm.state.delayingBlurEvent) {
|
3113 |
-
cm.state.delayingBlurEvent = false
|
3114 |
-
onBlur(cm)
|
3115 |
-
} }, 100)
|
3116 |
-
}
|
3117 |
-
|
3118 |
-
function onFocus(cm, e) {
|
3119 |
-
if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }
|
3120 |
-
|
3121 |
-
if (cm.options.readOnly == "nocursor") { return }
|
3122 |
-
if (!cm.state.focused) {
|
3123 |
-
signal(cm, "focus", cm, e)
|
3124 |
-
cm.state.focused = true
|
3125 |
-
addClass(cm.display.wrapper, "CodeMirror-focused")
|
3126 |
-
// This test prevents this from firing when a context
|
3127 |
-
// menu is closed (since the input reset would kill the
|
3128 |
-
// select-all detection hack)
|
3129 |
-
if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
|
3130 |
-
cm.display.input.reset()
|
3131 |
-
if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730
|
3132 |
-
}
|
3133 |
-
cm.display.input.receivedFocus()
|
3134 |
-
}
|
3135 |
-
restartBlink(cm)
|
3136 |
-
}
|
3137 |
-
function onBlur(cm, e) {
|
3138 |
-
if (cm.state.delayingBlurEvent) { return }
|
3139 |
-
|
3140 |
-
if (cm.state.focused) {
|
3141 |
-
signal(cm, "blur", cm, e)
|
3142 |
-
cm.state.focused = false
|
3143 |
-
rmClass(cm.display.wrapper, "CodeMirror-focused")
|
3144 |
-
}
|
3145 |
-
clearInterval(cm.display.blinker)
|
3146 |
-
setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)
|
3147 |
-
}
|
3148 |
-
|
3149 |
-
// Read the actual heights of the rendered lines, and update their
|
3150 |
-
// stored heights to match.
|
3151 |
-
function updateHeightsInViewport(cm) {
|
3152 |
-
var display = cm.display
|
3153 |
-
var prevBottom = display.lineDiv.offsetTop
|
3154 |
-
for (var i = 0; i < display.view.length; i++) {
|
3155 |
-
var cur = display.view[i], height = (void 0)
|
3156 |
-
if (cur.hidden) { continue }
|
3157 |
-
if (ie && ie_version < 8) {
|
3158 |
-
var bot = cur.node.offsetTop + cur.node.offsetHeight
|
3159 |
-
height = bot - prevBottom
|
3160 |
-
prevBottom = bot
|
3161 |
-
} else {
|
3162 |
-
var box = cur.node.getBoundingClientRect()
|
3163 |
-
height = box.bottom - box.top
|
3164 |
-
}
|
3165 |
-
var diff = cur.line.height - height
|
3166 |
-
if (height < 2) { height = textHeight(display) }
|
3167 |
-
if (diff > .001 || diff < -.001) {
|
3168 |
-
updateLineHeight(cur.line, height)
|
3169 |
-
updateWidgetHeight(cur.line)
|
3170 |
-
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
|
3171 |
-
{ updateWidgetHeight(cur.rest[j]) } }
|
3172 |
-
}
|
3173 |
-
}
|
3174 |
-
}
|
3175 |
-
|
3176 |
-
// Read and store the height of line widgets associated with the
|
3177 |
-
// given line.
|
3178 |
-
function updateWidgetHeight(line) {
|
3179 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)
|
3180 |
-
{ line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }
|
3181 |
-
}
|
3182 |
-
|
3183 |
-
// Compute the lines that are visible in a given viewport (defaults
|
3184 |
-
// the the current scroll position). viewport may contain top,
|
3185 |
-
// height, and ensure (see op.scrollToPos) properties.
|
3186 |
-
function visibleLines(display, doc, viewport) {
|
3187 |
-
var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop
|
3188 |
-
top = Math.floor(top - paddingTop(display))
|
3189 |
-
var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight
|
3190 |
-
|
3191 |
-
var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)
|
3192 |
-
// Ensure is a {from: {line, ch}, to: {line, ch}} object, and
|
3193 |
-
// forces those lines into the viewport (if possible).
|
3194 |
-
if (viewport && viewport.ensure) {
|
3195 |
-
var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line
|
3196 |
-
if (ensureFrom < from) {
|
3197 |
-
from = ensureFrom
|
3198 |
-
to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)
|
3199 |
-
} else if (Math.min(ensureTo, doc.lastLine()) >= to) {
|
3200 |
-
from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)
|
3201 |
-
to = ensureTo
|
3202 |
-
}
|
3203 |
-
}
|
3204 |
-
return {from: from, to: Math.max(to, from + 1)}
|
3205 |
-
}
|
3206 |
-
|
3207 |
-
// Re-align line numbers and gutter marks to compensate for
|
3208 |
-
// horizontal scrolling.
|
3209 |
-
function alignHorizontally(cm) {
|
3210 |
-
var display = cm.display, view = display.view
|
3211 |
-
if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
|
3212 |
-
var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
|
3213 |
-
var gutterW = display.gutters.offsetWidth, left = comp + "px"
|
3214 |
-
for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
|
3215 |
-
if (cm.options.fixedGutter) {
|
3216 |
-
if (view[i].gutter)
|
3217 |
-
{ view[i].gutter.style.left = left }
|
3218 |
-
if (view[i].gutterBackground)
|
3219 |
-
{ view[i].gutterBackground.style.left = left }
|
3220 |
-
}
|
3221 |
-
var align = view[i].alignable
|
3222 |
-
if (align) { for (var j = 0; j < align.length; j++)
|
3223 |
-
{ align[j].style.left = left } }
|
3224 |
-
} }
|
3225 |
-
if (cm.options.fixedGutter)
|
3226 |
-
{ display.gutters.style.left = (comp + gutterW) + "px" }
|
3227 |
-
}
|
3228 |
-
|
3229 |
-
// Used to ensure that the line number gutter is still the right
|
3230 |
-
// size for the current document size. Returns true when an update
|
3231 |
-
// is needed.
|
3232 |
-
function maybeUpdateLineNumberWidth(cm) {
|
3233 |
-
if (!cm.options.lineNumbers) { return false }
|
3234 |
-
var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
|
3235 |
-
if (last.length != display.lineNumChars) {
|
3236 |
-
var test = display.measure.appendChild(elt("div", [elt("div", last)],
|
3237 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt"))
|
3238 |
-
var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
|
3239 |
-
display.lineGutter.style.width = ""
|
3240 |
-
display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
|
3241 |
-
display.lineNumWidth = display.lineNumInnerWidth + padding
|
3242 |
-
display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
|
3243 |
-
display.lineGutter.style.width = display.lineNumWidth + "px"
|
3244 |
-
updateGutterSpace(cm)
|
3245 |
-
return true
|
3246 |
-
}
|
3247 |
-
return false
|
3248 |
-
}
|
3249 |
-
|
3250 |
-
// SCROLLING THINGS INTO VIEW
|
3251 |
-
|
3252 |
-
// If an editor sits on the top or bottom of the window, partially
|
3253 |
-
// scrolled out of view, this ensures that the cursor is visible.
|
3254 |
-
function maybeScrollWindow(cm, rect) {
|
3255 |
-
if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
|
3256 |
-
|
3257 |
-
var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
|
3258 |
-
if (rect.top + box.top < 0) { doScroll = true }
|
3259 |
-
else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
|
3260 |
-
if (doScroll != null && !phantom) {
|
3261 |
-
var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"))
|
3262 |
-
cm.display.lineSpace.appendChild(scrollNode)
|
3263 |
-
scrollNode.scrollIntoView(doScroll)
|
3264 |
-
cm.display.lineSpace.removeChild(scrollNode)
|
3265 |
-
}
|
3266 |
-
}
|
3267 |
-
|
3268 |
-
// Scroll a given position into view (immediately), verifying that
|
3269 |
-
// it actually became visible (as line heights are accurately
|
3270 |
-
// measured, the position of something may 'drift' during drawing).
|
3271 |
-
function scrollPosIntoView(cm, pos, end, margin) {
|
3272 |
-
if (margin == null) { margin = 0 }
|
3273 |
-
var rect
|
3274 |
-
for (var limit = 0; limit < 5; limit++) {
|
3275 |
-
var changed = false
|
3276 |
-
var coords = cursorCoords(cm, pos)
|
3277 |
-
var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
|
3278 |
-
rect = {left: Math.min(coords.left, endCoords.left),
|
3279 |
-
top: Math.min(coords.top, endCoords.top) - margin,
|
3280 |
-
right: Math.max(coords.left, endCoords.left),
|
3281 |
-
bottom: Math.max(coords.bottom, endCoords.bottom) + margin}
|
3282 |
-
var scrollPos = calculateScrollPos(cm, rect)
|
3283 |
-
var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
|
3284 |
-
if (scrollPos.scrollTop != null) {
|
3285 |
-
updateScrollTop(cm, scrollPos.scrollTop)
|
3286 |
-
if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
|
3287 |
-
}
|
3288 |
-
if (scrollPos.scrollLeft != null) {
|
3289 |
-
setScrollLeft(cm, scrollPos.scrollLeft)
|
3290 |
-
if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
|
3291 |
-
}
|
3292 |
-
if (!changed) { break }
|
3293 |
-
}
|
3294 |
-
return rect
|
3295 |
-
}
|
3296 |
-
|
3297 |
-
// Scroll a given set of coordinates into view (immediately).
|
3298 |
-
function scrollIntoView(cm, rect) {
|
3299 |
-
var scrollPos = calculateScrollPos(cm, rect)
|
3300 |
-
if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) }
|
3301 |
-
if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
|
3302 |
-
}
|
3303 |
-
|
3304 |
-
// Calculate a new scroll position needed to scroll the given
|
3305 |
-
// rectangle into view. Returns an object with scrollTop and
|
3306 |
-
// scrollLeft properties. When these are undefined, the
|
3307 |
-
// vertical/horizontal position does not need to be adjusted.
|
3308 |
-
function calculateScrollPos(cm, rect) {
|
3309 |
-
var display = cm.display, snapMargin = textHeight(cm.display)
|
3310 |
-
if (rect.top < 0) { rect.top = 0 }
|
3311 |
-
var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
|
3312 |
-
var screen = displayHeight(cm), result = {}
|
3313 |
-
if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }
|
3314 |
-
var docBottom = cm.doc.height + paddingVert(display)
|
3315 |
-
var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin
|
3316 |
-
if (rect.top < screentop) {
|
3317 |
-
result.scrollTop = atTop ? 0 : rect.top
|
3318 |
-
} else if (rect.bottom > screentop + screen) {
|
3319 |
-
var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)
|
3320 |
-
if (newTop != screentop) { result.scrollTop = newTop }
|
3321 |
-
}
|
3322 |
-
|
3323 |
-
var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
|
3324 |
-
var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
|
3325 |
-
var tooWide = rect.right - rect.left > screenw
|
3326 |
-
if (tooWide) { rect.right = rect.left + screenw }
|
3327 |
-
if (rect.left < 10)
|
3328 |
-
{ result.scrollLeft = 0 }
|
3329 |
-
else if (rect.left < screenleft)
|
3330 |
-
{ result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }
|
3331 |
-
else if (rect.right > screenw + screenleft - 3)
|
3332 |
-
{ result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }
|
3333 |
-
return result
|
3334 |
-
}
|
3335 |
-
|
3336 |
-
// Store a relative adjustment to the scroll position in the current
|
3337 |
-
// operation (to be applied when the operation finishes).
|
3338 |
-
function addToScrollTop(cm, top) {
|
3339 |
-
if (top == null) { return }
|
3340 |
-
resolveScrollToPos(cm)
|
3341 |
-
cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top
|
3342 |
-
}
|
3343 |
-
|
3344 |
-
// Make sure that at the end of the operation the current cursor is
|
3345 |
-
// shown.
|
3346 |
-
function ensureCursorVisible(cm) {
|
3347 |
-
resolveScrollToPos(cm)
|
3348 |
-
var cur = cm.getCursor(), from = cur, to = cur
|
3349 |
-
if (!cm.options.lineWrapping) {
|
3350 |
-
from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur
|
3351 |
-
to = Pos(cur.line, cur.ch + 1)
|
3352 |
-
}
|
3353 |
-
cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin}
|
3354 |
-
}
|
3355 |
-
|
3356 |
-
function scrollToCoords(cm, x, y) {
|
3357 |
-
if (x != null || y != null) { resolveScrollToPos(cm) }
|
3358 |
-
if (x != null) { cm.curOp.scrollLeft = x }
|
3359 |
-
if (y != null) { cm.curOp.scrollTop = y }
|
3360 |
-
}
|
3361 |
-
|
3362 |
-
function scrollToRange(cm, range) {
|
3363 |
-
resolveScrollToPos(cm)
|
3364 |
-
cm.curOp.scrollToPos = range
|
3365 |
-
}
|
3366 |
-
|
3367 |
-
// When an operation has its scrollToPos property set, and another
|
3368 |
-
// scroll action is applied before the end of the operation, this
|
3369 |
-
// 'simulates' scrolling that position into view in a cheap way, so
|
3370 |
-
// that the effect of intermediate scroll commands is not ignored.
|
3371 |
-
function resolveScrollToPos(cm) {
|
3372 |
-
var range = cm.curOp.scrollToPos
|
3373 |
-
if (range) {
|
3374 |
-
cm.curOp.scrollToPos = null
|
3375 |
-
var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
|
3376 |
-
scrollToCoordsRange(cm, from, to, range.margin)
|
3377 |
-
}
|
3378 |
-
}
|
3379 |
-
|
3380 |
-
function scrollToCoordsRange(cm, from, to, margin) {
|
3381 |
-
var sPos = calculateScrollPos(cm, {
|
3382 |
-
left: Math.min(from.left, to.left),
|
3383 |
-
top: Math.min(from.top, to.top) - margin,
|
3384 |
-
right: Math.max(from.right, to.right),
|
3385 |
-
bottom: Math.max(from.bottom, to.bottom) + margin
|
3386 |
-
})
|
3387 |
-
scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)
|
3388 |
-
}
|
3389 |
-
|
3390 |
-
// Sync the scrollable area and scrollbars, ensure the viewport
|
3391 |
-
// covers the visible area.
|
3392 |
-
function updateScrollTop(cm, val) {
|
3393 |
-
if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
|
3394 |
-
if (!gecko) { updateDisplaySimple(cm, {top: val}) }
|
3395 |
-
setScrollTop(cm, val, true)
|
3396 |
-
if (gecko) { updateDisplaySimple(cm) }
|
3397 |
-
startWorker(cm, 100)
|
3398 |
-
}
|
3399 |
-
|
3400 |
-
function setScrollTop(cm, val, forceScroll) {
|
3401 |
-
val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)
|
3402 |
-
if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
|
3403 |
-
cm.doc.scrollTop = val
|
3404 |
-
cm.display.scrollbars.setScrollTop(val)
|
3405 |
-
if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
|
3406 |
-
}
|
3407 |
-
|
3408 |
-
// Sync scroller and scrollbar, ensure the gutter elements are
|
3409 |
-
// aligned.
|
3410 |
-
function setScrollLeft(cm, val, isScroller, forceScroll) {
|
3411 |
-
val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
|
3412 |
-
if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
|
3413 |
-
cm.doc.scrollLeft = val
|
3414 |
-
alignHorizontally(cm)
|
3415 |
-
if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
|
3416 |
-
cm.display.scrollbars.setScrollLeft(val)
|
3417 |
-
}
|
3418 |
-
|
3419 |
-
// SCROLLBARS
|
3420 |
-
|
3421 |
-
// Prepare DOM reads needed to update the scrollbars. Done in one
|
3422 |
-
// shot to minimize update/measure roundtrips.
|
3423 |
-
function measureForScrollbars(cm) {
|
3424 |
-
var d = cm.display, gutterW = d.gutters.offsetWidth
|
3425 |
-
var docH = Math.round(cm.doc.height + paddingVert(cm.display))
|
3426 |
-
return {
|
3427 |
-
clientHeight: d.scroller.clientHeight,
|
3428 |
-
viewHeight: d.wrapper.clientHeight,
|
3429 |
-
scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
|
3430 |
-
viewWidth: d.wrapper.clientWidth,
|
3431 |
-
barLeft: cm.options.fixedGutter ? gutterW : 0,
|
3432 |
-
docHeight: docH,
|
3433 |
-
scrollHeight: docH + scrollGap(cm) + d.barHeight,
|
3434 |
-
nativeBarWidth: d.nativeBarWidth,
|
3435 |
-
gutterWidth: gutterW
|
3436 |
-
}
|
3437 |
-
}
|
3438 |
-
|
3439 |
-
var NativeScrollbars = function(place, scroll, cm) {
|
3440 |
-
this.cm = cm
|
3441 |
-
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
|
3442 |
-
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
|
3443 |
-
place(vert); place(horiz)
|
3444 |
-
|
3445 |
-
on(vert, "scroll", function () {
|
3446 |
-
if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") }
|
3447 |
-
})
|
3448 |
-
on(horiz, "scroll", function () {
|
3449 |
-
if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") }
|
3450 |
-
})
|
3451 |
-
|
3452 |
-
this.checkedZeroWidth = false
|
3453 |
-
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
|
3454 |
-
if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
|
3455 |
-
};
|
3456 |
-
|
3457 |
-
NativeScrollbars.prototype.update = function (measure) {
|
3458 |
-
var needsH = measure.scrollWidth > measure.clientWidth + 1
|
3459 |
-
var needsV = measure.scrollHeight > measure.clientHeight + 1
|
3460 |
-
var sWidth = measure.nativeBarWidth
|
3461 |
-
|
3462 |
-
if (needsV) {
|
3463 |
-
this.vert.style.display = "block"
|
3464 |
-
this.vert.style.bottom = needsH ? sWidth + "px" : "0"
|
3465 |
-
var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
|
3466 |
-
// A bug in IE8 can cause this value to be negative, so guard it.
|
3467 |
-
this.vert.firstChild.style.height =
|
3468 |
-
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
|
3469 |
-
} else {
|
3470 |
-
this.vert.style.display = ""
|
3471 |
-
this.vert.firstChild.style.height = "0"
|
3472 |
-
}
|
3473 |
-
|
3474 |
-
if (needsH) {
|
3475 |
-
this.horiz.style.display = "block"
|
3476 |
-
this.horiz.style.right = needsV ? sWidth + "px" : "0"
|
3477 |
-
this.horiz.style.left = measure.barLeft + "px"
|
3478 |
-
var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
|
3479 |
-
this.horiz.firstChild.style.width =
|
3480 |
-
Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
|
3481 |
-
} else {
|
3482 |
-
this.horiz.style.display = ""
|
3483 |
-
this.horiz.firstChild.style.width = "0"
|
3484 |
-
}
|
3485 |
-
|
3486 |
-
if (!this.checkedZeroWidth && measure.clientHeight > 0) {
|
3487 |
-
if (sWidth == 0) { this.zeroWidthHack() }
|
3488 |
-
this.checkedZeroWidth = true
|
3489 |
-
}
|
3490 |
-
|
3491 |
-
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
|
3492 |
-
};
|
3493 |
-
|
3494 |
-
NativeScrollbars.prototype.setScrollLeft = function (pos) {
|
3495 |
-
if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
|
3496 |
-
if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") }
|
3497 |
-
};
|
3498 |
-
|
3499 |
-
NativeScrollbars.prototype.setScrollTop = function (pos) {
|
3500 |
-
if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
|
3501 |
-
if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") }
|
3502 |
-
};
|
3503 |
-
|
3504 |
-
NativeScrollbars.prototype.zeroWidthHack = function () {
|
3505 |
-
var w = mac && !mac_geMountainLion ? "12px" : "18px"
|
3506 |
-
this.horiz.style.height = this.vert.style.width = w
|
3507 |
-
this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
|
3508 |
-
this.disableHoriz = new Delayed
|
3509 |
-
this.disableVert = new Delayed
|
3510 |
-
};
|
3511 |
-
|
3512 |
-
NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
|
3513 |
-
bar.style.pointerEvents = "auto"
|
3514 |
-
function maybeDisable() {
|
3515 |
-
// To find out whether the scrollbar is still visible, we
|
3516 |
-
// check whether the element under the pixel in the bottom
|
3517 |
-
// right corner of the scrollbar box is the scrollbar box
|
3518 |
-
// itself (when the bar is still visible) or its filler child
|
3519 |
-
// (when the bar is hidden). If it is still visible, we keep
|
3520 |
-
// it enabled, if it's hidden, we disable pointer events.
|
3521 |
-
var box = bar.getBoundingClientRect()
|
3522 |
-
var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
|
3523 |
-
: document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)
|
3524 |
-
if (elt != bar) { bar.style.pointerEvents = "none" }
|
3525 |
-
else { delay.set(1000, maybeDisable) }
|
3526 |
-
}
|
3527 |
-
delay.set(1000, maybeDisable)
|
3528 |
-
};
|
3529 |
-
|
3530 |
-
NativeScrollbars.prototype.clear = function () {
|
3531 |
-
var parent = this.horiz.parentNode
|
3532 |
-
parent.removeChild(this.horiz)
|
3533 |
-
parent.removeChild(this.vert)
|
3534 |
-
};
|
3535 |
-
|
3536 |
-
var NullScrollbars = function () {};
|
3537 |
-
|
3538 |
-
NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
|
3539 |
-
NullScrollbars.prototype.setScrollLeft = function () {};
|
3540 |
-
NullScrollbars.prototype.setScrollTop = function () {};
|
3541 |
-
NullScrollbars.prototype.clear = function () {};
|
3542 |
-
|
3543 |
-
function updateScrollbars(cm, measure) {
|
3544 |
-
if (!measure) { measure = measureForScrollbars(cm) }
|
3545 |
-
var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight
|
3546 |
-
updateScrollbarsInner(cm, measure)
|
3547 |
-
for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
|
3548 |
-
if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
|
3549 |
-
{ updateHeightsInViewport(cm) }
|
3550 |
-
updateScrollbarsInner(cm, measureForScrollbars(cm))
|
3551 |
-
startWidth = cm.display.barWidth; startHeight = cm.display.barHeight
|
3552 |
-
}
|
3553 |
-
}
|
3554 |
-
|
3555 |
-
// Re-synchronize the fake scrollbars with the actual size of the
|
3556 |
-
// content.
|
3557 |
-
function updateScrollbarsInner(cm, measure) {
|
3558 |
-
var d = cm.display
|
3559 |
-
var sizes = d.scrollbars.update(measure)
|
3560 |
-
|
3561 |
-
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"
|
3562 |
-
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"
|
3563 |
-
d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
|
3564 |
-
|
3565 |
-
if (sizes.right && sizes.bottom) {
|
3566 |
-
d.scrollbarFiller.style.display = "block"
|
3567 |
-
d.scrollbarFiller.style.height = sizes.bottom + "px"
|
3568 |
-
d.scrollbarFiller.style.width = sizes.right + "px"
|
3569 |
-
} else { d.scrollbarFiller.style.display = "" }
|
3570 |
-
if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
|
3571 |
-
d.gutterFiller.style.display = "block"
|
3572 |
-
d.gutterFiller.style.height = sizes.bottom + "px"
|
3573 |
-
d.gutterFiller.style.width = measure.gutterWidth + "px"
|
3574 |
-
} else { d.gutterFiller.style.display = "" }
|
3575 |
-
}
|
3576 |
-
|
3577 |
-
var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}
|
3578 |
-
|
3579 |
-
function initScrollbars(cm) {
|
3580 |
-
if (cm.display.scrollbars) {
|
3581 |
-
cm.display.scrollbars.clear()
|
3582 |
-
if (cm.display.scrollbars.addClass)
|
3583 |
-
{ rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
|
3584 |
-
}
|
3585 |
-
|
3586 |
-
cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
|
3587 |
-
cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)
|
3588 |
-
// Prevent clicks in the scrollbars from killing focus
|
3589 |
-
on(node, "mousedown", function () {
|
3590 |
-
if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }
|
3591 |
-
})
|
3592 |
-
node.setAttribute("cm-not-content", "true")
|
3593 |
-
}, function (pos, axis) {
|
3594 |
-
if (axis == "horizontal") { setScrollLeft(cm, pos) }
|
3595 |
-
else { updateScrollTop(cm, pos) }
|
3596 |
-
}, cm)
|
3597 |
-
if (cm.display.scrollbars.addClass)
|
3598 |
-
{ addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
|
3599 |
-
}
|
3600 |
-
|
3601 |
-
// Operations are used to wrap a series of changes to the editor
|
3602 |
-
// state in such a way that each change won't have to update the
|
3603 |
-
// cursor and display (which would be awkward, slow, and
|
3604 |
-
// error-prone). Instead, display updates are batched and then all
|
3605 |
-
// combined and executed at once.
|
3606 |
-
|
3607 |
-
var nextOpId = 0
|
3608 |
-
// Start a new operation.
|
3609 |
-
function startOperation(cm) {
|
3610 |
-
cm.curOp = {
|
3611 |
-
cm: cm,
|
3612 |
-
viewChanged: false, // Flag that indicates that lines might need to be redrawn
|
3613 |
-
startHeight: cm.doc.height, // Used to detect need to update scrollbar
|
3614 |
-
forceUpdate: false, // Used to force a redraw
|
3615 |
-
updateInput: null, // Whether to reset the input textarea
|
3616 |
-
typing: false, // Whether this reset should be careful to leave existing text (for compositing)
|
3617 |
-
changeObjs: null, // Accumulated changes, for firing change events
|
3618 |
-
cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
|
3619 |
-
cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
|
3620 |
-
selectionChanged: false, // Whether the selection needs to be redrawn
|
3621 |
-
updateMaxLine: false, // Set when the widest line needs to be determined anew
|
3622 |
-
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
|
3623 |
-
scrollToPos: null, // Used to scroll to a specific position
|
3624 |
-
focus: false,
|
3625 |
-
id: ++nextOpId // Unique ID
|
3626 |
-
}
|
3627 |
-
pushOperation(cm.curOp)
|
3628 |
-
}
|
3629 |
-
|
3630 |
-
// Finish an operation, updating the display and signalling delayed events
|
3631 |
-
function endOperation(cm) {
|
3632 |
-
var op = cm.curOp
|
3633 |
-
finishOperation(op, function (group) {
|
3634 |
-
for (var i = 0; i < group.ops.length; i++)
|
3635 |
-
{ group.ops[i].cm.curOp = null }
|
3636 |
-
endOperations(group)
|
3637 |
-
})
|
3638 |
-
}
|
3639 |
-
|
3640 |
-
// The DOM updates done when an operation finishes are batched so
|
3641 |
-
// that the minimum number of relayouts are required.
|
3642 |
-
function endOperations(group) {
|
3643 |
-
var ops = group.ops
|
3644 |
-
for (var i = 0; i < ops.length; i++) // Read DOM
|
3645 |
-
{ endOperation_R1(ops[i]) }
|
3646 |
-
for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
|
3647 |
-
{ endOperation_W1(ops[i$1]) }
|
3648 |
-
for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
|
3649 |
-
{ endOperation_R2(ops[i$2]) }
|
3650 |
-
for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
|
3651 |
-
{ endOperation_W2(ops[i$3]) }
|
3652 |
-
for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
|
3653 |
-
{ endOperation_finish(ops[i$4]) }
|
3654 |
-
}
|
3655 |
-
|
3656 |
-
function endOperation_R1(op) {
|
3657 |
-
var cm = op.cm, display = cm.display
|
3658 |
-
maybeClipScrollbars(cm)
|
3659 |
-
if (op.updateMaxLine) { findMaxLine(cm) }
|
3660 |
-
|
3661 |
-
op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
|
3662 |
-
op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
|
3663 |
-
op.scrollToPos.to.line >= display.viewTo) ||
|
3664 |
-
display.maxLineChanged && cm.options.lineWrapping
|
3665 |
-
op.update = op.mustUpdate &&
|
3666 |
-
new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)
|
3667 |
-
}
|
3668 |
-
|
3669 |
-
function endOperation_W1(op) {
|
3670 |
-
op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)
|
3671 |
-
}
|
3672 |
-
|
3673 |
-
function endOperation_R2(op) {
|
3674 |
-
var cm = op.cm, display = cm.display
|
3675 |
-
if (op.updatedDisplay) { updateHeightsInViewport(cm) }
|
3676 |
-
|
3677 |
-
op.barMeasure = measureForScrollbars(cm)
|
3678 |
-
|
3679 |
-
// If the max line changed since it was last measured, measure it,
|
3680 |
-
// and ensure the document's width matches it.
|
3681 |
-
// updateDisplay_W2 will use these properties to do the actual resizing
|
3682 |
-
if (display.maxLineChanged && !cm.options.lineWrapping) {
|
3683 |
-
op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3
|
3684 |
-
cm.display.sizerWidth = op.adjustWidthTo
|
3685 |
-
op.barMeasure.scrollWidth =
|
3686 |
-
Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)
|
3687 |
-
op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))
|
3688 |
-
}
|
3689 |
-
|
3690 |
-
if (op.updatedDisplay || op.selectionChanged)
|
3691 |
-
{ op.preparedSelection = display.input.prepareSelection(op.focus) }
|
3692 |
-
}
|
3693 |
-
|
3694 |
-
function endOperation_W2(op) {
|
3695 |
-
var cm = op.cm
|
3696 |
-
|
3697 |
-
if (op.adjustWidthTo != null) {
|
3698 |
-
cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"
|
3699 |
-
if (op.maxScrollLeft < cm.doc.scrollLeft)
|
3700 |
-
{ setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }
|
3701 |
-
cm.display.maxLineChanged = false
|
3702 |
-
}
|
3703 |
-
|
3704 |
-
var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
|
3705 |
-
if (op.preparedSelection)
|
3706 |
-
{ cm.display.input.showSelection(op.preparedSelection, takeFocus) }
|
3707 |
-
if (op.updatedDisplay || op.startHeight != cm.doc.height)
|
3708 |
-
{ updateScrollbars(cm, op.barMeasure) }
|
3709 |
-
if (op.updatedDisplay)
|
3710 |
-
{ setDocumentHeight(cm, op.barMeasure) }
|
3711 |
-
|
3712 |
-
if (op.selectionChanged) { restartBlink(cm) }
|
3713 |
-
|
3714 |
-
if (cm.state.focused && op.updateInput)
|
3715 |
-
{ cm.display.input.reset(op.typing) }
|
3716 |
-
if (takeFocus) { ensureFocus(op.cm) }
|
3717 |
-
}
|
3718 |
-
|
3719 |
-
function endOperation_finish(op) {
|
3720 |
-
var cm = op.cm, display = cm.display, doc = cm.doc
|
3721 |
-
|
3722 |
-
if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }
|
3723 |
-
|
3724 |
-
// Abort mouse wheel delta measurement, when scrolling explicitly
|
3725 |
-
if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
|
3726 |
-
{ display.wheelStartX = display.wheelStartY = null }
|
3727 |
-
|
3728 |
-
// Propagate the scroll position to the actual DOM scroller
|
3729 |
-
if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) }
|
3730 |
-
|
3731 |
-
if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) }
|
3732 |
-
// If we need to scroll a specific position into view, do so.
|
3733 |
-
if (op.scrollToPos) {
|
3734 |
-
var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
|
3735 |
-
clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
|
3736 |
-
maybeScrollWindow(cm, rect)
|
3737 |
-
}
|
3738 |
-
|
3739 |
-
// Fire events for markers that are hidden/unidden by editing or
|
3740 |
-
// undoing
|
3741 |
-
var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers
|
3742 |
-
if (hidden) { for (var i = 0; i < hidden.length; ++i)
|
3743 |
-
{ if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } }
|
3744 |
-
if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
|
3745 |
-
{ if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } }
|
3746 |
-
|
3747 |
-
if (display.wrapper.offsetHeight)
|
3748 |
-
{ doc.scrollTop = cm.display.scroller.scrollTop }
|
3749 |
-
|
3750 |
-
// Fire change events, and delayed event handlers
|
3751 |
-
if (op.changeObjs)
|
3752 |
-
{ signal(cm, "changes", cm, op.changeObjs) }
|
3753 |
-
if (op.update)
|
3754 |
-
{ op.update.finish() }
|
3755 |
-
}
|
3756 |
-
|
3757 |
-
// Run the given function in an operation
|
3758 |
-
function runInOp(cm, f) {
|
3759 |
-
if (cm.curOp) { return f() }
|
3760 |
-
startOperation(cm)
|
3761 |
-
try { return f() }
|
3762 |
-
finally { endOperation(cm) }
|
3763 |
-
}
|
3764 |
-
// Wraps a function in an operation. Returns the wrapped function.
|
3765 |
-
function operation(cm, f) {
|
3766 |
-
return function() {
|
3767 |
-
if (cm.curOp) { return f.apply(cm, arguments) }
|
3768 |
-
startOperation(cm)
|
3769 |
-
try { return f.apply(cm, arguments) }
|
3770 |
-
finally { endOperation(cm) }
|
3771 |
-
}
|
3772 |
-
}
|
3773 |
-
// Used to add methods to editor and doc instances, wrapping them in
|
3774 |
-
// operations.
|
3775 |
-
function methodOp(f) {
|
3776 |
-
return function() {
|
3777 |
-
if (this.curOp) { return f.apply(this, arguments) }
|
3778 |
-
startOperation(this)
|
3779 |
-
try { return f.apply(this, arguments) }
|
3780 |
-
finally { endOperation(this) }
|
3781 |
-
}
|
3782 |
-
}
|
3783 |
-
function docMethodOp(f) {
|
3784 |
-
return function() {
|
3785 |
-
var cm = this.cm
|
3786 |
-
if (!cm || cm.curOp) { return f.apply(this, arguments) }
|
3787 |
-
startOperation(cm)
|
3788 |
-
try { return f.apply(this, arguments) }
|
3789 |
-
finally { endOperation(cm) }
|
3790 |
-
}
|
3791 |
-
}
|
3792 |
-
|
3793 |
-
// Updates the display.view data structure for a given change to the
|
3794 |
-
// document. From and to are in pre-change coordinates. Lendiff is
|
3795 |
-
// the amount of lines added or subtracted by the change. This is
|
3796 |
-
// used for changes that span multiple lines, or change the way
|
3797 |
-
// lines are divided into visual lines. regLineChange (below)
|
3798 |
-
// registers single-line changes.
|
3799 |
-
function regChange(cm, from, to, lendiff) {
|
3800 |
-
if (from == null) { from = cm.doc.first }
|
3801 |
-
if (to == null) { to = cm.doc.first + cm.doc.size }
|
3802 |
-
if (!lendiff) { lendiff = 0 }
|
3803 |
-
|
3804 |
-
var display = cm.display
|
3805 |
-
if (lendiff && to < display.viewTo &&
|
3806 |
-
(display.updateLineNumbers == null || display.updateLineNumbers > from))
|
3807 |
-
{ display.updateLineNumbers = from }
|
3808 |
-
|
3809 |
-
cm.curOp.viewChanged = true
|
3810 |
-
|
3811 |
-
if (from >= display.viewTo) { // Change after
|
3812 |
-
if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
|
3813 |
-
{ resetView(cm) }
|
3814 |
-
} else if (to <= display.viewFrom) { // Change before
|
3815 |
-
if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
|
3816 |
-
resetView(cm)
|
3817 |
-
} else {
|
3818 |
-
display.viewFrom += lendiff
|
3819 |
-
display.viewTo += lendiff
|
3820 |
-
}
|
3821 |
-
} else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
|
3822 |
-
resetView(cm)
|
3823 |
-
} else if (from <= display.viewFrom) { // Top overlap
|
3824 |
-
var cut = viewCuttingPoint(cm, to, to + lendiff, 1)
|
3825 |
-
if (cut) {
|
3826 |
-
display.view = display.view.slice(cut.index)
|
3827 |
-
display.viewFrom = cut.lineN
|
3828 |
-
display.viewTo += lendiff
|
3829 |
-
} else {
|
3830 |
-
resetView(cm)
|
3831 |
-
}
|
3832 |
-
} else if (to >= display.viewTo) { // Bottom overlap
|
3833 |
-
var cut$1 = viewCuttingPoint(cm, from, from, -1)
|
3834 |
-
if (cut$1) {
|
3835 |
-
display.view = display.view.slice(0, cut$1.index)
|
3836 |
-
display.viewTo = cut$1.lineN
|
3837 |
-
} else {
|
3838 |
-
resetView(cm)
|
3839 |
-
}
|
3840 |
-
} else { // Gap in the middle
|
3841 |
-
var cutTop = viewCuttingPoint(cm, from, from, -1)
|
3842 |
-
var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)
|
3843 |
-
if (cutTop && cutBot) {
|
3844 |
-
display.view = display.view.slice(0, cutTop.index)
|
3845 |
-
.concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
|
3846 |
-
.concat(display.view.slice(cutBot.index))
|
3847 |
-
display.viewTo += lendiff
|
3848 |
-
} else {
|
3849 |
-
resetView(cm)
|
3850 |
-
}
|
3851 |
-
}
|
3852 |
-
|
3853 |
-
var ext = display.externalMeasured
|
3854 |
-
if (ext) {
|
3855 |
-
if (to < ext.lineN)
|
3856 |
-
{ ext.lineN += lendiff }
|
3857 |
-
else if (from < ext.lineN + ext.size)
|
3858 |
-
{ display.externalMeasured = null }
|
3859 |
-
}
|
3860 |
-
}
|
3861 |
-
|
3862 |
-
// Register a change to a single line. Type must be one of "text",
|
3863 |
-
// "gutter", "class", "widget"
|
3864 |
-
function regLineChange(cm, line, type) {
|
3865 |
-
cm.curOp.viewChanged = true
|
3866 |
-
var display = cm.display, ext = cm.display.externalMeasured
|
3867 |
-
if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
|
3868 |
-
{ display.externalMeasured = null }
|
3869 |
-
|
3870 |
-
if (line < display.viewFrom || line >= display.viewTo) { return }
|
3871 |
-
var lineView = display.view[findViewIndex(cm, line)]
|
3872 |
-
if (lineView.node == null) { return }
|
3873 |
-
var arr = lineView.changes || (lineView.changes = [])
|
3874 |
-
if (indexOf(arr, type) == -1) { arr.push(type) }
|
3875 |
-
}
|
3876 |
-
|
3877 |
-
// Clear the view.
|
3878 |
-
function resetView(cm) {
|
3879 |
-
cm.display.viewFrom = cm.display.viewTo = cm.doc.first
|
3880 |
-
cm.display.view = []
|
3881 |
-
cm.display.viewOffset = 0
|
3882 |
-
}
|
3883 |
-
|
3884 |
-
function viewCuttingPoint(cm, oldN, newN, dir) {
|
3885 |
-
var index = findViewIndex(cm, oldN), diff, view = cm.display.view
|
3886 |
-
if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
|
3887 |
-
{ return {index: index, lineN: newN} }
|
3888 |
-
var n = cm.display.viewFrom
|
3889 |
-
for (var i = 0; i < index; i++)
|
3890 |
-
{ n += view[i].size }
|
3891 |
-
if (n != oldN) {
|
3892 |
-
if (dir > 0) {
|
3893 |
-
if (index == view.length - 1) { return null }
|
3894 |
-
diff = (n + view[index].size) - oldN
|
3895 |
-
index++
|
3896 |
-
} else {
|
3897 |
-
diff = n - oldN
|
3898 |
-
}
|
3899 |
-
oldN += diff; newN += diff
|
3900 |
-
}
|
3901 |
-
while (visualLineNo(cm.doc, newN) != newN) {
|
3902 |
-
if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
|
3903 |
-
newN += dir * view[index - (dir < 0 ? 1 : 0)].size
|
3904 |
-
index += dir
|
3905 |
-
}
|
3906 |
-
return {index: index, lineN: newN}
|
3907 |
-
}
|
3908 |
-
|
3909 |
-
// Force the view to cover a given range, adding empty view element
|
3910 |
-
// or clipping off existing ones as needed.
|
3911 |
-
function adjustView(cm, from, to) {
|
3912 |
-
var display = cm.display, view = display.view
|
3913 |
-
if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
|
3914 |
-
display.view = buildViewArray(cm, from, to)
|
3915 |
-
display.viewFrom = from
|
3916 |
-
} else {
|
3917 |
-
if (display.viewFrom > from)
|
3918 |
-
{ display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }
|
3919 |
-
else if (display.viewFrom < from)
|
3920 |
-
{ display.view = display.view.slice(findViewIndex(cm, from)) }
|
3921 |
-
display.viewFrom = from
|
3922 |
-
if (display.viewTo < to)
|
3923 |
-
{ display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }
|
3924 |
-
else if (display.viewTo > to)
|
3925 |
-
{ display.view = display.view.slice(0, findViewIndex(cm, to)) }
|
3926 |
-
}
|
3927 |
-
display.viewTo = to
|
3928 |
-
}
|
3929 |
-
|
3930 |
-
// Count the number of lines in the view whose DOM representation is
|
3931 |
-
// out of date (or nonexistent).
|
3932 |
-
function countDirtyView(cm) {
|
3933 |
-
var view = cm.display.view, dirty = 0
|
3934 |
-
for (var i = 0; i < view.length; i++) {
|
3935 |
-
var lineView = view[i]
|
3936 |
-
if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }
|
3937 |
-
}
|
3938 |
-
return dirty
|
3939 |
-
}
|
3940 |
-
|
3941 |
-
// HIGHLIGHT WORKER
|
3942 |
-
|
3943 |
-
function startWorker(cm, time) {
|
3944 |
-
if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
|
3945 |
-
{ cm.state.highlight.set(time, bind(highlightWorker, cm)) }
|
3946 |
-
}
|
3947 |
-
|
3948 |
-
function highlightWorker(cm) {
|
3949 |
-
var doc = cm.doc
|
3950 |
-
if (doc.frontier < doc.first) { doc.frontier = doc.first }
|
3951 |
-
if (doc.frontier >= cm.display.viewTo) { return }
|
3952 |
-
var end = +new Date + cm.options.workTime
|
3953 |
-
var state = copyState(doc.mode, getStateBefore(cm, doc.frontier))
|
3954 |
-
var changedLines = []
|
3955 |
-
|
3956 |
-
doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
|
3957 |
-
if (doc.frontier >= cm.display.viewFrom) { // Visible
|
3958 |
-
var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength
|
3959 |
-
var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true)
|
3960 |
-
line.styles = highlighted.styles
|
3961 |
-
var oldCls = line.styleClasses, newCls = highlighted.classes
|
3962 |
-
if (newCls) { line.styleClasses = newCls }
|
3963 |
-
else if (oldCls) { line.styleClasses = null }
|
3964 |
-
var ischange = !oldStyles || oldStyles.length != line.styles.length ||
|
3965 |
-
oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)
|
3966 |
-
for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }
|
3967 |
-
if (ischange) { changedLines.push(doc.frontier) }
|
3968 |
-
line.stateAfter = tooLong ? state : copyState(doc.mode, state)
|
3969 |
-
} else {
|
3970 |
-
if (line.text.length <= cm.options.maxHighlightLength)
|
3971 |
-
{ processLine(cm, line.text, state) }
|
3972 |
-
line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null
|
3973 |
-
}
|
3974 |
-
++doc.frontier
|
3975 |
-
if (+new Date > end) {
|
3976 |
-
startWorker(cm, cm.options.workDelay)
|
3977 |
-
return true
|
3978 |
-
}
|
3979 |
-
})
|
3980 |
-
if (changedLines.length) { runInOp(cm, function () {
|
3981 |
-
for (var i = 0; i < changedLines.length; i++)
|
3982 |
-
{ regLineChange(cm, changedLines[i], "text") }
|
3983 |
-
}) }
|
3984 |
-
}
|
3985 |
-
|
3986 |
-
// DISPLAY DRAWING
|
3987 |
-
|
3988 |
-
var DisplayUpdate = function(cm, viewport, force) {
|
3989 |
-
var display = cm.display
|
3990 |
-
|
3991 |
-
this.viewport = viewport
|
3992 |
-
// Store some values that we'll need later (but don't want to force a relayout for)
|
3993 |
-
this.visible = visibleLines(display, cm.doc, viewport)
|
3994 |
-
this.editorIsHidden = !display.wrapper.offsetWidth
|
3995 |
-
this.wrapperHeight = display.wrapper.clientHeight
|
3996 |
-
this.wrapperWidth = display.wrapper.clientWidth
|
3997 |
-
this.oldDisplayWidth = displayWidth(cm)
|
3998 |
-
this.force = force
|
3999 |
-
this.dims = getDimensions(cm)
|
4000 |
-
this.events = []
|
4001 |
-
};
|
4002 |
-
|
4003 |
-
DisplayUpdate.prototype.signal = function (emitter, type) {
|
4004 |
-
if (hasHandler(emitter, type))
|
4005 |
-
{ this.events.push(arguments) }
|
4006 |
-
};
|
4007 |
-
DisplayUpdate.prototype.finish = function () {
|
4008 |
-
var this$1 = this;
|
4009 |
-
|
4010 |
-
for (var i = 0; i < this.events.length; i++)
|
4011 |
-
{ signal.apply(null, this$1.events[i]) }
|
4012 |
-
};
|
4013 |
-
|
4014 |
-
function maybeClipScrollbars(cm) {
|
4015 |
-
var display = cm.display
|
4016 |
-
if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
|
4017 |
-
display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth
|
4018 |
-
display.heightForcer.style.height = scrollGap(cm) + "px"
|
4019 |
-
display.sizer.style.marginBottom = -display.nativeBarWidth + "px"
|
4020 |
-
display.sizer.style.borderRightWidth = scrollGap(cm) + "px"
|
4021 |
-
display.scrollbarsClipped = true
|
4022 |
-
}
|
4023 |
-
}
|
4024 |
-
|
4025 |
-
function selectionSnapshot(cm) {
|
4026 |
-
if (cm.hasFocus()) { return null }
|
4027 |
-
var active = activeElt()
|
4028 |
-
if (!active || !contains(cm.display.lineDiv, active)) { return null }
|
4029 |
-
var result = {activeElt: active}
|
4030 |
-
if (window.getSelection) {
|
4031 |
-
var sel = window.getSelection()
|
4032 |
-
if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
|
4033 |
-
result.anchorNode = sel.anchorNode
|
4034 |
-
result.anchorOffset = sel.anchorOffset
|
4035 |
-
result.focusNode = sel.focusNode
|
4036 |
-
result.focusOffset = sel.focusOffset
|
4037 |
-
}
|
4038 |
-
}
|
4039 |
-
return result
|
4040 |
-
}
|
4041 |
-
|
4042 |
-
function restoreSelection(snapshot) {
|
4043 |
-
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
|
4044 |
-
snapshot.activeElt.focus()
|
4045 |
-
if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
|
4046 |
-
var sel = window.getSelection(), range = document.createRange()
|
4047 |
-
range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)
|
4048 |
-
range.collapse(false)
|
4049 |
-
sel.removeAllRanges()
|
4050 |
-
sel.addRange(range)
|
4051 |
-
sel.extend(snapshot.focusNode, snapshot.focusOffset)
|
4052 |
-
}
|
4053 |
-
}
|
4054 |
-
|
4055 |
-
// Does the actual updating of the line display. Bails out
|
4056 |
-
// (returning false) when there is nothing to be done and forced is
|
4057 |
-
// false.
|
4058 |
-
function updateDisplayIfNeeded(cm, update) {
|
4059 |
-
var display = cm.display, doc = cm.doc
|
4060 |
-
|
4061 |
-
if (update.editorIsHidden) {
|
4062 |
-
resetView(cm)
|
4063 |
-
return false
|
4064 |
-
}
|
4065 |
-
|
4066 |
-
// Bail out if the visible area is already rendered and nothing changed.
|
4067 |
-
if (!update.force &&
|
4068 |
-
update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
|
4069 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
|
4070 |
-
display.renderedView == display.view && countDirtyView(cm) == 0)
|
4071 |
-
{ return false }
|
4072 |
-
|
4073 |
-
if (maybeUpdateLineNumberWidth(cm)) {
|
4074 |
-
resetView(cm)
|
4075 |
-
update.dims = getDimensions(cm)
|
4076 |
-
}
|
4077 |
-
|
4078 |
-
// Compute a suitable new viewport (from & to)
|
4079 |
-
var end = doc.first + doc.size
|
4080 |
-
var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)
|
4081 |
-
var to = Math.min(end, update.visible.to + cm.options.viewportMargin)
|
4082 |
-
if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }
|
4083 |
-
if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }
|
4084 |
-
if (sawCollapsedSpans) {
|
4085 |
-
from = visualLineNo(cm.doc, from)
|
4086 |
-
to = visualLineEndNo(cm.doc, to)
|
4087 |
-
}
|
4088 |
-
|
4089 |
-
var different = from != display.viewFrom || to != display.viewTo ||
|
4090 |
-
display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth
|
4091 |
-
adjustView(cm, from, to)
|
4092 |
-
|
4093 |
-
display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))
|
4094 |
-
// Position the mover div to align with the current scroll position
|
4095 |
-
cm.display.mover.style.top = display.viewOffset + "px"
|
4096 |
-
|
4097 |
-
var toUpdate = countDirtyView(cm)
|
4098 |
-
if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
|
4099 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
|
4100 |
-
{ return false }
|
4101 |
-
|
4102 |
-
// For big changes, we hide the enclosing element during the
|
4103 |
-
// update, since that speeds up the operations on most browsers.
|
4104 |
-
var selSnapshot = selectionSnapshot(cm)
|
4105 |
-
if (toUpdate > 4) { display.lineDiv.style.display = "none" }
|
4106 |
-
patchDisplay(cm, display.updateLineNumbers, update.dims)
|
4107 |
-
if (toUpdate > 4) { display.lineDiv.style.display = "" }
|
4108 |
-
display.renderedView = display.view
|
4109 |
-
// There might have been a widget with a focused element that got
|
4110 |
-
// hidden or updated, if so re-focus it.
|
4111 |
-
restoreSelection(selSnapshot)
|
4112 |
-
|
4113 |
-
// Prevent selection and cursors from interfering with the scroll
|
4114 |
-
// width and height.
|
4115 |
-
removeChildren(display.cursorDiv)
|
4116 |
-
removeChildren(display.selectionDiv)
|
4117 |
-
display.gutters.style.height = display.sizer.style.minHeight = 0
|
4118 |
-
|
4119 |
-
if (different) {
|
4120 |
-
display.lastWrapHeight = update.wrapperHeight
|
4121 |
-
display.lastWrapWidth = update.wrapperWidth
|
4122 |
-
startWorker(cm, 400)
|
4123 |
-
}
|
4124 |
-
|
4125 |
-
display.updateLineNumbers = null
|
4126 |
-
|
4127 |
-
return true
|
4128 |
-
}
|
4129 |
-
|
4130 |
-
function postUpdateDisplay(cm, update) {
|
4131 |
-
var viewport = update.viewport
|
4132 |
-
|
4133 |
-
for (var first = true;; first = false) {
|
4134 |
-
if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
|
4135 |
-
// Clip forced viewport to actual scrollable area.
|
4136 |
-
if (viewport && viewport.top != null)
|
4137 |
-
{ viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }
|
4138 |
-
// Updated line heights might result in the drawn area not
|
4139 |
-
// actually covering the viewport. Keep looping until it does.
|
4140 |
-
update.visible = visibleLines(cm.display, cm.doc, viewport)
|
4141 |
-
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
|
4142 |
-
{ break }
|
4143 |
-
}
|
4144 |
-
if (!updateDisplayIfNeeded(cm, update)) { break }
|
4145 |
-
updateHeightsInViewport(cm)
|
4146 |
-
var barMeasure = measureForScrollbars(cm)
|
4147 |
-
updateSelection(cm)
|
4148 |
-
updateScrollbars(cm, barMeasure)
|
4149 |
-
setDocumentHeight(cm, barMeasure)
|
4150 |
-
}
|
4151 |
-
|
4152 |
-
update.signal(cm, "update", cm)
|
4153 |
-
if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
|
4154 |
-
update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo)
|
4155 |
-
cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo
|
4156 |
-
}
|
4157 |
-
}
|
4158 |
-
|
4159 |
-
function updateDisplaySimple(cm, viewport) {
|
4160 |
-
var update = new DisplayUpdate(cm, viewport)
|
4161 |
-
if (updateDisplayIfNeeded(cm, update)) {
|
4162 |
-
updateHeightsInViewport(cm)
|
4163 |
-
postUpdateDisplay(cm, update)
|
4164 |
-
var barMeasure = measureForScrollbars(cm)
|
4165 |
-
updateSelection(cm)
|
4166 |
-
updateScrollbars(cm, barMeasure)
|
4167 |
-
setDocumentHeight(cm, barMeasure)
|
4168 |
-
update.finish()
|
4169 |
-
}
|
4170 |
-
}
|
4171 |
-
|
4172 |
-
// Sync the actual display DOM structure with display.view, removing
|
4173 |
-
// nodes for lines that are no longer in view, and creating the ones
|
4174 |
-
// that are not there yet, and updating the ones that are out of
|
4175 |
-
// date.
|
4176 |
-
function patchDisplay(cm, updateNumbersFrom, dims) {
|
4177 |
-
var display = cm.display, lineNumbers = cm.options.lineNumbers
|
4178 |
-
var container = display.lineDiv, cur = container.firstChild
|
4179 |
-
|
4180 |
-
function rm(node) {
|
4181 |
-
var next = node.nextSibling
|
4182 |
-
// Works around a throw-scroll bug in OS X Webkit
|
4183 |
-
if (webkit && mac && cm.display.currentWheelTarget == node)
|
4184 |
-
{ node.style.display = "none" }
|
4185 |
-
else
|
4186 |
-
{ node.parentNode.removeChild(node) }
|
4187 |
-
return next
|
4188 |
-
}
|
4189 |
-
|
4190 |
-
var view = display.view, lineN = display.viewFrom
|
4191 |
-
// Loop over the elements in the view, syncing cur (the DOM nodes
|
4192 |
-
// in display.lineDiv) with the view as we go.
|
4193 |
-
for (var i = 0; i < view.length; i++) {
|
4194 |
-
var lineView = view[i]
|
4195 |
-
if (lineView.hidden) {
|
4196 |
-
} else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
|
4197 |
-
var node = buildLineElement(cm, lineView, lineN, dims)
|
4198 |
-
container.insertBefore(node, cur)
|
4199 |
-
} else { // Already drawn
|
4200 |
-
while (cur != lineView.node) { cur = rm(cur) }
|
4201 |
-
var updateNumber = lineNumbers && updateNumbersFrom != null &&
|
4202 |
-
updateNumbersFrom <= lineN && lineView.lineNumber
|
4203 |
-
if (lineView.changes) {
|
4204 |
-
if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false }
|
4205 |
-
updateLineForChanges(cm, lineView, lineN, dims)
|
4206 |
-
}
|
4207 |
-
if (updateNumber) {
|
4208 |
-
removeChildren(lineView.lineNumber)
|
4209 |
-
lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))
|
4210 |
-
}
|
4211 |
-
cur = lineView.node.nextSibling
|
4212 |
-
}
|
4213 |
-
lineN += lineView.size
|
4214 |
-
}
|
4215 |
-
while (cur) { cur = rm(cur) }
|
4216 |
-
}
|
4217 |
-
|
4218 |
-
function updateGutterSpace(cm) {
|
4219 |
-
var width = cm.display.gutters.offsetWidth
|
4220 |
-
cm.display.sizer.style.marginLeft = width + "px"
|
4221 |
-
}
|
4222 |
-
|
4223 |
-
function setDocumentHeight(cm, measure) {
|
4224 |
-
cm.display.sizer.style.minHeight = measure.docHeight + "px"
|
4225 |
-
cm.display.heightForcer.style.top = measure.docHeight + "px"
|
4226 |
-
cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"
|
4227 |
-
}
|
4228 |
-
|
4229 |
-
// Rebuild the gutter elements, ensure the margin to the left of the
|
4230 |
-
// code matches their width.
|
4231 |
-
function updateGutters(cm) {
|
4232 |
-
var gutters = cm.display.gutters, specs = cm.options.gutters
|
4233 |
-
removeChildren(gutters)
|
4234 |
-
var i = 0
|
4235 |
-
for (; i < specs.length; ++i) {
|
4236 |
-
var gutterClass = specs[i]
|
4237 |
-
var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass))
|
4238 |
-
if (gutterClass == "CodeMirror-linenumbers") {
|
4239 |
-
cm.display.lineGutter = gElt
|
4240 |
-
gElt.style.width = (cm.display.lineNumWidth || 1) + "px"
|
4241 |
-
}
|
4242 |
-
}
|
4243 |
-
gutters.style.display = i ? "" : "none"
|
4244 |
-
updateGutterSpace(cm)
|
4245 |
-
}
|
4246 |
-
|
4247 |
-
// Make sure the gutters options contains the element
|
4248 |
-
// "CodeMirror-linenumbers" when the lineNumbers option is true.
|
4249 |
-
function setGuttersForLineNumbers(options) {
|
4250 |
-
var found = indexOf(options.gutters, "CodeMirror-linenumbers")
|
4251 |
-
if (found == -1 && options.lineNumbers) {
|
4252 |
-
options.gutters = options.gutters.concat(["CodeMirror-linenumbers"])
|
4253 |
-
} else if (found > -1 && !options.lineNumbers) {
|
4254 |
-
options.gutters = options.gutters.slice(0)
|
4255 |
-
options.gutters.splice(found, 1)
|
4256 |
-
}
|
4257 |
-
}
|
4258 |
-
|
4259 |
-
var wheelSamples = 0;
|
4260 |
-
var wheelPixelsPerUnit = null;
|
4261 |
-
// Fill in a browser-detected starting value on browsers where we
|
4262 |
-
// know one. These don't have to be accurate -- the result of them
|
4263 |
-
// being wrong would just be a slight flicker on the first wheel
|
4264 |
-
// scroll (if it is large enough).
|
4265 |
-
if (ie) { wheelPixelsPerUnit = -.53 }
|
4266 |
-
else if (gecko) { wheelPixelsPerUnit = 15 }
|
4267 |
-
else if (chrome) { wheelPixelsPerUnit = -.7 }
|
4268 |
-
else if (safari) { wheelPixelsPerUnit = -1/3 }
|
4269 |
-
|
4270 |
-
function wheelEventDelta(e) {
|
4271 |
-
var dx = e.wheelDeltaX, dy = e.wheelDeltaY
|
4272 |
-
if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
|
4273 |
-
if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
|
4274 |
-
else if (dy == null) { dy = e.wheelDelta }
|
4275 |
-
return {x: dx, y: dy}
|
4276 |
-
}
|
4277 |
-
function wheelEventPixels(e) {
|
4278 |
-
var delta = wheelEventDelta(e)
|
4279 |
-
delta.x *= wheelPixelsPerUnit
|
4280 |
-
delta.y *= wheelPixelsPerUnit
|
4281 |
-
return delta
|
4282 |
-
}
|
4283 |
-
|
4284 |
-
function onScrollWheel(cm, e) {
|
4285 |
-
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
|
4286 |
-
|
4287 |
-
var display = cm.display, scroll = display.scroller
|
4288 |
-
// Quit if there's nothing to scroll here
|
4289 |
-
var canScrollX = scroll.scrollWidth > scroll.clientWidth
|
4290 |
-
var canScrollY = scroll.scrollHeight > scroll.clientHeight
|
4291 |
-
if (!(dx && canScrollX || dy && canScrollY)) { return }
|
4292 |
-
|
4293 |
-
// Webkit browsers on OS X abort momentum scrolls when the target
|
4294 |
-
// of the scroll event is removed from the scrollable element.
|
4295 |
-
// This hack (see related code in patchDisplay) makes sure the
|
4296 |
-
// element is kept around.
|
4297 |
-
if (dy && mac && webkit) {
|
4298 |
-
outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
|
4299 |
-
for (var i = 0; i < view.length; i++) {
|
4300 |
-
if (view[i].node == cur) {
|
4301 |
-
cm.display.currentWheelTarget = cur
|
4302 |
-
break outer
|
4303 |
-
}
|
4304 |
-
}
|
4305 |
-
}
|
4306 |
-
}
|
4307 |
-
|
4308 |
-
// On some browsers, horizontal scrolling will cause redraws to
|
4309 |
-
// happen before the gutter has been realigned, causing it to
|
4310 |
-
// wriggle around in a most unseemly way. When we have an
|
4311 |
-
// estimated pixels/delta value, we just handle horizontal
|
4312 |
-
// scrolling entirely here. It'll be slightly off from native, but
|
4313 |
-
// better than glitching out.
|
4314 |
-
if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
|
4315 |
-
if (dy && canScrollY)
|
4316 |
-
{ updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) }
|
4317 |
-
setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))
|
4318 |
-
// Only prevent default scrolling if vertical scrolling is
|
4319 |
-
// actually possible. Otherwise, it causes vertical scroll
|
4320 |
-
// jitter on OSX trackpads when deltaX is small and deltaY
|
4321 |
-
// is large (issue #3579)
|
4322 |
-
if (!dy || (dy && canScrollY))
|
4323 |
-
{ e_preventDefault(e) }
|
4324 |
-
display.wheelStartX = null // Abort measurement, if in progress
|
4325 |
-
return
|
4326 |
-
}
|
4327 |
-
|
4328 |
-
// 'Project' the visible viewport to cover the area that is being
|
4329 |
-
// scrolled into view (if we know enough to estimate it).
|
4330 |
-
if (dy && wheelPixelsPerUnit != null) {
|
4331 |
-
var pixels = dy * wheelPixelsPerUnit
|
4332 |
-
var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
|
4333 |
-
if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
|
4334 |
-
else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
|
4335 |
-
updateDisplaySimple(cm, {top: top, bottom: bot})
|
4336 |
-
}
|
4337 |
-
|
4338 |
-
if (wheelSamples < 20) {
|
4339 |
-
if (display.wheelStartX == null) {
|
4340 |
-
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
|
4341 |
-
display.wheelDX = dx; display.wheelDY = dy
|
4342 |
-
setTimeout(function () {
|
4343 |
-
if (display.wheelStartX == null) { return }
|
4344 |
-
var movedX = scroll.scrollLeft - display.wheelStartX
|
4345 |
-
var movedY = scroll.scrollTop - display.wheelStartY
|
4346 |
-
var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
|
4347 |
-
(movedX && display.wheelDX && movedX / display.wheelDX)
|
4348 |
-
display.wheelStartX = display.wheelStartY = null
|
4349 |
-
if (!sample) { return }
|
4350 |
-
wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
|
4351 |
-
++wheelSamples
|
4352 |
-
}, 200)
|
4353 |
-
} else {
|
4354 |
-
display.wheelDX += dx; display.wheelDY += dy
|
4355 |
-
}
|
4356 |
-
}
|
4357 |
-
}
|
4358 |
-
|
4359 |
-
// Selection objects are immutable. A new one is created every time
|
4360 |
-
// the selection changes. A selection is one or more non-overlapping
|
4361 |
-
// (and non-touching) ranges, sorted, and an integer that indicates
|
4362 |
-
// which one is the primary selection (the one that's scrolled into
|
4363 |
-
// view, that getCursor returns, etc).
|
4364 |
-
var Selection = function(ranges, primIndex) {
|
4365 |
-
this.ranges = ranges
|
4366 |
-
this.primIndex = primIndex
|
4367 |
-
};
|
4368 |
-
|
4369 |
-
Selection.prototype.primary = function () { return this.ranges[this.primIndex] };
|
4370 |
-
|
4371 |
-
Selection.prototype.equals = function (other) {
|
4372 |
-
var this$1 = this;
|
4373 |
-
|
4374 |
-
if (other == this) { return true }
|
4375 |
-
if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
|
4376 |
-
for (var i = 0; i < this.ranges.length; i++) {
|
4377 |
-
var here = this$1.ranges[i], there = other.ranges[i]
|
4378 |
-
if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }
|
4379 |
-
}
|
4380 |
-
return true
|
4381 |
-
};
|
4382 |
-
|
4383 |
-
Selection.prototype.deepCopy = function () {
|
4384 |
-
var this$1 = this;
|
4385 |
-
|
4386 |
-
var out = []
|
4387 |
-
for (var i = 0; i < this.ranges.length; i++)
|
4388 |
-
{ out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }
|
4389 |
-
return new Selection(out, this.primIndex)
|
4390 |
-
};
|
4391 |
-
|
4392 |
-
Selection.prototype.somethingSelected = function () {
|
4393 |
-
var this$1 = this;
|
4394 |
-
|
4395 |
-
for (var i = 0; i < this.ranges.length; i++)
|
4396 |
-
{ if (!this$1.ranges[i].empty()) { return true } }
|
4397 |
-
return false
|
4398 |
-
};
|
4399 |
-
|
4400 |
-
Selection.prototype.contains = function (pos, end) {
|
4401 |
-
var this$1 = this;
|
4402 |
-
|
4403 |
-
if (!end) { end = pos }
|
4404 |
-
for (var i = 0; i < this.ranges.length; i++) {
|
4405 |
-
var range = this$1.ranges[i]
|
4406 |
-
if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
|
4407 |
-
{ return i }
|
4408 |
-
}
|
4409 |
-
return -1
|
4410 |
-
};
|
4411 |
-
|
4412 |
-
var Range = function(anchor, head) {
|
4413 |
-
this.anchor = anchor; this.head = head
|
4414 |
-
};
|
4415 |
-
|
4416 |
-
Range.prototype.from = function () { return minPos(this.anchor, this.head) };
|
4417 |
-
Range.prototype.to = function () { return maxPos(this.anchor, this.head) };
|
4418 |
-
Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };
|
4419 |
-
|
4420 |
-
// Take an unsorted, potentially overlapping set of ranges, and
|
4421 |
-
// build a selection out of it. 'Consumes' ranges array (modifying
|
4422 |
-
// it).
|
4423 |
-
function normalizeSelection(ranges, primIndex) {
|
4424 |
-
var prim = ranges[primIndex]
|
4425 |
-
ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })
|
4426 |
-
primIndex = indexOf(ranges, prim)
|
4427 |
-
for (var i = 1; i < ranges.length; i++) {
|
4428 |
-
var cur = ranges[i], prev = ranges[i - 1]
|
4429 |
-
if (cmp(prev.to(), cur.from()) >= 0) {
|
4430 |
-
var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())
|
4431 |
-
var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head
|
4432 |
-
if (i <= primIndex) { --primIndex }
|
4433 |
-
ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))
|
4434 |
-
}
|
4435 |
-
}
|
4436 |
-
return new Selection(ranges, primIndex)
|
4437 |
-
}
|
4438 |
-
|
4439 |
-
function simpleSelection(anchor, head) {
|
4440 |
-
return new Selection([new Range(anchor, head || anchor)], 0)
|
4441 |
-
}
|
4442 |
-
|
4443 |
-
// Compute the position of the end of a change (its 'to' property
|
4444 |
-
// refers to the pre-change end).
|
4445 |
-
function changeEnd(change) {
|
4446 |
-
if (!change.text) { return change.to }
|
4447 |
-
return Pos(change.from.line + change.text.length - 1,
|
4448 |
-
lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
|
4449 |
-
}
|
4450 |
-
|
4451 |
-
// Adjust a position to refer to the post-change position of the
|
4452 |
-
// same text, or the end of the change if the change covers it.
|
4453 |
-
function adjustForChange(pos, change) {
|
4454 |
-
if (cmp(pos, change.from) < 0) { return pos }
|
4455 |
-
if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
|
4456 |
-
|
4457 |
-
var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch
|
4458 |
-
if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }
|
4459 |
-
return Pos(line, ch)
|
4460 |
-
}
|
4461 |
-
|
4462 |
-
function computeSelAfterChange(doc, change) {
|
4463 |
-
var out = []
|
4464 |
-
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
4465 |
-
var range = doc.sel.ranges[i]
|
4466 |
-
out.push(new Range(adjustForChange(range.anchor, change),
|
4467 |
-
adjustForChange(range.head, change)))
|
4468 |
-
}
|
4469 |
-
return normalizeSelection(out, doc.sel.primIndex)
|
4470 |
-
}
|
4471 |
-
|
4472 |
-
function offsetPos(pos, old, nw) {
|
4473 |
-
if (pos.line == old.line)
|
4474 |
-
{ return Pos(nw.line, pos.ch - old.ch + nw.ch) }
|
4475 |
-
else
|
4476 |
-
{ return Pos(nw.line + (pos.line - old.line), pos.ch) }
|
4477 |
-
}
|
4478 |
-
|
4479 |
-
// Used by replaceSelections to allow moving the selection to the
|
4480 |
-
// start or around the replaced test. Hint may be "start" or "around".
|
4481 |
-
function computeReplacedSel(doc, changes, hint) {
|
4482 |
-
var out = []
|
4483 |
-
var oldPrev = Pos(doc.first, 0), newPrev = oldPrev
|
4484 |
-
for (var i = 0; i < changes.length; i++) {
|
4485 |
-
var change = changes[i]
|
4486 |
-
var from = offsetPos(change.from, oldPrev, newPrev)
|
4487 |
-
var to = offsetPos(changeEnd(change), oldPrev, newPrev)
|
4488 |
-
oldPrev = change.to
|
4489 |
-
newPrev = to
|
4490 |
-
if (hint == "around") {
|
4491 |
-
var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0
|
4492 |
-
out[i] = new Range(inv ? to : from, inv ? from : to)
|
4493 |
-
} else {
|
4494 |
-
out[i] = new Range(from, from)
|
4495 |
-
}
|
4496 |
-
}
|
4497 |
-
return new Selection(out, doc.sel.primIndex)
|
4498 |
-
}
|
4499 |
-
|
4500 |
-
// Used to get the editor into a consistent state again when options change.
|
4501 |
-
|
4502 |
-
function loadMode(cm) {
|
4503 |
-
cm.doc.mode = getMode(cm.options, cm.doc.modeOption)
|
4504 |
-
resetModeState(cm)
|
4505 |
-
}
|
4506 |
-
|
4507 |
-
function resetModeState(cm) {
|
4508 |
-
cm.doc.iter(function (line) {
|
4509 |
-
if (line.stateAfter) { line.stateAfter = null }
|
4510 |
-
if (line.styles) { line.styles = null }
|
4511 |
-
})
|
4512 |
-
cm.doc.frontier = cm.doc.first
|
4513 |
-
startWorker(cm, 100)
|
4514 |
-
cm.state.modeGen++
|
4515 |
-
if (cm.curOp) { regChange(cm) }
|
4516 |
-
}
|
4517 |
-
|
4518 |
-
// DOCUMENT DATA STRUCTURE
|
4519 |
-
|
4520 |
-
// By default, updates that start and end at the beginning of a line
|
4521 |
-
// are treated specially, in order to make the association of line
|
4522 |
-
// widgets and marker elements with the text behave more intuitive.
|
4523 |
-
function isWholeLineUpdate(doc, change) {
|
4524 |
-
return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
|
4525 |
-
(!doc.cm || doc.cm.options.wholeLineUpdateBefore)
|
4526 |
-
}
|
4527 |
-
|
4528 |
-
// Perform a change on the document data structure.
|
4529 |
-
function updateDoc(doc, change, markedSpans, estimateHeight) {
|
4530 |
-
function spansFor(n) {return markedSpans ? markedSpans[n] : null}
|
4531 |
-
function update(line, text, spans) {
|
4532 |
-
updateLine(line, text, spans, estimateHeight)
|
4533 |
-
signalLater(line, "change", line, change)
|
4534 |
-
}
|
4535 |
-
function linesFor(start, end) {
|
4536 |
-
var result = []
|
4537 |
-
for (var i = start; i < end; ++i)
|
4538 |
-
{ result.push(new Line(text[i], spansFor(i), estimateHeight)) }
|
4539 |
-
return result
|
4540 |
-
}
|
4541 |
-
|
4542 |
-
var from = change.from, to = change.to, text = change.text
|
4543 |
-
var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)
|
4544 |
-
var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line
|
4545 |
-
|
4546 |
-
// Adjust the line structure
|
4547 |
-
if (change.full) {
|
4548 |
-
doc.insert(0, linesFor(0, text.length))
|
4549 |
-
doc.remove(text.length, doc.size - text.length)
|
4550 |
-
} else if (isWholeLineUpdate(doc, change)) {
|
4551 |
-
// This is a whole-line replace. Treated specially to make
|
4552 |
-
// sure line objects move the way they are supposed to.
|
4553 |
-
var added = linesFor(0, text.length - 1)
|
4554 |
-
update(lastLine, lastLine.text, lastSpans)
|
4555 |
-
if (nlines) { doc.remove(from.line, nlines) }
|
4556 |
-
if (added.length) { doc.insert(from.line, added) }
|
4557 |
-
} else if (firstLine == lastLine) {
|
4558 |
-
if (text.length == 1) {
|
4559 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)
|
4560 |
-
} else {
|
4561 |
-
var added$1 = linesFor(1, text.length - 1)
|
4562 |
-
added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))
|
4563 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
|
4564 |
-
doc.insert(from.line + 1, added$1)
|
4565 |
-
}
|
4566 |
-
} else if (text.length == 1) {
|
4567 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))
|
4568 |
-
doc.remove(from.line + 1, nlines)
|
4569 |
-
} else {
|
4570 |
-
update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
|
4571 |
-
update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)
|
4572 |
-
var added$2 = linesFor(1, text.length - 1)
|
4573 |
-
if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }
|
4574 |
-
doc.insert(from.line + 1, added$2)
|
4575 |
-
}
|
4576 |
-
|
4577 |
-
signalLater(doc, "change", doc, change)
|
4578 |
-
}
|
4579 |
-
|
4580 |
-
// Call f for all linked documents.
|
4581 |
-
function linkedDocs(doc, f, sharedHistOnly) {
|
4582 |
-
function propagate(doc, skip, sharedHist) {
|
4583 |
-
if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
|
4584 |
-
var rel = doc.linked[i]
|
4585 |
-
if (rel.doc == skip) { continue }
|
4586 |
-
var shared = sharedHist && rel.sharedHist
|
4587 |
-
if (sharedHistOnly && !shared) { continue }
|
4588 |
-
f(rel.doc, shared)
|
4589 |
-
propagate(rel.doc, doc, shared)
|
4590 |
-
} }
|
4591 |
-
}
|
4592 |
-
propagate(doc, null, true)
|
4593 |
-
}
|
4594 |
-
|
4595 |
-
// Attach a document to an editor.
|
4596 |
-
function attachDoc(cm, doc) {
|
4597 |
-
if (doc.cm) { throw new Error("This document is already in use.") }
|
4598 |
-
cm.doc = doc
|
4599 |
-
doc.cm = cm
|
4600 |
-
estimateLineHeights(cm)
|
4601 |
-
loadMode(cm)
|
4602 |
-
setDirectionClass(cm)
|
4603 |
-
if (!cm.options.lineWrapping) { findMaxLine(cm) }
|
4604 |
-
cm.options.mode = doc.modeOption
|
4605 |
-
regChange(cm)
|
4606 |
-
}
|
4607 |
-
|
4608 |
-
function setDirectionClass(cm) {
|
4609 |
-
;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl")
|
4610 |
-
}
|
4611 |
-
|
4612 |
-
function directionChanged(cm) {
|
4613 |
-
runInOp(cm, function () {
|
4614 |
-
setDirectionClass(cm)
|
4615 |
-
regChange(cm)
|
4616 |
-
})
|
4617 |
-
}
|
4618 |
-
|
4619 |
-
function History(startGen) {
|
4620 |
-
// Arrays of change events and selections. Doing something adds an
|
4621 |
-
// event to done and clears undo. Undoing moves events from done
|
4622 |
-
// to undone, redoing moves them in the other direction.
|
4623 |
-
this.done = []; this.undone = []
|
4624 |
-
this.undoDepth = Infinity
|
4625 |
-
// Used to track when changes can be merged into a single undo
|
4626 |
-
// event
|
4627 |
-
this.lastModTime = this.lastSelTime = 0
|
4628 |
-
this.lastOp = this.lastSelOp = null
|
4629 |
-
this.lastOrigin = this.lastSelOrigin = null
|
4630 |
-
// Used by the isClean() method
|
4631 |
-
this.generation = this.maxGeneration = startGen || 1
|
4632 |
-
}
|
4633 |
-
|
4634 |
-
// Create a history change event from an updateDoc-style change
|
4635 |
-
// object.
|
4636 |
-
function historyChangeFromChange(doc, change) {
|
4637 |
-
var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}
|
4638 |
-
attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)
|
4639 |
-
linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)
|
4640 |
-
return histChange
|
4641 |
-
}
|
4642 |
-
|
4643 |
-
// Pop all selection events off the end of a history array. Stop at
|
4644 |
-
// a change event.
|
4645 |
-
function clearSelectionEvents(array) {
|
4646 |
-
while (array.length) {
|
4647 |
-
var last = lst(array)
|
4648 |
-
if (last.ranges) { array.pop() }
|
4649 |
-
else { break }
|
4650 |
-
}
|
4651 |
-
}
|
4652 |
-
|
4653 |
-
// Find the top change event in the history. Pop off selection
|
4654 |
-
// events that are in the way.
|
4655 |
-
function lastChangeEvent(hist, force) {
|
4656 |
-
if (force) {
|
4657 |
-
clearSelectionEvents(hist.done)
|
4658 |
-
return lst(hist.done)
|
4659 |
-
} else if (hist.done.length && !lst(hist.done).ranges) {
|
4660 |
-
return lst(hist.done)
|
4661 |
-
} else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
|
4662 |
-
hist.done.pop()
|
4663 |
-
return lst(hist.done)
|
4664 |
-
}
|
4665 |
-
}
|
4666 |
-
|
4667 |
-
// Register a change in the history. Merges changes that are within
|
4668 |
-
// a single operation, or are close together with an origin that
|
4669 |
-
// allows merging (starting with "+") into a single event.
|
4670 |
-
function addChangeToHistory(doc, change, selAfter, opId) {
|
4671 |
-
var hist = doc.history
|
4672 |
-
hist.undone.length = 0
|
4673 |
-
var time = +new Date, cur
|
4674 |
-
var last
|
4675 |
-
|
4676 |
-
if ((hist.lastOp == opId ||
|
4677 |
-
hist.lastOrigin == change.origin && change.origin &&
|
4678 |
-
((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
|
4679 |
-
change.origin.charAt(0) == "*")) &&
|
4680 |
-
(cur = lastChangeEvent(hist, hist.lastOp == opId))) {
|
4681 |
-
// Merge this change into the last event
|
4682 |
-
last = lst(cur.changes)
|
4683 |
-
if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
|
4684 |
-
// Optimized case for simple insertion -- don't want to add
|
4685 |
-
// new changesets for every character typed
|
4686 |
-
last.to = changeEnd(change)
|
4687 |
-
} else {
|
4688 |
-
// Add new sub-event
|
4689 |
-
cur.changes.push(historyChangeFromChange(doc, change))
|
4690 |
-
}
|
4691 |
-
} else {
|
4692 |
-
// Can not be merged, start a new event.
|
4693 |
-
var before = lst(hist.done)
|
4694 |
-
if (!before || !before.ranges)
|
4695 |
-
{ pushSelectionToHistory(doc.sel, hist.done) }
|
4696 |
-
cur = {changes: [historyChangeFromChange(doc, change)],
|
4697 |
-
generation: hist.generation}
|
4698 |
-
hist.done.push(cur)
|
4699 |
-
while (hist.done.length > hist.undoDepth) {
|
4700 |
-
hist.done.shift()
|
4701 |
-
if (!hist.done[0].ranges) { hist.done.shift() }
|
4702 |
-
}
|
4703 |
-
}
|
4704 |
-
hist.done.push(selAfter)
|
4705 |
-
hist.generation = ++hist.maxGeneration
|
4706 |
-
hist.lastModTime = hist.lastSelTime = time
|
4707 |
-
hist.lastOp = hist.lastSelOp = opId
|
4708 |
-
hist.lastOrigin = hist.lastSelOrigin = change.origin
|
4709 |
-
|
4710 |
-
if (!last) { signal(doc, "historyAdded") }
|
4711 |
-
}
|
4712 |
-
|
4713 |
-
function selectionEventCanBeMerged(doc, origin, prev, sel) {
|
4714 |
-
var ch = origin.charAt(0)
|
4715 |
-
return ch == "*" ||
|
4716 |
-
ch == "+" &&
|
4717 |
-
prev.ranges.length == sel.ranges.length &&
|
4718 |
-
prev.somethingSelected() == sel.somethingSelected() &&
|
4719 |
-
new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
|
4720 |
-
}
|
4721 |
-
|
4722 |
-
// Called whenever the selection changes, sets the new selection as
|
4723 |
-
// the pending selection in the history, and pushes the old pending
|
4724 |
-
// selection into the 'done' array when it was significantly
|
4725 |
-
// different (in number of selected ranges, emptiness, or time).
|
4726 |
-
function addSelectionToHistory(doc, sel, opId, options) {
|
4727 |
-
var hist = doc.history, origin = options && options.origin
|
4728 |
-
|
4729 |
-
// A new event is started when the previous origin does not match
|
4730 |
-
// the current, or the origins don't allow matching. Origins
|
4731 |
-
// starting with * are always merged, those starting with + are
|
4732 |
-
// merged when similar and close together in time.
|
4733 |
-
if (opId == hist.lastSelOp ||
|
4734 |
-
(origin && hist.lastSelOrigin == origin &&
|
4735 |
-
(hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
|
4736 |
-
selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
|
4737 |
-
{ hist.done[hist.done.length - 1] = sel }
|
4738 |
-
else
|
4739 |
-
{ pushSelectionToHistory(sel, hist.done) }
|
4740 |
-
|
4741 |
-
hist.lastSelTime = +new Date
|
4742 |
-
hist.lastSelOrigin = origin
|
4743 |
-
hist.lastSelOp = opId
|
4744 |
-
if (options && options.clearRedo !== false)
|
4745 |
-
{ clearSelectionEvents(hist.undone) }
|
4746 |
-
}
|
4747 |
-
|
4748 |
-
function pushSelectionToHistory(sel, dest) {
|
4749 |
-
var top = lst(dest)
|
4750 |
-
if (!(top && top.ranges && top.equals(sel)))
|
4751 |
-
{ dest.push(sel) }
|
4752 |
-
}
|
4753 |
-
|
4754 |
-
// Used to store marked span information in the history.
|
4755 |
-
function attachLocalSpans(doc, change, from, to) {
|
4756 |
-
var existing = change["spans_" + doc.id], n = 0
|
4757 |
-
doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
|
4758 |
-
if (line.markedSpans)
|
4759 |
-
{ (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans }
|
4760 |
-
++n
|
4761 |
-
})
|
4762 |
-
}
|
4763 |
-
|
4764 |
-
// When un/re-doing restores text containing marked spans, those
|
4765 |
-
// that have been explicitly cleared should not be restored.
|
4766 |
-
function removeClearedSpans(spans) {
|
4767 |
-
if (!spans) { return null }
|
4768 |
-
var out
|
4769 |
-
for (var i = 0; i < spans.length; ++i) {
|
4770 |
-
if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }
|
4771 |
-
else if (out) { out.push(spans[i]) }
|
4772 |
-
}
|
4773 |
-
return !out ? spans : out.length ? out : null
|
4774 |
-
}
|
4775 |
-
|
4776 |
-
// Retrieve and filter the old marked spans stored in a change event.
|
4777 |
-
function getOldSpans(doc, change) {
|
4778 |
-
var found = change["spans_" + doc.id]
|
4779 |
-
if (!found) { return null }
|
4780 |
-
var nw = []
|
4781 |
-
for (var i = 0; i < change.text.length; ++i)
|
4782 |
-
{ nw.push(removeClearedSpans(found[i])) }
|
4783 |
-
return nw
|
4784 |
-
}
|
4785 |
-
|
4786 |
-
// Used for un/re-doing changes from the history. Combines the
|
4787 |
-
// result of computing the existing spans with the set of spans that
|
4788 |
-
// existed in the history (so that deleting around a span and then
|
4789 |
-
// undoing brings back the span).
|
4790 |
-
function mergeOldSpans(doc, change) {
|
4791 |
-
var old = getOldSpans(doc, change)
|
4792 |
-
var stretched = stretchSpansOverChange(doc, change)
|
4793 |
-
if (!old) { return stretched }
|
4794 |
-
if (!stretched) { return old }
|
4795 |
-
|
4796 |
-
for (var i = 0; i < old.length; ++i) {
|
4797 |
-
var oldCur = old[i], stretchCur = stretched[i]
|
4798 |
-
if (oldCur && stretchCur) {
|
4799 |
-
spans: for (var j = 0; j < stretchCur.length; ++j) {
|
4800 |
-
var span = stretchCur[j]
|
4801 |
-
for (var k = 0; k < oldCur.length; ++k)
|
4802 |
-
{ if (oldCur[k].marker == span.marker) { continue spans } }
|
4803 |
-
oldCur.push(span)
|
4804 |
-
}
|
4805 |
-
} else if (stretchCur) {
|
4806 |
-
old[i] = stretchCur
|
4807 |
-
}
|
4808 |
-
}
|
4809 |
-
return old
|
4810 |
-
}
|
4811 |
-
|
4812 |
-
// Used both to provide a JSON-safe object in .getHistory, and, when
|
4813 |
-
// detaching a document, to split the history in two
|
4814 |
-
function copyHistoryArray(events, newGroup, instantiateSel) {
|
4815 |
-
var copy = []
|
4816 |
-
for (var i = 0; i < events.length; ++i) {
|
4817 |
-
var event = events[i]
|
4818 |
-
if (event.ranges) {
|
4819 |
-
copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)
|
4820 |
-
continue
|
4821 |
-
}
|
4822 |
-
var changes = event.changes, newChanges = []
|
4823 |
-
copy.push({changes: newChanges})
|
4824 |
-
for (var j = 0; j < changes.length; ++j) {
|
4825 |
-
var change = changes[j], m = (void 0)
|
4826 |
-
newChanges.push({from: change.from, to: change.to, text: change.text})
|
4827 |
-
if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
|
4828 |
-
if (indexOf(newGroup, Number(m[1])) > -1) {
|
4829 |
-
lst(newChanges)[prop] = change[prop]
|
4830 |
-
delete change[prop]
|
4831 |
-
}
|
4832 |
-
} } }
|
4833 |
-
}
|
4834 |
-
}
|
4835 |
-
return copy
|
4836 |
-
}
|
4837 |
-
|
4838 |
-
// The 'scroll' parameter given to many of these indicated whether
|
4839 |
-
// the new cursor position should be scrolled into view after
|
4840 |
-
// modifying the selection.
|
4841 |
-
|
4842 |
-
// If shift is held or the extend flag is set, extends a range to
|
4843 |
-
// include a given position (and optionally a second position).
|
4844 |
-
// Otherwise, simply returns the range between the given positions.
|
4845 |
-
// Used for cursor motion and such.
|
4846 |
-
function extendRange(doc, range, head, other) {
|
4847 |
-
if (doc.cm && doc.cm.display.shift || doc.extend) {
|
4848 |
-
var anchor = range.anchor
|
4849 |
-
if (other) {
|
4850 |
-
var posBefore = cmp(head, anchor) < 0
|
4851 |
-
if (posBefore != (cmp(other, anchor) < 0)) {
|
4852 |
-
anchor = head
|
4853 |
-
head = other
|
4854 |
-
} else if (posBefore != (cmp(head, other) < 0)) {
|
4855 |
-
head = other
|
4856 |
-
}
|
4857 |
-
}
|
4858 |
-
return new Range(anchor, head)
|
4859 |
-
} else {
|
4860 |
-
return new Range(other || head, head)
|
4861 |
-
}
|
4862 |
-
}
|
4863 |
-
|
4864 |
-
// Extend the primary selection range, discard the rest.
|
4865 |
-
function extendSelection(doc, head, other, options) {
|
4866 |
-
setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options)
|
4867 |
-
}
|
4868 |
-
|
4869 |
-
// Extend all selections (pos is an array of selections with length
|
4870 |
-
// equal the number of selections)
|
4871 |
-
function extendSelections(doc, heads, options) {
|
4872 |
-
var out = []
|
4873 |
-
for (var i = 0; i < doc.sel.ranges.length; i++)
|
4874 |
-
{ out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) }
|
4875 |
-
var newSel = normalizeSelection(out, doc.sel.primIndex)
|
4876 |
-
setSelection(doc, newSel, options)
|
4877 |
-
}
|
4878 |
-
|
4879 |
-
// Updates a single range in the selection.
|
4880 |
-
function replaceOneSelection(doc, i, range, options) {
|
4881 |
-
var ranges = doc.sel.ranges.slice(0)
|
4882 |
-
ranges[i] = range
|
4883 |
-
setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)
|
4884 |
-
}
|
4885 |
-
|
4886 |
-
// Reset the selection to a single range.
|
4887 |
-
function setSimpleSelection(doc, anchor, head, options) {
|
4888 |
-
setSelection(doc, simpleSelection(anchor, head), options)
|
4889 |
-
}
|
4890 |
-
|
4891 |
-
// Give beforeSelectionChange handlers a change to influence a
|
4892 |
-
// selection update.
|
4893 |
-
function filterSelectionChange(doc, sel, options) {
|
4894 |
-
var obj = {
|
4895 |
-
ranges: sel.ranges,
|
4896 |
-
update: function(ranges) {
|
4897 |
-
var this$1 = this;
|
4898 |
-
|
4899 |
-
this.ranges = []
|
4900 |
-
for (var i = 0; i < ranges.length; i++)
|
4901 |
-
{ this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
|
4902 |
-
clipPos(doc, ranges[i].head)) }
|
4903 |
-
},
|
4904 |
-
origin: options && options.origin
|
4905 |
-
}
|
4906 |
-
signal(doc, "beforeSelectionChange", doc, obj)
|
4907 |
-
if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) }
|
4908 |
-
if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }
|
4909 |
-
else { return sel }
|
4910 |
-
}
|
4911 |
-
|
4912 |
-
function setSelectionReplaceHistory(doc, sel, options) {
|
4913 |
-
var done = doc.history.done, last = lst(done)
|
4914 |
-
if (last && last.ranges) {
|
4915 |
-
done[done.length - 1] = sel
|
4916 |
-
setSelectionNoUndo(doc, sel, options)
|
4917 |
-
} else {
|
4918 |
-
setSelection(doc, sel, options)
|
4919 |
-
}
|
4920 |
-
}
|
4921 |
-
|
4922 |
-
// Set a new selection.
|
4923 |
-
function setSelection(doc, sel, options) {
|
4924 |
-
setSelectionNoUndo(doc, sel, options)
|
4925 |
-
addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)
|
4926 |
-
}
|
4927 |
-
|
4928 |
-
function setSelectionNoUndo(doc, sel, options) {
|
4929 |
-
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
|
4930 |
-
{ sel = filterSelectionChange(doc, sel, options) }
|
4931 |
-
|
4932 |
-
var bias = options && options.bias ||
|
4933 |
-
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)
|
4934 |
-
setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))
|
4935 |
-
|
4936 |
-
if (!(options && options.scroll === false) && doc.cm)
|
4937 |
-
{ ensureCursorVisible(doc.cm) }
|
4938 |
-
}
|
4939 |
-
|
4940 |
-
function setSelectionInner(doc, sel) {
|
4941 |
-
if (sel.equals(doc.sel)) { return }
|
4942 |
-
|
4943 |
-
doc.sel = sel
|
4944 |
-
|
4945 |
-
if (doc.cm) {
|
4946 |
-
doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true
|
4947 |
-
signalCursorActivity(doc.cm)
|
4948 |
-
}
|
4949 |
-
signalLater(doc, "cursorActivity", doc)
|
4950 |
-
}
|
4951 |
-
|
4952 |
-
// Verify that the selection does not partially select any atomic
|
4953 |
-
// marked ranges.
|
4954 |
-
function reCheckSelection(doc) {
|
4955 |
-
setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false))
|
4956 |
-
}
|
4957 |
-
|
4958 |
-
// Return a selection that does not partially select any atomic
|
4959 |
-
// ranges.
|
4960 |
-
function skipAtomicInSelection(doc, sel, bias, mayClear) {
|
4961 |
-
var out
|
4962 |
-
for (var i = 0; i < sel.ranges.length; i++) {
|
4963 |
-
var range = sel.ranges[i]
|
4964 |
-
var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]
|
4965 |
-
var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)
|
4966 |
-
var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)
|
4967 |
-
if (out || newAnchor != range.anchor || newHead != range.head) {
|
4968 |
-
if (!out) { out = sel.ranges.slice(0, i) }
|
4969 |
-
out[i] = new Range(newAnchor, newHead)
|
4970 |
-
}
|
4971 |
-
}
|
4972 |
-
return out ? normalizeSelection(out, sel.primIndex) : sel
|
4973 |
-
}
|
4974 |
-
|
4975 |
-
function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
|
4976 |
-
var line = getLine(doc, pos.line)
|
4977 |
-
if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
|
4978 |
-
var sp = line.markedSpans[i], m = sp.marker
|
4979 |
-
if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
|
4980 |
-
(sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
|
4981 |
-
if (mayClear) {
|
4982 |
-
signal(m, "beforeCursorEnter")
|
4983 |
-
if (m.explicitlyCleared) {
|
4984 |
-
if (!line.markedSpans) { break }
|
4985 |
-
else {--i; continue}
|
4986 |
-
}
|
4987 |
-
}
|
4988 |
-
if (!m.atomic) { continue }
|
4989 |
-
|
4990 |
-
if (oldPos) {
|
4991 |
-
var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)
|
4992 |
-
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
|
4993 |
-
{ near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }
|
4994 |
-
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
|
4995 |
-
{ return skipAtomicInner(doc, near, pos, dir, mayClear) }
|
4996 |
-
}
|
4997 |
-
|
4998 |
-
var far = m.find(dir < 0 ? -1 : 1)
|
4999 |
-
if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
|
5000 |
-
{ far = movePos(doc, far, dir, far.line == pos.line ? line : null) }
|
5001 |
-
return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
|
5002 |
-
}
|
5003 |
-
} }
|
5004 |
-
return pos
|
5005 |
-
}
|
5006 |
-
|
5007 |
-
// Ensure a given position is not inside an atomic range.
|
5008 |
-
function skipAtomic(doc, pos, oldPos, bias, mayClear) {
|
5009 |
-
var dir = bias || 1
|
5010 |
-
var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
|
5011 |
-
(!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
|
5012 |
-
skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
|
5013 |
-
(!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))
|
5014 |
-
if (!found) {
|
5015 |
-
doc.cantEdit = true
|
5016 |
-
return Pos(doc.first, 0)
|
5017 |
-
}
|
5018 |
-
return found
|
5019 |
-
}
|
5020 |
-
|
5021 |
-
function movePos(doc, pos, dir, line) {
|
5022 |
-
if (dir < 0 && pos.ch == 0) {
|
5023 |
-
if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
|
5024 |
-
else { return null }
|
5025 |
-
} else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
|
5026 |
-
if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
|
5027 |
-
else { return null }
|
5028 |
-
} else {
|
5029 |
-
return new Pos(pos.line, pos.ch + dir)
|
5030 |
-
}
|
5031 |
-
}
|
5032 |
-
|
5033 |
-
function selectAll(cm) {
|
5034 |
-
cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)
|
5035 |
-
}
|
5036 |
-
|
5037 |
-
// UPDATING
|
5038 |
-
|
5039 |
-
// Allow "beforeChange" event handlers to influence a change
|
5040 |
-
function filterChange(doc, change, update) {
|
5041 |
-
var obj = {
|
5042 |
-
canceled: false,
|
5043 |
-
from: change.from,
|
5044 |
-
to: change.to,
|
5045 |
-
text: change.text,
|
5046 |
-
origin: change.origin,
|
5047 |
-
cancel: function () { return obj.canceled = true; }
|
5048 |
-
}
|
5049 |
-
if (update) { obj.update = function (from, to, text, origin) {
|
5050 |
-
if (from) { obj.from = clipPos(doc, from) }
|
5051 |
-
if (to) { obj.to = clipPos(doc, to) }
|
5052 |
-
if (text) { obj.text = text }
|
5053 |
-
if (origin !== undefined) { obj.origin = origin }
|
5054 |
-
} }
|
5055 |
-
signal(doc, "beforeChange", doc, obj)
|
5056 |
-
if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) }
|
5057 |
-
|
5058 |
-
if (obj.canceled) { return null }
|
5059 |
-
return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
|
5060 |
-
}
|
5061 |
-
|
5062 |
-
// Apply a change to a document, and add it to the document's
|
5063 |
-
// history, and propagating it to all linked documents.
|
5064 |
-
function makeChange(doc, change, ignoreReadOnly) {
|
5065 |
-
if (doc.cm) {
|
5066 |
-
if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
|
5067 |
-
if (doc.cm.state.suppressEdits) { return }
|
5068 |
-
}
|
5069 |
-
|
5070 |
-
if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
|
5071 |
-
change = filterChange(doc, change, true)
|
5072 |
-
if (!change) { return }
|
5073 |
-
}
|
5074 |
-
|
5075 |
-
// Possibly split or suppress the update based on the presence
|
5076 |
-
// of read-only spans in its range.
|
5077 |
-
var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)
|
5078 |
-
if (split) {
|
5079 |
-
for (var i = split.length - 1; i >= 0; --i)
|
5080 |
-
{ makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}) }
|
5081 |
-
} else {
|
5082 |
-
makeChangeInner(doc, change)
|
5083 |
-
}
|
5084 |
-
}
|
5085 |
-
|
5086 |
-
function makeChangeInner(doc, change) {
|
5087 |
-
if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
|
5088 |
-
var selAfter = computeSelAfterChange(doc, change)
|
5089 |
-
addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)
|
5090 |
-
|
5091 |
-
makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))
|
5092 |
-
var rebased = []
|
5093 |
-
|
5094 |
-
linkedDocs(doc, function (doc, sharedHist) {
|
5095 |
-
if (!sharedHist && indexOf(rebased, doc.history) == -1) {
|
5096 |
-
rebaseHist(doc.history, change)
|
5097 |
-
rebased.push(doc.history)
|
5098 |
-
}
|
5099 |
-
makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))
|
5100 |
-
})
|
5101 |
-
}
|
5102 |
-
|
5103 |
-
// Revert a change stored in a document's history.
|
5104 |
-
function makeChangeFromHistory(doc, type, allowSelectionOnly) {
|
5105 |
-
if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }
|
5106 |
-
|
5107 |
-
var hist = doc.history, event, selAfter = doc.sel
|
5108 |
-
var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
|
5109 |
-
|
5110 |
-
// Verify that there is a useable event (so that ctrl-z won't
|
5111 |
-
// needlessly clear selection events)
|
5112 |
-
var i = 0
|
5113 |
-
for (; i < source.length; i++) {
|
5114 |
-
event = source[i]
|
5115 |
-
if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
|
5116 |
-
{ break }
|
5117 |
-
}
|
5118 |
-
if (i == source.length) { return }
|
5119 |
-
hist.lastOrigin = hist.lastSelOrigin = null
|
5120 |
-
|
5121 |
-
for (;;) {
|
5122 |
-
event = source.pop()
|
5123 |
-
if (event.ranges) {
|
5124 |
-
pushSelectionToHistory(event, dest)
|
5125 |
-
if (allowSelectionOnly && !event.equals(doc.sel)) {
|
5126 |
-
setSelection(doc, event, {clearRedo: false})
|
5127 |
-
return
|
5128 |
-
}
|
5129 |
-
selAfter = event
|
5130 |
-
}
|
5131 |
-
else { break }
|
5132 |
-
}
|
5133 |
-
|
5134 |
-
// Build up a reverse change object to add to the opposite history
|
5135 |
-
// stack (redo when undoing, and vice versa).
|
5136 |
-
var antiChanges = []
|
5137 |
-
pushSelectionToHistory(selAfter, dest)
|
5138 |
-
dest.push({changes: antiChanges, generation: hist.generation})
|
5139 |
-
hist.generation = event.generation || ++hist.maxGeneration
|
5140 |
-
|
5141 |
-
var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")
|
5142 |
-
|
5143 |
-
var loop = function ( i ) {
|
5144 |
-
var change = event.changes[i]
|
5145 |
-
change.origin = type
|
5146 |
-
if (filter && !filterChange(doc, change, false)) {
|
5147 |
-
source.length = 0
|
5148 |
-
return {}
|
5149 |
-
}
|
5150 |
-
|
5151 |
-
antiChanges.push(historyChangeFromChange(doc, change))
|
5152 |
-
|
5153 |
-
var after = i ? computeSelAfterChange(doc, change) : lst(source)
|
5154 |
-
makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))
|
5155 |
-
if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }
|
5156 |
-
var rebased = []
|
5157 |
-
|
5158 |
-
// Propagate to the linked documents
|
5159 |
-
linkedDocs(doc, function (doc, sharedHist) {
|
5160 |
-
if (!sharedHist && indexOf(rebased, doc.history) == -1) {
|
5161 |
-
rebaseHist(doc.history, change)
|
5162 |
-
rebased.push(doc.history)
|
5163 |
-
}
|
5164 |
-
makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))
|
5165 |
-
})
|
5166 |
-
};
|
5167 |
-
|
5168 |
-
for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
|
5169 |
-
var returned = loop( i$1 );
|
5170 |
-
|
5171 |
-
if ( returned ) return returned.v;
|
5172 |
-
}
|
5173 |
-
}
|
5174 |
-
|
5175 |
-
// Sub-views need their line numbers shifted when text is added
|
5176 |
-
// above or below them in the parent document.
|
5177 |
-
function shiftDoc(doc, distance) {
|
5178 |
-
if (distance == 0) { return }
|
5179 |
-
doc.first += distance
|
5180 |
-
doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
|
5181 |
-
Pos(range.anchor.line + distance, range.anchor.ch),
|
5182 |
-
Pos(range.head.line + distance, range.head.ch)
|
5183 |
-
); }), doc.sel.primIndex)
|
5184 |
-
if (doc.cm) {
|
5185 |
-
regChange(doc.cm, doc.first, doc.first - distance, distance)
|
5186 |
-
for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
|
5187 |
-
{ regLineChange(doc.cm, l, "gutter") }
|
5188 |
-
}
|
5189 |
-
}
|
5190 |
-
|
5191 |
-
// More lower-level change function, handling only a single document
|
5192 |
-
// (not linked ones).
|
5193 |
-
function makeChangeSingleDoc(doc, change, selAfter, spans) {
|
5194 |
-
if (doc.cm && !doc.cm.curOp)
|
5195 |
-
{ return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
|
5196 |
-
|
5197 |
-
if (change.to.line < doc.first) {
|
5198 |
-
shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))
|
5199 |
-
return
|
5200 |
-
}
|
5201 |
-
if (change.from.line > doc.lastLine()) { return }
|
5202 |
-
|
5203 |
-
// Clip the change to the size of this doc
|
5204 |
-
if (change.from.line < doc.first) {
|
5205 |
-
var shift = change.text.length - 1 - (doc.first - change.from.line)
|
5206 |
-
shiftDoc(doc, shift)
|
5207 |
-
change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
|
5208 |
-
text: [lst(change.text)], origin: change.origin}
|
5209 |
-
}
|
5210 |
-
var last = doc.lastLine()
|
5211 |
-
if (change.to.line > last) {
|
5212 |
-
change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
|
5213 |
-
text: [change.text[0]], origin: change.origin}
|
5214 |
-
}
|
5215 |
-
|
5216 |
-
change.removed = getBetween(doc, change.from, change.to)
|
5217 |
-
|
5218 |
-
if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }
|
5219 |
-
if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }
|
5220 |
-
else { updateDoc(doc, change, spans) }
|
5221 |
-
setSelectionNoUndo(doc, selAfter, sel_dontScroll)
|
5222 |
-
}
|
5223 |
-
|
5224 |
-
// Handle the interaction of a change to a document with the editor
|
5225 |
-
// that this document is part of.
|
5226 |
-
function makeChangeSingleDocInEditor(cm, change, spans) {
|
5227 |
-
var doc = cm.doc, display = cm.display, from = change.from, to = change.to
|
5228 |
-
|
5229 |
-
var recomputeMaxLength = false, checkWidthStart = from.line
|
5230 |
-
if (!cm.options.lineWrapping) {
|
5231 |
-
checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
|
5232 |
-
doc.iter(checkWidthStart, to.line + 1, function (line) {
|
5233 |
-
if (line == display.maxLine) {
|
5234 |
-
recomputeMaxLength = true
|
5235 |
-
return true
|
5236 |
-
}
|
5237 |
-
})
|
5238 |
-
}
|
5239 |
-
|
5240 |
-
if (doc.sel.contains(change.from, change.to) > -1)
|
5241 |
-
{ signalCursorActivity(cm) }
|
5242 |
-
|
5243 |
-
updateDoc(doc, change, spans, estimateHeight(cm))
|
5244 |
-
|
5245 |
-
if (!cm.options.lineWrapping) {
|
5246 |
-
doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
|
5247 |
-
var len = lineLength(line)
|
5248 |
-
if (len > display.maxLineLength) {
|
5249 |
-
display.maxLine = line
|
5250 |
-
display.maxLineLength = len
|
5251 |
-
display.maxLineChanged = true
|
5252 |
-
recomputeMaxLength = false
|
5253 |
-
}
|
5254 |
-
})
|
5255 |
-
if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }
|
5256 |
-
}
|
5257 |
-
|
5258 |
-
// Adjust frontier, schedule worker
|
5259 |
-
doc.frontier = Math.min(doc.frontier, from.line)
|
5260 |
-
startWorker(cm, 400)
|
5261 |
-
|
5262 |
-
var lendiff = change.text.length - (to.line - from.line) - 1
|
5263 |
-
// Remember that these lines changed, for updating the display
|
5264 |
-
if (change.full)
|
5265 |
-
{ regChange(cm) }
|
5266 |
-
else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
|
5267 |
-
{ regLineChange(cm, from.line, "text") }
|
5268 |
-
else
|
5269 |
-
{ regChange(cm, from.line, to.line + 1, lendiff) }
|
5270 |
-
|
5271 |
-
var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change")
|
5272 |
-
if (changeHandler || changesHandler) {
|
5273 |
-
var obj = {
|
5274 |
-
from: from, to: to,
|
5275 |
-
text: change.text,
|
5276 |
-
removed: change.removed,
|
5277 |
-
origin: change.origin
|
5278 |
-
}
|
5279 |
-
if (changeHandler) { signalLater(cm, "change", cm, obj) }
|
5280 |
-
if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }
|
5281 |
-
}
|
5282 |
-
cm.display.selForContextMenu = null
|
5283 |
-
}
|
5284 |
-
|
5285 |
-
function replaceRange(doc, code, from, to, origin) {
|
5286 |
-
if (!to) { to = from }
|
5287 |
-
if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }
|
5288 |
-
if (typeof code == "string") { code = doc.splitLines(code) }
|
5289 |
-
makeChange(doc, {from: from, to: to, text: code, origin: origin})
|
5290 |
-
}
|
5291 |
-
|
5292 |
-
// Rebasing/resetting history to deal with externally-sourced changes
|
5293 |
-
|
5294 |
-
function rebaseHistSelSingle(pos, from, to, diff) {
|
5295 |
-
if (to < pos.line) {
|
5296 |
-
pos.line += diff
|
5297 |
-
} else if (from < pos.line) {
|
5298 |
-
pos.line = from
|
5299 |
-
pos.ch = 0
|
5300 |
-
}
|
5301 |
-
}
|
5302 |
-
|
5303 |
-
// Tries to rebase an array of history events given a change in the
|
5304 |
-
// document. If the change touches the same lines as the event, the
|
5305 |
-
// event, and everything 'behind' it, is discarded. If the change is
|
5306 |
-
// before the event, the event's positions are updated. Uses a
|
5307 |
-
// copy-on-write scheme for the positions, to avoid having to
|
5308 |
-
// reallocate them all on every rebase, but also avoid problems with
|
5309 |
-
// shared position objects being unsafely updated.
|
5310 |
-
function rebaseHistArray(array, from, to, diff) {
|
5311 |
-
for (var i = 0; i < array.length; ++i) {
|
5312 |
-
var sub = array[i], ok = true
|
5313 |
-
if (sub.ranges) {
|
5314 |
-
if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }
|
5315 |
-
for (var j = 0; j < sub.ranges.length; j++) {
|
5316 |
-
rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)
|
5317 |
-
rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)
|
5318 |
-
}
|
5319 |
-
continue
|
5320 |
-
}
|
5321 |
-
for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
|
5322 |
-
var cur = sub.changes[j$1]
|
5323 |
-
if (to < cur.from.line) {
|
5324 |
-
cur.from = Pos(cur.from.line + diff, cur.from.ch)
|
5325 |
-
cur.to = Pos(cur.to.line + diff, cur.to.ch)
|
5326 |
-
} else if (from <= cur.to.line) {
|
5327 |
-
ok = false
|
5328 |
-
break
|
5329 |
-
}
|
5330 |
-
}
|
5331 |
-
if (!ok) {
|
5332 |
-
array.splice(0, i + 1)
|
5333 |
-
i = 0
|
5334 |
-
}
|
5335 |
-
}
|
5336 |
-
}
|
5337 |
-
|
5338 |
-
function rebaseHist(hist, change) {
|
5339 |
-
var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1
|
5340 |
-
rebaseHistArray(hist.done, from, to, diff)
|
5341 |
-
rebaseHistArray(hist.undone, from, to, diff)
|
5342 |
-
}
|
5343 |
-
|
5344 |
-
// Utility for applying a change to a line by handle or number,
|
5345 |
-
// returning the number and optionally registering the line as
|
5346 |
-
// changed.
|
5347 |
-
function changeLine(doc, handle, changeType, op) {
|
5348 |
-
var no = handle, line = handle
|
5349 |
-
if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) }
|
5350 |
-
else { no = lineNo(handle) }
|
5351 |
-
if (no == null) { return null }
|
5352 |
-
if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }
|
5353 |
-
return line
|
5354 |
-
}
|
5355 |
-
|
5356 |
-
// The document is represented as a BTree consisting of leaves, with
|
5357 |
-
// chunk of lines in them, and branches, with up to ten leaves or
|
5358 |
-
// other branch nodes below them. The top node is always a branch
|
5359 |
-
// node, and is the document object itself (meaning it has
|
5360 |
-
// additional methods and properties).
|
5361 |
-
//
|
5362 |
-
// All nodes have parent links. The tree is used both to go from
|
5363 |
-
// line numbers to line objects, and to go from objects to numbers.
|
5364 |
-
// It also indexes by height, and is used to convert between height
|
5365 |
-
// and line object, and to find the total height of the document.
|
5366 |
-
//
|
5367 |
-
// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
|
5368 |
-
|
5369 |
-
var LeafChunk = function(lines) {
|
5370 |
-
var this$1 = this;
|
5371 |
-
|
5372 |
-
this.lines = lines
|
5373 |
-
this.parent = null
|
5374 |
-
var height = 0
|
5375 |
-
for (var i = 0; i < lines.length; ++i) {
|
5376 |
-
lines[i].parent = this$1
|
5377 |
-
height += lines[i].height
|
5378 |
-
}
|
5379 |
-
this.height = height
|
5380 |
-
};
|
5381 |
-
|
5382 |
-
LeafChunk.prototype.chunkSize = function () { return this.lines.length };
|
5383 |
-
|
5384 |
-
// Remove the n lines at offset 'at'.
|
5385 |
-
LeafChunk.prototype.removeInner = function (at, n) {
|
5386 |
-
var this$1 = this;
|
5387 |
-
|
5388 |
-
for (var i = at, e = at + n; i < e; ++i) {
|
5389 |
-
var line = this$1.lines[i]
|
5390 |
-
this$1.height -= line.height
|
5391 |
-
cleanUpLine(line)
|
5392 |
-
signalLater(line, "delete")
|
5393 |
-
}
|
5394 |
-
this.lines.splice(at, n)
|
5395 |
-
};
|
5396 |
-
|
5397 |
-
// Helper used to collapse a small branch into a single leaf.
|
5398 |
-
LeafChunk.prototype.collapse = function (lines) {
|
5399 |
-
lines.push.apply(lines, this.lines)
|
5400 |
-
};
|
5401 |
-
|
5402 |
-
// Insert the given array of lines at offset 'at', count them as
|
5403 |
-
// having the given height.
|
5404 |
-
LeafChunk.prototype.insertInner = function (at, lines, height) {
|
5405 |
-
var this$1 = this;
|
5406 |
-
|
5407 |
-
this.height += height
|
5408 |
-
this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
|
5409 |
-
for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
|
5410 |
-
};
|
5411 |
-
|
5412 |
-
// Used to iterate over a part of the tree.
|
5413 |
-
LeafChunk.prototype.iterN = function (at, n, op) {
|
5414 |
-
var this$1 = this;
|
5415 |
-
|
5416 |
-
for (var e = at + n; at < e; ++at)
|
5417 |
-
{ if (op(this$1.lines[at])) { return true } }
|
5418 |
-
};
|
5419 |
-
|
5420 |
-
var BranchChunk = function(children) {
|
5421 |
-
var this$1 = this;
|
5422 |
-
|
5423 |
-
this.children = children
|
5424 |
-
var size = 0, height = 0
|
5425 |
-
for (var i = 0; i < children.length; ++i) {
|
5426 |
-
var ch = children[i]
|
5427 |
-
size += ch.chunkSize(); height += ch.height
|
5428 |
-
ch.parent = this$1
|
5429 |
-
}
|
5430 |
-
this.size = size
|
5431 |
-
this.height = height
|
5432 |
-
this.parent = null
|
5433 |
-
};
|
5434 |
-
|
5435 |
-
BranchChunk.prototype.chunkSize = function () { return this.size };
|
5436 |
-
|
5437 |
-
BranchChunk.prototype.removeInner = function (at, n) {
|
5438 |
-
var this$1 = this;
|
5439 |
-
|
5440 |
-
this.size -= n
|
5441 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5442 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5443 |
-
if (at < sz) {
|
5444 |
-
var rm = Math.min(n, sz - at), oldHeight = child.height
|
5445 |
-
child.removeInner(at, rm)
|
5446 |
-
this$1.height -= oldHeight - child.height
|
5447 |
-
if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
|
5448 |
-
if ((n -= rm) == 0) { break }
|
5449 |
-
at = 0
|
5450 |
-
} else { at -= sz }
|
5451 |
-
}
|
5452 |
-
// If the result is smaller than 25 lines, ensure that it is a
|
5453 |
-
// single leaf node.
|
5454 |
-
if (this.size - n < 25 &&
|
5455 |
-
(this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
|
5456 |
-
var lines = []
|
5457 |
-
this.collapse(lines)
|
5458 |
-
this.children = [new LeafChunk(lines)]
|
5459 |
-
this.children[0].parent = this
|
5460 |
-
}
|
5461 |
-
};
|
5462 |
-
|
5463 |
-
BranchChunk.prototype.collapse = function (lines) {
|
5464 |
-
var this$1 = this;
|
5465 |
-
|
5466 |
-
for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
|
5467 |
-
};
|
5468 |
-
|
5469 |
-
BranchChunk.prototype.insertInner = function (at, lines, height) {
|
5470 |
-
var this$1 = this;
|
5471 |
-
|
5472 |
-
this.size += lines.length
|
5473 |
-
this.height += height
|
5474 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5475 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5476 |
-
if (at <= sz) {
|
5477 |
-
child.insertInner(at, lines, height)
|
5478 |
-
if (child.lines && child.lines.length > 50) {
|
5479 |
-
// To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
|
5480 |
-
// Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
|
5481 |
-
var remaining = child.lines.length % 25 + 25
|
5482 |
-
for (var pos = remaining; pos < child.lines.length;) {
|
5483 |
-
var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
|
5484 |
-
child.height -= leaf.height
|
5485 |
-
this$1.children.splice(++i, 0, leaf)
|
5486 |
-
leaf.parent = this$1
|
5487 |
-
}
|
5488 |
-
child.lines = child.lines.slice(0, remaining)
|
5489 |
-
this$1.maybeSpill()
|
5490 |
-
}
|
5491 |
-
break
|
5492 |
-
}
|
5493 |
-
at -= sz
|
5494 |
-
}
|
5495 |
-
};
|
5496 |
-
|
5497 |
-
// When a node has grown, check whether it should be split.
|
5498 |
-
BranchChunk.prototype.maybeSpill = function () {
|
5499 |
-
if (this.children.length <= 10) { return }
|
5500 |
-
var me = this
|
5501 |
-
do {
|
5502 |
-
var spilled = me.children.splice(me.children.length - 5, 5)
|
5503 |
-
var sibling = new BranchChunk(spilled)
|
5504 |
-
if (!me.parent) { // Become the parent node
|
5505 |
-
var copy = new BranchChunk(me.children)
|
5506 |
-
copy.parent = me
|
5507 |
-
me.children = [copy, sibling]
|
5508 |
-
me = copy
|
5509 |
-
} else {
|
5510 |
-
me.size -= sibling.size
|
5511 |
-
me.height -= sibling.height
|
5512 |
-
var myIndex = indexOf(me.parent.children, me)
|
5513 |
-
me.parent.children.splice(myIndex + 1, 0, sibling)
|
5514 |
-
}
|
5515 |
-
sibling.parent = me.parent
|
5516 |
-
} while (me.children.length > 10)
|
5517 |
-
me.parent.maybeSpill()
|
5518 |
-
};
|
5519 |
-
|
5520 |
-
BranchChunk.prototype.iterN = function (at, n, op) {
|
5521 |
-
var this$1 = this;
|
5522 |
-
|
5523 |
-
for (var i = 0; i < this.children.length; ++i) {
|
5524 |
-
var child = this$1.children[i], sz = child.chunkSize()
|
5525 |
-
if (at < sz) {
|
5526 |
-
var used = Math.min(n, sz - at)
|
5527 |
-
if (child.iterN(at, used, op)) { return true }
|
5528 |
-
if ((n -= used) == 0) { break }
|
5529 |
-
at = 0
|
5530 |
-
} else { at -= sz }
|
5531 |
-
}
|
5532 |
-
};
|
5533 |
-
|
5534 |
-
// Line widgets are block elements displayed above or below a line.
|
5535 |
-
|
5536 |
-
var LineWidget = function(doc, node, options) {
|
5537 |
-
var this$1 = this;
|
5538 |
-
|
5539 |
-
if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
|
5540 |
-
{ this$1[opt] = options[opt] } } }
|
5541 |
-
this.doc = doc
|
5542 |
-
this.node = node
|
5543 |
-
};
|
5544 |
-
|
5545 |
-
LineWidget.prototype.clear = function () {
|
5546 |
-
var this$1 = this;
|
5547 |
-
|
5548 |
-
var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)
|
5549 |
-
if (no == null || !ws) { return }
|
5550 |
-
for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }
|
5551 |
-
if (!ws.length) { line.widgets = null }
|
5552 |
-
var height = widgetHeight(this)
|
5553 |
-
updateLineHeight(line, Math.max(0, line.height - height))
|
5554 |
-
if (cm) {
|
5555 |
-
runInOp(cm, function () {
|
5556 |
-
adjustScrollWhenAboveVisible(cm, line, -height)
|
5557 |
-
regLineChange(cm, no, "widget")
|
5558 |
-
})
|
5559 |
-
signalLater(cm, "lineWidgetCleared", cm, this, no)
|
5560 |
-
}
|
5561 |
-
};
|
5562 |
-
|
5563 |
-
LineWidget.prototype.changed = function () {
|
5564 |
-
var this$1 = this;
|
5565 |
-
|
5566 |
-
var oldH = this.height, cm = this.doc.cm, line = this.line
|
5567 |
-
this.height = null
|
5568 |
-
var diff = widgetHeight(this) - oldH
|
5569 |
-
if (!diff) { return }
|
5570 |
-
updateLineHeight(line, line.height + diff)
|
5571 |
-
if (cm) {
|
5572 |
-
runInOp(cm, function () {
|
5573 |
-
cm.curOp.forceUpdate = true
|
5574 |
-
adjustScrollWhenAboveVisible(cm, line, diff)
|
5575 |
-
signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line))
|
5576 |
-
})
|
5577 |
-
}
|
5578 |
-
};
|
5579 |
-
eventMixin(LineWidget)
|
5580 |
-
|
5581 |
-
function adjustScrollWhenAboveVisible(cm, line, diff) {
|
5582 |
-
if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
|
5583 |
-
{ addToScrollTop(cm, diff) }
|
5584 |
-
}
|
5585 |
-
|
5586 |
-
function addLineWidget(doc, handle, node, options) {
|
5587 |
-
var widget = new LineWidget(doc, node, options)
|
5588 |
-
var cm = doc.cm
|
5589 |
-
if (cm && widget.noHScroll) { cm.display.alignWidgets = true }
|
5590 |
-
changeLine(doc, handle, "widget", function (line) {
|
5591 |
-
var widgets = line.widgets || (line.widgets = [])
|
5592 |
-
if (widget.insertAt == null) { widgets.push(widget) }
|
5593 |
-
else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }
|
5594 |
-
widget.line = line
|
5595 |
-
if (cm && !lineIsHidden(doc, line)) {
|
5596 |
-
var aboveVisible = heightAtLine(line) < doc.scrollTop
|
5597 |
-
updateLineHeight(line, line.height + widgetHeight(widget))
|
5598 |
-
if (aboveVisible) { addToScrollTop(cm, widget.height) }
|
5599 |
-
cm.curOp.forceUpdate = true
|
5600 |
-
}
|
5601 |
-
return true
|
5602 |
-
})
|
5603 |
-
signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle))
|
5604 |
-
return widget
|
5605 |
-
}
|
5606 |
-
|
5607 |
-
// TEXTMARKERS
|
5608 |
-
|
5609 |
-
// Created with markText and setBookmark methods. A TextMarker is a
|
5610 |
-
// handle that can be used to clear or find a marked position in the
|
5611 |
-
// document. Line objects hold arrays (markedSpans) containing
|
5612 |
-
// {from, to, marker} object pointing to such marker objects, and
|
5613 |
-
// indicating that such a marker is present on that line. Multiple
|
5614 |
-
// lines may point to the same marker when it spans across lines.
|
5615 |
-
// The spans will have null for their from/to properties when the
|
5616 |
-
// marker continues beyond the start/end of the line. Markers have
|
5617 |
-
// links back to the lines they currently touch.
|
5618 |
-
|
5619 |
-
// Collapsed markers have unique ids, in order to be able to order
|
5620 |
-
// them, which is needed for uniquely determining an outer marker
|
5621 |
-
// when they overlap (they may nest, but not partially overlap).
|
5622 |
-
var nextMarkerId = 0
|
5623 |
-
|
5624 |
-
var TextMarker = function(doc, type) {
|
5625 |
-
this.lines = []
|
5626 |
-
this.type = type
|
5627 |
-
this.doc = doc
|
5628 |
-
this.id = ++nextMarkerId
|
5629 |
-
};
|
5630 |
-
|
5631 |
-
// Clear the marker.
|
5632 |
-
TextMarker.prototype.clear = function () {
|
5633 |
-
var this$1 = this;
|
5634 |
-
|
5635 |
-
if (this.explicitlyCleared) { return }
|
5636 |
-
var cm = this.doc.cm, withOp = cm && !cm.curOp
|
5637 |
-
if (withOp) { startOperation(cm) }
|
5638 |
-
if (hasHandler(this, "clear")) {
|
5639 |
-
var found = this.find()
|
5640 |
-
if (found) { signalLater(this, "clear", found.from, found.to) }
|
5641 |
-
}
|
5642 |
-
var min = null, max = null
|
5643 |
-
for (var i = 0; i < this.lines.length; ++i) {
|
5644 |
-
var line = this$1.lines[i]
|
5645 |
-
var span = getMarkedSpanFor(line.markedSpans, this$1)
|
5646 |
-
if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") }
|
5647 |
-
else if (cm) {
|
5648 |
-
if (span.to != null) { max = lineNo(line) }
|
5649 |
-
if (span.from != null) { min = lineNo(line) }
|
5650 |
-
}
|
5651 |
-
line.markedSpans = removeMarkedSpan(line.markedSpans, span)
|
5652 |
-
if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)
|
5653 |
-
{ updateLineHeight(line, textHeight(cm.display)) }
|
5654 |
-
}
|
5655 |
-
if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
|
5656 |
-
var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)
|
5657 |
-
if (len > cm.display.maxLineLength) {
|
5658 |
-
cm.display.maxLine = visual
|
5659 |
-
cm.display.maxLineLength = len
|
5660 |
-
cm.display.maxLineChanged = true
|
5661 |
-
}
|
5662 |
-
} }
|
5663 |
-
|
5664 |
-
if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }
|
5665 |
-
this.lines.length = 0
|
5666 |
-
this.explicitlyCleared = true
|
5667 |
-
if (this.atomic && this.doc.cantEdit) {
|
5668 |
-
this.doc.cantEdit = false
|
5669 |
-
if (cm) { reCheckSelection(cm.doc) }
|
5670 |
-
}
|
5671 |
-
if (cm) { signalLater(cm, "markerCleared", cm, this, min, max) }
|
5672 |
-
if (withOp) { endOperation(cm) }
|
5673 |
-
if (this.parent) { this.parent.clear() }
|
5674 |
-
};
|
5675 |
-
|
5676 |
-
// Find the position of the marker in the document. Returns a {from,
|
5677 |
-
// to} object by default. Side can be passed to get a specific side
|
5678 |
-
// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
|
5679 |
-
// Pos objects returned contain a line object, rather than a line
|
5680 |
-
// number (used to prevent looking up the same line twice).
|
5681 |
-
TextMarker.prototype.find = function (side, lineObj) {
|
5682 |
-
var this$1 = this;
|
5683 |
-
|
5684 |
-
if (side == null && this.type == "bookmark") { side = 1 }
|
5685 |
-
var from, to
|
5686 |
-
for (var i = 0; i < this.lines.length; ++i) {
|
5687 |
-
var line = this$1.lines[i]
|
5688 |
-
var span = getMarkedSpanFor(line.markedSpans, this$1)
|
5689 |
-
if (span.from != null) {
|
5690 |
-
from = Pos(lineObj ? line : lineNo(line), span.from)
|
5691 |
-
if (side == -1) { return from }
|
5692 |
-
}
|
5693 |
-
if (span.to != null) {
|
5694 |
-
to = Pos(lineObj ? line : lineNo(line), span.to)
|
5695 |
-
if (side == 1) { return to }
|
5696 |
-
}
|
5697 |
-
}
|
5698 |
-
return from && {from: from, to: to}
|
5699 |
-
};
|
5700 |
-
|
5701 |
-
// Signals that the marker's widget changed, and surrounding layout
|
5702 |
-
// should be recomputed.
|
5703 |
-
TextMarker.prototype.changed = function () {
|
5704 |
-
var this$1 = this;
|
5705 |
-
|
5706 |
-
var pos = this.find(-1, true), widget = this, cm = this.doc.cm
|
5707 |
-
if (!pos || !cm) { return }
|
5708 |
-
runInOp(cm, function () {
|
5709 |
-
var line = pos.line, lineN = lineNo(pos.line)
|
5710 |
-
var view = findViewForLine(cm, lineN)
|
5711 |
-
if (view) {
|
5712 |
-
clearLineMeasurementCacheFor(view)
|
5713 |
-
cm.curOp.selectionChanged = cm.curOp.forceUpdate = true
|
5714 |
-
}
|
5715 |
-
cm.curOp.updateMaxLine = true
|
5716 |
-
if (!lineIsHidden(widget.doc, line) && widget.height != null) {
|
5717 |
-
var oldHeight = widget.height
|
5718 |
-
widget.height = null
|
5719 |
-
var dHeight = widgetHeight(widget) - oldHeight
|
5720 |
-
if (dHeight)
|
5721 |
-
{ updateLineHeight(line, line.height + dHeight) }
|
5722 |
-
}
|
5723 |
-
signalLater(cm, "markerChanged", cm, this$1)
|
5724 |
-
})
|
5725 |
-
};
|
5726 |
-
|
5727 |
-
TextMarker.prototype.attachLine = function (line) {
|
5728 |
-
if (!this.lines.length && this.doc.cm) {
|
5729 |
-
var op = this.doc.cm.curOp
|
5730 |
-
if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
|
5731 |
-
{ (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }
|
5732 |
-
}
|
5733 |
-
this.lines.push(line)
|
5734 |
-
};
|
5735 |
-
|
5736 |
-
TextMarker.prototype.detachLine = function (line) {
|
5737 |
-
this.lines.splice(indexOf(this.lines, line), 1)
|
5738 |
-
if (!this.lines.length && this.doc.cm) {
|
5739 |
-
var op = this.doc.cm.curOp
|
5740 |
-
;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)
|
5741 |
-
}
|
5742 |
-
};
|
5743 |
-
eventMixin(TextMarker)
|
5744 |
-
|
5745 |
-
// Create a marker, wire it up to the right lines, and
|
5746 |
-
function markText(doc, from, to, options, type) {
|
5747 |
-
// Shared markers (across linked documents) are handled separately
|
5748 |
-
// (markTextShared will call out to this again, once per
|
5749 |
-
// document).
|
5750 |
-
if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
|
5751 |
-
// Ensure we are in an operation.
|
5752 |
-
if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
|
5753 |
-
|
5754 |
-
var marker = new TextMarker(doc, type), diff = cmp(from, to)
|
5755 |
-
if (options) { copyObj(options, marker, false) }
|
5756 |
-
// Don't connect empty markers unless clearWhenEmpty is false
|
5757 |
-
if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
|
5758 |
-
{ return marker }
|
5759 |
-
if (marker.replacedWith) {
|
5760 |
-
// Showing up as a widget implies collapsed (widget replaces text)
|
5761 |
-
marker.collapsed = true
|
5762 |
-
marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget")
|
5763 |
-
if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") }
|
5764 |
-
if (options.insertLeft) { marker.widgetNode.insertLeft = true }
|
5765 |
-
}
|
5766 |
-
if (marker.collapsed) {
|
5767 |
-
if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
|
5768 |
-
from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
|
5769 |
-
{ throw new Error("Inserting collapsed marker partially overlapping an existing one") }
|
5770 |
-
seeCollapsedSpans()
|
5771 |
-
}
|
5772 |
-
|
5773 |
-
if (marker.addToHistory)
|
5774 |
-
{ addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) }
|
5775 |
-
|
5776 |
-
var curLine = from.line, cm = doc.cm, updateMaxLine
|
5777 |
-
doc.iter(curLine, to.line + 1, function (line) {
|
5778 |
-
if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
|
5779 |
-
{ updateMaxLine = true }
|
5780 |
-
if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }
|
5781 |
-
addMarkedSpan(line, new MarkedSpan(marker,
|
5782 |
-
curLine == from.line ? from.ch : null,
|
5783 |
-
curLine == to.line ? to.ch : null))
|
5784 |
-
++curLine
|
5785 |
-
})
|
5786 |
-
// lineIsHidden depends on the presence of the spans, so needs a second pass
|
5787 |
-
if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
|
5788 |
-
if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }
|
5789 |
-
}) }
|
5790 |
-
|
5791 |
-
if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) }
|
5792 |
-
|
5793 |
-
if (marker.readOnly) {
|
5794 |
-
seeReadOnlySpans()
|
5795 |
-
if (doc.history.done.length || doc.history.undone.length)
|
5796 |
-
{ doc.clearHistory() }
|
5797 |
-
}
|
5798 |
-
if (marker.collapsed) {
|
5799 |
-
marker.id = ++nextMarkerId
|
5800 |
-
marker.atomic = true
|
5801 |
-
}
|
5802 |
-
if (cm) {
|
5803 |
-
// Sync editor state
|
5804 |
-
if (updateMaxLine) { cm.curOp.updateMaxLine = true }
|
5805 |
-
if (marker.collapsed)
|
5806 |
-
{ regChange(cm, from.line, to.line + 1) }
|
5807 |
-
else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)
|
5808 |
-
{ for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } }
|
5809 |
-
if (marker.atomic) { reCheckSelection(cm.doc) }
|
5810 |
-
signalLater(cm, "markerAdded", cm, marker)
|
5811 |
-
}
|
5812 |
-
return marker
|
5813 |
-
}
|
5814 |
-
|
5815 |
-
// SHARED TEXTMARKERS
|
5816 |
-
|
5817 |
-
// A shared marker spans multiple linked documents. It is
|
5818 |
-
// implemented as a meta-marker-object controlling multiple normal
|
5819 |
-
// markers.
|
5820 |
-
var SharedTextMarker = function(markers, primary) {
|
5821 |
-
var this$1 = this;
|
5822 |
-
|
5823 |
-
this.markers = markers
|
5824 |
-
this.primary = primary
|
5825 |
-
for (var i = 0; i < markers.length; ++i)
|
5826 |
-
{ markers[i].parent = this$1 }
|
5827 |
-
};
|
5828 |
-
|
5829 |
-
SharedTextMarker.prototype.clear = function () {
|
5830 |
-
var this$1 = this;
|
5831 |
-
|
5832 |
-
if (this.explicitlyCleared) { return }
|
5833 |
-
this.explicitlyCleared = true
|
5834 |
-
for (var i = 0; i < this.markers.length; ++i)
|
5835 |
-
{ this$1.markers[i].clear() }
|
5836 |
-
signalLater(this, "clear")
|
5837 |
-
};
|
5838 |
-
|
5839 |
-
SharedTextMarker.prototype.find = function (side, lineObj) {
|
5840 |
-
return this.primary.find(side, lineObj)
|
5841 |
-
};
|
5842 |
-
eventMixin(SharedTextMarker)
|
5843 |
-
|
5844 |
-
function markTextShared(doc, from, to, options, type) {
|
5845 |
-
options = copyObj(options)
|
5846 |
-
options.shared = false
|
5847 |
-
var markers = [markText(doc, from, to, options, type)], primary = markers[0]
|
5848 |
-
var widget = options.widgetNode
|
5849 |
-
linkedDocs(doc, function (doc) {
|
5850 |
-
if (widget) { options.widgetNode = widget.cloneNode(true) }
|
5851 |
-
markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))
|
5852 |
-
for (var i = 0; i < doc.linked.length; ++i)
|
5853 |
-
{ if (doc.linked[i].isParent) { return } }
|
5854 |
-
primary = lst(markers)
|
5855 |
-
})
|
5856 |
-
return new SharedTextMarker(markers, primary)
|
5857 |
-
}
|
5858 |
-
|
5859 |
-
function findSharedMarkers(doc) {
|
5860 |
-
return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
|
5861 |
-
}
|
5862 |
-
|
5863 |
-
function copySharedMarkers(doc, markers) {
|
5864 |
-
for (var i = 0; i < markers.length; i++) {
|
5865 |
-
var marker = markers[i], pos = marker.find()
|
5866 |
-
var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)
|
5867 |
-
if (cmp(mFrom, mTo)) {
|
5868 |
-
var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)
|
5869 |
-
marker.markers.push(subMark)
|
5870 |
-
subMark.parent = marker
|
5871 |
-
}
|
5872 |
-
}
|
5873 |
-
}
|
5874 |
-
|
5875 |
-
function detachSharedMarkers(markers) {
|
5876 |
-
var loop = function ( i ) {
|
5877 |
-
var marker = markers[i], linked = [marker.primary.doc]
|
5878 |
-
linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })
|
5879 |
-
for (var j = 0; j < marker.markers.length; j++) {
|
5880 |
-
var subMarker = marker.markers[j]
|
5881 |
-
if (indexOf(linked, subMarker.doc) == -1) {
|
5882 |
-
subMarker.parent = null
|
5883 |
-
marker.markers.splice(j--, 1)
|
5884 |
-
}
|
5885 |
-
}
|
5886 |
-
};
|
5887 |
-
|
5888 |
-
for (var i = 0; i < markers.length; i++) loop( i );
|
5889 |
-
}
|
5890 |
-
|
5891 |
-
var nextDocId = 0
|
5892 |
-
var Doc = function(text, mode, firstLine, lineSep, direction) {
|
5893 |
-
if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }
|
5894 |
-
if (firstLine == null) { firstLine = 0 }
|
5895 |
-
|
5896 |
-
BranchChunk.call(this, [new LeafChunk([new Line("", null)])])
|
5897 |
-
this.first = firstLine
|
5898 |
-
this.scrollTop = this.scrollLeft = 0
|
5899 |
-
this.cantEdit = false
|
5900 |
-
this.cleanGeneration = 1
|
5901 |
-
this.frontier = firstLine
|
5902 |
-
var start = Pos(firstLine, 0)
|
5903 |
-
this.sel = simpleSelection(start)
|
5904 |
-
this.history = new History(null)
|
5905 |
-
this.id = ++nextDocId
|
5906 |
-
this.modeOption = mode
|
5907 |
-
this.lineSep = lineSep
|
5908 |
-
this.direction = (direction == "rtl") ? "rtl" : "ltr"
|
5909 |
-
this.extend = false
|
5910 |
-
|
5911 |
-
if (typeof text == "string") { text = this.splitLines(text) }
|
5912 |
-
updateDoc(this, {from: start, to: start, text: text})
|
5913 |
-
setSelection(this, simpleSelection(start), sel_dontScroll)
|
5914 |
-
}
|
5915 |
-
|
5916 |
-
Doc.prototype = createObj(BranchChunk.prototype, {
|
5917 |
-
constructor: Doc,
|
5918 |
-
// Iterate over the document. Supports two forms -- with only one
|
5919 |
-
// argument, it calls that for each line in the document. With
|
5920 |
-
// three, it iterates over the range given by the first two (with
|
5921 |
-
// the second being non-inclusive).
|
5922 |
-
iter: function(from, to, op) {
|
5923 |
-
if (op) { this.iterN(from - this.first, to - from, op) }
|
5924 |
-
else { this.iterN(this.first, this.first + this.size, from) }
|
5925 |
-
},
|
5926 |
-
|
5927 |
-
// Non-public interface for adding and removing lines.
|
5928 |
-
insert: function(at, lines) {
|
5929 |
-
var height = 0
|
5930 |
-
for (var i = 0; i < lines.length; ++i) { height += lines[i].height }
|
5931 |
-
this.insertInner(at - this.first, lines, height)
|
5932 |
-
},
|
5933 |
-
remove: function(at, n) { this.removeInner(at - this.first, n) },
|
5934 |
-
|
5935 |
-
// From here, the methods are part of the public interface. Most
|
5936 |
-
// are also available from CodeMirror (editor) instances.
|
5937 |
-
|
5938 |
-
getValue: function(lineSep) {
|
5939 |
-
var lines = getLines(this, this.first, this.first + this.size)
|
5940 |
-
if (lineSep === false) { return lines }
|
5941 |
-
return lines.join(lineSep || this.lineSeparator())
|
5942 |
-
},
|
5943 |
-
setValue: docMethodOp(function(code) {
|
5944 |
-
var top = Pos(this.first, 0), last = this.first + this.size - 1
|
5945 |
-
makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
|
5946 |
-
text: this.splitLines(code), origin: "setValue", full: true}, true)
|
5947 |
-
if (this.cm) { scrollToCoords(this.cm, 0, 0) }
|
5948 |
-
setSelection(this, simpleSelection(top), sel_dontScroll)
|
5949 |
-
}),
|
5950 |
-
replaceRange: function(code, from, to, origin) {
|
5951 |
-
from = clipPos(this, from)
|
5952 |
-
to = to ? clipPos(this, to) : from
|
5953 |
-
replaceRange(this, code, from, to, origin)
|
5954 |
-
},
|
5955 |
-
getRange: function(from, to, lineSep) {
|
5956 |
-
var lines = getBetween(this, clipPos(this, from), clipPos(this, to))
|
5957 |
-
if (lineSep === false) { return lines }
|
5958 |
-
return lines.join(lineSep || this.lineSeparator())
|
5959 |
-
},
|
5960 |
-
|
5961 |
-
getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
|
5962 |
-
|
5963 |
-
getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
|
5964 |
-
getLineNumber: function(line) {return lineNo(line)},
|
5965 |
-
|
5966 |
-
getLineHandleVisualStart: function(line) {
|
5967 |
-
if (typeof line == "number") { line = getLine(this, line) }
|
5968 |
-
return visualLine(line)
|
5969 |
-
},
|
5970 |
-
|
5971 |
-
lineCount: function() {return this.size},
|
5972 |
-
firstLine: function() {return this.first},
|
5973 |
-
lastLine: function() {return this.first + this.size - 1},
|
5974 |
-
|
5975 |
-
clipPos: function(pos) {return clipPos(this, pos)},
|
5976 |
-
|
5977 |
-
getCursor: function(start) {
|
5978 |
-
var range = this.sel.primary(), pos
|
5979 |
-
if (start == null || start == "head") { pos = range.head }
|
5980 |
-
else if (start == "anchor") { pos = range.anchor }
|
5981 |
-
else if (start == "end" || start == "to" || start === false) { pos = range.to() }
|
5982 |
-
else { pos = range.from() }
|
5983 |
-
return pos
|
5984 |
-
},
|
5985 |
-
listSelections: function() { return this.sel.ranges },
|
5986 |
-
somethingSelected: function() {return this.sel.somethingSelected()},
|
5987 |
-
|
5988 |
-
setCursor: docMethodOp(function(line, ch, options) {
|
5989 |
-
setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options)
|
5990 |
-
}),
|
5991 |
-
setSelection: docMethodOp(function(anchor, head, options) {
|
5992 |
-
setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)
|
5993 |
-
}),
|
5994 |
-
extendSelection: docMethodOp(function(head, other, options) {
|
5995 |
-
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)
|
5996 |
-
}),
|
5997 |
-
extendSelections: docMethodOp(function(heads, options) {
|
5998 |
-
extendSelections(this, clipPosArray(this, heads), options)
|
5999 |
-
}),
|
6000 |
-
extendSelectionsBy: docMethodOp(function(f, options) {
|
6001 |
-
var heads = map(this.sel.ranges, f)
|
6002 |
-
extendSelections(this, clipPosArray(this, heads), options)
|
6003 |
-
}),
|
6004 |
-
setSelections: docMethodOp(function(ranges, primary, options) {
|
6005 |
-
var this$1 = this;
|
6006 |
-
|
6007 |
-
if (!ranges.length) { return }
|
6008 |
-
var out = []
|
6009 |
-
for (var i = 0; i < ranges.length; i++)
|
6010 |
-
{ out[i] = new Range(clipPos(this$1, ranges[i].anchor),
|
6011 |
-
clipPos(this$1, ranges[i].head)) }
|
6012 |
-
if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }
|
6013 |
-
setSelection(this, normalizeSelection(out, primary), options)
|
6014 |
-
}),
|
6015 |
-
addSelection: docMethodOp(function(anchor, head, options) {
|
6016 |
-
var ranges = this.sel.ranges.slice(0)
|
6017 |
-
ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))
|
6018 |
-
setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)
|
6019 |
-
}),
|
6020 |
-
|
6021 |
-
getSelection: function(lineSep) {
|
6022 |
-
var this$1 = this;
|
6023 |
-
|
6024 |
-
var ranges = this.sel.ranges, lines
|
6025 |
-
for (var i = 0; i < ranges.length; i++) {
|
6026 |
-
var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
|
6027 |
-
lines = lines ? lines.concat(sel) : sel
|
6028 |
-
}
|
6029 |
-
if (lineSep === false) { return lines }
|
6030 |
-
else { return lines.join(lineSep || this.lineSeparator()) }
|
6031 |
-
},
|
6032 |
-
getSelections: function(lineSep) {
|
6033 |
-
var this$1 = this;
|
6034 |
-
|
6035 |
-
var parts = [], ranges = this.sel.ranges
|
6036 |
-
for (var i = 0; i < ranges.length; i++) {
|
6037 |
-
var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
|
6038 |
-
if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }
|
6039 |
-
parts[i] = sel
|
6040 |
-
}
|
6041 |
-
return parts
|
6042 |
-
},
|
6043 |
-
replaceSelection: function(code, collapse, origin) {
|
6044 |
-
var dup = []
|
6045 |
-
for (var i = 0; i < this.sel.ranges.length; i++)
|
6046 |
-
{ dup[i] = code }
|
6047 |
-
this.replaceSelections(dup, collapse, origin || "+input")
|
6048 |
-
},
|
6049 |
-
replaceSelections: docMethodOp(function(code, collapse, origin) {
|
6050 |
-
var this$1 = this;
|
6051 |
-
|
6052 |
-
var changes = [], sel = this.sel
|
6053 |
-
for (var i = 0; i < sel.ranges.length; i++) {
|
6054 |
-
var range = sel.ranges[i]
|
6055 |
-
changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}
|
6056 |
-
}
|
6057 |
-
var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse)
|
6058 |
-
for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
|
6059 |
-
{ makeChange(this$1, changes[i$1]) }
|
6060 |
-
if (newSel) { setSelectionReplaceHistory(this, newSel) }
|
6061 |
-
else if (this.cm) { ensureCursorVisible(this.cm) }
|
6062 |
-
}),
|
6063 |
-
undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}),
|
6064 |
-
redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}),
|
6065 |
-
undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}),
|
6066 |
-
redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}),
|
6067 |
-
|
6068 |
-
setExtending: function(val) {this.extend = val},
|
6069 |
-
getExtending: function() {return this.extend},
|
6070 |
-
|
6071 |
-
historySize: function() {
|
6072 |
-
var hist = this.history, done = 0, undone = 0
|
6073 |
-
for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }
|
6074 |
-
for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }
|
6075 |
-
return {undo: done, redo: undone}
|
6076 |
-
},
|
6077 |
-
clearHistory: function() {this.history = new History(this.history.maxGeneration)},
|
6078 |
-
|
6079 |
-
markClean: function() {
|
6080 |
-
this.cleanGeneration = this.changeGeneration(true)
|
6081 |
-
},
|
6082 |
-
changeGeneration: function(forceSplit) {
|
6083 |
-
if (forceSplit)
|
6084 |
-
{ this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }
|
6085 |
-
return this.history.generation
|
6086 |
-
},
|
6087 |
-
isClean: function (gen) {
|
6088 |
-
return this.history.generation == (gen || this.cleanGeneration)
|
6089 |
-
},
|
6090 |
-
|
6091 |
-
getHistory: function() {
|
6092 |
-
return {done: copyHistoryArray(this.history.done),
|
6093 |
-
undone: copyHistoryArray(this.history.undone)}
|
6094 |
-
},
|
6095 |
-
setHistory: function(histData) {
|
6096 |
-
var hist = this.history = new History(this.history.maxGeneration)
|
6097 |
-
hist.done = copyHistoryArray(histData.done.slice(0), null, true)
|
6098 |
-
hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)
|
6099 |
-
},
|
6100 |
-
|
6101 |
-
setGutterMarker: docMethodOp(function(line, gutterID, value) {
|
6102 |
-
return changeLine(this, line, "gutter", function (line) {
|
6103 |
-
var markers = line.gutterMarkers || (line.gutterMarkers = {})
|
6104 |
-
markers[gutterID] = value
|
6105 |
-
if (!value && isEmpty(markers)) { line.gutterMarkers = null }
|
6106 |
-
return true
|
6107 |
-
})
|
6108 |
-
}),
|
6109 |
-
|
6110 |
-
clearGutter: docMethodOp(function(gutterID) {
|
6111 |
-
var this$1 = this;
|
6112 |
-
|
6113 |
-
this.iter(function (line) {
|
6114 |
-
if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
|
6115 |
-
changeLine(this$1, line, "gutter", function () {
|
6116 |
-
line.gutterMarkers[gutterID] = null
|
6117 |
-
if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }
|
6118 |
-
return true
|
6119 |
-
})
|
6120 |
-
}
|
6121 |
-
})
|
6122 |
-
}),
|
6123 |
-
|
6124 |
-
lineInfo: function(line) {
|
6125 |
-
var n
|
6126 |
-
if (typeof line == "number") {
|
6127 |
-
if (!isLine(this, line)) { return null }
|
6128 |
-
n = line
|
6129 |
-
line = getLine(this, line)
|
6130 |
-
if (!line) { return null }
|
6131 |
-
} else {
|
6132 |
-
n = lineNo(line)
|
6133 |
-
if (n == null) { return null }
|
6134 |
-
}
|
6135 |
-
return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
|
6136 |
-
textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
|
6137 |
-
widgets: line.widgets}
|
6138 |
-
},
|
6139 |
-
|
6140 |
-
addLineClass: docMethodOp(function(handle, where, cls) {
|
6141 |
-
return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
|
6142 |
-
var prop = where == "text" ? "textClass"
|
6143 |
-
: where == "background" ? "bgClass"
|
6144 |
-
: where == "gutter" ? "gutterClass" : "wrapClass"
|
6145 |
-
if (!line[prop]) { line[prop] = cls }
|
6146 |
-
else if (classTest(cls).test(line[prop])) { return false }
|
6147 |
-
else { line[prop] += " " + cls }
|
6148 |
-
return true
|
6149 |
-
})
|
6150 |
-
}),
|
6151 |
-
removeLineClass: docMethodOp(function(handle, where, cls) {
|
6152 |
-
return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
|
6153 |
-
var prop = where == "text" ? "textClass"
|
6154 |
-
: where == "background" ? "bgClass"
|
6155 |
-
: where == "gutter" ? "gutterClass" : "wrapClass"
|
6156 |
-
var cur = line[prop]
|
6157 |
-
if (!cur) { return false }
|
6158 |
-
else if (cls == null) { line[prop] = null }
|
6159 |
-
else {
|
6160 |
-
var found = cur.match(classTest(cls))
|
6161 |
-
if (!found) { return false }
|
6162 |
-
var end = found.index + found[0].length
|
6163 |
-
line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null
|
6164 |
-
}
|
6165 |
-
return true
|
6166 |
-
})
|
6167 |
-
}),
|
6168 |
-
|
6169 |
-
addLineWidget: docMethodOp(function(handle, node, options) {
|
6170 |
-
return addLineWidget(this, handle, node, options)
|
6171 |
-
}),
|
6172 |
-
removeLineWidget: function(widget) { widget.clear() },
|
6173 |
-
|
6174 |
-
markText: function(from, to, options) {
|
6175 |
-
return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
|
6176 |
-
},
|
6177 |
-
setBookmark: function(pos, options) {
|
6178 |
-
var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
|
6179 |
-
insertLeft: options && options.insertLeft,
|
6180 |
-
clearWhenEmpty: false, shared: options && options.shared,
|
6181 |
-
handleMouseEvents: options && options.handleMouseEvents}
|
6182 |
-
pos = clipPos(this, pos)
|
6183 |
-
return markText(this, pos, pos, realOpts, "bookmark")
|
6184 |
-
},
|
6185 |
-
findMarksAt: function(pos) {
|
6186 |
-
pos = clipPos(this, pos)
|
6187 |
-
var markers = [], spans = getLine(this, pos.line).markedSpans
|
6188 |
-
if (spans) { for (var i = 0; i < spans.length; ++i) {
|
6189 |
-
var span = spans[i]
|
6190 |
-
if ((span.from == null || span.from <= pos.ch) &&
|
6191 |
-
(span.to == null || span.to >= pos.ch))
|
6192 |
-
{ markers.push(span.marker.parent || span.marker) }
|
6193 |
-
} }
|
6194 |
-
return markers
|
6195 |
-
},
|
6196 |
-
findMarks: function(from, to, filter) {
|
6197 |
-
from = clipPos(this, from); to = clipPos(this, to)
|
6198 |
-
var found = [], lineNo = from.line
|
6199 |
-
this.iter(from.line, to.line + 1, function (line) {
|
6200 |
-
var spans = line.markedSpans
|
6201 |
-
if (spans) { for (var i = 0; i < spans.length; i++) {
|
6202 |
-
var span = spans[i]
|
6203 |
-
if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
|
6204 |
-
span.from == null && lineNo != from.line ||
|
6205 |
-
span.from != null && lineNo == to.line && span.from >= to.ch) &&
|
6206 |
-
(!filter || filter(span.marker)))
|
6207 |
-
{ found.push(span.marker.parent || span.marker) }
|
6208 |
-
} }
|
6209 |
-
++lineNo
|
6210 |
-
})
|
6211 |
-
return found
|
6212 |
-
},
|
6213 |
-
getAllMarks: function() {
|
6214 |
-
var markers = []
|
6215 |
-
this.iter(function (line) {
|
6216 |
-
var sps = line.markedSpans
|
6217 |
-
if (sps) { for (var i = 0; i < sps.length; ++i)
|
6218 |
-
{ if (sps[i].from != null) { markers.push(sps[i].marker) } } }
|
6219 |
-
})
|
6220 |
-
return markers
|
6221 |
-
},
|
6222 |
-
|
6223 |
-
posFromIndex: function(off) {
|
6224 |
-
var ch, lineNo = this.first, sepSize = this.lineSeparator().length
|
6225 |
-
this.iter(function (line) {
|
6226 |
-
var sz = line.text.length + sepSize
|
6227 |
-
if (sz > off) { ch = off; return true }
|
6228 |
-
off -= sz
|
6229 |
-
++lineNo
|
6230 |
-
})
|
6231 |
-
return clipPos(this, Pos(lineNo, ch))
|
6232 |
-
},
|
6233 |
-
indexFromPos: function (coords) {
|
6234 |
-
coords = clipPos(this, coords)
|
6235 |
-
var index = coords.ch
|
6236 |
-
if (coords.line < this.first || coords.ch < 0) { return 0 }
|
6237 |
-
var sepSize = this.lineSeparator().length
|
6238 |
-
this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
|
6239 |
-
index += line.text.length + sepSize
|
6240 |
-
})
|
6241 |
-
return index
|
6242 |
-
},
|
6243 |
-
|
6244 |
-
copy: function(copyHistory) {
|
6245 |
-
var doc = new Doc(getLines(this, this.first, this.first + this.size),
|
6246 |
-
this.modeOption, this.first, this.lineSep, this.direction)
|
6247 |
-
doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft
|
6248 |
-
doc.sel = this.sel
|
6249 |
-
doc.extend = false
|
6250 |
-
if (copyHistory) {
|
6251 |
-
doc.history.undoDepth = this.history.undoDepth
|
6252 |
-
doc.setHistory(this.getHistory())
|
6253 |
-
}
|
6254 |
-
return doc
|
6255 |
-
},
|
6256 |
-
|
6257 |
-
linkedDoc: function(options) {
|
6258 |
-
if (!options) { options = {} }
|
6259 |
-
var from = this.first, to = this.first + this.size
|
6260 |
-
if (options.from != null && options.from > from) { from = options.from }
|
6261 |
-
if (options.to != null && options.to < to) { to = options.to }
|
6262 |
-
var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction)
|
6263 |
-
if (options.sharedHist) { copy.history = this.history
|
6264 |
-
; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})
|
6265 |
-
copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]
|
6266 |
-
copySharedMarkers(copy, findSharedMarkers(this))
|
6267 |
-
return copy
|
6268 |
-
},
|
6269 |
-
unlinkDoc: function(other) {
|
6270 |
-
var this$1 = this;
|
6271 |
-
|
6272 |
-
if (other instanceof CodeMirror) { other = other.doc }
|
6273 |
-
if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
|
6274 |
-
var link = this$1.linked[i]
|
6275 |
-
if (link.doc != other) { continue }
|
6276 |
-
this$1.linked.splice(i, 1)
|
6277 |
-
other.unlinkDoc(this$1)
|
6278 |
-
detachSharedMarkers(findSharedMarkers(this$1))
|
6279 |
-
break
|
6280 |
-
} }
|
6281 |
-
// If the histories were shared, split them again
|
6282 |
-
if (other.history == this.history) {
|
6283 |
-
var splitIds = [other.id]
|
6284 |
-
linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)
|
6285 |
-
other.history = new History(null)
|
6286 |
-
other.history.done = copyHistoryArray(this.history.done, splitIds)
|
6287 |
-
other.history.undone = copyHistoryArray(this.history.undone, splitIds)
|
6288 |
-
}
|
6289 |
-
},
|
6290 |
-
iterLinkedDocs: function(f) {linkedDocs(this, f)},
|
6291 |
-
|
6292 |
-
getMode: function() {return this.mode},
|
6293 |
-
getEditor: function() {return this.cm},
|
6294 |
-
|
6295 |
-
splitLines: function(str) {
|
6296 |
-
if (this.lineSep) { return str.split(this.lineSep) }
|
6297 |
-
return splitLinesAuto(str)
|
6298 |
-
},
|
6299 |
-
lineSeparator: function() { return this.lineSep || "\n" },
|
6300 |
-
|
6301 |
-
setDirection: docMethodOp(function (dir) {
|
6302 |
-
if (dir != "rtl") { dir = "ltr" }
|
6303 |
-
if (dir == this.direction) { return }
|
6304 |
-
this.direction = dir
|
6305 |
-
this.iter(function (line) { return line.order = null; })
|
6306 |
-
if (this.cm) { directionChanged(this.cm) }
|
6307 |
-
})
|
6308 |
-
})
|
6309 |
-
|
6310 |
-
// Public alias.
|
6311 |
-
Doc.prototype.eachLine = Doc.prototype.iter
|
6312 |
-
|
6313 |
-
// Kludge to work around strange IE behavior where it'll sometimes
|
6314 |
-
// re-fire a series of drag-related events right after the drop (#1551)
|
6315 |
-
var lastDrop = 0
|
6316 |
-
|
6317 |
-
function onDrop(e) {
|
6318 |
-
var cm = this
|
6319 |
-
clearDragCursor(cm)
|
6320 |
-
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
|
6321 |
-
{ return }
|
6322 |
-
e_preventDefault(e)
|
6323 |
-
if (ie) { lastDrop = +new Date }
|
6324 |
-
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files
|
6325 |
-
if (!pos || cm.isReadOnly()) { return }
|
6326 |
-
// Might be a file drop, in which case we simply extract the text
|
6327 |
-
// and insert it.
|
6328 |
-
if (files && files.length && window.FileReader && window.File) {
|
6329 |
-
var n = files.length, text = Array(n), read = 0
|
6330 |
-
var loadFile = function (file, i) {
|
6331 |
-
if (cm.options.allowDropFileTypes &&
|
6332 |
-
indexOf(cm.options.allowDropFileTypes, file.type) == -1)
|
6333 |
-
{ return }
|
6334 |
-
|
6335 |
-
var reader = new FileReader
|
6336 |
-
reader.onload = operation(cm, function () {
|
6337 |
-
var content = reader.result
|
6338 |
-
if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" }
|
6339 |
-
text[i] = content
|
6340 |
-
if (++read == n) {
|
6341 |
-
pos = clipPos(cm.doc, pos)
|
6342 |
-
var change = {from: pos, to: pos,
|
6343 |
-
text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
|
6344 |
-
origin: "paste"}
|
6345 |
-
makeChange(cm.doc, change)
|
6346 |
-
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))
|
6347 |
-
}
|
6348 |
-
})
|
6349 |
-
reader.readAsText(file)
|
6350 |
-
}
|
6351 |
-
for (var i = 0; i < n; ++i) { loadFile(files[i], i) }
|
6352 |
-
} else { // Normal drop
|
6353 |
-
// Don't do a replace if the drop happened inside of the selected text.
|
6354 |
-
if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
|
6355 |
-
cm.state.draggingText(e)
|
6356 |
-
// Ensure the editor is re-focused
|
6357 |
-
setTimeout(function () { return cm.display.input.focus(); }, 20)
|
6358 |
-
return
|
6359 |
-
}
|
6360 |
-
try {
|
6361 |
-
var text$1 = e.dataTransfer.getData("Text")
|
6362 |
-
if (text$1) {
|
6363 |
-
var selected
|
6364 |
-
if (cm.state.draggingText && !cm.state.draggingText.copy)
|
6365 |
-
{ selected = cm.listSelections() }
|
6366 |
-
setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))
|
6367 |
-
if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
|
6368 |
-
{ replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } }
|
6369 |
-
cm.replaceSelection(text$1, "around", "paste")
|
6370 |
-
cm.display.input.focus()
|
6371 |
-
}
|
6372 |
-
}
|
6373 |
-
catch(e){}
|
6374 |
-
}
|
6375 |
-
}
|
6376 |
-
|
6377 |
-
function onDragStart(cm, e) {
|
6378 |
-
if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
|
6379 |
-
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
|
6380 |
-
|
6381 |
-
e.dataTransfer.setData("Text", cm.getSelection())
|
6382 |
-
e.dataTransfer.effectAllowed = "copyMove"
|
6383 |
-
|
6384 |
-
// Use dummy image instead of default browsers image.
|
6385 |
-
// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
|
6386 |
-
if (e.dataTransfer.setDragImage && !safari) {
|
6387 |
-
var img = elt("img", null, null, "position: fixed; left: 0; top: 0;")
|
6388 |
-
img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
6389 |
-
if (presto) {
|
6390 |
-
img.width = img.height = 1
|
6391 |
-
cm.display.wrapper.appendChild(img)
|
6392 |
-
// Force a relayout, or Opera won't use our image for some obscure reason
|
6393 |
-
img._top = img.offsetTop
|
6394 |
-
}
|
6395 |
-
e.dataTransfer.setDragImage(img, 0, 0)
|
6396 |
-
if (presto) { img.parentNode.removeChild(img) }
|
6397 |
-
}
|
6398 |
-
}
|
6399 |
-
|
6400 |
-
function onDragOver(cm, e) {
|
6401 |
-
var pos = posFromMouse(cm, e)
|
6402 |
-
if (!pos) { return }
|
6403 |
-
var frag = document.createDocumentFragment()
|
6404 |
-
drawSelectionCursor(cm, pos, frag)
|
6405 |
-
if (!cm.display.dragCursor) {
|
6406 |
-
cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors")
|
6407 |
-
cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)
|
6408 |
-
}
|
6409 |
-
removeChildrenAndAdd(cm.display.dragCursor, frag)
|
6410 |
-
}
|
6411 |
-
|
6412 |
-
function clearDragCursor(cm) {
|
6413 |
-
if (cm.display.dragCursor) {
|
6414 |
-
cm.display.lineSpace.removeChild(cm.display.dragCursor)
|
6415 |
-
cm.display.dragCursor = null
|
6416 |
-
}
|
6417 |
-
}
|
6418 |
-
|
6419 |
-
// These must be handled carefully, because naively registering a
|
6420 |
-
// handler for each editor will cause the editors to never be
|
6421 |
-
// garbage collected.
|
6422 |
-
|
6423 |
-
function forEachCodeMirror(f) {
|
6424 |
-
if (!document.body.getElementsByClassName) { return }
|
6425 |
-
var byClass = document.body.getElementsByClassName("CodeMirror")
|
6426 |
-
for (var i = 0; i < byClass.length; i++) {
|
6427 |
-
var cm = byClass[i].CodeMirror
|
6428 |
-
if (cm) { f(cm) }
|
6429 |
-
}
|
6430 |
-
}
|
6431 |
-
|
6432 |
-
var globalsRegistered = false
|
6433 |
-
function ensureGlobalHandlers() {
|
6434 |
-
if (globalsRegistered) { return }
|
6435 |
-
registerGlobalHandlers()
|
6436 |
-
globalsRegistered = true
|
6437 |
-
}
|
6438 |
-
function registerGlobalHandlers() {
|
6439 |
-
// When the window resizes, we need to refresh active editors.
|
6440 |
-
var resizeTimer
|
6441 |
-
on(window, "resize", function () {
|
6442 |
-
if (resizeTimer == null) { resizeTimer = setTimeout(function () {
|
6443 |
-
resizeTimer = null
|
6444 |
-
forEachCodeMirror(onResize)
|
6445 |
-
}, 100) }
|
6446 |
-
})
|
6447 |
-
// When the window loses focus, we want to show the editor as blurred
|
6448 |
-
on(window, "blur", function () { return forEachCodeMirror(onBlur); })
|
6449 |
-
}
|
6450 |
-
// Called when the window resizes
|
6451 |
-
function onResize(cm) {
|
6452 |
-
var d = cm.display
|
6453 |
-
if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
|
6454 |
-
{ return }
|
6455 |
-
// Might be a text scaling operation, clear size caches.
|
6456 |
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
6457 |
-
d.scrollbarsClipped = false
|
6458 |
-
cm.setSize()
|
6459 |
-
}
|
6460 |
-
|
6461 |
-
var keyNames = {
|
6462 |
-
3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
|
6463 |
-
19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
|
6464 |
-
36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
|
6465 |
-
46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
|
6466 |
-
106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
|
6467 |
-
173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
|
6468 |
-
221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
|
6469 |
-
63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
|
6470 |
-
}
|
6471 |
-
|
6472 |
-
// Number keys
|
6473 |
-
for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }
|
6474 |
-
// Alphabetic keys
|
6475 |
-
for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }
|
6476 |
-
// Function keys
|
6477 |
-
for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 }
|
6478 |
-
|
6479 |
-
var keyMap = {}
|
6480 |
-
|
6481 |
-
keyMap.basic = {
|
6482 |
-
"Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
|
6483 |
-
"End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
|
6484 |
-
"Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
|
6485 |
-
"Tab": "defaultTab", "Shift-Tab": "indentAuto",
|
6486 |
-
"Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
|
6487 |
-
"Esc": "singleSelection"
|
6488 |
-
}
|
6489 |
-
// Note that the save and find-related commands aren't defined by
|
6490 |
-
// default. User code or addons can define them. Unknown commands
|
6491 |
-
// are simply ignored.
|
6492 |
-
keyMap.pcDefault = {
|
6493 |
-
"Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
|
6494 |
-
"Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
|
6495 |
-
"Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
|
6496 |
-
"Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
|
6497 |
-
"Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
|
6498 |
-
"Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
|
6499 |
-
"Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
|
6500 |
-
fallthrough: "basic"
|
6501 |
-
}
|
6502 |
-
// Very basic readline/emacs-style bindings, which are standard on Mac.
|
6503 |
-
keyMap.emacsy = {
|
6504 |
-
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
|
6505 |
-
"Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
6506 |
-
"Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
|
6507 |
-
"Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
|
6508 |
-
"Ctrl-O": "openLine"
|
6509 |
-
}
|
6510 |
-
keyMap.macDefault = {
|
6511 |
-
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
|
6512 |
-
"Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
|
6513 |
-
"Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
|
6514 |
-
"Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
|
6515 |
-
"Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
|
6516 |
-
"Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
|
6517 |
-
"Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
|
6518 |
-
fallthrough: ["basic", "emacsy"]
|
6519 |
-
}
|
6520 |
-
keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault
|
6521 |
-
|
6522 |
-
// KEYMAP DISPATCH
|
6523 |
-
|
6524 |
-
function normalizeKeyName(name) {
|
6525 |
-
var parts = name.split(/-(?!$)/)
|
6526 |
-
name = parts[parts.length - 1]
|
6527 |
-
var alt, ctrl, shift, cmd
|
6528 |
-
for (var i = 0; i < parts.length - 1; i++) {
|
6529 |
-
var mod = parts[i]
|
6530 |
-
if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }
|
6531 |
-
else if (/^a(lt)?$/i.test(mod)) { alt = true }
|
6532 |
-
else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }
|
6533 |
-
else if (/^s(hift)?$/i.test(mod)) { shift = true }
|
6534 |
-
else { throw new Error("Unrecognized modifier name: " + mod) }
|
6535 |
-
}
|
6536 |
-
if (alt) { name = "Alt-" + name }
|
6537 |
-
if (ctrl) { name = "Ctrl-" + name }
|
6538 |
-
if (cmd) { name = "Cmd-" + name }
|
6539 |
-
if (shift) { name = "Shift-" + name }
|
6540 |
-
return name
|
6541 |
-
}
|
6542 |
-
|
6543 |
-
// This is a kludge to keep keymaps mostly working as raw objects
|
6544 |
-
// (backwards compatibility) while at the same time support features
|
6545 |
-
// like normalization and multi-stroke key bindings. It compiles a
|
6546 |
-
// new normalized keymap, and then updates the old object to reflect
|
6547 |
-
// this.
|
6548 |
-
function normalizeKeyMap(keymap) {
|
6549 |
-
var copy = {}
|
6550 |
-
for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
|
6551 |
-
var value = keymap[keyname]
|
6552 |
-
if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
|
6553 |
-
if (value == "...") { delete keymap[keyname]; continue }
|
6554 |
-
|
6555 |
-
var keys = map(keyname.split(" "), normalizeKeyName)
|
6556 |
-
for (var i = 0; i < keys.length; i++) {
|
6557 |
-
var val = (void 0), name = (void 0)
|
6558 |
-
if (i == keys.length - 1) {
|
6559 |
-
name = keys.join(" ")
|
6560 |
-
val = value
|
6561 |
-
} else {
|
6562 |
-
name = keys.slice(0, i + 1).join(" ")
|
6563 |
-
val = "..."
|
6564 |
-
}
|
6565 |
-
var prev = copy[name]
|
6566 |
-
if (!prev) { copy[name] = val }
|
6567 |
-
else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
|
6568 |
-
}
|
6569 |
-
delete keymap[keyname]
|
6570 |
-
} }
|
6571 |
-
for (var prop in copy) { keymap[prop] = copy[prop] }
|
6572 |
-
return keymap
|
6573 |
-
}
|
6574 |
-
|
6575 |
-
function lookupKey(key, map, handle, context) {
|
6576 |
-
map = getKeyMap(map)
|
6577 |
-
var found = map.call ? map.call(key, context) : map[key]
|
6578 |
-
if (found === false) { return "nothing" }
|
6579 |
-
if (found === "...") { return "multi" }
|
6580 |
-
if (found != null && handle(found)) { return "handled" }
|
6581 |
-
|
6582 |
-
if (map.fallthrough) {
|
6583 |
-
if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
|
6584 |
-
{ return lookupKey(key, map.fallthrough, handle, context) }
|
6585 |
-
for (var i = 0; i < map.fallthrough.length; i++) {
|
6586 |
-
var result = lookupKey(key, map.fallthrough[i], handle, context)
|
6587 |
-
if (result) { return result }
|
6588 |
-
}
|
6589 |
-
}
|
6590 |
-
}
|
6591 |
-
|
6592 |
-
// Modifier key presses don't count as 'real' key presses for the
|
6593 |
-
// purpose of keymap fallthrough.
|
6594 |
-
function isModifierKey(value) {
|
6595 |
-
var name = typeof value == "string" ? value : keyNames[value.keyCode]
|
6596 |
-
return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
|
6597 |
-
}
|
6598 |
-
|
6599 |
-
// Look up the name of a key as indicated by an event object.
|
6600 |
-
function keyName(event, noShift) {
|
6601 |
-
if (presto && event.keyCode == 34 && event["char"]) { return false }
|
6602 |
-
var base = keyNames[event.keyCode], name = base
|
6603 |
-
if (name == null || event.altGraphKey) { return false }
|
6604 |
-
if (event.altKey && base != "Alt") { name = "Alt-" + name }
|
6605 |
-
if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name }
|
6606 |
-
if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name }
|
6607 |
-
if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name }
|
6608 |
-
return name
|
6609 |
-
}
|
6610 |
-
|
6611 |
-
function getKeyMap(val) {
|
6612 |
-
return typeof val == "string" ? keyMap[val] : val
|
6613 |
-
}
|
6614 |
-
|
6615 |
-
// Helper for deleting text near the selection(s), used to implement
|
6616 |
-
// backspace, delete, and similar functionality.
|
6617 |
-
function deleteNearSelection(cm, compute) {
|
6618 |
-
var ranges = cm.doc.sel.ranges, kill = []
|
6619 |
-
// Build up a set of ranges to kill first, merging overlapping
|
6620 |
-
// ranges.
|
6621 |
-
for (var i = 0; i < ranges.length; i++) {
|
6622 |
-
var toKill = compute(ranges[i])
|
6623 |
-
while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
|
6624 |
-
var replaced = kill.pop()
|
6625 |
-
if (cmp(replaced.from, toKill.from) < 0) {
|
6626 |
-
toKill.from = replaced.from
|
6627 |
-
break
|
6628 |
-
}
|
6629 |
-
}
|
6630 |
-
kill.push(toKill)
|
6631 |
-
}
|
6632 |
-
// Next, remove those actual ranges.
|
6633 |
-
runInOp(cm, function () {
|
6634 |
-
for (var i = kill.length - 1; i >= 0; i--)
|
6635 |
-
{ replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") }
|
6636 |
-
ensureCursorVisible(cm)
|
6637 |
-
})
|
6638 |
-
}
|
6639 |
-
|
6640 |
-
// Commands are parameter-less actions that can be performed on an
|
6641 |
-
// editor, mostly used for keybindings.
|
6642 |
-
var commands = {
|
6643 |
-
selectAll: selectAll,
|
6644 |
-
singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
|
6645 |
-
killLine: function (cm) { return deleteNearSelection(cm, function (range) {
|
6646 |
-
if (range.empty()) {
|
6647 |
-
var len = getLine(cm.doc, range.head.line).text.length
|
6648 |
-
if (range.head.ch == len && range.head.line < cm.lastLine())
|
6649 |
-
{ return {from: range.head, to: Pos(range.head.line + 1, 0)} }
|
6650 |
-
else
|
6651 |
-
{ return {from: range.head, to: Pos(range.head.line, len)} }
|
6652 |
-
} else {
|
6653 |
-
return {from: range.from(), to: range.to()}
|
6654 |
-
}
|
6655 |
-
}); },
|
6656 |
-
deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
|
6657 |
-
from: Pos(range.from().line, 0),
|
6658 |
-
to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
|
6659 |
-
}); }); },
|
6660 |
-
delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
|
6661 |
-
from: Pos(range.from().line, 0), to: range.from()
|
6662 |
-
}); }); },
|
6663 |
-
delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
|
6664 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6665 |
-
var leftPos = cm.coordsChar({left: 0, top: top}, "div")
|
6666 |
-
return {from: leftPos, to: range.from()}
|
6667 |
-
}); },
|
6668 |
-
delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
|
6669 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6670 |
-
var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
|
6671 |
-
return {from: range.from(), to: rightPos }
|
6672 |
-
}); },
|
6673 |
-
undo: function (cm) { return cm.undo(); },
|
6674 |
-
redo: function (cm) { return cm.redo(); },
|
6675 |
-
undoSelection: function (cm) { return cm.undoSelection(); },
|
6676 |
-
redoSelection: function (cm) { return cm.redoSelection(); },
|
6677 |
-
goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
|
6678 |
-
goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
|
6679 |
-
goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
|
6680 |
-
{origin: "+move", bias: 1}
|
6681 |
-
); },
|
6682 |
-
goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
|
6683 |
-
{origin: "+move", bias: 1}
|
6684 |
-
); },
|
6685 |
-
goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
|
6686 |
-
{origin: "+move", bias: -1}
|
6687 |
-
); },
|
6688 |
-
goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6689 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6690 |
-
return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
|
6691 |
-
}, sel_move); },
|
6692 |
-
goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6693 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6694 |
-
return cm.coordsChar({left: 0, top: top}, "div")
|
6695 |
-
}, sel_move); },
|
6696 |
-
goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
|
6697 |
-
var top = cm.charCoords(range.head, "div").top + 5
|
6698 |
-
var pos = cm.coordsChar({left: 0, top: top}, "div")
|
6699 |
-
if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
|
6700 |
-
return pos
|
6701 |
-
}, sel_move); },
|
6702 |
-
goLineUp: function (cm) { return cm.moveV(-1, "line"); },
|
6703 |
-
goLineDown: function (cm) { return cm.moveV(1, "line"); },
|
6704 |
-
goPageUp: function (cm) { return cm.moveV(-1, "page"); },
|
6705 |
-
goPageDown: function (cm) { return cm.moveV(1, "page"); },
|
6706 |
-
goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
|
6707 |
-
goCharRight: function (cm) { return cm.moveH(1, "char"); },
|
6708 |
-
goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
|
6709 |
-
goColumnRight: function (cm) { return cm.moveH(1, "column"); },
|
6710 |
-
goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
|
6711 |
-
goGroupRight: function (cm) { return cm.moveH(1, "group"); },
|
6712 |
-
goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
|
6713 |
-
goWordRight: function (cm) { return cm.moveH(1, "word"); },
|
6714 |
-
delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
|
6715 |
-
delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
|
6716 |
-
delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
|
6717 |
-
delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
|
6718 |
-
delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
|
6719 |
-
delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
|
6720 |
-
indentAuto: function (cm) { return cm.indentSelection("smart"); },
|
6721 |
-
indentMore: function (cm) { return cm.indentSelection("add"); },
|
6722 |
-
indentLess: function (cm) { return cm.indentSelection("subtract"); },
|
6723 |
-
insertTab: function (cm) { return cm.replaceSelection("\t"); },
|
6724 |
-
insertSoftTab: function (cm) {
|
6725 |
-
var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize
|
6726 |
-
for (var i = 0; i < ranges.length; i++) {
|
6727 |
-
var pos = ranges[i].from()
|
6728 |
-
var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)
|
6729 |
-
spaces.push(spaceStr(tabSize - col % tabSize))
|
6730 |
-
}
|
6731 |
-
cm.replaceSelections(spaces)
|
6732 |
-
},
|
6733 |
-
defaultTab: function (cm) {
|
6734 |
-
if (cm.somethingSelected()) { cm.indentSelection("add") }
|
6735 |
-
else { cm.execCommand("insertTab") }
|
6736 |
-
},
|
6737 |
-
// Swap the two chars left and right of each selection's head.
|
6738 |
-
// Move cursor behind the two swapped characters afterwards.
|
6739 |
-
//
|
6740 |
-
// Doesn't consider line feeds a character.
|
6741 |
-
// Doesn't scan more than one line above to find a character.
|
6742 |
-
// Doesn't do anything on an empty line.
|
6743 |
-
// Doesn't do anything with non-empty selections.
|
6744 |
-
transposeChars: function (cm) { return runInOp(cm, function () {
|
6745 |
-
var ranges = cm.listSelections(), newSel = []
|
6746 |
-
for (var i = 0; i < ranges.length; i++) {
|
6747 |
-
if (!ranges[i].empty()) { continue }
|
6748 |
-
var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text
|
6749 |
-
if (line) {
|
6750 |
-
if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }
|
6751 |
-
if (cur.ch > 0) {
|
6752 |
-
cur = new Pos(cur.line, cur.ch + 1)
|
6753 |
-
cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
|
6754 |
-
Pos(cur.line, cur.ch - 2), cur, "+transpose")
|
6755 |
-
} else if (cur.line > cm.doc.first) {
|
6756 |
-
var prev = getLine(cm.doc, cur.line - 1).text
|
6757 |
-
if (prev) {
|
6758 |
-
cur = new Pos(cur.line, 1)
|
6759 |
-
cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
|
6760 |
-
prev.charAt(prev.length - 1),
|
6761 |
-
Pos(cur.line - 1, prev.length - 1), cur, "+transpose")
|
6762 |
-
}
|
6763 |
-
}
|
6764 |
-
}
|
6765 |
-
newSel.push(new Range(cur, cur))
|
6766 |
-
}
|
6767 |
-
cm.setSelections(newSel)
|
6768 |
-
}); },
|
6769 |
-
newlineAndIndent: function (cm) { return runInOp(cm, function () {
|
6770 |
-
var sels = cm.listSelections()
|
6771 |
-
for (var i = sels.length - 1; i >= 0; i--)
|
6772 |
-
{ cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") }
|
6773 |
-
sels = cm.listSelections()
|
6774 |
-
for (var i$1 = 0; i$1 < sels.length; i$1++)
|
6775 |
-
{ cm.indentLine(sels[i$1].from().line, null, true) }
|
6776 |
-
ensureCursorVisible(cm)
|
6777 |
-
}); },
|
6778 |
-
openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
|
6779 |
-
toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
|
6780 |
-
}
|
6781 |
-
|
6782 |
-
|
6783 |
-
function lineStart(cm, lineN) {
|
6784 |
-
var line = getLine(cm.doc, lineN)
|
6785 |
-
var visual = visualLine(line)
|
6786 |
-
if (visual != line) { lineN = lineNo(visual) }
|
6787 |
-
return endOfLine(true, cm, visual, lineN, 1)
|
6788 |
-
}
|
6789 |
-
function lineEnd(cm, lineN) {
|
6790 |
-
var line = getLine(cm.doc, lineN)
|
6791 |
-
var visual = visualLineEnd(line)
|
6792 |
-
if (visual != line) { lineN = lineNo(visual) }
|
6793 |
-
return endOfLine(true, cm, line, lineN, -1)
|
6794 |
-
}
|
6795 |
-
function lineStartSmart(cm, pos) {
|
6796 |
-
var start = lineStart(cm, pos.line)
|
6797 |
-
var line = getLine(cm.doc, start.line)
|
6798 |
-
var order = getOrder(line, cm.doc.direction)
|
6799 |
-
if (!order || order[0].level == 0) {
|
6800 |
-
var firstNonWS = Math.max(0, line.text.search(/\S/))
|
6801 |
-
var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
|
6802 |
-
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
|
6803 |
-
}
|
6804 |
-
return start
|
6805 |
-
}
|
6806 |
-
|
6807 |
-
// Run a handler that was bound to a key.
|
6808 |
-
function doHandleBinding(cm, bound, dropShift) {
|
6809 |
-
if (typeof bound == "string") {
|
6810 |
-
bound = commands[bound]
|
6811 |
-
if (!bound) { return false }
|
6812 |
-
}
|
6813 |
-
// Ensure previous input has been read, so that the handler sees a
|
6814 |
-
// consistent view of the document
|
6815 |
-
cm.display.input.ensurePolled()
|
6816 |
-
var prevShift = cm.display.shift, done = false
|
6817 |
-
try {
|
6818 |
-
if (cm.isReadOnly()) { cm.state.suppressEdits = true }
|
6819 |
-
if (dropShift) { cm.display.shift = false }
|
6820 |
-
done = bound(cm) != Pass
|
6821 |
-
} finally {
|
6822 |
-
cm.display.shift = prevShift
|
6823 |
-
cm.state.suppressEdits = false
|
6824 |
-
}
|
6825 |
-
return done
|
6826 |
-
}
|
6827 |
-
|
6828 |
-
function lookupKeyForEditor(cm, name, handle) {
|
6829 |
-
for (var i = 0; i < cm.state.keyMaps.length; i++) {
|
6830 |
-
var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)
|
6831 |
-
if (result) { return result }
|
6832 |
-
}
|
6833 |
-
return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
|
6834 |
-
|| lookupKey(name, cm.options.keyMap, handle, cm)
|
6835 |
-
}
|
6836 |
-
|
6837 |
-
var stopSeq = new Delayed
|
6838 |
-
function dispatchKey(cm, name, e, handle) {
|
6839 |
-
var seq = cm.state.keySeq
|
6840 |
-
if (seq) {
|
6841 |
-
if (isModifierKey(name)) { return "handled" }
|
6842 |
-
stopSeq.set(50, function () {
|
6843 |
-
if (cm.state.keySeq == seq) {
|
6844 |
-
cm.state.keySeq = null
|
6845 |
-
cm.display.input.reset()
|
6846 |
-
}
|
6847 |
-
})
|
6848 |
-
name = seq + " " + name
|
6849 |
-
}
|
6850 |
-
var result = lookupKeyForEditor(cm, name, handle)
|
6851 |
-
|
6852 |
-
if (result == "multi")
|
6853 |
-
{ cm.state.keySeq = name }
|
6854 |
-
if (result == "handled")
|
6855 |
-
{ signalLater(cm, "keyHandled", cm, name, e) }
|
6856 |
-
|
6857 |
-
if (result == "handled" || result == "multi") {
|
6858 |
-
e_preventDefault(e)
|
6859 |
-
restartBlink(cm)
|
6860 |
-
}
|
6861 |
-
|
6862 |
-
if (seq && !result && /\'$/.test(name)) {
|
6863 |
-
e_preventDefault(e)
|
6864 |
-
return true
|
6865 |
-
}
|
6866 |
-
return !!result
|
6867 |
-
}
|
6868 |
-
|
6869 |
-
// Handle a key from the keydown event.
|
6870 |
-
function handleKeyBinding(cm, e) {
|
6871 |
-
var name = keyName(e, true)
|
6872 |
-
if (!name) { return false }
|
6873 |
-
|
6874 |
-
if (e.shiftKey && !cm.state.keySeq) {
|
6875 |
-
// First try to resolve full name (including 'Shift-'). Failing
|
6876 |
-
// that, see if there is a cursor-motion command (starting with
|
6877 |
-
// 'go') bound to the keyname without 'Shift-'.
|
6878 |
-
return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
|
6879 |
-
|| dispatchKey(cm, name, e, function (b) {
|
6880 |
-
if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
|
6881 |
-
{ return doHandleBinding(cm, b) }
|
6882 |
-
})
|
6883 |
-
} else {
|
6884 |
-
return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
|
6885 |
-
}
|
6886 |
-
}
|
6887 |
-
|
6888 |
-
// Handle a key from the keypress event
|
6889 |
-
function handleCharBinding(cm, e, ch) {
|
6890 |
-
return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
|
6891 |
-
}
|
6892 |
-
|
6893 |
-
var lastStoppedKey = null
|
6894 |
-
function onKeyDown(e) {
|
6895 |
-
var cm = this
|
6896 |
-
cm.curOp.focus = activeElt()
|
6897 |
-
if (signalDOMEvent(cm, e)) { return }
|
6898 |
-
// IE does strange things with escape.
|
6899 |
-
if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }
|
6900 |
-
var code = e.keyCode
|
6901 |
-
cm.display.shift = code == 16 || e.shiftKey
|
6902 |
-
var handled = handleKeyBinding(cm, e)
|
6903 |
-
if (presto) {
|
6904 |
-
lastStoppedKey = handled ? code : null
|
6905 |
-
// Opera has no cut event... we try to at least catch the key combo
|
6906 |
-
if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
|
6907 |
-
{ cm.replaceSelection("", null, "cut") }
|
6908 |
-
}
|
6909 |
-
|
6910 |
-
// Turn mouse into crosshair when Alt is held on Mac.
|
6911 |
-
if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
|
6912 |
-
{ showCrossHair(cm) }
|
6913 |
-
}
|
6914 |
-
|
6915 |
-
function showCrossHair(cm) {
|
6916 |
-
var lineDiv = cm.display.lineDiv
|
6917 |
-
addClass(lineDiv, "CodeMirror-crosshair")
|
6918 |
-
|
6919 |
-
function up(e) {
|
6920 |
-
if (e.keyCode == 18 || !e.altKey) {
|
6921 |
-
rmClass(lineDiv, "CodeMirror-crosshair")
|
6922 |
-
off(document, "keyup", up)
|
6923 |
-
off(document, "mouseover", up)
|
6924 |
-
}
|
6925 |
-
}
|
6926 |
-
on(document, "keyup", up)
|
6927 |
-
on(document, "mouseover", up)
|
6928 |
-
}
|
6929 |
-
|
6930 |
-
function onKeyUp(e) {
|
6931 |
-
if (e.keyCode == 16) { this.doc.sel.shift = false }
|
6932 |
-
signalDOMEvent(this, e)
|
6933 |
-
}
|
6934 |
-
|
6935 |
-
function onKeyPress(e) {
|
6936 |
-
var cm = this
|
6937 |
-
if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
|
6938 |
-
var keyCode = e.keyCode, charCode = e.charCode
|
6939 |
-
if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
|
6940 |
-
if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
|
6941 |
-
var ch = String.fromCharCode(charCode == null ? keyCode : charCode)
|
6942 |
-
// Some browsers fire keypress events for backspace
|
6943 |
-
if (ch == "\x08") { return }
|
6944 |
-
if (handleCharBinding(cm, e, ch)) { return }
|
6945 |
-
cm.display.input.onKeyPress(e)
|
6946 |
-
}
|
6947 |
-
|
6948 |
-
// A mouse down can be a single click, double click, triple click,
|
6949 |
-
// start of selection drag, start of text drag, new cursor
|
6950 |
-
// (ctrl-click), rectangle drag (alt-drag), or xwin
|
6951 |
-
// middle-click-paste. Or it might be a click on something we should
|
6952 |
-
// not interfere with, such as a scrollbar or widget.
|
6953 |
-
function onMouseDown(e) {
|
6954 |
-
var cm = this, display = cm.display
|
6955 |
-
if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
|
6956 |
-
display.input.ensurePolled()
|
6957 |
-
display.shift = e.shiftKey
|
6958 |
-
|
6959 |
-
if (eventInWidget(display, e)) {
|
6960 |
-
if (!webkit) {
|
6961 |
-
// Briefly turn off draggability, to allow widgets to do
|
6962 |
-
// normal dragging things.
|
6963 |
-
display.scroller.draggable = false
|
6964 |
-
setTimeout(function () { return display.scroller.draggable = true; }, 100)
|
6965 |
-
}
|
6966 |
-
return
|
6967 |
-
}
|
6968 |
-
if (clickInGutter(cm, e)) { return }
|
6969 |
-
var start = posFromMouse(cm, e)
|
6970 |
-
window.focus()
|
6971 |
-
|
6972 |
-
switch (e_button(e)) {
|
6973 |
-
case 1:
|
6974 |
-
// #3261: make sure, that we're not starting a second selection
|
6975 |
-
if (cm.state.selectingText)
|
6976 |
-
{ cm.state.selectingText(e) }
|
6977 |
-
else if (start)
|
6978 |
-
{ leftButtonDown(cm, e, start) }
|
6979 |
-
else if (e_target(e) == display.scroller)
|
6980 |
-
{ e_preventDefault(e) }
|
6981 |
-
break
|
6982 |
-
case 2:
|
6983 |
-
if (webkit) { cm.state.lastMiddleDown = +new Date }
|
6984 |
-
if (start) { extendSelection(cm.doc, start) }
|
6985 |
-
setTimeout(function () { return display.input.focus(); }, 20)
|
6986 |
-
e_preventDefault(e)
|
6987 |
-
break
|
6988 |
-
case 3:
|
6989 |
-
if (captureRightClick) { onContextMenu(cm, e) }
|
6990 |
-
else { delayBlurEvent(cm) }
|
6991 |
-
break
|
6992 |
-
}
|
6993 |
-
}
|
6994 |
-
|
6995 |
-
var lastClick;
|
6996 |
-
var lastDoubleClick;
|
6997 |
-
function leftButtonDown(cm, e, start) {
|
6998 |
-
if (ie) { setTimeout(bind(ensureFocus, cm), 0) }
|
6999 |
-
else { cm.curOp.focus = activeElt() }
|
7000 |
-
|
7001 |
-
var now = +new Date, type
|
7002 |
-
if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
|
7003 |
-
type = "triple"
|
7004 |
-
} else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
|
7005 |
-
type = "double"
|
7006 |
-
lastDoubleClick = {time: now, pos: start}
|
7007 |
-
} else {
|
7008 |
-
type = "single"
|
7009 |
-
lastClick = {time: now, pos: start}
|
7010 |
-
}
|
7011 |
-
|
7012 |
-
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained
|
7013 |
-
if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
|
7014 |
-
type == "single" && (contained = sel.contains(start)) > -1 &&
|
7015 |
-
(cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
|
7016 |
-
(cmp(contained.to(), start) > 0 || start.xRel < 0))
|
7017 |
-
{ leftButtonStartDrag(cm, e, start, modifier) }
|
7018 |
-
else
|
7019 |
-
{ leftButtonSelect(cm, e, start, type, modifier) }
|
7020 |
-
}
|
7021 |
-
|
7022 |
-
// Start a text drag. When it ends, see if any dragging actually
|
7023 |
-
// happen, and treat as a click if it didn't.
|
7024 |
-
function leftButtonStartDrag(cm, e, start, modifier) {
|
7025 |
-
var display = cm.display, moved = false
|
7026 |
-
var dragEnd = operation(cm, function (e) {
|
7027 |
-
if (webkit) { display.scroller.draggable = false }
|
7028 |
-
cm.state.draggingText = false
|
7029 |
-
off(document, "mouseup", dragEnd)
|
7030 |
-
off(document, "mousemove", mouseMove)
|
7031 |
-
off(display.scroller, "dragstart", dragStart)
|
7032 |
-
off(display.scroller, "drop", dragEnd)
|
7033 |
-
if (!moved) {
|
7034 |
-
e_preventDefault(e)
|
7035 |
-
if (!modifier)
|
7036 |
-
{ extendSelection(cm.doc, start) }
|
7037 |
-
// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
|
7038 |
-
if (webkit || ie && ie_version == 9)
|
7039 |
-
{ setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }
|
7040 |
-
else
|
7041 |
-
{ display.input.focus() }
|
7042 |
-
}
|
7043 |
-
})
|
7044 |
-
var mouseMove = function(e2) {
|
7045 |
-
moved = moved || Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) >= 10
|
7046 |
-
}
|
7047 |
-
var dragStart = function () { return moved = true; }
|
7048 |
-
// Let the drag handler handle this.
|
7049 |
-
if (webkit) { display.scroller.draggable = true }
|
7050 |
-
cm.state.draggingText = dragEnd
|
7051 |
-
dragEnd.copy = mac ? e.altKey : e.ctrlKey
|
7052 |
-
// IE's approach to draggable
|
7053 |
-
if (display.scroller.dragDrop) { display.scroller.dragDrop() }
|
7054 |
-
on(document, "mouseup", dragEnd)
|
7055 |
-
on(document, "mousemove", mouseMove)
|
7056 |
-
on(display.scroller, "dragstart", dragStart)
|
7057 |
-
on(display.scroller, "drop", dragEnd)
|
7058 |
-
|
7059 |
-
delayBlurEvent(cm)
|
7060 |
-
setTimeout(function () { return display.input.focus(); }, 20)
|
7061 |
-
}
|
7062 |
-
|
7063 |
-
// Normal selection, as opposed to text dragging.
|
7064 |
-
function leftButtonSelect(cm, e, start, type, addNew) {
|
7065 |
-
var display = cm.display, doc = cm.doc
|
7066 |
-
e_preventDefault(e)
|
7067 |
-
|
7068 |
-
var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
|
7069 |
-
if (addNew && !e.shiftKey) {
|
7070 |
-
ourIndex = doc.sel.contains(start)
|
7071 |
-
if (ourIndex > -1)
|
7072 |
-
{ ourRange = ranges[ourIndex] }
|
7073 |
-
else
|
7074 |
-
{ ourRange = new Range(start, start) }
|
7075 |
-
} else {
|
7076 |
-
ourRange = doc.sel.primary()
|
7077 |
-
ourIndex = doc.sel.primIndex
|
7078 |
-
}
|
7079 |
-
|
7080 |
-
if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
|
7081 |
-
type = "rect"
|
7082 |
-
if (!addNew) { ourRange = new Range(start, start) }
|
7083 |
-
start = posFromMouse(cm, e, true, true)
|
7084 |
-
ourIndex = -1
|
7085 |
-
} else if (type == "double") {
|
7086 |
-
var word = cm.findWordAt(start)
|
7087 |
-
if (cm.display.shift || doc.extend)
|
7088 |
-
{ ourRange = extendRange(doc, ourRange, word.anchor, word.head) }
|
7089 |
-
else
|
7090 |
-
{ ourRange = word }
|
7091 |
-
} else if (type == "triple") {
|
7092 |
-
var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))
|
7093 |
-
if (cm.display.shift || doc.extend)
|
7094 |
-
{ ourRange = extendRange(doc, ourRange, line.anchor, line.head) }
|
7095 |
-
else
|
7096 |
-
{ ourRange = line }
|
7097 |
-
} else {
|
7098 |
-
ourRange = extendRange(doc, ourRange, start)
|
7099 |
-
}
|
7100 |
-
|
7101 |
-
if (!addNew) {
|
7102 |
-
ourIndex = 0
|
7103 |
-
setSelection(doc, new Selection([ourRange], 0), sel_mouse)
|
7104 |
-
startSel = doc.sel
|
7105 |
-
} else if (ourIndex == -1) {
|
7106 |
-
ourIndex = ranges.length
|
7107 |
-
setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
|
7108 |
-
{scroll: false, origin: "*mouse"})
|
7109 |
-
} else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
|
7110 |
-
setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
|
7111 |
-
{scroll: false, origin: "*mouse"})
|
7112 |
-
startSel = doc.sel
|
7113 |
-
} else {
|
7114 |
-
replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)
|
7115 |
-
}
|
7116 |
-
|
7117 |
-
var lastPos = start
|
7118 |
-
function extendTo(pos) {
|
7119 |
-
if (cmp(lastPos, pos) == 0) { return }
|
7120 |
-
lastPos = pos
|
7121 |
-
|
7122 |
-
if (type == "rect") {
|
7123 |
-
var ranges = [], tabSize = cm.options.tabSize
|
7124 |
-
var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)
|
7125 |
-
var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)
|
7126 |
-
var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)
|
7127 |
-
for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
|
7128 |
-
line <= end; line++) {
|
7129 |
-
var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)
|
7130 |
-
if (left == right)
|
7131 |
-
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }
|
7132 |
-
else if (text.length > leftPos)
|
7133 |
-
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }
|
7134 |
-
}
|
7135 |
-
if (!ranges.length) { ranges.push(new Range(start, start)) }
|
7136 |
-
setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
|
7137 |
-
{origin: "*mouse", scroll: false})
|
7138 |
-
cm.scrollIntoView(pos)
|
7139 |
-
} else {
|
7140 |
-
var oldRange = ourRange
|
7141 |
-
var anchor = oldRange.anchor, head = pos
|
7142 |
-
if (type != "single") {
|
7143 |
-
var range
|
7144 |
-
if (type == "double")
|
7145 |
-
{ range = cm.findWordAt(pos) }
|
7146 |
-
else
|
7147 |
-
{ range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }
|
7148 |
-
if (cmp(range.anchor, anchor) > 0) {
|
7149 |
-
head = range.head
|
7150 |
-
anchor = minPos(oldRange.from(), range.anchor)
|
7151 |
-
} else {
|
7152 |
-
head = range.anchor
|
7153 |
-
anchor = maxPos(oldRange.to(), range.head)
|
7154 |
-
}
|
7155 |
-
}
|
7156 |
-
var ranges$1 = startSel.ranges.slice(0)
|
7157 |
-
ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)
|
7158 |
-
setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)
|
7159 |
-
}
|
7160 |
-
}
|
7161 |
-
|
7162 |
-
var editorSize = display.wrapper.getBoundingClientRect()
|
7163 |
-
// Used to ensure timeout re-tries don't fire when another extend
|
7164 |
-
// happened in the meantime (clearTimeout isn't reliable -- at
|
7165 |
-
// least on Chrome, the timeouts still happen even when cleared,
|
7166 |
-
// if the clear happens after their scheduled firing time).
|
7167 |
-
var counter = 0
|
7168 |
-
|
7169 |
-
function extend(e) {
|
7170 |
-
var curCount = ++counter
|
7171 |
-
var cur = posFromMouse(cm, e, true, type == "rect")
|
7172 |
-
if (!cur) { return }
|
7173 |
-
if (cmp(cur, lastPos) != 0) {
|
7174 |
-
cm.curOp.focus = activeElt()
|
7175 |
-
extendTo(cur)
|
7176 |
-
var visible = visibleLines(display, doc)
|
7177 |
-
if (cur.line >= visible.to || cur.line < visible.from)
|
7178 |
-
{ setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }
|
7179 |
-
} else {
|
7180 |
-
var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0
|
7181 |
-
if (outside) { setTimeout(operation(cm, function () {
|
7182 |
-
if (counter != curCount) { return }
|
7183 |
-
display.scroller.scrollTop += outside
|
7184 |
-
extend(e)
|
7185 |
-
}), 50) }
|
7186 |
-
}
|
7187 |
-
}
|
7188 |
-
|
7189 |
-
function done(e) {
|
7190 |
-
cm.state.selectingText = false
|
7191 |
-
counter = Infinity
|
7192 |
-
e_preventDefault(e)
|
7193 |
-
display.input.focus()
|
7194 |
-
off(document, "mousemove", move)
|
7195 |
-
off(document, "mouseup", up)
|
7196 |
-
doc.history.lastSelOrigin = null
|
7197 |
-
}
|
7198 |
-
|
7199 |
-
var move = operation(cm, function (e) {
|
7200 |
-
if (!e_button(e)) { done(e) }
|
7201 |
-
else { extend(e) }
|
7202 |
-
})
|
7203 |
-
var up = operation(cm, done)
|
7204 |
-
cm.state.selectingText = up
|
7205 |
-
on(document, "mousemove", move)
|
7206 |
-
on(document, "mouseup", up)
|
7207 |
-
}
|
7208 |
-
|
7209 |
-
|
7210 |
-
// Determines whether an event happened in the gutter, and fires the
|
7211 |
-
// handlers for the corresponding event.
|
7212 |
-
function gutterEvent(cm, e, type, prevent) {
|
7213 |
-
var mX, mY
|
7214 |
-
try { mX = e.clientX; mY = e.clientY }
|
7215 |
-
catch(e) { return false }
|
7216 |
-
if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
|
7217 |
-
if (prevent) { e_preventDefault(e) }
|
7218 |
-
|
7219 |
-
var display = cm.display
|
7220 |
-
var lineBox = display.lineDiv.getBoundingClientRect()
|
7221 |
-
|
7222 |
-
if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
|
7223 |
-
mY -= lineBox.top - display.viewOffset
|
7224 |
-
|
7225 |
-
for (var i = 0; i < cm.options.gutters.length; ++i) {
|
7226 |
-
var g = display.gutters.childNodes[i]
|
7227 |
-
if (g && g.getBoundingClientRect().right >= mX) {
|
7228 |
-
var line = lineAtHeight(cm.doc, mY)
|
7229 |
-
var gutter = cm.options.gutters[i]
|
7230 |
-
signal(cm, type, cm, line, gutter, e)
|
7231 |
-
return e_defaultPrevented(e)
|
7232 |
-
}
|
7233 |
-
}
|
7234 |
-
}
|
7235 |
-
|
7236 |
-
function clickInGutter(cm, e) {
|
7237 |
-
return gutterEvent(cm, e, "gutterClick", true)
|
7238 |
-
}
|
7239 |
-
|
7240 |
-
// CONTEXT MENU HANDLING
|
7241 |
-
|
7242 |
-
// To make the context menu work, we need to briefly unhide the
|
7243 |
-
// textarea (making it as unobtrusive as possible) to let the
|
7244 |
-
// right-click take effect on it.
|
7245 |
-
function onContextMenu(cm, e) {
|
7246 |
-
if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
|
7247 |
-
if (signalDOMEvent(cm, e, "contextmenu")) { return }
|
7248 |
-
cm.display.input.onContextMenu(e)
|
7249 |
-
}
|
7250 |
-
|
7251 |
-
function contextMenuInGutter(cm, e) {
|
7252 |
-
if (!hasHandler(cm, "gutterContextMenu")) { return false }
|
7253 |
-
return gutterEvent(cm, e, "gutterContextMenu", false)
|
7254 |
-
}
|
7255 |
-
|
7256 |
-
function themeChanged(cm) {
|
7257 |
-
cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
|
7258 |
-
cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-")
|
7259 |
-
clearCaches(cm)
|
7260 |
-
}
|
7261 |
-
|
7262 |
-
var Init = {toString: function(){return "CodeMirror.Init"}}
|
7263 |
-
|
7264 |
-
var defaults = {}
|
7265 |
-
var optionHandlers = {}
|
7266 |
-
|
7267 |
-
function defineOptions(CodeMirror) {
|
7268 |
-
var optionHandlers = CodeMirror.optionHandlers
|
7269 |
-
|
7270 |
-
function option(name, deflt, handle, notOnInit) {
|
7271 |
-
CodeMirror.defaults[name] = deflt
|
7272 |
-
if (handle) { optionHandlers[name] =
|
7273 |
-
notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }
|
7274 |
-
}
|
7275 |
-
|
7276 |
-
CodeMirror.defineOption = option
|
7277 |
-
|
7278 |
-
// Passed to option handlers when there is no old value.
|
7279 |
-
CodeMirror.Init = Init
|
7280 |
-
|
7281 |
-
// These two are, on init, called from the constructor because they
|
7282 |
-
// have to be initialized before the editor can start at all.
|
7283 |
-
option("value", "", function (cm, val) { return cm.setValue(val); }, true)
|
7284 |
-
option("mode", null, function (cm, val) {
|
7285 |
-
cm.doc.modeOption = val
|
7286 |
-
loadMode(cm)
|
7287 |
-
}, true)
|
7288 |
-
|
7289 |
-
option("indentUnit", 2, loadMode, true)
|
7290 |
-
option("indentWithTabs", false)
|
7291 |
-
option("smartIndent", true)
|
7292 |
-
option("tabSize", 4, function (cm) {
|
7293 |
-
resetModeState(cm)
|
7294 |
-
clearCaches(cm)
|
7295 |
-
regChange(cm)
|
7296 |
-
}, true)
|
7297 |
-
option("lineSeparator", null, function (cm, val) {
|
7298 |
-
cm.doc.lineSep = val
|
7299 |
-
if (!val) { return }
|
7300 |
-
var newBreaks = [], lineNo = cm.doc.first
|
7301 |
-
cm.doc.iter(function (line) {
|
7302 |
-
for (var pos = 0;;) {
|
7303 |
-
var found = line.text.indexOf(val, pos)
|
7304 |
-
if (found == -1) { break }
|
7305 |
-
pos = found + val.length
|
7306 |
-
newBreaks.push(Pos(lineNo, found))
|
7307 |
-
}
|
7308 |
-
lineNo++
|
7309 |
-
})
|
7310 |
-
for (var i = newBreaks.length - 1; i >= 0; i--)
|
7311 |
-
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
|
7312 |
-
})
|
7313 |
-
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
|
7314 |
-
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
|
7315 |
-
if (old != Init) { cm.refresh() }
|
7316 |
-
})
|
7317 |
-
option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)
|
7318 |
-
option("electricChars", true)
|
7319 |
-
option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
|
7320 |
-
throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
|
7321 |
-
}, true)
|
7322 |
-
option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)
|
7323 |
-
option("rtlMoveVisually", !windows)
|
7324 |
-
option("wholeLineUpdateBefore", true)
|
7325 |
-
|
7326 |
-
option("theme", "default", function (cm) {
|
7327 |
-
themeChanged(cm)
|
7328 |
-
guttersChanged(cm)
|
7329 |
-
}, true)
|
7330 |
-
option("keyMap", "default", function (cm, val, old) {
|
7331 |
-
var next = getKeyMap(val)
|
7332 |
-
var prev = old != Init && getKeyMap(old)
|
7333 |
-
if (prev && prev.detach) { prev.detach(cm, next) }
|
7334 |
-
if (next.attach) { next.attach(cm, prev || null) }
|
7335 |
-
})
|
7336 |
-
option("extraKeys", null)
|
7337 |
-
|
7338 |
-
option("lineWrapping", false, wrappingChanged, true)
|
7339 |
-
option("gutters", [], function (cm) {
|
7340 |
-
setGuttersForLineNumbers(cm.options)
|
7341 |
-
guttersChanged(cm)
|
7342 |
-
}, true)
|
7343 |
-
option("fixedGutter", true, function (cm, val) {
|
7344 |
-
cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"
|
7345 |
-
cm.refresh()
|
7346 |
-
}, true)
|
7347 |
-
option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true)
|
7348 |
-
option("scrollbarStyle", "native", function (cm) {
|
7349 |
-
initScrollbars(cm)
|
7350 |
-
updateScrollbars(cm)
|
7351 |
-
cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)
|
7352 |
-
cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)
|
7353 |
-
}, true)
|
7354 |
-
option("lineNumbers", false, function (cm) {
|
7355 |
-
setGuttersForLineNumbers(cm.options)
|
7356 |
-
guttersChanged(cm)
|
7357 |
-
}, true)
|
7358 |
-
option("firstLineNumber", 1, guttersChanged, true)
|
7359 |
-
option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true)
|
7360 |
-
option("showCursorWhenSelecting", false, updateSelection, true)
|
7361 |
-
|
7362 |
-
option("resetSelectionOnContextMenu", true)
|
7363 |
-
option("lineWiseCopyCut", true)
|
7364 |
-
|
7365 |
-
option("readOnly", false, function (cm, val) {
|
7366 |
-
if (val == "nocursor") {
|
7367 |
-
onBlur(cm)
|
7368 |
-
cm.display.input.blur()
|
7369 |
-
cm.display.disabled = true
|
7370 |
-
} else {
|
7371 |
-
cm.display.disabled = false
|
7372 |
-
}
|
7373 |
-
cm.display.input.readOnlyChanged(val)
|
7374 |
-
})
|
7375 |
-
option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)
|
7376 |
-
option("dragDrop", true, dragDropChanged)
|
7377 |
-
option("allowDropFileTypes", null)
|
7378 |
-
|
7379 |
-
option("cursorBlinkRate", 530)
|
7380 |
-
option("cursorScrollMargin", 0)
|
7381 |
-
option("cursorHeight", 1, updateSelection, true)
|
7382 |
-
option("singleCursorHeightPerLine", true, updateSelection, true)
|
7383 |
-
option("workTime", 100)
|
7384 |
-
option("workDelay", 100)
|
7385 |
-
option("flattenSpans", true, resetModeState, true)
|
7386 |
-
option("addModeClass", false, resetModeState, true)
|
7387 |
-
option("pollInterval", 100)
|
7388 |
-
option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })
|
7389 |
-
option("historyEventDelay", 1250)
|
7390 |
-
option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true)
|
7391 |
-
option("maxHighlightLength", 10000, resetModeState, true)
|
7392 |
-
option("moveInputWithCursor", true, function (cm, val) {
|
7393 |
-
if (!val) { cm.display.input.resetPosition() }
|
7394 |
-
})
|
7395 |
-
|
7396 |
-
option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; })
|
7397 |
-
option("autofocus", null)
|
7398 |
-
option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true)
|
7399 |
-
}
|
7400 |
-
|
7401 |
-
function guttersChanged(cm) {
|
7402 |
-
updateGutters(cm)
|
7403 |
-
regChange(cm)
|
7404 |
-
alignHorizontally(cm)
|
7405 |
-
}
|
7406 |
-
|
7407 |
-
function dragDropChanged(cm, value, old) {
|
7408 |
-
var wasOn = old && old != Init
|
7409 |
-
if (!value != !wasOn) {
|
7410 |
-
var funcs = cm.display.dragFunctions
|
7411 |
-
var toggle = value ? on : off
|
7412 |
-
toggle(cm.display.scroller, "dragstart", funcs.start)
|
7413 |
-
toggle(cm.display.scroller, "dragenter", funcs.enter)
|
7414 |
-
toggle(cm.display.scroller, "dragover", funcs.over)
|
7415 |
-
toggle(cm.display.scroller, "dragleave", funcs.leave)
|
7416 |
-
toggle(cm.display.scroller, "drop", funcs.drop)
|
7417 |
-
}
|
7418 |
-
}
|
7419 |
-
|
7420 |
-
function wrappingChanged(cm) {
|
7421 |
-
if (cm.options.lineWrapping) {
|
7422 |
-
addClass(cm.display.wrapper, "CodeMirror-wrap")
|
7423 |
-
cm.display.sizer.style.minWidth = ""
|
7424 |
-
cm.display.sizerWidth = null
|
7425 |
-
} else {
|
7426 |
-
rmClass(cm.display.wrapper, "CodeMirror-wrap")
|
7427 |
-
findMaxLine(cm)
|
7428 |
-
}
|
7429 |
-
estimateLineHeights(cm)
|
7430 |
-
regChange(cm)
|
7431 |
-
clearCaches(cm)
|
7432 |
-
setTimeout(function () { return updateScrollbars(cm); }, 100)
|
7433 |
-
}
|
7434 |
-
|
7435 |
-
// A CodeMirror instance represents an editor. This is the object
|
7436 |
-
// that user code is usually dealing with.
|
7437 |
-
|
7438 |
-
function CodeMirror(place, options) {
|
7439 |
-
var this$1 = this;
|
7440 |
-
|
7441 |
-
if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
|
7442 |
-
|
7443 |
-
this.options = options = options ? copyObj(options) : {}
|
7444 |
-
// Determine effective options based on given values and defaults.
|
7445 |
-
copyObj(defaults, options, false)
|
7446 |
-
setGuttersForLineNumbers(options)
|
7447 |
-
|
7448 |
-
var doc = options.value
|
7449 |
-
if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) }
|
7450 |
-
this.doc = doc
|
7451 |
-
|
7452 |
-
var input = new CodeMirror.inputStyles[options.inputStyle](this)
|
7453 |
-
var display = this.display = new Display(place, doc, input)
|
7454 |
-
display.wrapper.CodeMirror = this
|
7455 |
-
updateGutters(this)
|
7456 |
-
themeChanged(this)
|
7457 |
-
if (options.lineWrapping)
|
7458 |
-
{ this.display.wrapper.className += " CodeMirror-wrap" }
|
7459 |
-
initScrollbars(this)
|
7460 |
-
|
7461 |
-
this.state = {
|
7462 |
-
keyMaps: [], // stores maps added by addKeyMap
|
7463 |
-
overlays: [], // highlighting overlays, as added by addOverlay
|
7464 |
-
modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
|
7465 |
-
overwrite: false,
|
7466 |
-
delayingBlurEvent: false,
|
7467 |
-
focused: false,
|
7468 |
-
suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
|
7469 |
-
pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
|
7470 |
-
selectingText: false,
|
7471 |
-
draggingText: false,
|
7472 |
-
highlight: new Delayed(), // stores highlight worker timeout
|
7473 |
-
keySeq: null, // Unfinished key sequence
|
7474 |
-
specialChars: null
|
7475 |
-
}
|
7476 |
-
|
7477 |
-
if (options.autofocus && !mobile) { display.input.focus() }
|
7478 |
-
|
7479 |
-
// Override magic textarea content restore that IE sometimes does
|
7480 |
-
// on our hidden textarea on reload
|
7481 |
-
if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
|
7482 |
-
|
7483 |
-
registerEventHandlers(this)
|
7484 |
-
ensureGlobalHandlers()
|
7485 |
-
|
7486 |
-
startOperation(this)
|
7487 |
-
this.curOp.forceUpdate = true
|
7488 |
-
attachDoc(this, doc)
|
7489 |
-
|
7490 |
-
if ((options.autofocus && !mobile) || this.hasFocus())
|
7491 |
-
{ setTimeout(bind(onFocus, this), 20) }
|
7492 |
-
else
|
7493 |
-
{ onBlur(this) }
|
7494 |
-
|
7495 |
-
for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
|
7496 |
-
{ optionHandlers[opt](this$1, options[opt], Init) } }
|
7497 |
-
maybeUpdateLineNumberWidth(this)
|
7498 |
-
if (options.finishInit) { options.finishInit(this) }
|
7499 |
-
for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }
|
7500 |
-
endOperation(this)
|
7501 |
-
// Suppress optimizelegibility in Webkit, since it breaks text
|
7502 |
-
// measuring on line wrapping boundaries.
|
7503 |
-
if (webkit && options.lineWrapping &&
|
7504 |
-
getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
|
7505 |
-
{ display.lineDiv.style.textRendering = "auto" }
|
7506 |
-
}
|
7507 |
-
|
7508 |
-
// The default configuration options.
|
7509 |
-
CodeMirror.defaults = defaults
|
7510 |
-
// Functions to run when options are changed.
|
7511 |
-
CodeMirror.optionHandlers = optionHandlers
|
7512 |
-
|
7513 |
-
// Attach the necessary event handlers when initializing the editor
|
7514 |
-
function registerEventHandlers(cm) {
|
7515 |
-
var d = cm.display
|
7516 |
-
on(d.scroller, "mousedown", operation(cm, onMouseDown))
|
7517 |
-
// Older IE's will not fire a second mousedown for a double click
|
7518 |
-
if (ie && ie_version < 11)
|
7519 |
-
{ on(d.scroller, "dblclick", operation(cm, function (e) {
|
7520 |
-
if (signalDOMEvent(cm, e)) { return }
|
7521 |
-
var pos = posFromMouse(cm, e)
|
7522 |
-
if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
|
7523 |
-
e_preventDefault(e)
|
7524 |
-
var word = cm.findWordAt(pos)
|
7525 |
-
extendSelection(cm.doc, word.anchor, word.head)
|
7526 |
-
})) }
|
7527 |
-
else
|
7528 |
-
{ on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }
|
7529 |
-
// Some browsers fire contextmenu *after* opening the menu, at
|
7530 |
-
// which point we can't mess with it anymore. Context menu is
|
7531 |
-
// handled in onMouseDown for these browsers.
|
7532 |
-
if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) }
|
7533 |
-
|
7534 |
-
// Used to suppress mouse event handling when a touch happens
|
7535 |
-
var touchFinished, prevTouch = {end: 0}
|
7536 |
-
function finishTouch() {
|
7537 |
-
if (d.activeTouch) {
|
7538 |
-
touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)
|
7539 |
-
prevTouch = d.activeTouch
|
7540 |
-
prevTouch.end = +new Date
|
7541 |
-
}
|
7542 |
-
}
|
7543 |
-
function isMouseLikeTouchEvent(e) {
|
7544 |
-
if (e.touches.length != 1) { return false }
|
7545 |
-
var touch = e.touches[0]
|
7546 |
-
return touch.radiusX <= 1 && touch.radiusY <= 1
|
7547 |
-
}
|
7548 |
-
function farAway(touch, other) {
|
7549 |
-
if (other.left == null) { return true }
|
7550 |
-
var dx = other.left - touch.left, dy = other.top - touch.top
|
7551 |
-
return dx * dx + dy * dy > 20 * 20
|
7552 |
-
}
|
7553 |
-
on(d.scroller, "touchstart", function (e) {
|
7554 |
-
if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
|
7555 |
-
d.input.ensurePolled()
|
7556 |
-
clearTimeout(touchFinished)
|
7557 |
-
var now = +new Date
|
7558 |
-
d.activeTouch = {start: now, moved: false,
|
7559 |
-
prev: now - prevTouch.end <= 300 ? prevTouch : null}
|
7560 |
-
if (e.touches.length == 1) {
|
7561 |
-
d.activeTouch.left = e.touches[0].pageX
|
7562 |
-
d.activeTouch.top = e.touches[0].pageY
|
7563 |
-
}
|
7564 |
-
}
|
7565 |
-
})
|
7566 |
-
on(d.scroller, "touchmove", function () {
|
7567 |
-
if (d.activeTouch) { d.activeTouch.moved = true }
|
7568 |
-
})
|
7569 |
-
on(d.scroller, "touchend", function (e) {
|
7570 |
-
var touch = d.activeTouch
|
7571 |
-
if (touch && !eventInWidget(d, e) && touch.left != null &&
|
7572 |
-
!touch.moved && new Date - touch.start < 300) {
|
7573 |
-
var pos = cm.coordsChar(d.activeTouch, "page"), range
|
7574 |
-
if (!touch.prev || farAway(touch, touch.prev)) // Single tap
|
7575 |
-
{ range = new Range(pos, pos) }
|
7576 |
-
else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
|
7577 |
-
{ range = cm.findWordAt(pos) }
|
7578 |
-
else // Triple tap
|
7579 |
-
{ range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
|
7580 |
-
cm.setSelection(range.anchor, range.head)
|
7581 |
-
cm.focus()
|
7582 |
-
e_preventDefault(e)
|
7583 |
-
}
|
7584 |
-
finishTouch()
|
7585 |
-
})
|
7586 |
-
on(d.scroller, "touchcancel", finishTouch)
|
7587 |
-
|
7588 |
-
// Sync scrolling between fake scrollbars and real scrollable
|
7589 |
-
// area, ensure viewport is updated when scrolling.
|
7590 |
-
on(d.scroller, "scroll", function () {
|
7591 |
-
if (d.scroller.clientHeight) {
|
7592 |
-
updateScrollTop(cm, d.scroller.scrollTop)
|
7593 |
-
setScrollLeft(cm, d.scroller.scrollLeft, true)
|
7594 |
-
signal(cm, "scroll", cm)
|
7595 |
-
}
|
7596 |
-
})
|
7597 |
-
|
7598 |
-
// Listen to wheel events in order to try and update the viewport on time.
|
7599 |
-
on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); })
|
7600 |
-
on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); })
|
7601 |
-
|
7602 |
-
// Prevent wrapper from ever scrolling
|
7603 |
-
on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })
|
7604 |
-
|
7605 |
-
d.dragFunctions = {
|
7606 |
-
enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},
|
7607 |
-
over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},
|
7608 |
-
start: function (e) { return onDragStart(cm, e); },
|
7609 |
-
drop: operation(cm, onDrop),
|
7610 |
-
leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}
|
7611 |
-
}
|
7612 |
-
|
7613 |
-
var inp = d.input.getField()
|
7614 |
-
on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); })
|
7615 |
-
on(inp, "keydown", operation(cm, onKeyDown))
|
7616 |
-
on(inp, "keypress", operation(cm, onKeyPress))
|
7617 |
-
on(inp, "focus", function (e) { return onFocus(cm, e); })
|
7618 |
-
on(inp, "blur", function (e) { return onBlur(cm, e); })
|
7619 |
-
}
|
7620 |
-
|
7621 |
-
var initHooks = []
|
7622 |
-
CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }
|
7623 |
-
|
7624 |
-
// Indent the given line. The how parameter can be "smart",
|
7625 |
-
// "add"/null, "subtract", or "prev". When aggressive is false
|
7626 |
-
// (typically set to true for forced single-line indents), empty
|
7627 |
-
// lines are not indented, and places where the mode returns Pass
|
7628 |
-
// are left alone.
|
7629 |
-
function indentLine(cm, n, how, aggressive) {
|
7630 |
-
var doc = cm.doc, state
|
7631 |
-
if (how == null) { how = "add" }
|
7632 |
-
if (how == "smart") {
|
7633 |
-
// Fall back to "prev" when the mode doesn't have an indentation
|
7634 |
-
// method.
|
7635 |
-
if (!doc.mode.indent) { how = "prev" }
|
7636 |
-
else { state = getStateBefore(cm, n) }
|
7637 |
-
}
|
7638 |
-
|
7639 |
-
var tabSize = cm.options.tabSize
|
7640 |
-
var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)
|
7641 |
-
if (line.stateAfter) { line.stateAfter = null }
|
7642 |
-
var curSpaceString = line.text.match(/^\s*/)[0], indentation
|
7643 |
-
if (!aggressive && !/\S/.test(line.text)) {
|
7644 |
-
indentation = 0
|
7645 |
-
how = "not"
|
7646 |
-
} else if (how == "smart") {
|
7647 |
-
indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)
|
7648 |
-
if (indentation == Pass || indentation > 150) {
|
7649 |
-
if (!aggressive) { return }
|
7650 |
-
how = "prev"
|
7651 |
-
}
|
7652 |
-
}
|
7653 |
-
if (how == "prev") {
|
7654 |
-
if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }
|
7655 |
-
else { indentation = 0 }
|
7656 |
-
} else if (how == "add") {
|
7657 |
-
indentation = curSpace + cm.options.indentUnit
|
7658 |
-
} else if (how == "subtract") {
|
7659 |
-
indentation = curSpace - cm.options.indentUnit
|
7660 |
-
} else if (typeof how == "number") {
|
7661 |
-
indentation = curSpace + how
|
7662 |
-
}
|
7663 |
-
indentation = Math.max(0, indentation)
|
7664 |
-
|
7665 |
-
var indentString = "", pos = 0
|
7666 |
-
if (cm.options.indentWithTabs)
|
7667 |
-
{ for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} }
|
7668 |
-
if (pos < indentation) { indentString += spaceStr(indentation - pos) }
|
7669 |
-
|
7670 |
-
if (indentString != curSpaceString) {
|
7671 |
-
replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input")
|
7672 |
-
line.stateAfter = null
|
7673 |
-
return true
|
7674 |
-
} else {
|
7675 |
-
// Ensure that, if the cursor was in the whitespace at the start
|
7676 |
-
// of the line, it is moved to the end of that space.
|
7677 |
-
for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
|
7678 |
-
var range = doc.sel.ranges[i$1]
|
7679 |
-
if (range.head.line == n && range.head.ch < curSpaceString.length) {
|
7680 |
-
var pos$1 = Pos(n, curSpaceString.length)
|
7681 |
-
replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))
|
7682 |
-
break
|
7683 |
-
}
|
7684 |
-
}
|
7685 |
-
}
|
7686 |
-
}
|
7687 |
-
|
7688 |
-
// This will be set to a {lineWise: bool, text: [string]} object, so
|
7689 |
-
// that, when pasting, we know what kind of selections the copied
|
7690 |
-
// text was made out of.
|
7691 |
-
var lastCopied = null
|
7692 |
-
|
7693 |
-
function setLastCopied(newLastCopied) {
|
7694 |
-
lastCopied = newLastCopied
|
7695 |
-
}
|
7696 |
-
|
7697 |
-
function applyTextInput(cm, inserted, deleted, sel, origin) {
|
7698 |
-
var doc = cm.doc
|
7699 |
-
cm.display.shift = false
|
7700 |
-
if (!sel) { sel = doc.sel }
|
7701 |
-
|
7702 |
-
var paste = cm.state.pasteIncoming || origin == "paste"
|
7703 |
-
var textLines = splitLinesAuto(inserted), multiPaste = null
|
7704 |
-
// When pasing N lines into N selections, insert one line per selection
|
7705 |
-
if (paste && sel.ranges.length > 1) {
|
7706 |
-
if (lastCopied && lastCopied.text.join("\n") == inserted) {
|
7707 |
-
if (sel.ranges.length % lastCopied.text.length == 0) {
|
7708 |
-
multiPaste = []
|
7709 |
-
for (var i = 0; i < lastCopied.text.length; i++)
|
7710 |
-
{ multiPaste.push(doc.splitLines(lastCopied.text[i])) }
|
7711 |
-
}
|
7712 |
-
} else if (textLines.length == sel.ranges.length) {
|
7713 |
-
multiPaste = map(textLines, function (l) { return [l]; })
|
7714 |
-
}
|
7715 |
-
}
|
7716 |
-
|
7717 |
-
var updateInput
|
7718 |
-
// Normal behavior is to insert the new text into every selection
|
7719 |
-
for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
|
7720 |
-
var range = sel.ranges[i$1]
|
7721 |
-
var from = range.from(), to = range.to()
|
7722 |
-
if (range.empty()) {
|
7723 |
-
if (deleted && deleted > 0) // Handle deletion
|
7724 |
-
{ from = Pos(from.line, from.ch - deleted) }
|
7725 |
-
else if (cm.state.overwrite && !paste) // Handle overwrite
|
7726 |
-
{ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }
|
7727 |
-
else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
|
7728 |
-
{ from = to = Pos(from.line, 0) }
|
7729 |
-
}
|
7730 |
-
updateInput = cm.curOp.updateInput
|
7731 |
-
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
|
7732 |
-
origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}
|
7733 |
-
makeChange(cm.doc, changeEvent)
|
7734 |
-
signalLater(cm, "inputRead", cm, changeEvent)
|
7735 |
-
}
|
7736 |
-
if (inserted && !paste)
|
7737 |
-
{ triggerElectric(cm, inserted) }
|
7738 |
-
|
7739 |
-
ensureCursorVisible(cm)
|
7740 |
-
cm.curOp.updateInput = updateInput
|
7741 |
-
cm.curOp.typing = true
|
7742 |
-
cm.state.pasteIncoming = cm.state.cutIncoming = false
|
7743 |
-
}
|
7744 |
-
|
7745 |
-
function handlePaste(e, cm) {
|
7746 |
-
var pasted = e.clipboardData && e.clipboardData.getData("Text")
|
7747 |
-
if (pasted) {
|
7748 |
-
e.preventDefault()
|
7749 |
-
if (!cm.isReadOnly() && !cm.options.disableInput)
|
7750 |
-
{ runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) }
|
7751 |
-
return true
|
7752 |
-
}
|
7753 |
-
}
|
7754 |
-
|
7755 |
-
function triggerElectric(cm, inserted) {
|
7756 |
-
// When an 'electric' character is inserted, immediately trigger a reindent
|
7757 |
-
if (!cm.options.electricChars || !cm.options.smartIndent) { return }
|
7758 |
-
var sel = cm.doc.sel
|
7759 |
-
|
7760 |
-
for (var i = sel.ranges.length - 1; i >= 0; i--) {
|
7761 |
-
var range = sel.ranges[i]
|
7762 |
-
if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }
|
7763 |
-
var mode = cm.getModeAt(range.head)
|
7764 |
-
var indented = false
|
7765 |
-
if (mode.electricChars) {
|
7766 |
-
for (var j = 0; j < mode.electricChars.length; j++)
|
7767 |
-
{ if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
|
7768 |
-
indented = indentLine(cm, range.head.line, "smart")
|
7769 |
-
break
|
7770 |
-
} }
|
7771 |
-
} else if (mode.electricInput) {
|
7772 |
-
if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
|
7773 |
-
{ indented = indentLine(cm, range.head.line, "smart") }
|
7774 |
-
}
|
7775 |
-
if (indented) { signalLater(cm, "electricInput", cm, range.head.line) }
|
7776 |
-
}
|
7777 |
-
}
|
7778 |
-
|
7779 |
-
function copyableRanges(cm) {
|
7780 |
-
var text = [], ranges = []
|
7781 |
-
for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
|
7782 |
-
var line = cm.doc.sel.ranges[i].head.line
|
7783 |
-
var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}
|
7784 |
-
ranges.push(lineRange)
|
7785 |
-
text.push(cm.getRange(lineRange.anchor, lineRange.head))
|
7786 |
-
}
|
7787 |
-
return {text: text, ranges: ranges}
|
7788 |
-
}
|
7789 |
-
|
7790 |
-
function disableBrowserMagic(field, spellcheck) {
|
7791 |
-
field.setAttribute("autocorrect", "off")
|
7792 |
-
field.setAttribute("autocapitalize", "off")
|
7793 |
-
field.setAttribute("spellcheck", !!spellcheck)
|
7794 |
-
}
|
7795 |
-
|
7796 |
-
function hiddenTextarea() {
|
7797 |
-
var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none")
|
7798 |
-
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;")
|
7799 |
-
// The textarea is kept positioned near the cursor to prevent the
|
7800 |
-
// fact that it'll be scrolled into view on input from scrolling
|
7801 |
-
// our fake cursor out of view. On webkit, when wrap=off, paste is
|
7802 |
-
// very slow. So make the area wide instead.
|
7803 |
-
if (webkit) { te.style.width = "1000px" }
|
7804 |
-
else { te.setAttribute("wrap", "off") }
|
7805 |
-
// If border: 0; -- iOS fails to open keyboard (issue #1287)
|
7806 |
-
if (ios) { te.style.border = "1px solid black" }
|
7807 |
-
disableBrowserMagic(te)
|
7808 |
-
return div
|
7809 |
-
}
|
7810 |
-
|
7811 |
-
// The publicly visible API. Note that methodOp(f) means
|
7812 |
-
// 'wrap f in an operation, performed on its `this` parameter'.
|
7813 |
-
|
7814 |
-
// This is not the complete set of editor methods. Most of the
|
7815 |
-
// methods defined on the Doc type are also injected into
|
7816 |
-
// CodeMirror.prototype, for backwards compatibility and
|
7817 |
-
// convenience.
|
7818 |
-
|
7819 |
-
function addEditorMethods(CodeMirror) {
|
7820 |
-
var optionHandlers = CodeMirror.optionHandlers
|
7821 |
-
|
7822 |
-
var helpers = CodeMirror.helpers = {}
|
7823 |
-
|
7824 |
-
CodeMirror.prototype = {
|
7825 |
-
constructor: CodeMirror,
|
7826 |
-
focus: function(){window.focus(); this.display.input.focus()},
|
7827 |
-
|
7828 |
-
setOption: function(option, value) {
|
7829 |
-
var options = this.options, old = options[option]
|
7830 |
-
if (options[option] == value && option != "mode") { return }
|
7831 |
-
options[option] = value
|
7832 |
-
if (optionHandlers.hasOwnProperty(option))
|
7833 |
-
{ operation(this, optionHandlers[option])(this, value, old) }
|
7834 |
-
signal(this, "optionChange", this, option)
|
7835 |
-
},
|
7836 |
-
|
7837 |
-
getOption: function(option) {return this.options[option]},
|
7838 |
-
getDoc: function() {return this.doc},
|
7839 |
-
|
7840 |
-
addKeyMap: function(map, bottom) {
|
7841 |
-
this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map))
|
7842 |
-
},
|
7843 |
-
removeKeyMap: function(map) {
|
7844 |
-
var maps = this.state.keyMaps
|
7845 |
-
for (var i = 0; i < maps.length; ++i)
|
7846 |
-
{ if (maps[i] == map || maps[i].name == map) {
|
7847 |
-
maps.splice(i, 1)
|
7848 |
-
return true
|
7849 |
-
} }
|
7850 |
-
},
|
7851 |
-
|
7852 |
-
addOverlay: methodOp(function(spec, options) {
|
7853 |
-
var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)
|
7854 |
-
if (mode.startState) { throw new Error("Overlays may not be stateful.") }
|
7855 |
-
insertSorted(this.state.overlays,
|
7856 |
-
{mode: mode, modeSpec: spec, opaque: options && options.opaque,
|
7857 |
-
priority: (options && options.priority) || 0},
|
7858 |
-
function (overlay) { return overlay.priority; })
|
7859 |
-
this.state.modeGen++
|
7860 |
-
regChange(this)
|
7861 |
-
}),
|
7862 |
-
removeOverlay: methodOp(function(spec) {
|
7863 |
-
var this$1 = this;
|
7864 |
-
|
7865 |
-
var overlays = this.state.overlays
|
7866 |
-
for (var i = 0; i < overlays.length; ++i) {
|
7867 |
-
var cur = overlays[i].modeSpec
|
7868 |
-
if (cur == spec || typeof spec == "string" && cur.name == spec) {
|
7869 |
-
overlays.splice(i, 1)
|
7870 |
-
this$1.state.modeGen++
|
7871 |
-
regChange(this$1)
|
7872 |
-
return
|
7873 |
-
}
|
7874 |
-
}
|
7875 |
-
}),
|
7876 |
-
|
7877 |
-
indentLine: methodOp(function(n, dir, aggressive) {
|
7878 |
-
if (typeof dir != "string" && typeof dir != "number") {
|
7879 |
-
if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" }
|
7880 |
-
else { dir = dir ? "add" : "subtract" }
|
7881 |
-
}
|
7882 |
-
if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }
|
7883 |
-
}),
|
7884 |
-
indentSelection: methodOp(function(how) {
|
7885 |
-
var this$1 = this;
|
7886 |
-
|
7887 |
-
var ranges = this.doc.sel.ranges, end = -1
|
7888 |
-
for (var i = 0; i < ranges.length; i++) {
|
7889 |
-
var range = ranges[i]
|
7890 |
-
if (!range.empty()) {
|
7891 |
-
var from = range.from(), to = range.to()
|
7892 |
-
var start = Math.max(end, from.line)
|
7893 |
-
end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1
|
7894 |
-
for (var j = start; j < end; ++j)
|
7895 |
-
{ indentLine(this$1, j, how) }
|
7896 |
-
var newRanges = this$1.doc.sel.ranges
|
7897 |
-
if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
|
7898 |
-
{ replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }
|
7899 |
-
} else if (range.head.line > end) {
|
7900 |
-
indentLine(this$1, range.head.line, how, true)
|
7901 |
-
end = range.head.line
|
7902 |
-
if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }
|
7903 |
-
}
|
7904 |
-
}
|
7905 |
-
}),
|
7906 |
-
|
7907 |
-
// Fetch the parser token for a given character. Useful for hacks
|
7908 |
-
// that want to inspect the mode state (say, for completion).
|
7909 |
-
getTokenAt: function(pos, precise) {
|
7910 |
-
return takeToken(this, pos, precise)
|
7911 |
-
},
|
7912 |
-
|
7913 |
-
getLineTokens: function(line, precise) {
|
7914 |
-
return takeToken(this, Pos(line), precise, true)
|
7915 |
-
},
|
7916 |
-
|
7917 |
-
getTokenTypeAt: function(pos) {
|
7918 |
-
pos = clipPos(this.doc, pos)
|
7919 |
-
var styles = getLineStyles(this, getLine(this.doc, pos.line))
|
7920 |
-
var before = 0, after = (styles.length - 1) / 2, ch = pos.ch
|
7921 |
-
var type
|
7922 |
-
if (ch == 0) { type = styles[2] }
|
7923 |
-
else { for (;;) {
|
7924 |
-
var mid = (before + after) >> 1
|
7925 |
-
if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }
|
7926 |
-
else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }
|
7927 |
-
else { type = styles[mid * 2 + 2]; break }
|
7928 |
-
} }
|
7929 |
-
var cut = type ? type.indexOf("overlay ") : -1
|
7930 |
-
return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
|
7931 |
-
},
|
7932 |
-
|
7933 |
-
getModeAt: function(pos) {
|
7934 |
-
var mode = this.doc.mode
|
7935 |
-
if (!mode.innerMode) { return mode }
|
7936 |
-
return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
|
7937 |
-
},
|
7938 |
-
|
7939 |
-
getHelper: function(pos, type) {
|
7940 |
-
return this.getHelpers(pos, type)[0]
|
7941 |
-
},
|
7942 |
-
|
7943 |
-
getHelpers: function(pos, type) {
|
7944 |
-
var this$1 = this;
|
7945 |
-
|
7946 |
-
var found = []
|
7947 |
-
if (!helpers.hasOwnProperty(type)) { return found }
|
7948 |
-
var help = helpers[type], mode = this.getModeAt(pos)
|
7949 |
-
if (typeof mode[type] == "string") {
|
7950 |
-
if (help[mode[type]]) { found.push(help[mode[type]]) }
|
7951 |
-
} else if (mode[type]) {
|
7952 |
-
for (var i = 0; i < mode[type].length; i++) {
|
7953 |
-
var val = help[mode[type][i]]
|
7954 |
-
if (val) { found.push(val) }
|
7955 |
-
}
|
7956 |
-
} else if (mode.helperType && help[mode.helperType]) {
|
7957 |
-
found.push(help[mode.helperType])
|
7958 |
-
} else if (help[mode.name]) {
|
7959 |
-
found.push(help[mode.name])
|
7960 |
-
}
|
7961 |
-
for (var i$1 = 0; i$1 < help._global.length; i$1++) {
|
7962 |
-
var cur = help._global[i$1]
|
7963 |
-
if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)
|
7964 |
-
{ found.push(cur.val) }
|
7965 |
-
}
|
7966 |
-
return found
|
7967 |
-
},
|
7968 |
-
|
7969 |
-
getStateAfter: function(line, precise) {
|
7970 |
-
var doc = this.doc
|
7971 |
-
line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)
|
7972 |
-
return getStateBefore(this, line + 1, precise)
|
7973 |
-
},
|
7974 |
-
|
7975 |
-
cursorCoords: function(start, mode) {
|
7976 |
-
var pos, range = this.doc.sel.primary()
|
7977 |
-
if (start == null) { pos = range.head }
|
7978 |
-
else if (typeof start == "object") { pos = clipPos(this.doc, start) }
|
7979 |
-
else { pos = start ? range.from() : range.to() }
|
7980 |
-
return cursorCoords(this, pos, mode || "page")
|
7981 |
-
},
|
7982 |
-
|
7983 |
-
charCoords: function(pos, mode) {
|
7984 |
-
return charCoords(this, clipPos(this.doc, pos), mode || "page")
|
7985 |
-
},
|
7986 |
-
|
7987 |
-
coordsChar: function(coords, mode) {
|
7988 |
-
coords = fromCoordSystem(this, coords, mode || "page")
|
7989 |
-
return coordsChar(this, coords.left, coords.top)
|
7990 |
-
},
|
7991 |
-
|
7992 |
-
lineAtHeight: function(height, mode) {
|
7993 |
-
height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top
|
7994 |
-
return lineAtHeight(this.doc, height + this.display.viewOffset)
|
7995 |
-
},
|
7996 |
-
heightAtLine: function(line, mode, includeWidgets) {
|
7997 |
-
var end = false, lineObj
|
7998 |
-
if (typeof line == "number") {
|
7999 |
-
var last = this.doc.first + this.doc.size - 1
|
8000 |
-
if (line < this.doc.first) { line = this.doc.first }
|
8001 |
-
else if (line > last) { line = last; end = true }
|
8002 |
-
lineObj = getLine(this.doc, line)
|
8003 |
-
} else {
|
8004 |
-
lineObj = line
|
8005 |
-
}
|
8006 |
-
return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top +
|
8007 |
-
(end ? this.doc.height - heightAtLine(lineObj) : 0)
|
8008 |
-
},
|
8009 |
-
|
8010 |
-
defaultTextHeight: function() { return textHeight(this.display) },
|
8011 |
-
defaultCharWidth: function() { return charWidth(this.display) },
|
8012 |
-
|
8013 |
-
getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
|
8014 |
-
|
8015 |
-
addWidget: function(pos, node, scroll, vert, horiz) {
|
8016 |
-
var display = this.display
|
8017 |
-
pos = cursorCoords(this, clipPos(this.doc, pos))
|
8018 |
-
var top = pos.bottom, left = pos.left
|
8019 |
-
node.style.position = "absolute"
|
8020 |
-
node.setAttribute("cm-ignore-events", "true")
|
8021 |
-
this.display.input.setUneditable(node)
|
8022 |
-
display.sizer.appendChild(node)
|
8023 |
-
if (vert == "over") {
|
8024 |
-
top = pos.top
|
8025 |
-
} else if (vert == "above" || vert == "near") {
|
8026 |
-
var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
|
8027 |
-
hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)
|
8028 |
-
// Default to positioning above (if specified and possible); otherwise default to positioning below
|
8029 |
-
if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
|
8030 |
-
{ top = pos.top - node.offsetHeight }
|
8031 |
-
else if (pos.bottom + node.offsetHeight <= vspace)
|
8032 |
-
{ top = pos.bottom }
|
8033 |
-
if (left + node.offsetWidth > hspace)
|
8034 |
-
{ left = hspace - node.offsetWidth }
|
8035 |
-
}
|
8036 |
-
node.style.top = top + "px"
|
8037 |
-
node.style.left = node.style.right = ""
|
8038 |
-
if (horiz == "right") {
|
8039 |
-
left = display.sizer.clientWidth - node.offsetWidth
|
8040 |
-
node.style.right = "0px"
|
8041 |
-
} else {
|
8042 |
-
if (horiz == "left") { left = 0 }
|
8043 |
-
else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }
|
8044 |
-
node.style.left = left + "px"
|
8045 |
-
}
|
8046 |
-
if (scroll)
|
8047 |
-
{ scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }
|
8048 |
-
},
|
8049 |
-
|
8050 |
-
triggerOnKeyDown: methodOp(onKeyDown),
|
8051 |
-
triggerOnKeyPress: methodOp(onKeyPress),
|
8052 |
-
triggerOnKeyUp: onKeyUp,
|
8053 |
-
|
8054 |
-
execCommand: function(cmd) {
|
8055 |
-
if (commands.hasOwnProperty(cmd))
|
8056 |
-
{ return commands[cmd].call(null, this) }
|
8057 |
-
},
|
8058 |
-
|
8059 |
-
triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),
|
8060 |
-
|
8061 |
-
findPosH: function(from, amount, unit, visually) {
|
8062 |
-
var this$1 = this;
|
8063 |
-
|
8064 |
-
var dir = 1
|
8065 |
-
if (amount < 0) { dir = -1; amount = -amount }
|
8066 |
-
var cur = clipPos(this.doc, from)
|
8067 |
-
for (var i = 0; i < amount; ++i) {
|
8068 |
-
cur = findPosH(this$1.doc, cur, dir, unit, visually)
|
8069 |
-
if (cur.hitSide) { break }
|
8070 |
-
}
|
8071 |
-
return cur
|
8072 |
-
},
|
8073 |
-
|
8074 |
-
moveH: methodOp(function(dir, unit) {
|
8075 |
-
var this$1 = this;
|
8076 |
-
|
8077 |
-
this.extendSelectionsBy(function (range) {
|
8078 |
-
if (this$1.display.shift || this$1.doc.extend || range.empty())
|
8079 |
-
{ return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
|
8080 |
-
else
|
8081 |
-
{ return dir < 0 ? range.from() : range.to() }
|
8082 |
-
}, sel_move)
|
8083 |
-
}),
|
8084 |
-
|
8085 |
-
deleteH: methodOp(function(dir, unit) {
|
8086 |
-
var sel = this.doc.sel, doc = this.doc
|
8087 |
-
if (sel.somethingSelected())
|
8088 |
-
{ doc.replaceSelection("", null, "+delete") }
|
8089 |
-
else
|
8090 |
-
{ deleteNearSelection(this, function (range) {
|
8091 |
-
var other = findPosH(doc, range.head, dir, unit, false)
|
8092 |
-
return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}
|
8093 |
-
}) }
|
8094 |
-
}),
|
8095 |
-
|
8096 |
-
findPosV: function(from, amount, unit, goalColumn) {
|
8097 |
-
var this$1 = this;
|
8098 |
-
|
8099 |
-
var dir = 1, x = goalColumn
|
8100 |
-
if (amount < 0) { dir = -1; amount = -amount }
|
8101 |
-
var cur = clipPos(this.doc, from)
|
8102 |
-
for (var i = 0; i < amount; ++i) {
|
8103 |
-
var coords = cursorCoords(this$1, cur, "div")
|
8104 |
-
if (x == null) { x = coords.left }
|
8105 |
-
else { coords.left = x }
|
8106 |
-
cur = findPosV(this$1, coords, dir, unit)
|
8107 |
-
if (cur.hitSide) { break }
|
8108 |
-
}
|
8109 |
-
return cur
|
8110 |
-
},
|
8111 |
-
|
8112 |
-
moveV: methodOp(function(dir, unit) {
|
8113 |
-
var this$1 = this;
|
8114 |
-
|
8115 |
-
var doc = this.doc, goals = []
|
8116 |
-
var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()
|
8117 |
-
doc.extendSelectionsBy(function (range) {
|
8118 |
-
if (collapse)
|
8119 |
-
{ return dir < 0 ? range.from() : range.to() }
|
8120 |
-
var headPos = cursorCoords(this$1, range.head, "div")
|
8121 |
-
if (range.goalColumn != null) { headPos.left = range.goalColumn }
|
8122 |
-
goals.push(headPos.left)
|
8123 |
-
var pos = findPosV(this$1, headPos, dir, unit)
|
8124 |
-
if (unit == "page" && range == doc.sel.primary())
|
8125 |
-
{ addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) }
|
8126 |
-
return pos
|
8127 |
-
}, sel_move)
|
8128 |
-
if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
|
8129 |
-
{ doc.sel.ranges[i].goalColumn = goals[i] } }
|
8130 |
-
}),
|
8131 |
-
|
8132 |
-
// Find the word at the given position (as returned by coordsChar).
|
8133 |
-
findWordAt: function(pos) {
|
8134 |
-
var doc = this.doc, line = getLine(doc, pos.line).text
|
8135 |
-
var start = pos.ch, end = pos.ch
|
8136 |
-
if (line) {
|
8137 |
-
var helper = this.getHelper(pos, "wordChars")
|
8138 |
-
if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end }
|
8139 |
-
var startChar = line.charAt(start)
|
8140 |
-
var check = isWordChar(startChar, helper)
|
8141 |
-
? function (ch) { return isWordChar(ch, helper); }
|
8142 |
-
: /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
|
8143 |
-
: function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }
|
8144 |
-
while (start > 0 && check(line.charAt(start - 1))) { --start }
|
8145 |
-
while (end < line.length && check(line.charAt(end))) { ++end }
|
8146 |
-
}
|
8147 |
-
return new Range(Pos(pos.line, start), Pos(pos.line, end))
|
8148 |
-
},
|
8149 |
-
|
8150 |
-
toggleOverwrite: function(value) {
|
8151 |
-
if (value != null && value == this.state.overwrite) { return }
|
8152 |
-
if (this.state.overwrite = !this.state.overwrite)
|
8153 |
-
{ addClass(this.display.cursorDiv, "CodeMirror-overwrite") }
|
8154 |
-
else
|
8155 |
-
{ rmClass(this.display.cursorDiv, "CodeMirror-overwrite") }
|
8156 |
-
|
8157 |
-
signal(this, "overwriteToggle", this, this.state.overwrite)
|
8158 |
-
},
|
8159 |
-
hasFocus: function() { return this.display.input.getField() == activeElt() },
|
8160 |
-
isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
|
8161 |
-
|
8162 |
-
scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }),
|
8163 |
-
getScrollInfo: function() {
|
8164 |
-
var scroller = this.display.scroller
|
8165 |
-
return {left: scroller.scrollLeft, top: scroller.scrollTop,
|
8166 |
-
height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
|
8167 |
-
width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
|
8168 |
-
clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
|
8169 |
-
},
|
8170 |
-
|
8171 |
-
scrollIntoView: methodOp(function(range, margin) {
|
8172 |
-
if (range == null) {
|
8173 |
-
range = {from: this.doc.sel.primary().head, to: null}
|
8174 |
-
if (margin == null) { margin = this.options.cursorScrollMargin }
|
8175 |
-
} else if (typeof range == "number") {
|
8176 |
-
range = {from: Pos(range, 0), to: null}
|
8177 |
-
} else if (range.from == null) {
|
8178 |
-
range = {from: range, to: null}
|
8179 |
-
}
|
8180 |
-
if (!range.to) { range.to = range.from }
|
8181 |
-
range.margin = margin || 0
|
8182 |
-
|
8183 |
-
if (range.from.line != null) {
|
8184 |
-
scrollToRange(this, range)
|
8185 |
-
} else {
|
8186 |
-
scrollToCoordsRange(this, range.from, range.to, range.margin)
|
8187 |
-
}
|
8188 |
-
}),
|
8189 |
-
|
8190 |
-
setSize: methodOp(function(width, height) {
|
8191 |
-
var this$1 = this;
|
8192 |
-
|
8193 |
-
var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }
|
8194 |
-
if (width != null) { this.display.wrapper.style.width = interpret(width) }
|
8195 |
-
if (height != null) { this.display.wrapper.style.height = interpret(height) }
|
8196 |
-
if (this.options.lineWrapping) { clearLineMeasurementCache(this) }
|
8197 |
-
var lineNo = this.display.viewFrom
|
8198 |
-
this.doc.iter(lineNo, this.display.viewTo, function (line) {
|
8199 |
-
if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
|
8200 |
-
{ if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
|
8201 |
-
++lineNo
|
8202 |
-
})
|
8203 |
-
this.curOp.forceUpdate = true
|
8204 |
-
signal(this, "refresh", this)
|
8205 |
-
}),
|
8206 |
-
|
8207 |
-
operation: function(f){return runInOp(this, f)},
|
8208 |
-
|
8209 |
-
refresh: methodOp(function() {
|
8210 |
-
var oldHeight = this.display.cachedTextHeight
|
8211 |
-
regChange(this)
|
8212 |
-
this.curOp.forceUpdate = true
|
8213 |
-
clearCaches(this)
|
8214 |
-
scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop)
|
8215 |
-
updateGutterSpace(this)
|
8216 |
-
if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
|
8217 |
-
{ estimateLineHeights(this) }
|
8218 |
-
signal(this, "refresh", this)
|
8219 |
-
}),
|
8220 |
-
|
8221 |
-
swapDoc: methodOp(function(doc) {
|
8222 |
-
var old = this.doc
|
8223 |
-
old.cm = null
|
8224 |
-
attachDoc(this, doc)
|
8225 |
-
clearCaches(this)
|
8226 |
-
this.display.input.reset()
|
8227 |
-
scrollToCoords(this, doc.scrollLeft, doc.scrollTop)
|
8228 |
-
this.curOp.forceScroll = true
|
8229 |
-
signalLater(this, "swapDoc", this, old)
|
8230 |
-
return old
|
8231 |
-
}),
|
8232 |
-
|
8233 |
-
getInputField: function(){return this.display.input.getField()},
|
8234 |
-
getWrapperElement: function(){return this.display.wrapper},
|
8235 |
-
getScrollerElement: function(){return this.display.scroller},
|
8236 |
-
getGutterElement: function(){return this.display.gutters}
|
8237 |
-
}
|
8238 |
-
eventMixin(CodeMirror)
|
8239 |
-
|
8240 |
-
CodeMirror.registerHelper = function(type, name, value) {
|
8241 |
-
if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }
|
8242 |
-
helpers[type][name] = value
|
8243 |
-
}
|
8244 |
-
CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
|
8245 |
-
CodeMirror.registerHelper(type, name, value)
|
8246 |
-
helpers[type]._global.push({pred: predicate, val: value})
|
8247 |
-
}
|
8248 |
-
}
|
8249 |
-
|
8250 |
-
// Used for horizontal relative motion. Dir is -1 or 1 (left or
|
8251 |
-
// right), unit can be "char", "column" (like char, but doesn't
|
8252 |
-
// cross line boundaries), "word" (across next word), or "group" (to
|
8253 |
-
// the start of next group of word or non-word-non-whitespace
|
8254 |
-
// chars). The visually param controls whether, in right-to-left
|
8255 |
-
// text, direction 1 means to move towards the next index in the
|
8256 |
-
// string, or towards the character to the right of the current
|
8257 |
-
// position. The resulting position will have a hitSide=true
|
8258 |
-
// property if it reached the end of the document.
|
8259 |
-
function findPosH(doc, pos, dir, unit, visually) {
|
8260 |
-
var oldPos = pos
|
8261 |
-
var origDir = dir
|
8262 |
-
var lineObj = getLine(doc, pos.line)
|
8263 |
-
function findNextLine() {
|
8264 |
-
var l = pos.line + dir
|
8265 |
-
if (l < doc.first || l >= doc.first + doc.size) { return false }
|
8266 |
-
pos = new Pos(l, pos.ch, pos.sticky)
|
8267 |
-
return lineObj = getLine(doc, l)
|
8268 |
-
}
|
8269 |
-
function moveOnce(boundToLine) {
|
8270 |
-
var next
|
8271 |
-
if (visually) {
|
8272 |
-
next = moveVisually(doc.cm, lineObj, pos, dir)
|
8273 |
-
} else {
|
8274 |
-
next = moveLogically(lineObj, pos, dir)
|
8275 |
-
}
|
8276 |
-
if (next == null) {
|
8277 |
-
if (!boundToLine && findNextLine())
|
8278 |
-
{ pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) }
|
8279 |
-
else
|
8280 |
-
{ return false }
|
8281 |
-
} else {
|
8282 |
-
pos = next
|
8283 |
-
}
|
8284 |
-
return true
|
8285 |
-
}
|
8286 |
-
|
8287 |
-
if (unit == "char") {
|
8288 |
-
moveOnce()
|
8289 |
-
} else if (unit == "column") {
|
8290 |
-
moveOnce(true)
|
8291 |
-
} else if (unit == "word" || unit == "group") {
|
8292 |
-
var sawType = null, group = unit == "group"
|
8293 |
-
var helper = doc.cm && doc.cm.getHelper(pos, "wordChars")
|
8294 |
-
for (var first = true;; first = false) {
|
8295 |
-
if (dir < 0 && !moveOnce(!first)) { break }
|
8296 |
-
var cur = lineObj.text.charAt(pos.ch) || "\n"
|
8297 |
-
var type = isWordChar(cur, helper) ? "w"
|
8298 |
-
: group && cur == "\n" ? "n"
|
8299 |
-
: !group || /\s/.test(cur) ? null
|
8300 |
-
: "p"
|
8301 |
-
if (group && !first && !type) { type = "s" }
|
8302 |
-
if (sawType && sawType != type) {
|
8303 |
-
if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"}
|
8304 |
-
break
|
8305 |
-
}
|
8306 |
-
|
8307 |
-
if (type) { sawType = type }
|
8308 |
-
if (dir > 0 && !moveOnce(!first)) { break }
|
8309 |
-
}
|
8310 |
-
}
|
8311 |
-
var result = skipAtomic(doc, pos, oldPos, origDir, true)
|
8312 |
-
if (equalCursorPos(oldPos, result)) { result.hitSide = true }
|
8313 |
-
return result
|
8314 |
-
}
|
8315 |
-
|
8316 |
-
// For relative vertical movement. Dir may be -1 or 1. Unit can be
|
8317 |
-
// "page" or "line". The resulting position will have a hitSide=true
|
8318 |
-
// property if it reached the end of the document.
|
8319 |
-
function findPosV(cm, pos, dir, unit) {
|
8320 |
-
var doc = cm.doc, x = pos.left, y
|
8321 |
-
if (unit == "page") {
|
8322 |
-
var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)
|
8323 |
-
var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)
|
8324 |
-
y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount
|
8325 |
-
|
8326 |
-
} else if (unit == "line") {
|
8327 |
-
y = dir > 0 ? pos.bottom + 3 : pos.top - 3
|
8328 |
-
}
|
8329 |
-
var target
|
8330 |
-
for (;;) {
|
8331 |
-
target = coordsChar(cm, x, y)
|
8332 |
-
if (!target.outside) { break }
|
8333 |
-
if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
|
8334 |
-
y += dir * 5
|
8335 |
-
}
|
8336 |
-
return target
|
8337 |
-
}
|
8338 |
-
|
8339 |
-
// CONTENTEDITABLE INPUT STYLE
|
8340 |
-
|
8341 |
-
var ContentEditableInput = function(cm) {
|
8342 |
-
this.cm = cm
|
8343 |
-
this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
|
8344 |
-
this.polling = new Delayed()
|
8345 |
-
this.composing = null
|
8346 |
-
this.gracePeriod = false
|
8347 |
-
this.readDOMTimeout = null
|
8348 |
-
};
|
8349 |
-
|
8350 |
-
ContentEditableInput.prototype.init = function (display) {
|
8351 |
-
var this$1 = this;
|
8352 |
-
|
8353 |
-
var input = this, cm = input.cm
|
8354 |
-
var div = input.div = display.lineDiv
|
8355 |
-
disableBrowserMagic(div, cm.options.spellcheck)
|
8356 |
-
|
8357 |
-
on(div, "paste", function (e) {
|
8358 |
-
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
8359 |
-
// IE doesn't fire input events, so we schedule a read for the pasted content in this way
|
8360 |
-
if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) }
|
8361 |
-
})
|
8362 |
-
|
8363 |
-
on(div, "compositionstart", function (e) {
|
8364 |
-
this$1.composing = {data: e.data, done: false}
|
8365 |
-
})
|
8366 |
-
on(div, "compositionupdate", function (e) {
|
8367 |
-
if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }
|
8368 |
-
})
|
8369 |
-
on(div, "compositionend", function (e) {
|
8370 |
-
if (this$1.composing) {
|
8371 |
-
if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
|
8372 |
-
this$1.composing.done = true
|
8373 |
-
}
|
8374 |
-
})
|
8375 |
-
|
8376 |
-
on(div, "touchstart", function () { return input.forceCompositionEnd(); })
|
8377 |
-
|
8378 |
-
on(div, "input", function () {
|
8379 |
-
if (!this$1.composing) { this$1.readFromDOMSoon() }
|
8380 |
-
})
|
8381 |
-
|
8382 |
-
function onCopyCut(e) {
|
8383 |
-
if (signalDOMEvent(cm, e)) { return }
|
8384 |
-
if (cm.somethingSelected()) {
|
8385 |
-
setLastCopied({lineWise: false, text: cm.getSelections()})
|
8386 |
-
if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
|
8387 |
-
} else if (!cm.options.lineWiseCopyCut) {
|
8388 |
-
return
|
8389 |
-
} else {
|
8390 |
-
var ranges = copyableRanges(cm)
|
8391 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
8392 |
-
if (e.type == "cut") {
|
8393 |
-
cm.operation(function () {
|
8394 |
-
cm.setSelections(ranges.ranges, 0, sel_dontScroll)
|
8395 |
-
cm.replaceSelection("", null, "cut")
|
8396 |
-
})
|
8397 |
-
}
|
8398 |
-
}
|
8399 |
-
if (e.clipboardData) {
|
8400 |
-
e.clipboardData.clearData()
|
8401 |
-
var content = lastCopied.text.join("\n")
|
8402 |
-
// iOS exposes the clipboard API, but seems to discard content inserted into it
|
8403 |
-
e.clipboardData.setData("Text", content)
|
8404 |
-
if (e.clipboardData.getData("Text") == content) {
|
8405 |
-
e.preventDefault()
|
8406 |
-
return
|
8407 |
-
}
|
8408 |
-
}
|
8409 |
-
// Old-fashioned briefly-focus-a-textarea hack
|
8410 |
-
var kludge = hiddenTextarea(), te = kludge.firstChild
|
8411 |
-
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
|
8412 |
-
te.value = lastCopied.text.join("\n")
|
8413 |
-
var hadFocus = document.activeElement
|
8414 |
-
selectInput(te)
|
8415 |
-
setTimeout(function () {
|
8416 |
-
cm.display.lineSpace.removeChild(kludge)
|
8417 |
-
hadFocus.focus()
|
8418 |
-
if (hadFocus == div) { input.showPrimarySelection() }
|
8419 |
-
}, 50)
|
8420 |
-
}
|
8421 |
-
on(div, "copy", onCopyCut)
|
8422 |
-
on(div, "cut", onCopyCut)
|
8423 |
-
};
|
8424 |
-
|
8425 |
-
ContentEditableInput.prototype.prepareSelection = function () {
|
8426 |
-
var result = prepareSelection(this.cm, false)
|
8427 |
-
result.focus = this.cm.state.focused
|
8428 |
-
return result
|
8429 |
-
};
|
8430 |
-
|
8431 |
-
ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
|
8432 |
-
if (!info || !this.cm.display.view.length) { return }
|
8433 |
-
if (info.focus || takeFocus) { this.showPrimarySelection() }
|
8434 |
-
this.showMultipleSelections(info)
|
8435 |
-
};
|
8436 |
-
|
8437 |
-
ContentEditableInput.prototype.showPrimarySelection = function () {
|
8438 |
-
var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary()
|
8439 |
-
var from = prim.from(), to = prim.to()
|
8440 |
-
|
8441 |
-
if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
|
8442 |
-
sel.removeAllRanges()
|
8443 |
-
return
|
8444 |
-
}
|
8445 |
-
|
8446 |
-
var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
|
8447 |
-
var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset)
|
8448 |
-
if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
|
8449 |
-
cmp(minPos(curAnchor, curFocus), from) == 0 &&
|
8450 |
-
cmp(maxPos(curAnchor, curFocus), to) == 0)
|
8451 |
-
{ return }
|
8452 |
-
|
8453 |
-
var view = cm.display.view
|
8454 |
-
var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
|
8455 |
-
{node: view[0].measure.map[2], offset: 0}
|
8456 |
-
var end = to.line < cm.display.viewTo && posToDOM(cm, to)
|
8457 |
-
if (!end) {
|
8458 |
-
var measure = view[view.length - 1].measure
|
8459 |
-
var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
|
8460 |
-
end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
|
8461 |
-
}
|
8462 |
-
|
8463 |
-
if (!start || !end) {
|
8464 |
-
sel.removeAllRanges()
|
8465 |
-
return
|
8466 |
-
}
|
8467 |
-
|
8468 |
-
var old = sel.rangeCount && sel.getRangeAt(0), rng
|
8469 |
-
try { rng = range(start.node, start.offset, end.offset, end.node) }
|
8470 |
-
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
|
8471 |
-
if (rng) {
|
8472 |
-
if (!gecko && cm.state.focused) {
|
8473 |
-
sel.collapse(start.node, start.offset)
|
8474 |
-
if (!rng.collapsed) {
|
8475 |
-
sel.removeAllRanges()
|
8476 |
-
sel.addRange(rng)
|
8477 |
-
}
|
8478 |
-
} else {
|
8479 |
-
sel.removeAllRanges()
|
8480 |
-
sel.addRange(rng)
|
8481 |
-
}
|
8482 |
-
if (old && sel.anchorNode == null) { sel.addRange(old) }
|
8483 |
-
else if (gecko) { this.startGracePeriod() }
|
8484 |
-
}
|
8485 |
-
this.rememberSelection()
|
8486 |
-
};
|
8487 |
-
|
8488 |
-
ContentEditableInput.prototype.startGracePeriod = function () {
|
8489 |
-
var this$1 = this;
|
8490 |
-
|
8491 |
-
clearTimeout(this.gracePeriod)
|
8492 |
-
this.gracePeriod = setTimeout(function () {
|
8493 |
-
this$1.gracePeriod = false
|
8494 |
-
if (this$1.selectionChanged())
|
8495 |
-
{ this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }
|
8496 |
-
}, 20)
|
8497 |
-
};
|
8498 |
-
|
8499 |
-
ContentEditableInput.prototype.showMultipleSelections = function (info) {
|
8500 |
-
removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
|
8501 |
-
removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
|
8502 |
-
};
|
8503 |
-
|
8504 |
-
ContentEditableInput.prototype.rememberSelection = function () {
|
8505 |
-
var sel = window.getSelection()
|
8506 |
-
this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
|
8507 |
-
this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
|
8508 |
-
};
|
8509 |
-
|
8510 |
-
ContentEditableInput.prototype.selectionInEditor = function () {
|
8511 |
-
var sel = window.getSelection()
|
8512 |
-
if (!sel.rangeCount) { return false }
|
8513 |
-
var node = sel.getRangeAt(0).commonAncestorContainer
|
8514 |
-
return contains(this.div, node)
|
8515 |
-
};
|
8516 |
-
|
8517 |
-
ContentEditableInput.prototype.focus = function () {
|
8518 |
-
if (this.cm.options.readOnly != "nocursor") {
|
8519 |
-
if (!this.selectionInEditor())
|
8520 |
-
{ this.showSelection(this.prepareSelection(), true) }
|
8521 |
-
this.div.focus()
|
8522 |
-
}
|
8523 |
-
};
|
8524 |
-
ContentEditableInput.prototype.blur = function () { this.div.blur() };
|
8525 |
-
ContentEditableInput.prototype.getField = function () { return this.div };
|
8526 |
-
|
8527 |
-
ContentEditableInput.prototype.supportsTouch = function () { return true };
|
8528 |
-
|
8529 |
-
ContentEditableInput.prototype.receivedFocus = function () {
|
8530 |
-
var input = this
|
8531 |
-
if (this.selectionInEditor())
|
8532 |
-
{ this.pollSelection() }
|
8533 |
-
else
|
8534 |
-
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
|
8535 |
-
|
8536 |
-
function poll() {
|
8537 |
-
if (input.cm.state.focused) {
|
8538 |
-
input.pollSelection()
|
8539 |
-
input.polling.set(input.cm.options.pollInterval, poll)
|
8540 |
-
}
|
8541 |
-
}
|
8542 |
-
this.polling.set(this.cm.options.pollInterval, poll)
|
8543 |
-
};
|
8544 |
-
|
8545 |
-
ContentEditableInput.prototype.selectionChanged = function () {
|
8546 |
-
var sel = window.getSelection()
|
8547 |
-
return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
|
8548 |
-
sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
|
8549 |
-
};
|
8550 |
-
|
8551 |
-
ContentEditableInput.prototype.pollSelection = function () {
|
8552 |
-
if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }
|
8553 |
-
var sel = window.getSelection(), cm = this.cm
|
8554 |
-
// On Android Chrome (version 56, at least), backspacing into an
|
8555 |
-
// uneditable block element will put the cursor in that element,
|
8556 |
-
// and then, because it's not editable, hide the virtual keyboard.
|
8557 |
-
// Because Android doesn't allow us to actually detect backspace
|
8558 |
-
// presses in a sane way, this code checks for when that happens
|
8559 |
-
// and simulates a backspace press in this case.
|
8560 |
-
if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {
|
8561 |
-
this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs})
|
8562 |
-
this.blur()
|
8563 |
-
this.focus()
|
8564 |
-
return
|
8565 |
-
}
|
8566 |
-
if (this.composing) { return }
|
8567 |
-
this.rememberSelection()
|
8568 |
-
var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
|
8569 |
-
var head = domToPos(cm, sel.focusNode, sel.focusOffset)
|
8570 |
-
if (anchor && head) { runInOp(cm, function () {
|
8571 |
-
setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
|
8572 |
-
if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
|
8573 |
-
}) }
|
8574 |
-
};
|
8575 |
-
|
8576 |
-
ContentEditableInput.prototype.pollContent = function () {
|
8577 |
-
if (this.readDOMTimeout != null) {
|
8578 |
-
clearTimeout(this.readDOMTimeout)
|
8579 |
-
this.readDOMTimeout = null
|
8580 |
-
}
|
8581 |
-
|
8582 |
-
var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
|
8583 |
-
var from = sel.from(), to = sel.to()
|
8584 |
-
if (from.ch == 0 && from.line > cm.firstLine())
|
8585 |
-
{ from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
|
8586 |
-
if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
|
8587 |
-
{ to = Pos(to.line + 1, 0) }
|
8588 |
-
if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
|
8589 |
-
|
8590 |
-
var fromIndex, fromLine, fromNode
|
8591 |
-
if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
|
8592 |
-
fromLine = lineNo(display.view[0].line)
|
8593 |
-
fromNode = display.view[0].node
|
8594 |
-
} else {
|
8595 |
-
fromLine = lineNo(display.view[fromIndex].line)
|
8596 |
-
fromNode = display.view[fromIndex - 1].node.nextSibling
|
8597 |
-
}
|
8598 |
-
var toIndex = findViewIndex(cm, to.line)
|
8599 |
-
var toLine, toNode
|
8600 |
-
if (toIndex == display.view.length - 1) {
|
8601 |
-
toLine = display.viewTo - 1
|
8602 |
-
toNode = display.lineDiv.lastChild
|
8603 |
-
} else {
|
8604 |
-
toLine = lineNo(display.view[toIndex + 1].line) - 1
|
8605 |
-
toNode = display.view[toIndex + 1].node.previousSibling
|
8606 |
-
}
|
8607 |
-
|
8608 |
-
if (!fromNode) { return false }
|
8609 |
-
var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))
|
8610 |
-
var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))
|
8611 |
-
while (newText.length > 1 && oldText.length > 1) {
|
8612 |
-
if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }
|
8613 |
-
else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }
|
8614 |
-
else { break }
|
8615 |
-
}
|
8616 |
-
|
8617 |
-
var cutFront = 0, cutEnd = 0
|
8618 |
-
var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)
|
8619 |
-
while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
|
8620 |
-
{ ++cutFront }
|
8621 |
-
var newBot = lst(newText), oldBot = lst(oldText)
|
8622 |
-
var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
|
8623 |
-
oldBot.length - (oldText.length == 1 ? cutFront : 0))
|
8624 |
-
while (cutEnd < maxCutEnd &&
|
8625 |
-
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
|
8626 |
-
{ ++cutEnd }
|
8627 |
-
// Try to move start of change to start of selection if ambiguous
|
8628 |
-
if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {
|
8629 |
-
while (cutFront && cutFront > from.ch &&
|
8630 |
-
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {
|
8631 |
-
cutFront--
|
8632 |
-
cutEnd++
|
8633 |
-
}
|
8634 |
-
}
|
8635 |
-
|
8636 |
-
newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
|
8637 |
-
newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
|
8638 |
-
|
8639 |
-
var chFrom = Pos(fromLine, cutFront)
|
8640 |
-
var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
|
8641 |
-
if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
|
8642 |
-
replaceRange(cm.doc, newText, chFrom, chTo, "+input")
|
8643 |
-
return true
|
8644 |
-
}
|
8645 |
-
};
|
8646 |
-
|
8647 |
-
ContentEditableInput.prototype.ensurePolled = function () {
|
8648 |
-
this.forceCompositionEnd()
|
8649 |
-
};
|
8650 |
-
ContentEditableInput.prototype.reset = function () {
|
8651 |
-
this.forceCompositionEnd()
|
8652 |
-
};
|
8653 |
-
ContentEditableInput.prototype.forceCompositionEnd = function () {
|
8654 |
-
if (!this.composing) { return }
|
8655 |
-
clearTimeout(this.readDOMTimeout)
|
8656 |
-
this.composing = null
|
8657 |
-
this.updateFromDOM()
|
8658 |
-
this.div.blur()
|
8659 |
-
this.div.focus()
|
8660 |
-
};
|
8661 |
-
ContentEditableInput.prototype.readFromDOMSoon = function () {
|
8662 |
-
var this$1 = this;
|
8663 |
-
|
8664 |
-
if (this.readDOMTimeout != null) { return }
|
8665 |
-
this.readDOMTimeout = setTimeout(function () {
|
8666 |
-
this$1.readDOMTimeout = null
|
8667 |
-
if (this$1.composing) {
|
8668 |
-
if (this$1.composing.done) { this$1.composing = null }
|
8669 |
-
else { return }
|
8670 |
-
}
|
8671 |
-
this$1.updateFromDOM()
|
8672 |
-
}, 80)
|
8673 |
-
};
|
8674 |
-
|
8675 |
-
ContentEditableInput.prototype.updateFromDOM = function () {
|
8676 |
-
var this$1 = this;
|
8677 |
-
|
8678 |
-
if (this.cm.isReadOnly() || !this.pollContent())
|
8679 |
-
{ runInOp(this.cm, function () { return regChange(this$1.cm); }) }
|
8680 |
-
};
|
8681 |
-
|
8682 |
-
ContentEditableInput.prototype.setUneditable = function (node) {
|
8683 |
-
node.contentEditable = "false"
|
8684 |
-
};
|
8685 |
-
|
8686 |
-
ContentEditableInput.prototype.onKeyPress = function (e) {
|
8687 |
-
if (e.charCode == 0) { return }
|
8688 |
-
e.preventDefault()
|
8689 |
-
if (!this.cm.isReadOnly())
|
8690 |
-
{ operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }
|
8691 |
-
};
|
8692 |
-
|
8693 |
-
ContentEditableInput.prototype.readOnlyChanged = function (val) {
|
8694 |
-
this.div.contentEditable = String(val != "nocursor")
|
8695 |
-
};
|
8696 |
-
|
8697 |
-
ContentEditableInput.prototype.onContextMenu = function () {};
|
8698 |
-
ContentEditableInput.prototype.resetPosition = function () {};
|
8699 |
-
|
8700 |
-
ContentEditableInput.prototype.needsContentAttribute = true
|
8701 |
-
|
8702 |
-
function posToDOM(cm, pos) {
|
8703 |
-
var view = findViewForLine(cm, pos.line)
|
8704 |
-
if (!view || view.hidden) { return null }
|
8705 |
-
var line = getLine(cm.doc, pos.line)
|
8706 |
-
var info = mapFromLineView(view, line, pos.line)
|
8707 |
-
|
8708 |
-
var order = getOrder(line, cm.doc.direction), side = "left"
|
8709 |
-
if (order) {
|
8710 |
-
var partPos = getBidiPartAt(order, pos.ch)
|
8711 |
-
side = partPos % 2 ? "right" : "left"
|
8712 |
-
}
|
8713 |
-
var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)
|
8714 |
-
result.offset = result.collapse == "right" ? result.end : result.start
|
8715 |
-
return result
|
8716 |
-
}
|
8717 |
-
|
8718 |
-
function isInGutter(node) {
|
8719 |
-
for (var scan = node; scan; scan = scan.parentNode)
|
8720 |
-
{ if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }
|
8721 |
-
return false
|
8722 |
-
}
|
8723 |
-
|
8724 |
-
function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
|
8725 |
-
|
8726 |
-
function domTextBetween(cm, from, to, fromLine, toLine) {
|
8727 |
-
var text = "", closing = false, lineSep = cm.doc.lineSeparator()
|
8728 |
-
function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
|
8729 |
-
function close() {
|
8730 |
-
if (closing) {
|
8731 |
-
text += lineSep
|
8732 |
-
closing = false
|
8733 |
-
}
|
8734 |
-
}
|
8735 |
-
function addText(str) {
|
8736 |
-
if (str) {
|
8737 |
-
close()
|
8738 |
-
text += str
|
8739 |
-
}
|
8740 |
-
}
|
8741 |
-
function walk(node) {
|
8742 |
-
if (node.nodeType == 1) {
|
8743 |
-
var cmText = node.getAttribute("cm-text")
|
8744 |
-
if (cmText != null) {
|
8745 |
-
addText(cmText || node.textContent.replace(/\u200b/g, ""))
|
8746 |
-
return
|
8747 |
-
}
|
8748 |
-
var markerID = node.getAttribute("cm-marker"), range
|
8749 |
-
if (markerID) {
|
8750 |
-
var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))
|
8751 |
-
if (found.length && (range = found[0].find()))
|
8752 |
-
{ addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) }
|
8753 |
-
return
|
8754 |
-
}
|
8755 |
-
if (node.getAttribute("contenteditable") == "false") { return }
|
8756 |
-
var isBlock = /^(pre|div|p)$/i.test(node.nodeName)
|
8757 |
-
if (isBlock) { close() }
|
8758 |
-
for (var i = 0; i < node.childNodes.length; i++)
|
8759 |
-
{ walk(node.childNodes[i]) }
|
8760 |
-
if (isBlock) { closing = true }
|
8761 |
-
} else if (node.nodeType == 3) {
|
8762 |
-
addText(node.nodeValue)
|
8763 |
-
}
|
8764 |
-
}
|
8765 |
-
for (;;) {
|
8766 |
-
walk(from)
|
8767 |
-
if (from == to) { break }
|
8768 |
-
from = from.nextSibling
|
8769 |
-
}
|
8770 |
-
return text
|
8771 |
-
}
|
8772 |
-
|
8773 |
-
function domToPos(cm, node, offset) {
|
8774 |
-
var lineNode
|
8775 |
-
if (node == cm.display.lineDiv) {
|
8776 |
-
lineNode = cm.display.lineDiv.childNodes[offset]
|
8777 |
-
if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
|
8778 |
-
node = null; offset = 0
|
8779 |
-
} else {
|
8780 |
-
for (lineNode = node;; lineNode = lineNode.parentNode) {
|
8781 |
-
if (!lineNode || lineNode == cm.display.lineDiv) { return null }
|
8782 |
-
if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
|
8783 |
-
}
|
8784 |
-
}
|
8785 |
-
for (var i = 0; i < cm.display.view.length; i++) {
|
8786 |
-
var lineView = cm.display.view[i]
|
8787 |
-
if (lineView.node == lineNode)
|
8788 |
-
{ return locateNodeInLineView(lineView, node, offset) }
|
8789 |
-
}
|
8790 |
-
}
|
8791 |
-
|
8792 |
-
function locateNodeInLineView(lineView, node, offset) {
|
8793 |
-
var wrapper = lineView.text.firstChild, bad = false
|
8794 |
-
if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
|
8795 |
-
if (node == wrapper) {
|
8796 |
-
bad = true
|
8797 |
-
node = wrapper.childNodes[offset]
|
8798 |
-
offset = 0
|
8799 |
-
if (!node) {
|
8800 |
-
var line = lineView.rest ? lst(lineView.rest) : lineView.line
|
8801 |
-
return badPos(Pos(lineNo(line), line.text.length), bad)
|
8802 |
-
}
|
8803 |
-
}
|
8804 |
-
|
8805 |
-
var textNode = node.nodeType == 3 ? node : null, topNode = node
|
8806 |
-
if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
|
8807 |
-
textNode = node.firstChild
|
8808 |
-
if (offset) { offset = textNode.nodeValue.length }
|
8809 |
-
}
|
8810 |
-
while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }
|
8811 |
-
var measure = lineView.measure, maps = measure.maps
|
8812 |
-
|
8813 |
-
function find(textNode, topNode, offset) {
|
8814 |
-
for (var i = -1; i < (maps ? maps.length : 0); i++) {
|
8815 |
-
var map = i < 0 ? measure.map : maps[i]
|
8816 |
-
for (var j = 0; j < map.length; j += 3) {
|
8817 |
-
var curNode = map[j + 2]
|
8818 |
-
if (curNode == textNode || curNode == topNode) {
|
8819 |
-
var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])
|
8820 |
-
var ch = map[j] + offset
|
8821 |
-
if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }
|
8822 |
-
return Pos(line, ch)
|
8823 |
-
}
|
8824 |
-
}
|
8825 |
-
}
|
8826 |
-
}
|
8827 |
-
var found = find(textNode, topNode, offset)
|
8828 |
-
if (found) { return badPos(found, bad) }
|
8829 |
-
|
8830 |
-
// FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
|
8831 |
-
for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
|
8832 |
-
found = find(after, after.firstChild, 0)
|
8833 |
-
if (found)
|
8834 |
-
{ return badPos(Pos(found.line, found.ch - dist), bad) }
|
8835 |
-
else
|
8836 |
-
{ dist += after.textContent.length }
|
8837 |
-
}
|
8838 |
-
for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
|
8839 |
-
found = find(before, before.firstChild, -1)
|
8840 |
-
if (found)
|
8841 |
-
{ return badPos(Pos(found.line, found.ch + dist$1), bad) }
|
8842 |
-
else
|
8843 |
-
{ dist$1 += before.textContent.length }
|
8844 |
-
}
|
8845 |
-
}
|
8846 |
-
|
8847 |
-
// TEXTAREA INPUT STYLE
|
8848 |
-
|
8849 |
-
var TextareaInput = function(cm) {
|
8850 |
-
this.cm = cm
|
8851 |
-
// See input.poll and input.reset
|
8852 |
-
this.prevInput = ""
|
8853 |
-
|
8854 |
-
// Flag that indicates whether we expect input to appear real soon
|
8855 |
-
// now (after some event like 'keypress' or 'input') and are
|
8856 |
-
// polling intensively.
|
8857 |
-
this.pollingFast = false
|
8858 |
-
// Self-resetting timeout for the poller
|
8859 |
-
this.polling = new Delayed()
|
8860 |
-
// Tracks when input.reset has punted to just putting a short
|
8861 |
-
// string into the textarea instead of the full selection.
|
8862 |
-
this.inaccurateSelection = false
|
8863 |
-
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
8864 |
-
this.hasSelection = false
|
8865 |
-
this.composing = null
|
8866 |
-
};
|
8867 |
-
|
8868 |
-
TextareaInput.prototype.init = function (display) {
|
8869 |
-
var this$1 = this;
|
8870 |
-
|
8871 |
-
var input = this, cm = this.cm
|
8872 |
-
|
8873 |
-
// Wraps and hides input textarea
|
8874 |
-
var div = this.wrapper = hiddenTextarea()
|
8875 |
-
// The semihidden textarea that is focused when the editor is
|
8876 |
-
// focused, and receives input.
|
8877 |
-
var te = this.textarea = div.firstChild
|
8878 |
-
display.wrapper.insertBefore(div, display.wrapper.firstChild)
|
8879 |
-
|
8880 |
-
// Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
|
8881 |
-
if (ios) { te.style.width = "0px" }
|
8882 |
-
|
8883 |
-
on(te, "input", function () {
|
8884 |
-
if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }
|
8885 |
-
input.poll()
|
8886 |
-
})
|
8887 |
-
|
8888 |
-
on(te, "paste", function (e) {
|
8889 |
-
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
8890 |
-
|
8891 |
-
cm.state.pasteIncoming = true
|
8892 |
-
input.fastPoll()
|
8893 |
-
})
|
8894 |
-
|
8895 |
-
function prepareCopyCut(e) {
|
8896 |
-
if (signalDOMEvent(cm, e)) { return }
|
8897 |
-
if (cm.somethingSelected()) {
|
8898 |
-
setLastCopied({lineWise: false, text: cm.getSelections()})
|
8899 |
-
if (input.inaccurateSelection) {
|
8900 |
-
input.prevInput = ""
|
8901 |
-
input.inaccurateSelection = false
|
8902 |
-
te.value = lastCopied.text.join("\n")
|
8903 |
-
selectInput(te)
|
8904 |
-
}
|
8905 |
-
} else if (!cm.options.lineWiseCopyCut) {
|
8906 |
-
return
|
8907 |
-
} else {
|
8908 |
-
var ranges = copyableRanges(cm)
|
8909 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
8910 |
-
if (e.type == "cut") {
|
8911 |
-
cm.setSelections(ranges.ranges, null, sel_dontScroll)
|
8912 |
-
} else {
|
8913 |
-
input.prevInput = ""
|
8914 |
-
te.value = ranges.text.join("\n")
|
8915 |
-
selectInput(te)
|
8916 |
-
}
|
8917 |
-
}
|
8918 |
-
if (e.type == "cut") { cm.state.cutIncoming = true }
|
8919 |
-
}
|
8920 |
-
on(te, "cut", prepareCopyCut)
|
8921 |
-
on(te, "copy", prepareCopyCut)
|
8922 |
-
|
8923 |
-
on(display.scroller, "paste", function (e) {
|
8924 |
-
if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
|
8925 |
-
cm.state.pasteIncoming = true
|
8926 |
-
input.focus()
|
8927 |
-
})
|
8928 |
-
|
8929 |
-
// Prevent normal selection in the editor (we handle our own)
|
8930 |
-
on(display.lineSpace, "selectstart", function (e) {
|
8931 |
-
if (!eventInWidget(display, e)) { e_preventDefault(e) }
|
8932 |
-
})
|
8933 |
-
|
8934 |
-
on(te, "compositionstart", function () {
|
8935 |
-
var start = cm.getCursor("from")
|
8936 |
-
if (input.composing) { input.composing.range.clear() }
|
8937 |
-
input.composing = {
|
8938 |
-
start: start,
|
8939 |
-
range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
|
8940 |
-
}
|
8941 |
-
})
|
8942 |
-
on(te, "compositionend", function () {
|
8943 |
-
if (input.composing) {
|
8944 |
-
input.poll()
|
8945 |
-
input.composing.range.clear()
|
8946 |
-
input.composing = null
|
8947 |
-
}
|
8948 |
-
})
|
8949 |
-
};
|
8950 |
-
|
8951 |
-
TextareaInput.prototype.prepareSelection = function () {
|
8952 |
-
// Redraw the selection and/or cursor
|
8953 |
-
var cm = this.cm, display = cm.display, doc = cm.doc
|
8954 |
-
var result = prepareSelection(cm)
|
8955 |
-
|
8956 |
-
// Move the hidden textarea near the cursor to prevent scrolling artifacts
|
8957 |
-
if (cm.options.moveInputWithCursor) {
|
8958 |
-
var headPos = cursorCoords(cm, doc.sel.primary().head, "div")
|
8959 |
-
var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()
|
8960 |
-
result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
|
8961 |
-
headPos.top + lineOff.top - wrapOff.top))
|
8962 |
-
result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
|
8963 |
-
headPos.left + lineOff.left - wrapOff.left))
|
8964 |
-
}
|
8965 |
-
|
8966 |
-
return result
|
8967 |
-
};
|
8968 |
-
|
8969 |
-
TextareaInput.prototype.showSelection = function (drawn) {
|
8970 |
-
var cm = this.cm, display = cm.display
|
8971 |
-
removeChildrenAndAdd(display.cursorDiv, drawn.cursors)
|
8972 |
-
removeChildrenAndAdd(display.selectionDiv, drawn.selection)
|
8973 |
-
if (drawn.teTop != null) {
|
8974 |
-
this.wrapper.style.top = drawn.teTop + "px"
|
8975 |
-
this.wrapper.style.left = drawn.teLeft + "px"
|
8976 |
-
}
|
8977 |
-
};
|
8978 |
-
|
8979 |
-
// Reset the input to correspond to the selection (or to be empty,
|
8980 |
-
// when not typing and nothing is selected)
|
8981 |
-
TextareaInput.prototype.reset = function (typing) {
|
8982 |
-
if (this.contextMenuPending || this.composing) { return }
|
8983 |
-
var minimal, selected, cm = this.cm, doc = cm.doc
|
8984 |
-
if (cm.somethingSelected()) {
|
8985 |
-
this.prevInput = ""
|
8986 |
-
var range = doc.sel.primary()
|
8987 |
-
minimal = hasCopyEvent &&
|
8988 |
-
(range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
|
8989 |
-
var content = minimal ? "-" : selected || cm.getSelection()
|
8990 |
-
this.textarea.value = content
|
8991 |
-
if (cm.state.focused) { selectInput(this.textarea) }
|
8992 |
-
if (ie && ie_version >= 9) { this.hasSelection = content }
|
8993 |
-
} else if (!typing) {
|
8994 |
-
this.prevInput = this.textarea.value = ""
|
8995 |
-
if (ie && ie_version >= 9) { this.hasSelection = null }
|
8996 |
-
}
|
8997 |
-
this.inaccurateSelection = minimal
|
8998 |
-
};
|
8999 |
-
|
9000 |
-
TextareaInput.prototype.getField = function () { return this.textarea };
|
9001 |
-
|
9002 |
-
TextareaInput.prototype.supportsTouch = function () { return false };
|
9003 |
-
|
9004 |
-
TextareaInput.prototype.focus = function () {
|
9005 |
-
if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
|
9006 |
-
try { this.textarea.focus() }
|
9007 |
-
catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
|
9008 |
-
}
|
9009 |
-
};
|
9010 |
-
|
9011 |
-
TextareaInput.prototype.blur = function () { this.textarea.blur() };
|
9012 |
-
|
9013 |
-
TextareaInput.prototype.resetPosition = function () {
|
9014 |
-
this.wrapper.style.top = this.wrapper.style.left = 0
|
9015 |
-
};
|
9016 |
-
|
9017 |
-
TextareaInput.prototype.receivedFocus = function () { this.slowPoll() };
|
9018 |
-
|
9019 |
-
// Poll for input changes, using the normal rate of polling. This
|
9020 |
-
// runs as long as the editor is focused.
|
9021 |
-
TextareaInput.prototype.slowPoll = function () {
|
9022 |
-
var this$1 = this;
|
9023 |
-
|
9024 |
-
if (this.pollingFast) { return }
|
9025 |
-
this.polling.set(this.cm.options.pollInterval, function () {
|
9026 |
-
this$1.poll()
|
9027 |
-
if (this$1.cm.state.focused) { this$1.slowPoll() }
|
9028 |
-
})
|
9029 |
-
};
|
9030 |
-
|
9031 |
-
// When an event has just come in that is likely to add or change
|
9032 |
-
// something in the input textarea, we poll faster, to ensure that
|
9033 |
-
// the change appears on the screen quickly.
|
9034 |
-
TextareaInput.prototype.fastPoll = function () {
|
9035 |
-
var missed = false, input = this
|
9036 |
-
input.pollingFast = true
|
9037 |
-
function p() {
|
9038 |
-
var changed = input.poll()
|
9039 |
-
if (!changed && !missed) {missed = true; input.polling.set(60, p)}
|
9040 |
-
else {input.pollingFast = false; input.slowPoll()}
|
9041 |
-
}
|
9042 |
-
input.polling.set(20, p)
|
9043 |
-
};
|
9044 |
-
|
9045 |
-
// Read input from the textarea, and update the document to match.
|
9046 |
-
// When something is selected, it is present in the textarea, and
|
9047 |
-
// selected (unless it is huge, in which case a placeholder is
|
9048 |
-
// used). When nothing is selected, the cursor sits after previously
|
9049 |
-
// seen text (can be empty), which is stored in prevInput (we must
|
9050 |
-
// not reset the textarea when typing, because that breaks IME).
|
9051 |
-
TextareaInput.prototype.poll = function () {
|
9052 |
-
var this$1 = this;
|
9053 |
-
|
9054 |
-
var cm = this.cm, input = this.textarea, prevInput = this.prevInput
|
9055 |
-
// Since this is called a *lot*, try to bail out as cheaply as
|
9056 |
-
// possible when it is clear that nothing happened. hasSelection
|
9057 |
-
// will be the case when there is a lot of text in the textarea,
|
9058 |
-
// in which case reading its value would be expensive.
|
9059 |
-
if (this.contextMenuPending || !cm.state.focused ||
|
9060 |
-
(hasSelection(input) && !prevInput && !this.composing) ||
|
9061 |
-
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
|
9062 |
-
{ return false }
|
9063 |
-
|
9064 |
-
var text = input.value
|
9065 |
-
// If nothing changed, bail.
|
9066 |
-
if (text == prevInput && !cm.somethingSelected()) { return false }
|
9067 |
-
// Work around nonsensical selection resetting in IE9/10, and
|
9068 |
-
// inexplicable appearance of private area unicode characters on
|
9069 |
-
// some key combos in Mac (#2689).
|
9070 |
-
if (ie && ie_version >= 9 && this.hasSelection === text ||
|
9071 |
-
mac && /[\uf700-\uf7ff]/.test(text)) {
|
9072 |
-
cm.display.input.reset()
|
9073 |
-
return false
|
9074 |
-
}
|
9075 |
-
|
9076 |
-
if (cm.doc.sel == cm.display.selForContextMenu) {
|
9077 |
-
var first = text.charCodeAt(0)
|
9078 |
-
if (first == 0x200b && !prevInput) { prevInput = "\u200b" }
|
9079 |
-
if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
|
9080 |
-
}
|
9081 |
-
// Find the part of the input that is actually new
|
9082 |
-
var same = 0, l = Math.min(prevInput.length, text.length)
|
9083 |
-
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
|
9084 |
-
|
9085 |
-
runInOp(cm, function () {
|
9086 |
-
applyTextInput(cm, text.slice(same), prevInput.length - same,
|
9087 |
-
null, this$1.composing ? "*compose" : null)
|
9088 |
-
|
9089 |
-
// Don't leave long text in the textarea, since it makes further polling slow
|
9090 |
-
if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" }
|
9091 |
-
else { this$1.prevInput = text }
|
9092 |
-
|
9093 |
-
if (this$1.composing) {
|
9094 |
-
this$1.composing.range.clear()
|
9095 |
-
this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
|
9096 |
-
{className: "CodeMirror-composing"})
|
9097 |
-
}
|
9098 |
-
})
|
9099 |
-
return true
|
9100 |
-
};
|
9101 |
-
|
9102 |
-
TextareaInput.prototype.ensurePolled = function () {
|
9103 |
-
if (this.pollingFast && this.poll()) { this.pollingFast = false }
|
9104 |
-
};
|
9105 |
-
|
9106 |
-
TextareaInput.prototype.onKeyPress = function () {
|
9107 |
-
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9108 |
-
this.fastPoll()
|
9109 |
-
};
|
9110 |
-
|
9111 |
-
TextareaInput.prototype.onContextMenu = function (e) {
|
9112 |
-
var input = this, cm = input.cm, display = cm.display, te = input.textarea
|
9113 |
-
var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop
|
9114 |
-
if (!pos || presto) { return } // Opera is difficult.
|
9115 |
-
|
9116 |
-
// Reset the current text selection only if the click is done outside of the selection
|
9117 |
-
// and 'resetSelectionOnContextMenu' option is true.
|
9118 |
-
var reset = cm.options.resetSelectionOnContextMenu
|
9119 |
-
if (reset && cm.doc.sel.contains(pos) == -1)
|
9120 |
-
{ operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
|
9121 |
-
|
9122 |
-
var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
|
9123 |
-
input.wrapper.style.cssText = "position: absolute"
|
9124 |
-
var wrapperBox = input.wrapper.getBoundingClientRect()
|
9125 |
-
te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
|
9126 |
-
var oldScrollY
|
9127 |
-
if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
|
9128 |
-
display.input.focus()
|
9129 |
-
if (webkit) { window.scrollTo(null, oldScrollY) }
|
9130 |
-
display.input.reset()
|
9131 |
-
// Adds "Select all" to context menu in FF
|
9132 |
-
if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
|
9133 |
-
input.contextMenuPending = true
|
9134 |
-
display.selForContextMenu = cm.doc.sel
|
9135 |
-
clearTimeout(display.detectingSelectAll)
|
9136 |
-
|
9137 |
-
// Select-all will be greyed out if there's nothing to select, so
|
9138 |
-
// this adds a zero-width space so that we can later check whether
|
9139 |
-
// it got selected.
|
9140 |
-
function prepareSelectAllHack() {
|
9141 |
-
if (te.selectionStart != null) {
|
9142 |
-
var selected = cm.somethingSelected()
|
9143 |
-
var extval = "\u200b" + (selected ? te.value : "")
|
9144 |
-
te.value = "\u21da" // Used to catch context-menu undo
|
9145 |
-
te.value = extval
|
9146 |
-
input.prevInput = selected ? "" : "\u200b"
|
9147 |
-
te.selectionStart = 1; te.selectionEnd = extval.length
|
9148 |
-
// Re-set this, in case some other handler touched the
|
9149 |
-
// selection in the meantime.
|
9150 |
-
display.selForContextMenu = cm.doc.sel
|
9151 |
-
}
|
9152 |
-
}
|
9153 |
-
function rehide() {
|
9154 |
-
input.contextMenuPending = false
|
9155 |
-
input.wrapper.style.cssText = oldWrapperCSS
|
9156 |
-
te.style.cssText = oldCSS
|
9157 |
-
if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
|
9158 |
-
|
9159 |
-
// Try to detect the user choosing select-all
|
9160 |
-
if (te.selectionStart != null) {
|
9161 |
-
if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
|
9162 |
-
var i = 0, poll = function () {
|
9163 |
-
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
|
9164 |
-
te.selectionEnd > 0 && input.prevInput == "\u200b") {
|
9165 |
-
operation(cm, selectAll)(cm)
|
9166 |
-
} else if (i++ < 10) {
|
9167 |
-
display.detectingSelectAll = setTimeout(poll, 500)
|
9168 |
-
} else {
|
9169 |
-
display.selForContextMenu = null
|
9170 |
-
display.input.reset()
|
9171 |
-
}
|
9172 |
-
}
|
9173 |
-
display.detectingSelectAll = setTimeout(poll, 200)
|
9174 |
-
}
|
9175 |
-
}
|
9176 |
-
|
9177 |
-
if (ie && ie_version >= 9) { prepareSelectAllHack() }
|
9178 |
-
if (captureRightClick) {
|
9179 |
-
e_stop(e)
|
9180 |
-
var mouseup = function () {
|
9181 |
-
off(window, "mouseup", mouseup)
|
9182 |
-
setTimeout(rehide, 20)
|
9183 |
-
}
|
9184 |
-
on(window, "mouseup", mouseup)
|
9185 |
-
} else {
|
9186 |
-
setTimeout(rehide, 50)
|
9187 |
-
}
|
9188 |
-
};
|
9189 |
-
|
9190 |
-
TextareaInput.prototype.readOnlyChanged = function (val) {
|
9191 |
-
if (!val) { this.reset() }
|
9192 |
-
};
|
9193 |
-
|
9194 |
-
TextareaInput.prototype.setUneditable = function () {};
|
9195 |
-
|
9196 |
-
TextareaInput.prototype.needsContentAttribute = false
|
9197 |
-
|
9198 |
-
function fromTextArea(textarea, options) {
|
9199 |
-
options = options ? copyObj(options) : {}
|
9200 |
-
options.value = textarea.value
|
9201 |
-
if (!options.tabindex && textarea.tabIndex)
|
9202 |
-
{ options.tabindex = textarea.tabIndex }
|
9203 |
-
if (!options.placeholder && textarea.placeholder)
|
9204 |
-
{ options.placeholder = textarea.placeholder }
|
9205 |
-
// Set autofocus to true if this textarea is focused, or if it has
|
9206 |
-
// autofocus and no other element is focused.
|
9207 |
-
if (options.autofocus == null) {
|
9208 |
-
var hasFocus = activeElt()
|
9209 |
-
options.autofocus = hasFocus == textarea ||
|
9210 |
-
textarea.getAttribute("autofocus") != null && hasFocus == document.body
|
9211 |
-
}
|
9212 |
-
|
9213 |
-
function save() {textarea.value = cm.getValue()}
|
9214 |
-
|
9215 |
-
var realSubmit
|
9216 |
-
if (textarea.form) {
|
9217 |
-
on(textarea.form, "submit", save)
|
9218 |
-
// Deplorable hack to make the submit method do the right thing.
|
9219 |
-
if (!options.leaveSubmitMethodAlone) {
|
9220 |
-
var form = textarea.form
|
9221 |
-
realSubmit = form.submit
|
9222 |
-
try {
|
9223 |
-
var wrappedSubmit = form.submit = function () {
|
9224 |
-
save()
|
9225 |
-
form.submit = realSubmit
|
9226 |
-
form.submit()
|
9227 |
-
form.submit = wrappedSubmit
|
9228 |
-
}
|
9229 |
-
} catch(e) {}
|
9230 |
-
}
|
9231 |
-
}
|
9232 |
-
|
9233 |
-
options.finishInit = function (cm) {
|
9234 |
-
cm.save = save
|
9235 |
-
cm.getTextArea = function () { return textarea; }
|
9236 |
-
cm.toTextArea = function () {
|
9237 |
-
cm.toTextArea = isNaN // Prevent this from being ran twice
|
9238 |
-
save()
|
9239 |
-
textarea.parentNode.removeChild(cm.getWrapperElement())
|
9240 |
-
textarea.style.display = ""
|
9241 |
-
if (textarea.form) {
|
9242 |
-
off(textarea.form, "submit", save)
|
9243 |
-
if (typeof textarea.form.submit == "function")
|
9244 |
-
{ textarea.form.submit = realSubmit }
|
9245 |
-
}
|
9246 |
-
}
|
9247 |
-
}
|
9248 |
-
|
9249 |
-
textarea.style.display = "none"
|
9250 |
-
var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
|
9251 |
-
options)
|
9252 |
-
return cm
|
9253 |
-
}
|
9254 |
-
|
9255 |
-
function addLegacyProps(CodeMirror) {
|
9256 |
-
CodeMirror.off = off
|
9257 |
-
CodeMirror.on = on
|
9258 |
-
CodeMirror.wheelEventPixels = wheelEventPixels
|
9259 |
-
CodeMirror.Doc = Doc
|
9260 |
-
CodeMirror.splitLines = splitLinesAuto
|
9261 |
-
CodeMirror.countColumn = countColumn
|
9262 |
-
CodeMirror.findColumn = findColumn
|
9263 |
-
CodeMirror.isWordChar = isWordCharBasic
|
9264 |
-
CodeMirror.Pass = Pass
|
9265 |
-
CodeMirror.signal = signal
|
9266 |
-
CodeMirror.Line = Line
|
9267 |
-
CodeMirror.changeEnd = changeEnd
|
9268 |
-
CodeMirror.scrollbarModel = scrollbarModel
|
9269 |
-
CodeMirror.Pos = Pos
|
9270 |
-
CodeMirror.cmpPos = cmp
|
9271 |
-
CodeMirror.modes = modes
|
9272 |
-
CodeMirror.mimeModes = mimeModes
|
9273 |
-
CodeMirror.resolveMode = resolveMode
|
9274 |
-
CodeMirror.getMode = getMode
|
9275 |
-
CodeMirror.modeExtensions = modeExtensions
|
9276 |
-
CodeMirror.extendMode = extendMode
|
9277 |
-
CodeMirror.copyState = copyState
|
9278 |
-
CodeMirror.startState = startState
|
9279 |
-
CodeMirror.innerMode = innerMode
|
9280 |
-
CodeMirror.commands = commands
|
9281 |
-
CodeMirror.keyMap = keyMap
|
9282 |
-
CodeMirror.keyName = keyName
|
9283 |
-
CodeMirror.isModifierKey = isModifierKey
|
9284 |
-
CodeMirror.lookupKey = lookupKey
|
9285 |
-
CodeMirror.normalizeKeyMap = normalizeKeyMap
|
9286 |
-
CodeMirror.StringStream = StringStream
|
9287 |
-
CodeMirror.SharedTextMarker = SharedTextMarker
|
9288 |
-
CodeMirror.TextMarker = TextMarker
|
9289 |
-
CodeMirror.LineWidget = LineWidget
|
9290 |
-
CodeMirror.e_preventDefault = e_preventDefault
|
9291 |
-
CodeMirror.e_stopPropagation = e_stopPropagation
|
9292 |
-
CodeMirror.e_stop = e_stop
|
9293 |
-
CodeMirror.addClass = addClass
|
9294 |
-
CodeMirror.contains = contains
|
9295 |
-
CodeMirror.rmClass = rmClass
|
9296 |
-
CodeMirror.keyNames = keyNames
|
9297 |
-
}
|
9298 |
-
|
9299 |
-
// EDITOR CONSTRUCTOR
|
9300 |
-
|
9301 |
-
defineOptions(CodeMirror)
|
9302 |
-
|
9303 |
-
addEditorMethods(CodeMirror)
|
9304 |
-
|
9305 |
-
// Set up methods on CodeMirror's prototype to redirect to the editor's document.
|
9306 |
-
var dontDelegate = "iter insert remove copy getEditor constructor".split(" ")
|
9307 |
-
for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
|
9308 |
-
{ CodeMirror.prototype[prop] = (function(method) {
|
9309 |
-
return function() {return method.apply(this.doc, arguments)}
|
9310 |
-
})(Doc.prototype[prop]) } }
|
9311 |
-
|
9312 |
-
eventMixin(Doc)
|
9313 |
-
|
9314 |
-
// INPUT HANDLING
|
9315 |
-
|
9316 |
-
CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}
|
9317 |
-
|
9318 |
-
// MODE DEFINITION AND QUERYING
|
9319 |
-
|
9320 |
-
// Extra arguments are stored as the mode's dependencies, which is
|
9321 |
-
// used by (legacy) mechanisms like loadmode.js to automatically
|
9322 |
-
// load a mode. (Preferred mechanism is the require/define calls.)
|
9323 |
-
CodeMirror.defineMode = function(name/*, mode, …*/) {
|
9324 |
-
if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name }
|
9325 |
-
defineMode.apply(this, arguments)
|
9326 |
-
}
|
9327 |
-
|
9328 |
-
CodeMirror.defineMIME = defineMIME
|
9329 |
-
|
9330 |
-
// Minimal default mode.
|
9331 |
-
CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })
|
9332 |
-
CodeMirror.defineMIME("text/plain", "null")
|
9333 |
-
|
9334 |
-
// EXTENSIONS
|
9335 |
-
|
9336 |
-
CodeMirror.defineExtension = function (name, func) {
|
9337 |
-
CodeMirror.prototype[name] = func
|
9338 |
-
}
|
9339 |
-
CodeMirror.defineDocExtension = function (name, func) {
|
9340 |
-
Doc.prototype[name] = func
|
9341 |
-
}
|
9342 |
-
|
9343 |
-
CodeMirror.fromTextArea = fromTextArea
|
9344 |
-
|
9345 |
-
addLegacyProps(CodeMirror)
|
9346 |
-
|
9347 |
-
CodeMirror.version = "5.26.0"
|
9348 |
-
|
9349 |
-
return CodeMirror;
|
9350 |
-
|
9351 |
-
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/codemirror/css.js
DELETED
@@ -1,830 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode("css", function(config, parserConfig) {
|
15 |
-
var inline = parserConfig.inline
|
16 |
-
if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
|
17 |
-
|
18 |
-
var indentUnit = config.indentUnit,
|
19 |
-
tokenHooks = parserConfig.tokenHooks,
|
20 |
-
documentTypes = parserConfig.documentTypes || {},
|
21 |
-
mediaTypes = parserConfig.mediaTypes || {},
|
22 |
-
mediaFeatures = parserConfig.mediaFeatures || {},
|
23 |
-
mediaValueKeywords = parserConfig.mediaValueKeywords || {},
|
24 |
-
propertyKeywords = parserConfig.propertyKeywords || {},
|
25 |
-
nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
|
26 |
-
fontProperties = parserConfig.fontProperties || {},
|
27 |
-
counterDescriptors = parserConfig.counterDescriptors || {},
|
28 |
-
colorKeywords = parserConfig.colorKeywords || {},
|
29 |
-
valueKeywords = parserConfig.valueKeywords || {},
|
30 |
-
allowNested = parserConfig.allowNested,
|
31 |
-
lineComment = parserConfig.lineComment,
|
32 |
-
supportsAtComponent = parserConfig.supportsAtComponent === true;
|
33 |
-
|
34 |
-
var type, override;
|
35 |
-
function ret(style, tp) { type = tp; return style; }
|
36 |
-
|
37 |
-
// Tokenizers
|
38 |
-
|
39 |
-
function tokenBase(stream, state) {
|
40 |
-
var ch = stream.next();
|
41 |
-
if (tokenHooks[ch]) {
|
42 |
-
var result = tokenHooks[ch](stream, state);
|
43 |
-
if (result !== false) return result;
|
44 |
-
}
|
45 |
-
if (ch == "@") {
|
46 |
-
stream.eatWhile(/[\w\\\-]/);
|
47 |
-
return ret("def", stream.current());
|
48 |
-
} else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
|
49 |
-
return ret(null, "compare");
|
50 |
-
} else if (ch == "\"" || ch == "'") {
|
51 |
-
state.tokenize = tokenString(ch);
|
52 |
-
return state.tokenize(stream, state);
|
53 |
-
} else if (ch == "#") {
|
54 |
-
stream.eatWhile(/[\w\\\-]/);
|
55 |
-
return ret("atom", "hash");
|
56 |
-
} else if (ch == "!") {
|
57 |
-
stream.match(/^\s*\w*/);
|
58 |
-
return ret("keyword", "important");
|
59 |
-
} else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
|
60 |
-
stream.eatWhile(/[\w.%]/);
|
61 |
-
return ret("number", "unit");
|
62 |
-
} else if (ch === "-") {
|
63 |
-
if (/[\d.]/.test(stream.peek())) {
|
64 |
-
stream.eatWhile(/[\w.%]/);
|
65 |
-
return ret("number", "unit");
|
66 |
-
} else if (stream.match(/^-[\w\\\-]+/)) {
|
67 |
-
stream.eatWhile(/[\w\\\-]/);
|
68 |
-
if (stream.match(/^\s*:/, false))
|
69 |
-
return ret("variable-2", "variable-definition");
|
70 |
-
return ret("variable-2", "variable");
|
71 |
-
} else if (stream.match(/^\w+-/)) {
|
72 |
-
return ret("meta", "meta");
|
73 |
-
}
|
74 |
-
} else if (/[,+>*\/]/.test(ch)) {
|
75 |
-
return ret(null, "select-op");
|
76 |
-
} else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
|
77 |
-
return ret("qualifier", "qualifier");
|
78 |
-
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
|
79 |
-
return ret(null, ch);
|
80 |
-
} else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
|
81 |
-
(ch == "d" && stream.match("omain(")) ||
|
82 |
-
(ch == "r" && stream.match("egexp("))) {
|
83 |
-
stream.backUp(1);
|
84 |
-
state.tokenize = tokenParenthesized;
|
85 |
-
return ret("property", "word");
|
86 |
-
} else if (/[\w\\\-]/.test(ch)) {
|
87 |
-
stream.eatWhile(/[\w\\\-]/);
|
88 |
-
return ret("property", "word");
|
89 |
-
} else {
|
90 |
-
return ret(null, null);
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
function tokenString(quote) {
|
95 |
-
return function(stream, state) {
|
96 |
-
var escaped = false, ch;
|
97 |
-
while ((ch = stream.next()) != null) {
|
98 |
-
if (ch == quote && !escaped) {
|
99 |
-
if (quote == ")") stream.backUp(1);
|
100 |
-
break;
|
101 |
-
}
|
102 |
-
escaped = !escaped && ch == "\\";
|
103 |
-
}
|
104 |
-
if (ch == quote || !escaped && quote != ")") state.tokenize = null;
|
105 |
-
return ret("string", "string");
|
106 |
-
};
|
107 |
-
}
|
108 |
-
|
109 |
-
function tokenParenthesized(stream, state) {
|
110 |
-
stream.next(); // Must be '('
|
111 |
-
if (!stream.match(/\s*[\"\')]/, false))
|
112 |
-
state.tokenize = tokenString(")");
|
113 |
-
else
|
114 |
-
state.tokenize = null;
|
115 |
-
return ret(null, "(");
|
116 |
-
}
|
117 |
-
|
118 |
-
// Context management
|
119 |
-
|
120 |
-
function Context(type, indent, prev) {
|
121 |
-
this.type = type;
|
122 |
-
this.indent = indent;
|
123 |
-
this.prev = prev;
|
124 |
-
}
|
125 |
-
|
126 |
-
function pushContext(state, stream, type, indent) {
|
127 |
-
state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
|
128 |
-
return type;
|
129 |
-
}
|
130 |
-
|
131 |
-
function popContext(state) {
|
132 |
-
if (state.context.prev)
|
133 |
-
state.context = state.context.prev;
|
134 |
-
return state.context.type;
|
135 |
-
}
|
136 |
-
|
137 |
-
function pass(type, stream, state) {
|
138 |
-
return states[state.context.type](type, stream, state);
|
139 |
-
}
|
140 |
-
function popAndPass(type, stream, state, n) {
|
141 |
-
for (var i = n || 1; i > 0; i--)
|
142 |
-
state.context = state.context.prev;
|
143 |
-
return pass(type, stream, state);
|
144 |
-
}
|
145 |
-
|
146 |
-
// Parser
|
147 |
-
|
148 |
-
function wordAsValue(stream) {
|
149 |
-
var word = stream.current().toLowerCase();
|
150 |
-
if (valueKeywords.hasOwnProperty(word))
|
151 |
-
override = "atom";
|
152 |
-
else if (colorKeywords.hasOwnProperty(word))
|
153 |
-
override = "keyword";
|
154 |
-
else
|
155 |
-
override = "variable";
|
156 |
-
}
|
157 |
-
|
158 |
-
var states = {};
|
159 |
-
|
160 |
-
states.top = function(type, stream, state) {
|
161 |
-
if (type == "{") {
|
162 |
-
return pushContext(state, stream, "block");
|
163 |
-
} else if (type == "}" && state.context.prev) {
|
164 |
-
return popContext(state);
|
165 |
-
} else if (supportsAtComponent && /@component/.test(type)) {
|
166 |
-
return pushContext(state, stream, "atComponentBlock");
|
167 |
-
} else if (/^@(-moz-)?document$/.test(type)) {
|
168 |
-
return pushContext(state, stream, "documentTypes");
|
169 |
-
} else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
|
170 |
-
return pushContext(state, stream, "atBlock");
|
171 |
-
} else if (/^@(font-face|counter-style)/.test(type)) {
|
172 |
-
state.stateArg = type;
|
173 |
-
return "restricted_atBlock_before";
|
174 |
-
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
|
175 |
-
return "keyframes";
|
176 |
-
} else if (type && type.charAt(0) == "@") {
|
177 |
-
return pushContext(state, stream, "at");
|
178 |
-
} else if (type == "hash") {
|
179 |
-
override = "builtin";
|
180 |
-
} else if (type == "word") {
|
181 |
-
override = "tag";
|
182 |
-
} else if (type == "variable-definition") {
|
183 |
-
return "maybeprop";
|
184 |
-
} else if (type == "interpolation") {
|
185 |
-
return pushContext(state, stream, "interpolation");
|
186 |
-
} else if (type == ":") {
|
187 |
-
return "pseudo";
|
188 |
-
} else if (allowNested && type == "(") {
|
189 |
-
return pushContext(state, stream, "parens");
|
190 |
-
}
|
191 |
-
return state.context.type;
|
192 |
-
};
|
193 |
-
|
194 |
-
states.block = function(type, stream, state) {
|
195 |
-
if (type == "word") {
|
196 |
-
var word = stream.current().toLowerCase();
|
197 |
-
if (propertyKeywords.hasOwnProperty(word)) {
|
198 |
-
override = "property";
|
199 |
-
return "maybeprop";
|
200 |
-
} else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
|
201 |
-
override = "string-2";
|
202 |
-
return "maybeprop";
|
203 |
-
} else if (allowNested) {
|
204 |
-
override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
|
205 |
-
return "block";
|
206 |
-
} else {
|
207 |
-
override += " error";
|
208 |
-
return "maybeprop";
|
209 |
-
}
|
210 |
-
} else if (type == "meta") {
|
211 |
-
return "block";
|
212 |
-
} else if (!allowNested && (type == "hash" || type == "qualifier")) {
|
213 |
-
override = "error";
|
214 |
-
return "block";
|
215 |
-
} else {
|
216 |
-
return states.top(type, stream, state);
|
217 |
-
}
|
218 |
-
};
|
219 |
-
|
220 |
-
states.maybeprop = function(type, stream, state) {
|
221 |
-
if (type == ":") return pushContext(state, stream, "prop");
|
222 |
-
return pass(type, stream, state);
|
223 |
-
};
|
224 |
-
|
225 |
-
states.prop = function(type, stream, state) {
|
226 |
-
if (type == ";") return popContext(state);
|
227 |
-
if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
|
228 |
-
if (type == "}" || type == "{") return popAndPass(type, stream, state);
|
229 |
-
if (type == "(") return pushContext(state, stream, "parens");
|
230 |
-
|
231 |
-
if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
|
232 |
-
override += " error";
|
233 |
-
} else if (type == "word") {
|
234 |
-
wordAsValue(stream);
|
235 |
-
} else if (type == "interpolation") {
|
236 |
-
return pushContext(state, stream, "interpolation");
|
237 |
-
}
|
238 |
-
return "prop";
|
239 |
-
};
|
240 |
-
|
241 |
-
states.propBlock = function(type, _stream, state) {
|
242 |
-
if (type == "}") return popContext(state);
|
243 |
-
if (type == "word") { override = "property"; return "maybeprop"; }
|
244 |
-
return state.context.type;
|
245 |
-
};
|
246 |
-
|
247 |
-
states.parens = function(type, stream, state) {
|
248 |
-
if (type == "{" || type == "}") return popAndPass(type, stream, state);
|
249 |
-
if (type == ")") return popContext(state);
|
250 |
-
if (type == "(") return pushContext(state, stream, "parens");
|
251 |
-
if (type == "interpolation") return pushContext(state, stream, "interpolation");
|
252 |
-
if (type == "word") wordAsValue(stream);
|
253 |
-
return "parens";
|
254 |
-
};
|
255 |
-
|
256 |
-
states.pseudo = function(type, stream, state) {
|
257 |
-
if (type == "meta") return "pseudo";
|
258 |
-
|
259 |
-
if (type == "word") {
|
260 |
-
override = "variable-3";
|
261 |
-
return state.context.type;
|
262 |
-
}
|
263 |
-
return pass(type, stream, state);
|
264 |
-
};
|
265 |
-
|
266 |
-
states.documentTypes = function(type, stream, state) {
|
267 |
-
if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
|
268 |
-
override = "tag";
|
269 |
-
return state.context.type;
|
270 |
-
} else {
|
271 |
-
return states.atBlock(type, stream, state);
|
272 |
-
}
|
273 |
-
};
|
274 |
-
|
275 |
-
states.atBlock = function(type, stream, state) {
|
276 |
-
if (type == "(") return pushContext(state, stream, "atBlock_parens");
|
277 |
-
if (type == "}" || type == ";") return popAndPass(type, stream, state);
|
278 |
-
if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
|
279 |
-
|
280 |
-
if (type == "interpolation") return pushContext(state, stream, "interpolation");
|
281 |
-
|
282 |
-
if (type == "word") {
|
283 |
-
var word = stream.current().toLowerCase();
|
284 |
-
if (word == "only" || word == "not" || word == "and" || word == "or")
|
285 |
-
override = "keyword";
|
286 |
-
else if (mediaTypes.hasOwnProperty(word))
|
287 |
-
override = "attribute";
|
288 |
-
else if (mediaFeatures.hasOwnProperty(word))
|
289 |
-
override = "property";
|
290 |
-
else if (mediaValueKeywords.hasOwnProperty(word))
|
291 |
-
override = "keyword";
|
292 |
-
else if (propertyKeywords.hasOwnProperty(word))
|
293 |
-
override = "property";
|
294 |
-
else if (nonStandardPropertyKeywords.hasOwnProperty(word))
|
295 |
-
override = "string-2";
|
296 |
-
else if (valueKeywords.hasOwnProperty(word))
|
297 |
-
override = "atom";
|
298 |
-
else if (colorKeywords.hasOwnProperty(word))
|
299 |
-
override = "keyword";
|
300 |
-
else
|
301 |
-
override = "error";
|
302 |
-
}
|
303 |
-
return state.context.type;
|
304 |
-
};
|
305 |
-
|
306 |
-
states.atComponentBlock = function(type, stream, state) {
|
307 |
-
if (type == "}")
|
308 |
-
return popAndPass(type, stream, state);
|
309 |
-
if (type == "{")
|
310 |
-
return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
|
311 |
-
if (type == "word")
|
312 |
-
override = "error";
|
313 |
-
return state.context.type;
|
314 |
-
};
|
315 |
-
|
316 |
-
states.atBlock_parens = function(type, stream, state) {
|
317 |
-
if (type == ")") return popContext(state);
|
318 |
-
if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
|
319 |
-
return states.atBlock(type, stream, state);
|
320 |
-
};
|
321 |
-
|
322 |
-
states.restricted_atBlock_before = function(type, stream, state) {
|
323 |
-
if (type == "{")
|
324 |
-
return pushContext(state, stream, "restricted_atBlock");
|
325 |
-
if (type == "word" && state.stateArg == "@counter-style") {
|
326 |
-
override = "variable";
|
327 |
-
return "restricted_atBlock_before";
|
328 |
-
}
|
329 |
-
return pass(type, stream, state);
|
330 |
-
};
|
331 |
-
|
332 |
-
states.restricted_atBlock = function(type, stream, state) {
|
333 |
-
if (type == "}") {
|
334 |
-
state.stateArg = null;
|
335 |
-
return popContext(state);
|
336 |
-
}
|
337 |
-
if (type == "word") {
|
338 |
-
if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
|
339 |
-
(state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
|
340 |
-
override = "error";
|
341 |
-
else
|
342 |
-
override = "property";
|
343 |
-
return "maybeprop";
|
344 |
-
}
|
345 |
-
return "restricted_atBlock";
|
346 |
-
};
|
347 |
-
|
348 |
-
states.keyframes = function(type, stream, state) {
|
349 |
-
if (type == "word") { override = "variable"; return "keyframes"; }
|
350 |
-
if (type == "{") return pushContext(state, stream, "top");
|
351 |
-
return pass(type, stream, state);
|
352 |
-
};
|
353 |
-
|
354 |
-
states.at = function(type, stream, state) {
|
355 |
-
if (type == ";") return popContext(state);
|
356 |
-
if (type == "{" || type == "}") return popAndPass(type, stream, state);
|
357 |
-
if (type == "word") override = "tag";
|
358 |
-
else if (type == "hash") override = "builtin";
|
359 |
-
return "at";
|
360 |
-
};
|
361 |
-
|
362 |
-
states.interpolation = function(type, stream, state) {
|
363 |
-
if (type == "}") return popContext(state);
|
364 |
-
if (type == "{" || type == ";") return popAndPass(type, stream, state);
|
365 |
-
if (type == "word") override = "variable";
|
366 |
-
else if (type != "variable" && type != "(" && type != ")") override = "error";
|
367 |
-
return "interpolation";
|
368 |
-
};
|
369 |
-
|
370 |
-
return {
|
371 |
-
startState: function(base) {
|
372 |
-
return {tokenize: null,
|
373 |
-
state: inline ? "block" : "top",
|
374 |
-
stateArg: null,
|
375 |
-
context: new Context(inline ? "block" : "top", base || 0, null)};
|
376 |
-
},
|
377 |
-
|
378 |
-
token: function(stream, state) {
|
379 |
-
if (!state.tokenize && stream.eatSpace()) return null;
|
380 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
381 |
-
if (style && typeof style == "object") {
|
382 |
-
type = style[1];
|
383 |
-
style = style[0];
|
384 |
-
}
|
385 |
-
override = style;
|
386 |
-
state.state = states[state.state](type, stream, state);
|
387 |
-
return override;
|
388 |
-
},
|
389 |
-
|
390 |
-
indent: function(state, textAfter) {
|
391 |
-
var cx = state.context, ch = textAfter && textAfter.charAt(0);
|
392 |
-
var indent = cx.indent;
|
393 |
-
if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
|
394 |
-
if (cx.prev) {
|
395 |
-
if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
|
396 |
-
cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
|
397 |
-
// Resume indentation from parent context.
|
398 |
-
cx = cx.prev;
|
399 |
-
indent = cx.indent;
|
400 |
-
} else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
|
401 |
-
ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
|
402 |
-
// Dedent relative to current context.
|
403 |
-
indent = Math.max(0, cx.indent - indentUnit);
|
404 |
-
}
|
405 |
-
}
|
406 |
-
return indent;
|
407 |
-
},
|
408 |
-
|
409 |
-
electricChars: "}",
|
410 |
-
blockCommentStart: "/*",
|
411 |
-
blockCommentEnd: "*/",
|
412 |
-
lineComment: lineComment,
|
413 |
-
fold: "brace"
|
414 |
-
};
|
415 |
-
});
|
416 |
-
|
417 |
-
function keySet(array) {
|
418 |
-
var keys = {};
|
419 |
-
for (var i = 0; i < array.length; ++i) {
|
420 |
-
keys[array[i].toLowerCase()] = true;
|
421 |
-
}
|
422 |
-
return keys;
|
423 |
-
}
|
424 |
-
|
425 |
-
var documentTypes_ = [
|
426 |
-
"domain", "regexp", "url", "url-prefix"
|
427 |
-
], documentTypes = keySet(documentTypes_);
|
428 |
-
|
429 |
-
var mediaTypes_ = [
|
430 |
-
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
431 |
-
"tty", "tv", "embossed"
|
432 |
-
], mediaTypes = keySet(mediaTypes_);
|
433 |
-
|
434 |
-
var mediaFeatures_ = [
|
435 |
-
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
436 |
-
"device-width", "min-device-width", "max-device-width", "device-height",
|
437 |
-
"min-device-height", "max-device-height", "aspect-ratio",
|
438 |
-
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
439 |
-
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
440 |
-
"max-color", "color-index", "min-color-index", "max-color-index",
|
441 |
-
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
442 |
-
"min-resolution", "max-resolution", "scan", "grid", "orientation",
|
443 |
-
"device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
|
444 |
-
"pointer", "any-pointer", "hover", "any-hover"
|
445 |
-
], mediaFeatures = keySet(mediaFeatures_);
|
446 |
-
|
447 |
-
var mediaValueKeywords_ = [
|
448 |
-
"landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
|
449 |
-
"interlace", "progressive"
|
450 |
-
], mediaValueKeywords = keySet(mediaValueKeywords_);
|
451 |
-
|
452 |
-
var propertyKeywords_ = [
|
453 |
-
"align-content", "align-items", "align-self", "alignment-adjust",
|
454 |
-
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
455 |
-
"animation-direction", "animation-duration", "animation-fill-mode",
|
456 |
-
"animation-iteration-count", "animation-name", "animation-play-state",
|
457 |
-
"animation-timing-function", "appearance", "azimuth", "backface-visibility",
|
458 |
-
"background", "background-attachment", "background-blend-mode", "background-clip",
|
459 |
-
"background-color", "background-image", "background-origin", "background-position",
|
460 |
-
"background-repeat", "background-size", "baseline-shift", "binding",
|
461 |
-
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
462 |
-
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
463 |
-
"border-bottom-left-radius", "border-bottom-right-radius",
|
464 |
-
"border-bottom-style", "border-bottom-width", "border-collapse",
|
465 |
-
"border-color", "border-image", "border-image-outset",
|
466 |
-
"border-image-repeat", "border-image-slice", "border-image-source",
|
467 |
-
"border-image-width", "border-left", "border-left-color",
|
468 |
-
"border-left-style", "border-left-width", "border-radius", "border-right",
|
469 |
-
"border-right-color", "border-right-style", "border-right-width",
|
470 |
-
"border-spacing", "border-style", "border-top", "border-top-color",
|
471 |
-
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
472 |
-
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
473 |
-
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
474 |
-
"caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
|
475 |
-
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
476 |
-
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
477 |
-
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
478 |
-
"cue-after", "cue-before", "cursor", "direction", "display",
|
479 |
-
"dominant-baseline", "drop-initial-after-adjust",
|
480 |
-
"drop-initial-after-align", "drop-initial-before-adjust",
|
481 |
-
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
482 |
-
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
483 |
-
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
484 |
-
"float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
|
485 |
-
"font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
486 |
-
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
487 |
-
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
488 |
-
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
489 |
-
"font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
|
490 |
-
"grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
|
491 |
-
"grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
|
492 |
-
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
|
493 |
-
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
|
494 |
-
"icon", "image-orientation", "image-rendering", "image-resolution",
|
495 |
-
"inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
|
496 |
-
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
497 |
-
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
498 |
-
"list-style-image", "list-style-position", "list-style-type", "margin",
|
499 |
-
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
500 |
-
"marks", "marquee-direction", "marquee-loop",
|
501 |
-
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
502 |
-
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
503 |
-
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
|
504 |
-
"opacity", "order", "orphans", "outline",
|
505 |
-
"outline-color", "outline-offset", "outline-style", "outline-width",
|
506 |
-
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
507 |
-
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
508 |
-
"page", "page-break-after", "page-break-before", "page-break-inside",
|
509 |
-
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
510 |
-
"perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
|
511 |
-
"presentation-level", "punctuation-trim", "quotes", "region-break-after",
|
512 |
-
"region-break-before", "region-break-inside", "region-fragment",
|
513 |
-
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
|
514 |
-
"right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
515 |
-
"ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
|
516 |
-
"shape-outside", "size", "speak", "speak-as", "speak-header",
|
517 |
-
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
518 |
-
"tab-size", "table-layout", "target", "target-name", "target-new",
|
519 |
-
"target-position", "text-align", "text-align-last", "text-decoration",
|
520 |
-
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
521 |
-
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
522 |
-
"text-emphasis-position", "text-emphasis-style", "text-height",
|
523 |
-
"text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
|
524 |
-
"text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
|
525 |
-
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
526 |
-
"transition", "transition-delay", "transition-duration",
|
527 |
-
"transition-property", "transition-timing-function", "unicode-bidi",
|
528 |
-
"user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
|
529 |
-
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
530 |
-
"voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
|
531 |
-
"word-spacing", "word-wrap", "z-index",
|
532 |
-
// SVG-specific
|
533 |
-
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
|
534 |
-
"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
|
535 |
-
"color-interpolation", "color-interpolation-filters",
|
536 |
-
"color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
|
537 |
-
"marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
|
538 |
-
"stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
|
539 |
-
"stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
|
540 |
-
"baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
|
541 |
-
"glyph-orientation-vertical", "text-anchor", "writing-mode"
|
542 |
-
], propertyKeywords = keySet(propertyKeywords_);
|
543 |
-
|
544 |
-
var nonStandardPropertyKeywords_ = [
|
545 |
-
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
|
546 |
-
"scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
|
547 |
-
"scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
|
548 |
-
"searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
|
549 |
-
"searchfield-results-decoration", "zoom"
|
550 |
-
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
|
551 |
-
|
552 |
-
var fontProperties_ = [
|
553 |
-
"font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
|
554 |
-
"font-stretch", "font-weight", "font-style"
|
555 |
-
], fontProperties = keySet(fontProperties_);
|
556 |
-
|
557 |
-
var counterDescriptors_ = [
|
558 |
-
"additive-symbols", "fallback", "negative", "pad", "prefix", "range",
|
559 |
-
"speak-as", "suffix", "symbols", "system"
|
560 |
-
], counterDescriptors = keySet(counterDescriptors_);
|
561 |
-
|
562 |
-
var colorKeywords_ = [
|
563 |
-
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
|
564 |
-
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
|
565 |
-
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
|
566 |
-
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
|
567 |
-
"darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
|
568 |
-
"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
|
569 |
-
"darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
|
570 |
-
"deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
|
571 |
-
"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
|
572 |
-
"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
|
573 |
-
"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
|
574 |
-
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
|
575 |
-
"lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
|
576 |
-
"lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
|
577 |
-
"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
|
578 |
-
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
|
579 |
-
"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
|
580 |
-
"mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
|
581 |
-
"navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
|
582 |
-
"orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
|
583 |
-
"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
|
584 |
-
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
|
585 |
-
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
|
586 |
-
"slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
|
587 |
-
"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
|
588 |
-
"whitesmoke", "yellow", "yellowgreen"
|
589 |
-
], colorKeywords = keySet(colorKeywords_);
|
590 |
-
|
591 |
-
var valueKeywords_ = [
|
592 |
-
"above", "absolute", "activeborder", "additive", "activecaption", "afar",
|
593 |
-
"after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
|
594 |
-
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
595 |
-
"arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
|
596 |
-
"avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
|
597 |
-
"bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
598 |
-
"both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
|
599 |
-
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
|
600 |
-
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
601 |
-
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
|
602 |
-
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
603 |
-
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
|
604 |
-
"compact", "condensed", "contain", "content", "contents",
|
605 |
-
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
|
606 |
-
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
|
607 |
-
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
|
608 |
-
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
|
609 |
-
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
|
610 |
-
"dot-dash", "dot-dot-dash",
|
611 |
-
"dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
612 |
-
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
613 |
-
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
614 |
-
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
615 |
-
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
616 |
-
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
617 |
-
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
618 |
-
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
|
619 |
-
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
|
620 |
-
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
|
621 |
-
"forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
|
622 |
-
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
|
623 |
-
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
624 |
-
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
|
625 |
-
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
626 |
-
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
627 |
-
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
|
628 |
-
"italic", "japanese-formal", "japanese-informal", "justify", "kannada",
|
629 |
-
"katakana", "katakana-iroha", "keep-all", "khmer",
|
630 |
-
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
|
631 |
-
"landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
|
632 |
-
"line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
|
633 |
-
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
634 |
-
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
635 |
-
"lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
|
636 |
-
"media-controls-background", "media-current-time-display",
|
637 |
-
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
638 |
-
"media-return-to-realtime-button", "media-rewind-button",
|
639 |
-
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
640 |
-
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
641 |
-
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
642 |
-
"menu", "menulist", "menulist-button", "menulist-text",
|
643 |
-
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
644 |
-
"mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
|
645 |
-
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
646 |
-
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
647 |
-
"ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
|
648 |
-
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
649 |
-
"outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
|
650 |
-
"painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
|
651 |
-
"pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
|
652 |
-
"progress", "push-button", "radial-gradient", "radio", "read-only",
|
653 |
-
"read-write", "read-write-plaintext-only", "rectangle", "region",
|
654 |
-
"relative", "repeat", "repeating-linear-gradient",
|
655 |
-
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
|
656 |
-
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
|
657 |
-
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
|
658 |
-
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
|
659 |
-
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
|
660 |
-
"searchfield-cancel-button", "searchfield-decoration",
|
661 |
-
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
|
662 |
-
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
663 |
-
"simp-chinese-formal", "simp-chinese-informal", "single",
|
664 |
-
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
|
665 |
-
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
666 |
-
"small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
|
667 |
-
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
|
668 |
-
"square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
|
669 |
-
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
|
670 |
-
"table-caption", "table-cell", "table-column", "table-column-group",
|
671 |
-
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
672 |
-
"tamil",
|
673 |
-
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
674 |
-
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
675 |
-
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
676 |
-
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
677 |
-
"trad-chinese-formal", "trad-chinese-informal", "transform",
|
678 |
-
"translate", "translate3d", "translateX", "translateY", "translateZ",
|
679 |
-
"transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
|
680 |
-
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
681 |
-
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
682 |
-
"var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
683 |
-
"visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
|
684 |
-
"window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
|
685 |
-
"xx-large", "xx-small"
|
686 |
-
], valueKeywords = keySet(valueKeywords_);
|
687 |
-
|
688 |
-
var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
|
689 |
-
.concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
|
690 |
-
.concat(valueKeywords_);
|
691 |
-
CodeMirror.registerHelper("hintWords", "css", allWords);
|
692 |
-
|
693 |
-
function tokenCComment(stream, state) {
|
694 |
-
var maybeEnd = false, ch;
|
695 |
-
while ((ch = stream.next()) != null) {
|
696 |
-
if (maybeEnd && ch == "/") {
|
697 |
-
state.tokenize = null;
|
698 |
-
break;
|
699 |
-
}
|
700 |
-
maybeEnd = (ch == "*");
|
701 |
-
}
|
702 |
-
return ["comment", "comment"];
|
703 |
-
}
|
704 |
-
|
705 |
-
CodeMirror.defineMIME("text/css", {
|
706 |
-
documentTypes: documentTypes,
|
707 |
-
mediaTypes: mediaTypes,
|
708 |
-
mediaFeatures: mediaFeatures,
|
709 |
-
mediaValueKeywords: mediaValueKeywords,
|
710 |
-
propertyKeywords: propertyKeywords,
|
711 |
-
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
|
712 |
-
fontProperties: fontProperties,
|
713 |
-
counterDescriptors: counterDescriptors,
|
714 |
-
colorKeywords: colorKeywords,
|
715 |
-
valueKeywords: valueKeywords,
|
716 |
-
tokenHooks: {
|
717 |
-
"/": function(stream, state) {
|
718 |
-
if (!stream.eat("*")) return false;
|
719 |
-
state.tokenize = tokenCComment;
|
720 |
-
return tokenCComment(stream, state);
|
721 |
-
}
|
722 |
-
},
|
723 |
-
name: "css"
|
724 |
-
});
|
725 |
-
|
726 |
-
CodeMirror.defineMIME("text/x-scss", {
|
727 |
-
mediaTypes: mediaTypes,
|
728 |
-
mediaFeatures: mediaFeatures,
|
729 |
-
mediaValueKeywords: mediaValueKeywords,
|
730 |
-
propertyKeywords: propertyKeywords,
|
731 |
-
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
|
732 |
-
colorKeywords: colorKeywords,
|
733 |
-
valueKeywords: valueKeywords,
|
734 |
-
fontProperties: fontProperties,
|
735 |
-
allowNested: true,
|
736 |
-
lineComment: "//",
|
737 |
-
tokenHooks: {
|
738 |
-
"/": function(stream, state) {
|
739 |
-
if (stream.eat("/")) {
|
740 |
-
stream.skipToEnd();
|
741 |
-
return ["comment", "comment"];
|
742 |
-
} else if (stream.eat("*")) {
|
743 |
-
state.tokenize = tokenCComment;
|
744 |
-
return tokenCComment(stream, state);
|
745 |
-
} else {
|
746 |
-
return ["operator", "operator"];
|
747 |
-
}
|
748 |
-
},
|
749 |
-
":": function(stream) {
|
750 |
-
if (stream.match(/\s*\{/, false))
|
751 |
-
return [null, null]
|
752 |
-
return false;
|
753 |
-
},
|
754 |
-
"$": function(stream) {
|
755 |
-
stream.match(/^[\w-]+/);
|
756 |
-
if (stream.match(/^\s*:/, false))
|
757 |
-
return ["variable-2", "variable-definition"];
|
758 |
-
return ["variable-2", "variable"];
|
759 |
-
},
|
760 |
-
"#": function(stream) {
|
761 |
-
if (!stream.eat("{")) return false;
|
762 |
-
return [null, "interpolation"];
|
763 |
-
}
|
764 |
-
},
|
765 |
-
name: "css",
|
766 |
-
helperType: "scss"
|
767 |
-
});
|
768 |
-
|
769 |
-
CodeMirror.defineMIME("text/x-less", {
|
770 |
-
mediaTypes: mediaTypes,
|
771 |
-
mediaFeatures: mediaFeatures,
|
772 |
-
mediaValueKeywords: mediaValueKeywords,
|
773 |
-
propertyKeywords: propertyKeywords,
|
774 |
-
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
|
775 |
-
colorKeywords: colorKeywords,
|
776 |
-
valueKeywords: valueKeywords,
|
777 |
-
fontProperties: fontProperties,
|
778 |
-
allowNested: true,
|
779 |
-
lineComment: "//",
|
780 |
-
tokenHooks: {
|
781 |
-
"/": function(stream, state) {
|
782 |
-
if (stream.eat("/")) {
|
783 |
-
stream.skipToEnd();
|
784 |
-
return ["comment", "comment"];
|
785 |
-
} else if (stream.eat("*")) {
|
786 |
-
state.tokenize = tokenCComment;
|
787 |
-
return tokenCComment(stream, state);
|
788 |
-
} else {
|
789 |
-
return ["operator", "operator"];
|
790 |
-
}
|
791 |
-
},
|
792 |
-
"@": function(stream) {
|
793 |
-
if (stream.eat("{")) return [null, "interpolation"];
|
794 |
-
if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
|
795 |
-
stream.eatWhile(/[\w\\\-]/);
|
796 |
-
if (stream.match(/^\s*:/, false))
|
797 |
-
return ["variable-2", "variable-definition"];
|
798 |
-
return ["variable-2", "variable"];
|
799 |
-
},
|
800 |
-
"&": function() {
|
801 |
-
return ["atom", "atom"];
|
802 |
-
}
|
803 |
-
},
|
804 |
-
name: "css",
|
805 |
-
helperType: "less"
|
806 |
-
});
|
807 |
-
|
808 |
-
CodeMirror.defineMIME("text/x-gss", {
|
809 |
-
documentTypes: documentTypes,
|
810 |
-
mediaTypes: mediaTypes,
|
811 |
-
mediaFeatures: mediaFeatures,
|
812 |
-
propertyKeywords: propertyKeywords,
|
813 |
-
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
|
814 |
-
fontProperties: fontProperties,
|
815 |
-
counterDescriptors: counterDescriptors,
|
816 |
-
colorKeywords: colorKeywords,
|
817 |
-
valueKeywords: valueKeywords,
|
818 |
-
supportsAtComponent: true,
|
819 |
-
tokenHooks: {
|
820 |
-
"/": function(stream, state) {
|
821 |
-
if (!stream.eat("*")) return false;
|
822 |
-
state.tokenize = tokenCComment;
|
823 |
-
return tokenCComment(stream, state);
|
824 |
-
}
|
825 |
-
},
|
826 |
-
name: "css",
|
827 |
-
helperType: "gss"
|
828 |
-
});
|
829 |
-
|
830 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/codemirror/htmlmixed.js
DELETED
@@ -1,152 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
var defaultTags = {
|
15 |
-
script: [
|
16 |
-
["lang", /(javascript|babel)/i, "javascript"],
|
17 |
-
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
|
18 |
-
["type", /./, "text/plain"],
|
19 |
-
[null, null, "javascript"]
|
20 |
-
],
|
21 |
-
style: [
|
22 |
-
["lang", /^css$/i, "css"],
|
23 |
-
["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
|
24 |
-
["type", /./, "text/plain"],
|
25 |
-
[null, null, "css"]
|
26 |
-
]
|
27 |
-
};
|
28 |
-
|
29 |
-
function maybeBackup(stream, pat, style) {
|
30 |
-
var cur = stream.current(), close = cur.search(pat);
|
31 |
-
if (close > -1) {
|
32 |
-
stream.backUp(cur.length - close);
|
33 |
-
} else if (cur.match(/<\/?$/)) {
|
34 |
-
stream.backUp(cur.length);
|
35 |
-
if (!stream.match(pat, false)) stream.match(cur);
|
36 |
-
}
|
37 |
-
return style;
|
38 |
-
}
|
39 |
-
|
40 |
-
var attrRegexpCache = {};
|
41 |
-
function getAttrRegexp(attr) {
|
42 |
-
var regexp = attrRegexpCache[attr];
|
43 |
-
if (regexp) return regexp;
|
44 |
-
return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
|
45 |
-
}
|
46 |
-
|
47 |
-
function getAttrValue(text, attr) {
|
48 |
-
var match = text.match(getAttrRegexp(attr))
|
49 |
-
return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
|
50 |
-
}
|
51 |
-
|
52 |
-
function getTagRegexp(tagName, anchored) {
|
53 |
-
return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
|
54 |
-
}
|
55 |
-
|
56 |
-
function addTags(from, to) {
|
57 |
-
for (var tag in from) {
|
58 |
-
var dest = to[tag] || (to[tag] = []);
|
59 |
-
var source = from[tag];
|
60 |
-
for (var i = source.length - 1; i >= 0; i--)
|
61 |
-
dest.unshift(source[i])
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
function findMatchingMode(tagInfo, tagText) {
|
66 |
-
for (var i = 0; i < tagInfo.length; i++) {
|
67 |
-
var spec = tagInfo[i];
|
68 |
-
if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
|
73 |
-
var htmlMode = CodeMirror.getMode(config, {
|
74 |
-
name: "xml",
|
75 |
-
htmlMode: true,
|
76 |
-
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
|
77 |
-
multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
|
78 |
-
});
|
79 |
-
|
80 |
-
var tags = {};
|
81 |
-
var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
|
82 |
-
addTags(defaultTags, tags);
|
83 |
-
if (configTags) addTags(configTags, tags);
|
84 |
-
if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
|
85 |
-
tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
|
86 |
-
|
87 |
-
function html(stream, state) {
|
88 |
-
var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
|
89 |
-
if (tag && !/[<>\s\/]/.test(stream.current()) &&
|
90 |
-
(tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
|
91 |
-
tags.hasOwnProperty(tagName)) {
|
92 |
-
state.inTag = tagName + " "
|
93 |
-
} else if (state.inTag && tag && />$/.test(stream.current())) {
|
94 |
-
var inTag = /^([\S]+) (.*)/.exec(state.inTag)
|
95 |
-
state.inTag = null
|
96 |
-
var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
|
97 |
-
var mode = CodeMirror.getMode(config, modeSpec)
|
98 |
-
var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
|
99 |
-
state.token = function (stream, state) {
|
100 |
-
if (stream.match(endTagA, false)) {
|
101 |
-
state.token = html;
|
102 |
-
state.localState = state.localMode = null;
|
103 |
-
return null;
|
104 |
-
}
|
105 |
-
return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
|
106 |
-
};
|
107 |
-
state.localMode = mode;
|
108 |
-
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
|
109 |
-
} else if (state.inTag) {
|
110 |
-
state.inTag += stream.current()
|
111 |
-
if (stream.eol()) state.inTag += " "
|
112 |
-
}
|
113 |
-
return style;
|
114 |
-
};
|
115 |
-
|
116 |
-
return {
|
117 |
-
startState: function () {
|
118 |
-
var state = CodeMirror.startState(htmlMode);
|
119 |
-
return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
|
120 |
-
},
|
121 |
-
|
122 |
-
copyState: function (state) {
|
123 |
-
var local;
|
124 |
-
if (state.localState) {
|
125 |
-
local = CodeMirror.copyState(state.localMode, state.localState);
|
126 |
-
}
|
127 |
-
return {token: state.token, inTag: state.inTag,
|
128 |
-
localMode: state.localMode, localState: local,
|
129 |
-
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
130 |
-
},
|
131 |
-
|
132 |
-
token: function (stream, state) {
|
133 |
-
return state.token(stream, state);
|
134 |
-
},
|
135 |
-
|
136 |
-
indent: function (state, textAfter, line) {
|
137 |
-
if (!state.localMode || /^\s*<\//.test(textAfter))
|
138 |
-
return htmlMode.indent(state.htmlState, textAfter);
|
139 |
-
else if (state.localMode.indent)
|
140 |
-
return state.localMode.indent(state.localState, textAfter, line);
|
141 |
-
else
|
142 |
-
return CodeMirror.Pass;
|
143 |
-
},
|
144 |
-
|
145 |
-
innerMode: function (state) {
|
146 |
-
return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
|
147 |
-
}
|
148 |
-
};
|
149 |
-
}, "xml", "javascript", "css");
|
150 |
-
|
151 |
-
CodeMirror.defineMIME("text/html", "htmlmixed");
|
152 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/codemirror/javascript.js
DELETED
@@ -1,813 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
function expressionAllowed(stream, state, backUp) {
|
15 |
-
return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
|
16 |
-
(state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
|
17 |
-
}
|
18 |
-
|
19 |
-
CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
20 |
-
var indentUnit = config.indentUnit;
|
21 |
-
var statementIndent = parserConfig.statementIndent;
|
22 |
-
var jsonldMode = parserConfig.jsonld;
|
23 |
-
var jsonMode = parserConfig.json || jsonldMode;
|
24 |
-
var isTS = parserConfig.typescript;
|
25 |
-
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
|
26 |
-
|
27 |
-
// Tokenizer
|
28 |
-
|
29 |
-
var keywords = function(){
|
30 |
-
function kw(type) {return {type: type, style: "keyword"};}
|
31 |
-
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
|
32 |
-
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
33 |
-
|
34 |
-
var jsKeywords = {
|
35 |
-
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
36 |
-
"return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
|
37 |
-
"var": kw("var"), "const": kw("var"), "let": kw("var"),
|
38 |
-
"function": kw("function"), "catch": kw("catch"),
|
39 |
-
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
40 |
-
"in": operator, "typeof": operator, "instanceof": operator,
|
41 |
-
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
|
42 |
-
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
|
43 |
-
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
|
44 |
-
"await": C, "async": kw("async")
|
45 |
-
};
|
46 |
-
|
47 |
-
// Extend the 'normal' keywords with the TypeScript language extensions
|
48 |
-
if (isTS) {
|
49 |
-
var type = {type: "variable", style: "variable-3"};
|
50 |
-
var tsKeywords = {
|
51 |
-
// object-like things
|
52 |
-
"interface": kw("class"),
|
53 |
-
"implements": C,
|
54 |
-
"namespace": C,
|
55 |
-
"module": kw("module"),
|
56 |
-
"enum": kw("module"),
|
57 |
-
|
58 |
-
// scope modifiers
|
59 |
-
"public": kw("modifier"),
|
60 |
-
"private": kw("modifier"),
|
61 |
-
"protected": kw("modifier"),
|
62 |
-
"abstract": kw("modifier"),
|
63 |
-
|
64 |
-
// operators
|
65 |
-
"as": operator,
|
66 |
-
|
67 |
-
// types
|
68 |
-
"string": type, "number": type, "boolean": type, "any": type
|
69 |
-
};
|
70 |
-
|
71 |
-
for (var attr in tsKeywords) {
|
72 |
-
jsKeywords[attr] = tsKeywords[attr];
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
return jsKeywords;
|
77 |
-
}();
|
78 |
-
|
79 |
-
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
|
80 |
-
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
|
81 |
-
|
82 |
-
function readRegexp(stream) {
|
83 |
-
var escaped = false, next, inSet = false;
|
84 |
-
while ((next = stream.next()) != null) {
|
85 |
-
if (!escaped) {
|
86 |
-
if (next == "/" && !inSet) return;
|
87 |
-
if (next == "[") inSet = true;
|
88 |
-
else if (inSet && next == "]") inSet = false;
|
89 |
-
}
|
90 |
-
escaped = !escaped && next == "\\";
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
// Used as scratch variables to communicate multiple values without
|
95 |
-
// consing up tons of objects.
|
96 |
-
var type, content;
|
97 |
-
function ret(tp, style, cont) {
|
98 |
-
type = tp; content = cont;
|
99 |
-
return style;
|
100 |
-
}
|
101 |
-
function tokenBase(stream, state) {
|
102 |
-
var ch = stream.next();
|
103 |
-
if (ch == '"' || ch == "'") {
|
104 |
-
state.tokenize = tokenString(ch);
|
105 |
-
return state.tokenize(stream, state);
|
106 |
-
} else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
|
107 |
-
return ret("number", "number");
|
108 |
-
} else if (ch == "." && stream.match("..")) {
|
109 |
-
return ret("spread", "meta");
|
110 |
-
} else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
111 |
-
return ret(ch);
|
112 |
-
} else if (ch == "=" && stream.eat(">")) {
|
113 |
-
return ret("=>", "operator");
|
114 |
-
} else if (ch == "0" && stream.eat(/x/i)) {
|
115 |
-
stream.eatWhile(/[\da-f]/i);
|
116 |
-
return ret("number", "number");
|
117 |
-
} else if (ch == "0" && stream.eat(/o/i)) {
|
118 |
-
stream.eatWhile(/[0-7]/i);
|
119 |
-
return ret("number", "number");
|
120 |
-
} else if (ch == "0" && stream.eat(/b/i)) {
|
121 |
-
stream.eatWhile(/[01]/i);
|
122 |
-
return ret("number", "number");
|
123 |
-
} else if (/\d/.test(ch)) {
|
124 |
-
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
|
125 |
-
return ret("number", "number");
|
126 |
-
} else if (ch == "/") {
|
127 |
-
if (stream.eat("*")) {
|
128 |
-
state.tokenize = tokenComment;
|
129 |
-
return tokenComment(stream, state);
|
130 |
-
} else if (stream.eat("/")) {
|
131 |
-
stream.skipToEnd();
|
132 |
-
return ret("comment", "comment");
|
133 |
-
} else if (expressionAllowed(stream, state, 1)) {
|
134 |
-
readRegexp(stream);
|
135 |
-
stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
|
136 |
-
return ret("regexp", "string-2");
|
137 |
-
} else {
|
138 |
-
stream.eatWhile(isOperatorChar);
|
139 |
-
return ret("operator", "operator", stream.current());
|
140 |
-
}
|
141 |
-
} else if (ch == "`") {
|
142 |
-
state.tokenize = tokenQuasi;
|
143 |
-
return tokenQuasi(stream, state);
|
144 |
-
} else if (ch == "#") {
|
145 |
-
stream.skipToEnd();
|
146 |
-
return ret("error", "error");
|
147 |
-
} else if (isOperatorChar.test(ch)) {
|
148 |
-
if (ch != ">" || !state.lexical || state.lexical.type != ">")
|
149 |
-
stream.eatWhile(isOperatorChar);
|
150 |
-
return ret("operator", "operator", stream.current());
|
151 |
-
} else if (wordRE.test(ch)) {
|
152 |
-
stream.eatWhile(wordRE);
|
153 |
-
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
154 |
-
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
|
155 |
-
ret("variable", "variable", word);
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
function tokenString(quote) {
|
160 |
-
return function(stream, state) {
|
161 |
-
var escaped = false, next;
|
162 |
-
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
|
163 |
-
state.tokenize = tokenBase;
|
164 |
-
return ret("jsonld-keyword", "meta");
|
165 |
-
}
|
166 |
-
while ((next = stream.next()) != null) {
|
167 |
-
if (next == quote && !escaped) break;
|
168 |
-
escaped = !escaped && next == "\\";
|
169 |
-
}
|
170 |
-
if (!escaped) state.tokenize = tokenBase;
|
171 |
-
return ret("string", "string");
|
172 |
-
};
|
173 |
-
}
|
174 |
-
|
175 |
-
function tokenComment(stream, state) {
|
176 |
-
var maybeEnd = false, ch;
|
177 |
-
while (ch = stream.next()) {
|
178 |
-
if (ch == "/" && maybeEnd) {
|
179 |
-
state.tokenize = tokenBase;
|
180 |
-
break;
|
181 |
-
}
|
182 |
-
maybeEnd = (ch == "*");
|
183 |
-
}
|
184 |
-
return ret("comment", "comment");
|
185 |
-
}
|
186 |
-
|
187 |
-
function tokenQuasi(stream, state) {
|
188 |
-
var escaped = false, next;
|
189 |
-
while ((next = stream.next()) != null) {
|
190 |
-
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
|
191 |
-
state.tokenize = tokenBase;
|
192 |
-
break;
|
193 |
-
}
|
194 |
-
escaped = !escaped && next == "\\";
|
195 |
-
}
|
196 |
-
return ret("quasi", "string-2", stream.current());
|
197 |
-
}
|
198 |
-
|
199 |
-
var brackets = "([{}])";
|
200 |
-
// This is a crude lookahead trick to try and notice that we're
|
201 |
-
// parsing the argument patterns for a fat-arrow function before we
|
202 |
-
// actually hit the arrow token. It only works if the arrow is on
|
203 |
-
// the same line as the arguments and there's no strange noise
|
204 |
-
// (comments) in between. Fallback is to only notice when we hit the
|
205 |
-
// arrow, and not declare the arguments as locals for the arrow
|
206 |
-
// body.
|
207 |
-
function findFatArrow(stream, state) {
|
208 |
-
if (state.fatArrowAt) state.fatArrowAt = null;
|
209 |
-
var arrow = stream.string.indexOf("=>", stream.start);
|
210 |
-
if (arrow < 0) return;
|
211 |
-
|
212 |
-
if (isTS) { // Try to skip TypeScript return type declarations after the arguments
|
213 |
-
var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
|
214 |
-
if (m) arrow = m.index
|
215 |
-
}
|
216 |
-
|
217 |
-
var depth = 0, sawSomething = false;
|
218 |
-
for (var pos = arrow - 1; pos >= 0; --pos) {
|
219 |
-
var ch = stream.string.charAt(pos);
|
220 |
-
var bracket = brackets.indexOf(ch);
|
221 |
-
if (bracket >= 0 && bracket < 3) {
|
222 |
-
if (!depth) { ++pos; break; }
|
223 |
-
if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
|
224 |
-
} else if (bracket >= 3 && bracket < 6) {
|
225 |
-
++depth;
|
226 |
-
} else if (wordRE.test(ch)) {
|
227 |
-
sawSomething = true;
|
228 |
-
} else if (/["'\/]/.test(ch)) {
|
229 |
-
return;
|
230 |
-
} else if (sawSomething && !depth) {
|
231 |
-
++pos;
|
232 |
-
break;
|
233 |
-
}
|
234 |
-
}
|
235 |
-
if (sawSomething && !depth) state.fatArrowAt = pos;
|
236 |
-
}
|
237 |
-
|
238 |
-
// Parser
|
239 |
-
|
240 |
-
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
|
241 |
-
|
242 |
-
function JSLexical(indented, column, type, align, prev, info) {
|
243 |
-
this.indented = indented;
|
244 |
-
this.column = column;
|
245 |
-
this.type = type;
|
246 |
-
this.prev = prev;
|
247 |
-
this.info = info;
|
248 |
-
if (align != null) this.align = align;
|
249 |
-
}
|
250 |
-
|
251 |
-
function inScope(state, varname) {
|
252 |
-
for (var v = state.localVars; v; v = v.next)
|
253 |
-
if (v.name == varname) return true;
|
254 |
-
for (var cx = state.context; cx; cx = cx.prev) {
|
255 |
-
for (var v = cx.vars; v; v = v.next)
|
256 |
-
if (v.name == varname) return true;
|
257 |
-
}
|
258 |
-
}
|
259 |
-
|
260 |
-
function parseJS(state, style, type, content, stream) {
|
261 |
-
var cc = state.cc;
|
262 |
-
// Communicate our context to the combinators.
|
263 |
-
// (Less wasteful than consing up a hundred closures on every call.)
|
264 |
-
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
|
265 |
-
|
266 |
-
if (!state.lexical.hasOwnProperty("align"))
|
267 |
-
state.lexical.align = true;
|
268 |
-
|
269 |
-
while(true) {
|
270 |
-
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
|
271 |
-
if (combinator(type, content)) {
|
272 |
-
while(cc.length && cc[cc.length - 1].lex)
|
273 |
-
cc.pop()();
|
274 |
-
if (cx.marked) return cx.marked;
|
275 |
-
if (type == "variable" && inScope(state, content)) return "variable-2";
|
276 |
-
return style;
|
277 |
-
}
|
278 |
-
}
|
279 |
-
}
|
280 |
-
|
281 |
-
// Combinator utils
|
282 |
-
|
283 |
-
var cx = {state: null, column: null, marked: null, cc: null};
|
284 |
-
function pass() {
|
285 |
-
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
286 |
-
}
|
287 |
-
function cont() {
|
288 |
-
pass.apply(null, arguments);
|
289 |
-
return true;
|
290 |
-
}
|
291 |
-
function register(varname) {
|
292 |
-
function inList(list) {
|
293 |
-
for (var v = list; v; v = v.next)
|
294 |
-
if (v.name == varname) return true;
|
295 |
-
return false;
|
296 |
-
}
|
297 |
-
var state = cx.state;
|
298 |
-
cx.marked = "def";
|
299 |
-
if (state.context) {
|
300 |
-
if (inList(state.localVars)) return;
|
301 |
-
state.localVars = {name: varname, next: state.localVars};
|
302 |
-
} else {
|
303 |
-
if (inList(state.globalVars)) return;
|
304 |
-
if (parserConfig.globalVars)
|
305 |
-
state.globalVars = {name: varname, next: state.globalVars};
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
// Combinators
|
310 |
-
|
311 |
-
var defaultVars = {name: "this", next: {name: "arguments"}};
|
312 |
-
function pushcontext() {
|
313 |
-
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
|
314 |
-
cx.state.localVars = defaultVars;
|
315 |
-
}
|
316 |
-
function popcontext() {
|
317 |
-
cx.state.localVars = cx.state.context.vars;
|
318 |
-
cx.state.context = cx.state.context.prev;
|
319 |
-
}
|
320 |
-
function pushlex(type, info) {
|
321 |
-
var result = function() {
|
322 |
-
var state = cx.state, indent = state.indented;
|
323 |
-
if (state.lexical.type == "stat") indent = state.lexical.indented;
|
324 |
-
else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
|
325 |
-
indent = outer.indented;
|
326 |
-
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
|
327 |
-
};
|
328 |
-
result.lex = true;
|
329 |
-
return result;
|
330 |
-
}
|
331 |
-
function poplex() {
|
332 |
-
var state = cx.state;
|
333 |
-
if (state.lexical.prev) {
|
334 |
-
if (state.lexical.type == ")")
|
335 |
-
state.indented = state.lexical.indented;
|
336 |
-
state.lexical = state.lexical.prev;
|
337 |
-
}
|
338 |
-
}
|
339 |
-
poplex.lex = true;
|
340 |
-
|
341 |
-
function expect(wanted) {
|
342 |
-
function exp(type) {
|
343 |
-
if (type == wanted) return cont();
|
344 |
-
else if (wanted == ";") return pass();
|
345 |
-
else return cont(exp);
|
346 |
-
};
|
347 |
-
return exp;
|
348 |
-
}
|
349 |
-
|
350 |
-
function statement(type, value) {
|
351 |
-
if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
|
352 |
-
if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
|
353 |
-
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
354 |
-
if (type == "{") return cont(pushlex("}"), block, poplex);
|
355 |
-
if (type == ";") return cont();
|
356 |
-
if (type == "if") {
|
357 |
-
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
|
358 |
-
cx.state.cc.pop()();
|
359 |
-
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
|
360 |
-
}
|
361 |
-
if (type == "function") return cont(functiondef);
|
362 |
-
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
363 |
-
if (type == "variable") {
|
364 |
-
if (isTS && value == "type") {
|
365 |
-
cx.marked = "keyword"
|
366 |
-
return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
|
367 |
-
} else {
|
368 |
-
return cont(pushlex("stat"), maybelabel);
|
369 |
-
}
|
370 |
-
}
|
371 |
-
if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"),
|
372 |
-
block, poplex, poplex);
|
373 |
-
if (type == "case") return cont(expression, expect(":"));
|
374 |
-
if (type == "default") return cont(expect(":"));
|
375 |
-
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
376 |
-
statement, poplex, popcontext);
|
377 |
-
if (type == "class") return cont(pushlex("form"), className, poplex);
|
378 |
-
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
|
379 |
-
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
|
380 |
-
if (type == "module") return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
|
381 |
-
if (type == "async") return cont(statement)
|
382 |
-
if (value == "@") return cont(expression, statement)
|
383 |
-
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
384 |
-
}
|
385 |
-
function expression(type) {
|
386 |
-
return expressionInner(type, false);
|
387 |
-
}
|
388 |
-
function expressionNoComma(type) {
|
389 |
-
return expressionInner(type, true);
|
390 |
-
}
|
391 |
-
function parenExpr(type) {
|
392 |
-
if (type != "(") return pass()
|
393 |
-
return cont(pushlex(")"), expression, expect(")"), poplex)
|
394 |
-
}
|
395 |
-
function expressionInner(type, noComma) {
|
396 |
-
if (cx.state.fatArrowAt == cx.stream.start) {
|
397 |
-
var body = noComma ? arrowBodyNoComma : arrowBody;
|
398 |
-
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
|
399 |
-
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
|
400 |
-
}
|
401 |
-
|
402 |
-
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
|
403 |
-
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
|
404 |
-
if (type == "function") return cont(functiondef, maybeop);
|
405 |
-
if (type == "class") return cont(pushlex("form"), classExpression, poplex);
|
406 |
-
if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
|
407 |
-
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
|
408 |
-
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
|
409 |
-
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
|
410 |
-
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
|
411 |
-
if (type == "quasi") return pass(quasi, maybeop);
|
412 |
-
if (type == "new") return cont(maybeTarget(noComma));
|
413 |
-
return cont();
|
414 |
-
}
|
415 |
-
function maybeexpression(type) {
|
416 |
-
if (type.match(/[;\}\)\],]/)) return pass();
|
417 |
-
return pass(expression);
|
418 |
-
}
|
419 |
-
function maybeexpressionNoComma(type) {
|
420 |
-
if (type.match(/[;\}\)\],]/)) return pass();
|
421 |
-
return pass(expressionNoComma);
|
422 |
-
}
|
423 |
-
|
424 |
-
function maybeoperatorComma(type, value) {
|
425 |
-
if (type == ",") return cont(expression);
|
426 |
-
return maybeoperatorNoComma(type, value, false);
|
427 |
-
}
|
428 |
-
function maybeoperatorNoComma(type, value, noComma) {
|
429 |
-
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
|
430 |
-
var expr = noComma == false ? expression : expressionNoComma;
|
431 |
-
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
|
432 |
-
if (type == "operator") {
|
433 |
-
if (/\+\+|--/.test(value)) return cont(me);
|
434 |
-
if (value == "?") return cont(expression, expect(":"), expr);
|
435 |
-
return cont(expr);
|
436 |
-
}
|
437 |
-
if (type == "quasi") { return pass(quasi, me); }
|
438 |
-
if (type == ";") return;
|
439 |
-
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
|
440 |
-
if (type == ".") return cont(property, me);
|
441 |
-
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
|
442 |
-
}
|
443 |
-
function quasi(type, value) {
|
444 |
-
if (type != "quasi") return pass();
|
445 |
-
if (value.slice(value.length - 2) != "${") return cont(quasi);
|
446 |
-
return cont(expression, continueQuasi);
|
447 |
-
}
|
448 |
-
function continueQuasi(type) {
|
449 |
-
if (type == "}") {
|
450 |
-
cx.marked = "string-2";
|
451 |
-
cx.state.tokenize = tokenQuasi;
|
452 |
-
return cont(quasi);
|
453 |
-
}
|
454 |
-
}
|
455 |
-
function arrowBody(type) {
|
456 |
-
findFatArrow(cx.stream, cx.state);
|
457 |
-
return pass(type == "{" ? statement : expression);
|
458 |
-
}
|
459 |
-
function arrowBodyNoComma(type) {
|
460 |
-
findFatArrow(cx.stream, cx.state);
|
461 |
-
return pass(type == "{" ? statement : expressionNoComma);
|
462 |
-
}
|
463 |
-
function maybeTarget(noComma) {
|
464 |
-
return function(type) {
|
465 |
-
if (type == ".") return cont(noComma ? targetNoComma : target);
|
466 |
-
else return pass(noComma ? expressionNoComma : expression);
|
467 |
-
};
|
468 |
-
}
|
469 |
-
function target(_, value) {
|
470 |
-
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
|
471 |
-
}
|
472 |
-
function targetNoComma(_, value) {
|
473 |
-
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
|
474 |
-
}
|
475 |
-
function maybelabel(type) {
|
476 |
-
if (type == ":") return cont(poplex, statement);
|
477 |
-
return pass(maybeoperatorComma, expect(";"), poplex);
|
478 |
-
}
|
479 |
-
function property(type) {
|
480 |
-
if (type == "variable") {cx.marked = "property"; return cont();}
|
481 |
-
}
|
482 |
-
function objprop(type, value) {
|
483 |
-
if (type == "async") {
|
484 |
-
cx.marked = "property";
|
485 |
-
return cont(objprop);
|
486 |
-
} else if (type == "variable" || cx.style == "keyword") {
|
487 |
-
cx.marked = "property";
|
488 |
-
if (value == "get" || value == "set") return cont(getterSetter);
|
489 |
-
return cont(afterprop);
|
490 |
-
} else if (type == "number" || type == "string") {
|
491 |
-
cx.marked = jsonldMode ? "property" : (cx.style + " property");
|
492 |
-
return cont(afterprop);
|
493 |
-
} else if (type == "jsonld-keyword") {
|
494 |
-
return cont(afterprop);
|
495 |
-
} else if (type == "modifier") {
|
496 |
-
return cont(objprop)
|
497 |
-
} else if (type == "[") {
|
498 |
-
return cont(expression, expect("]"), afterprop);
|
499 |
-
} else if (type == "spread") {
|
500 |
-
return cont(expression);
|
501 |
-
} else if (type == ":") {
|
502 |
-
return pass(afterprop)
|
503 |
-
}
|
504 |
-
}
|
505 |
-
function getterSetter(type) {
|
506 |
-
if (type != "variable") return pass(afterprop);
|
507 |
-
cx.marked = "property";
|
508 |
-
return cont(functiondef);
|
509 |
-
}
|
510 |
-
function afterprop(type) {
|
511 |
-
if (type == ":") return cont(expressionNoComma);
|
512 |
-
if (type == "(") return pass(functiondef);
|
513 |
-
}
|
514 |
-
function commasep(what, end, sep) {
|
515 |
-
function proceed(type, value) {
|
516 |
-
if (sep ? sep.indexOf(type) > -1 : type == ",") {
|
517 |
-
var lex = cx.state.lexical;
|
518 |
-
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
|
519 |
-
return cont(function(type, value) {
|
520 |
-
if (type == end || value == end) return pass()
|
521 |
-
return pass(what)
|
522 |
-
}, proceed);
|
523 |
-
}
|
524 |
-
if (type == end || value == end) return cont();
|
525 |
-
return cont(expect(end));
|
526 |
-
}
|
527 |
-
return function(type, value) {
|
528 |
-
if (type == end || value == end) return cont();
|
529 |
-
return pass(what, proceed);
|
530 |
-
};
|
531 |
-
}
|
532 |
-
function contCommasep(what, end, info) {
|
533 |
-
for (var i = 3; i < arguments.length; i++)
|
534 |
-
cx.cc.push(arguments[i]);
|
535 |
-
return cont(pushlex(end, info), commasep(what, end), poplex);
|
536 |
-
}
|
537 |
-
function block(type) {
|
538 |
-
if (type == "}") return cont();
|
539 |
-
return pass(statement, block);
|
540 |
-
}
|
541 |
-
function maybetype(type, value) {
|
542 |
-
if (isTS) {
|
543 |
-
if (type == ":") return cont(typeexpr);
|
544 |
-
if (value == "?") return cont(maybetype);
|
545 |
-
}
|
546 |
-
}
|
547 |
-
function typeexpr(type) {
|
548 |
-
if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
|
549 |
-
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
550 |
-
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
|
551 |
-
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
|
552 |
-
}
|
553 |
-
function maybeReturnType(type) {
|
554 |
-
if (type == "=>") return cont(typeexpr)
|
555 |
-
}
|
556 |
-
function typeprop(type, value) {
|
557 |
-
if (type == "variable" || cx.style == "keyword") {
|
558 |
-
cx.marked = "property"
|
559 |
-
return cont(typeprop)
|
560 |
-
} else if (value == "?") {
|
561 |
-
return cont(typeprop)
|
562 |
-
} else if (type == ":") {
|
563 |
-
return cont(typeexpr)
|
564 |
-
} else if (type == "[") {
|
565 |
-
return cont(expression, maybetype, expect("]"), typeprop)
|
566 |
-
}
|
567 |
-
}
|
568 |
-
function typearg(type) {
|
569 |
-
if (type == "variable") return cont(typearg)
|
570 |
-
else if (type == ":") return cont(typeexpr)
|
571 |
-
}
|
572 |
-
function afterType(type, value) {
|
573 |
-
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
574 |
-
if (value == "|" || type == ".") return cont(typeexpr)
|
575 |
-
if (type == "[") return cont(expect("]"), afterType)
|
576 |
-
if (value == "extends") return cont(typeexpr)
|
577 |
-
}
|
578 |
-
function vardef() {
|
579 |
-
return pass(pattern, maybetype, maybeAssign, vardefCont);
|
580 |
-
}
|
581 |
-
function pattern(type, value) {
|
582 |
-
if (type == "modifier") return cont(pattern)
|
583 |
-
if (type == "variable") { register(value); return cont(); }
|
584 |
-
if (type == "spread") return cont(pattern);
|
585 |
-
if (type == "[") return contCommasep(pattern, "]");
|
586 |
-
if (type == "{") return contCommasep(proppattern, "}");
|
587 |
-
}
|
588 |
-
function proppattern(type, value) {
|
589 |
-
if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
|
590 |
-
register(value);
|
591 |
-
return cont(maybeAssign);
|
592 |
-
}
|
593 |
-
if (type == "variable") cx.marked = "property";
|
594 |
-
if (type == "spread") return cont(pattern);
|
595 |
-
if (type == "}") return pass();
|
596 |
-
return cont(expect(":"), pattern, maybeAssign);
|
597 |
-
}
|
598 |
-
function maybeAssign(_type, value) {
|
599 |
-
if (value == "=") return cont(expressionNoComma);
|
600 |
-
}
|
601 |
-
function vardefCont(type) {
|
602 |
-
if (type == ",") return cont(vardef);
|
603 |
-
}
|
604 |
-
function maybeelse(type, value) {
|
605 |
-
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
|
606 |
-
}
|
607 |
-
function forspec(type) {
|
608 |
-
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
|
609 |
-
}
|
610 |
-
function forspec1(type) {
|
611 |
-
if (type == "var") return cont(vardef, expect(";"), forspec2);
|
612 |
-
if (type == ";") return cont(forspec2);
|
613 |
-
if (type == "variable") return cont(formaybeinof);
|
614 |
-
return pass(expression, expect(";"), forspec2);
|
615 |
-
}
|
616 |
-
function formaybeinof(_type, value) {
|
617 |
-
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
|
618 |
-
return cont(maybeoperatorComma, forspec2);
|
619 |
-
}
|
620 |
-
function forspec2(type, value) {
|
621 |
-
if (type == ";") return cont(forspec3);
|
622 |
-
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
|
623 |
-
return pass(expression, expect(";"), forspec3);
|
624 |
-
}
|
625 |
-
function forspec3(type) {
|
626 |
-
if (type != ")") cont(expression);
|
627 |
-
}
|
628 |
-
function functiondef(type, value) {
|
629 |
-
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
|
630 |
-
if (type == "variable") {register(value); return cont(functiondef);}
|
631 |
-
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
|
632 |
-
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, functiondef)
|
633 |
-
}
|
634 |
-
function funarg(type) {
|
635 |
-
if (type == "spread") return cont(funarg);
|
636 |
-
return pass(pattern, maybetype, maybeAssign);
|
637 |
-
}
|
638 |
-
function classExpression(type, value) {
|
639 |
-
// Class expressions may have an optional name.
|
640 |
-
if (type == "variable") return className(type, value);
|
641 |
-
return classNameAfter(type, value);
|
642 |
-
}
|
643 |
-
function className(type, value) {
|
644 |
-
if (type == "variable") {register(value); return cont(classNameAfter);}
|
645 |
-
}
|
646 |
-
function classNameAfter(type, value) {
|
647 |
-
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, classNameAfter)
|
648 |
-
if (value == "extends" || value == "implements" || (isTS && type == ","))
|
649 |
-
return cont(isTS ? typeexpr : expression, classNameAfter);
|
650 |
-
if (type == "{") return cont(pushlex("}"), classBody, poplex);
|
651 |
-
}
|
652 |
-
function classBody(type, value) {
|
653 |
-
if (type == "variable" || cx.style == "keyword") {
|
654 |
-
if ((value == "async" || value == "static" || value == "get" || value == "set" ||
|
655 |
-
(isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) &&
|
656 |
-
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) {
|
657 |
-
cx.marked = "keyword";
|
658 |
-
return cont(classBody);
|
659 |
-
}
|
660 |
-
cx.marked = "property";
|
661 |
-
return cont(isTS ? classfield : functiondef, classBody);
|
662 |
-
}
|
663 |
-
if (type == "[")
|
664 |
-
return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
|
665 |
-
if (value == "*") {
|
666 |
-
cx.marked = "keyword";
|
667 |
-
return cont(classBody);
|
668 |
-
}
|
669 |
-
if (type == ";") return cont(classBody);
|
670 |
-
if (type == "}") return cont();
|
671 |
-
if (value == "@") return cont(expression, classBody)
|
672 |
-
}
|
673 |
-
function classfield(type, value) {
|
674 |
-
if (value == "?") return cont(classfield)
|
675 |
-
if (type == ":") return cont(typeexpr, maybeAssign)
|
676 |
-
if (value == "=") return cont(expressionNoComma)
|
677 |
-
return pass(functiondef)
|
678 |
-
}
|
679 |
-
function afterExport(type, value) {
|
680 |
-
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
|
681 |
-
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
|
682 |
-
if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
|
683 |
-
return pass(statement);
|
684 |
-
}
|
685 |
-
function exportField(type, value) {
|
686 |
-
if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
|
687 |
-
if (type == "variable") return pass(expressionNoComma, exportField);
|
688 |
-
}
|
689 |
-
function afterImport(type) {
|
690 |
-
if (type == "string") return cont();
|
691 |
-
return pass(importSpec, maybeMoreImports, maybeFrom);
|
692 |
-
}
|
693 |
-
function importSpec(type, value) {
|
694 |
-
if (type == "{") return contCommasep(importSpec, "}");
|
695 |
-
if (type == "variable") register(value);
|
696 |
-
if (value == "*") cx.marked = "keyword";
|
697 |
-
return cont(maybeAs);
|
698 |
-
}
|
699 |
-
function maybeMoreImports(type) {
|
700 |
-
if (type == ",") return cont(importSpec, maybeMoreImports)
|
701 |
-
}
|
702 |
-
function maybeAs(_type, value) {
|
703 |
-
if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
|
704 |
-
}
|
705 |
-
function maybeFrom(_type, value) {
|
706 |
-
if (value == "from") { cx.marked = "keyword"; return cont(expression); }
|
707 |
-
}
|
708 |
-
function arrayLiteral(type) {
|
709 |
-
if (type == "]") return cont();
|
710 |
-
return pass(commasep(expressionNoComma, "]"));
|
711 |
-
}
|
712 |
-
|
713 |
-
function isContinuedStatement(state, textAfter) {
|
714 |
-
return state.lastType == "operator" || state.lastType == "," ||
|
715 |
-
isOperatorChar.test(textAfter.charAt(0)) ||
|
716 |
-
/[,.]/.test(textAfter.charAt(0));
|
717 |
-
}
|
718 |
-
|
719 |
-
// Interface
|
720 |
-
|
721 |
-
return {
|
722 |
-
startState: function(basecolumn) {
|
723 |
-
var state = {
|
724 |
-
tokenize: tokenBase,
|
725 |
-
lastType: "sof",
|
726 |
-
cc: [],
|
727 |
-
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
728 |
-
localVars: parserConfig.localVars,
|
729 |
-
context: parserConfig.localVars && {vars: parserConfig.localVars},
|
730 |
-
indented: basecolumn || 0
|
731 |
-
};
|
732 |
-
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
|
733 |
-
state.globalVars = parserConfig.globalVars;
|
734 |
-
return state;
|
735 |
-
},
|
736 |
-
|
737 |
-
token: function(stream, state) {
|
738 |
-
if (stream.sol()) {
|
739 |
-
if (!state.lexical.hasOwnProperty("align"))
|
740 |
-
state.lexical.align = false;
|
741 |
-
state.indented = stream.indentation();
|
742 |
-
findFatArrow(stream, state);
|
743 |
-
}
|
744 |
-
if (state.tokenize != tokenComment && stream.eatSpace()) return null;
|
745 |
-
var style = state.tokenize(stream, state);
|
746 |
-
if (type == "comment") return style;
|
747 |
-
state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
|
748 |
-
return parseJS(state, style, type, content, stream);
|
749 |
-
},
|
750 |
-
|
751 |
-
indent: function(state, textAfter) {
|
752 |
-
if (state.tokenize == tokenComment) return CodeMirror.Pass;
|
753 |
-
if (state.tokenize != tokenBase) return 0;
|
754 |
-
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
|
755 |
-
// Kludge to prevent 'maybelse' from blocking lexical scope pops
|
756 |
-
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
|
757 |
-
var c = state.cc[i];
|
758 |
-
if (c == poplex) lexical = lexical.prev;
|
759 |
-
else if (c != maybeelse) break;
|
760 |
-
}
|
761 |
-
while ((lexical.type == "stat" || lexical.type == "form") &&
|
762 |
-
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
|
763 |
-
(top == maybeoperatorComma || top == maybeoperatorNoComma) &&
|
764 |
-
!/^[,\.=+\-*:?[\(]/.test(textAfter))))
|
765 |
-
lexical = lexical.prev;
|
766 |
-
if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
|
767 |
-
lexical = lexical.prev;
|
768 |
-
var type = lexical.type, closing = firstChar == type;
|
769 |
-
|
770 |
-
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);
|
771 |
-
else if (type == "form" && firstChar == "{") return lexical.indented;
|
772 |
-
else if (type == "form") return lexical.indented + indentUnit;
|
773 |
-
else if (type == "stat")
|
774 |
-
return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
|
775 |
-
else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
|
776 |
-
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
|
777 |
-
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
778 |
-
else return lexical.indented + (closing ? 0 : indentUnit);
|
779 |
-
},
|
780 |
-
|
781 |
-
electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
|
782 |
-
blockCommentStart: jsonMode ? null : "/*",
|
783 |
-
blockCommentEnd: jsonMode ? null : "*/",
|
784 |
-
lineComment: jsonMode ? null : "//",
|
785 |
-
fold: "brace",
|
786 |
-
closeBrackets: "()[]{}''\"\"``",
|
787 |
-
|
788 |
-
helperType: jsonMode ? "json" : "javascript",
|
789 |
-
jsonldMode: jsonldMode,
|
790 |
-
jsonMode: jsonMode,
|
791 |
-
|
792 |
-
expressionAllowed: expressionAllowed,
|
793 |
-
skipExpression: function(state) {
|
794 |
-
var top = state.cc[state.cc.length - 1]
|
795 |
-
if (top == expression || top == expressionNoComma) state.cc.pop()
|
796 |
-
}
|
797 |
-
};
|
798 |
-
});
|
799 |
-
|
800 |
-
CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
|
801 |
-
|
802 |
-
CodeMirror.defineMIME("text/javascript", "javascript");
|
803 |
-
CodeMirror.defineMIME("text/ecmascript", "javascript");
|
804 |
-
CodeMirror.defineMIME("application/javascript", "javascript");
|
805 |
-
CodeMirror.defineMIME("application/x-javascript", "javascript");
|
806 |
-
CodeMirror.defineMIME("application/ecmascript", "javascript");
|
807 |
-
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
808 |
-
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
|
809 |
-
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
|
810 |
-
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
|
811 |
-
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
|
812 |
-
|
813 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/codemirror/xml.js
DELETED
@@ -1,394 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
var htmlConfig = {
|
15 |
-
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
16 |
-
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
17 |
-
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
18 |
-
'track': true, 'wbr': true, 'menuitem': true},
|
19 |
-
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
20 |
-
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
21 |
-
'th': true, 'tr': true},
|
22 |
-
contextGrabbers: {
|
23 |
-
'dd': {'dd': true, 'dt': true},
|
24 |
-
'dt': {'dd': true, 'dt': true},
|
25 |
-
'li': {'li': true},
|
26 |
-
'option': {'option': true, 'optgroup': true},
|
27 |
-
'optgroup': {'optgroup': true},
|
28 |
-
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
29 |
-
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
30 |
-
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
31 |
-
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
32 |
-
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
33 |
-
'rp': {'rp': true, 'rt': true},
|
34 |
-
'rt': {'rp': true, 'rt': true},
|
35 |
-
'tbody': {'tbody': true, 'tfoot': true},
|
36 |
-
'td': {'td': true, 'th': true},
|
37 |
-
'tfoot': {'tbody': true},
|
38 |
-
'th': {'td': true, 'th': true},
|
39 |
-
'thead': {'tbody': true, 'tfoot': true},
|
40 |
-
'tr': {'tr': true}
|
41 |
-
},
|
42 |
-
doNotIndent: {"pre": true},
|
43 |
-
allowUnquoted: true,
|
44 |
-
allowMissing: true,
|
45 |
-
caseFold: true
|
46 |
-
}
|
47 |
-
|
48 |
-
var xmlConfig = {
|
49 |
-
autoSelfClosers: {},
|
50 |
-
implicitlyClosed: {},
|
51 |
-
contextGrabbers: {},
|
52 |
-
doNotIndent: {},
|
53 |
-
allowUnquoted: false,
|
54 |
-
allowMissing: false,
|
55 |
-
caseFold: false
|
56 |
-
}
|
57 |
-
|
58 |
-
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
59 |
-
var indentUnit = editorConf.indentUnit
|
60 |
-
var config = {}
|
61 |
-
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
62 |
-
for (var prop in defaults) config[prop] = defaults[prop]
|
63 |
-
for (var prop in config_) config[prop] = config_[prop]
|
64 |
-
|
65 |
-
// Return variables for tokenizers
|
66 |
-
var type, setStyle;
|
67 |
-
|
68 |
-
function inText(stream, state) {
|
69 |
-
function chain(parser) {
|
70 |
-
state.tokenize = parser;
|
71 |
-
return parser(stream, state);
|
72 |
-
}
|
73 |
-
|
74 |
-
var ch = stream.next();
|
75 |
-
if (ch == "<") {
|
76 |
-
if (stream.eat("!")) {
|
77 |
-
if (stream.eat("[")) {
|
78 |
-
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
79 |
-
else return null;
|
80 |
-
} else if (stream.match("--")) {
|
81 |
-
return chain(inBlock("comment", "-->"));
|
82 |
-
} else if (stream.match("DOCTYPE", true, true)) {
|
83 |
-
stream.eatWhile(/[\w\._\-]/);
|
84 |
-
return chain(doctype(1));
|
85 |
-
} else {
|
86 |
-
return null;
|
87 |
-
}
|
88 |
-
} else if (stream.eat("?")) {
|
89 |
-
stream.eatWhile(/[\w\._\-]/);
|
90 |
-
state.tokenize = inBlock("meta", "?>");
|
91 |
-
return "meta";
|
92 |
-
} else {
|
93 |
-
type = stream.eat("/") ? "closeTag" : "openTag";
|
94 |
-
state.tokenize = inTag;
|
95 |
-
return "tag bracket";
|
96 |
-
}
|
97 |
-
} else if (ch == "&") {
|
98 |
-
var ok;
|
99 |
-
if (stream.eat("#")) {
|
100 |
-
if (stream.eat("x")) {
|
101 |
-
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
102 |
-
} else {
|
103 |
-
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
104 |
-
}
|
105 |
-
} else {
|
106 |
-
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
107 |
-
}
|
108 |
-
return ok ? "atom" : "error";
|
109 |
-
} else {
|
110 |
-
stream.eatWhile(/[^&<]/);
|
111 |
-
return null;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
inText.isInText = true;
|
115 |
-
|
116 |
-
function inTag(stream, state) {
|
117 |
-
var ch = stream.next();
|
118 |
-
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
119 |
-
state.tokenize = inText;
|
120 |
-
type = ch == ">" ? "endTag" : "selfcloseTag";
|
121 |
-
return "tag bracket";
|
122 |
-
} else if (ch == "=") {
|
123 |
-
type = "equals";
|
124 |
-
return null;
|
125 |
-
} else if (ch == "<") {
|
126 |
-
state.tokenize = inText;
|
127 |
-
state.state = baseState;
|
128 |
-
state.tagName = state.tagStart = null;
|
129 |
-
var next = state.tokenize(stream, state);
|
130 |
-
return next ? next + " tag error" : "tag error";
|
131 |
-
} else if (/[\'\"]/.test(ch)) {
|
132 |
-
state.tokenize = inAttribute(ch);
|
133 |
-
state.stringStartCol = stream.column();
|
134 |
-
return state.tokenize(stream, state);
|
135 |
-
} else {
|
136 |
-
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
137 |
-
return "word";
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
function inAttribute(quote) {
|
142 |
-
var closure = function(stream, state) {
|
143 |
-
while (!stream.eol()) {
|
144 |
-
if (stream.next() == quote) {
|
145 |
-
state.tokenize = inTag;
|
146 |
-
break;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
return "string";
|
150 |
-
};
|
151 |
-
closure.isInAttribute = true;
|
152 |
-
return closure;
|
153 |
-
}
|
154 |
-
|
155 |
-
function inBlock(style, terminator) {
|
156 |
-
return function(stream, state) {
|
157 |
-
while (!stream.eol()) {
|
158 |
-
if (stream.match(terminator)) {
|
159 |
-
state.tokenize = inText;
|
160 |
-
break;
|
161 |
-
}
|
162 |
-
stream.next();
|
163 |
-
}
|
164 |
-
return style;
|
165 |
-
};
|
166 |
-
}
|
167 |
-
function doctype(depth) {
|
168 |
-
return function(stream, state) {
|
169 |
-
var ch;
|
170 |
-
while ((ch = stream.next()) != null) {
|
171 |
-
if (ch == "<") {
|
172 |
-
state.tokenize = doctype(depth + 1);
|
173 |
-
return state.tokenize(stream, state);
|
174 |
-
} else if (ch == ">") {
|
175 |
-
if (depth == 1) {
|
176 |
-
state.tokenize = inText;
|
177 |
-
break;
|
178 |
-
} else {
|
179 |
-
state.tokenize = doctype(depth - 1);
|
180 |
-
return state.tokenize(stream, state);
|
181 |
-
}
|
182 |
-
}
|
183 |
-
}
|
184 |
-
return "meta";
|
185 |
-
};
|
186 |
-
}
|
187 |
-
|
188 |
-
function Context(state, tagName, startOfLine) {
|
189 |
-
this.prev = state.context;
|
190 |
-
this.tagName = tagName;
|
191 |
-
this.indent = state.indented;
|
192 |
-
this.startOfLine = startOfLine;
|
193 |
-
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
194 |
-
this.noIndent = true;
|
195 |
-
}
|
196 |
-
function popContext(state) {
|
197 |
-
if (state.context) state.context = state.context.prev;
|
198 |
-
}
|
199 |
-
function maybePopContext(state, nextTagName) {
|
200 |
-
var parentTagName;
|
201 |
-
while (true) {
|
202 |
-
if (!state.context) {
|
203 |
-
return;
|
204 |
-
}
|
205 |
-
parentTagName = state.context.tagName;
|
206 |
-
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
207 |
-
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
208 |
-
return;
|
209 |
-
}
|
210 |
-
popContext(state);
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
function baseState(type, stream, state) {
|
215 |
-
if (type == "openTag") {
|
216 |
-
state.tagStart = stream.column();
|
217 |
-
return tagNameState;
|
218 |
-
} else if (type == "closeTag") {
|
219 |
-
return closeTagNameState;
|
220 |
-
} else {
|
221 |
-
return baseState;
|
222 |
-
}
|
223 |
-
}
|
224 |
-
function tagNameState(type, stream, state) {
|
225 |
-
if (type == "word") {
|
226 |
-
state.tagName = stream.current();
|
227 |
-
setStyle = "tag";
|
228 |
-
return attrState;
|
229 |
-
} else {
|
230 |
-
setStyle = "error";
|
231 |
-
return tagNameState;
|
232 |
-
}
|
233 |
-
}
|
234 |
-
function closeTagNameState(type, stream, state) {
|
235 |
-
if (type == "word") {
|
236 |
-
var tagName = stream.current();
|
237 |
-
if (state.context && state.context.tagName != tagName &&
|
238 |
-
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
239 |
-
popContext(state);
|
240 |
-
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
241 |
-
setStyle = "tag";
|
242 |
-
return closeState;
|
243 |
-
} else {
|
244 |
-
setStyle = "tag error";
|
245 |
-
return closeStateErr;
|
246 |
-
}
|
247 |
-
} else {
|
248 |
-
setStyle = "error";
|
249 |
-
return closeStateErr;
|
250 |
-
}
|
251 |
-
}
|
252 |
-
|
253 |
-
function closeState(type, _stream, state) {
|
254 |
-
if (type != "endTag") {
|
255 |
-
setStyle = "error";
|
256 |
-
return closeState;
|
257 |
-
}
|
258 |
-
popContext(state);
|
259 |
-
return baseState;
|
260 |
-
}
|
261 |
-
function closeStateErr(type, stream, state) {
|
262 |
-
setStyle = "error";
|
263 |
-
return closeState(type, stream, state);
|
264 |
-
}
|
265 |
-
|
266 |
-
function attrState(type, _stream, state) {
|
267 |
-
if (type == "word") {
|
268 |
-
setStyle = "attribute";
|
269 |
-
return attrEqState;
|
270 |
-
} else if (type == "endTag" || type == "selfcloseTag") {
|
271 |
-
var tagName = state.tagName, tagStart = state.tagStart;
|
272 |
-
state.tagName = state.tagStart = null;
|
273 |
-
if (type == "selfcloseTag" ||
|
274 |
-
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
275 |
-
maybePopContext(state, tagName);
|
276 |
-
} else {
|
277 |
-
maybePopContext(state, tagName);
|
278 |
-
state.context = new Context(state, tagName, tagStart == state.indented);
|
279 |
-
}
|
280 |
-
return baseState;
|
281 |
-
}
|
282 |
-
setStyle = "error";
|
283 |
-
return attrState;
|
284 |
-
}
|
285 |
-
function attrEqState(type, stream, state) {
|
286 |
-
if (type == "equals") return attrValueState;
|
287 |
-
if (!config.allowMissing) setStyle = "error";
|
288 |
-
return attrState(type, stream, state);
|
289 |
-
}
|
290 |
-
function attrValueState(type, stream, state) {
|
291 |
-
if (type == "string") return attrContinuedState;
|
292 |
-
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
293 |
-
setStyle = "error";
|
294 |
-
return attrState(type, stream, state);
|
295 |
-
}
|
296 |
-
function attrContinuedState(type, stream, state) {
|
297 |
-
if (type == "string") return attrContinuedState;
|
298 |
-
return attrState(type, stream, state);
|
299 |
-
}
|
300 |
-
|
301 |
-
return {
|
302 |
-
startState: function(baseIndent) {
|
303 |
-
var state = {tokenize: inText,
|
304 |
-
state: baseState,
|
305 |
-
indented: baseIndent || 0,
|
306 |
-
tagName: null, tagStart: null,
|
307 |
-
context: null}
|
308 |
-
if (baseIndent != null) state.baseIndent = baseIndent
|
309 |
-
return state
|
310 |
-
},
|
311 |
-
|
312 |
-
token: function(stream, state) {
|
313 |
-
if (!state.tagName && stream.sol())
|
314 |
-
state.indented = stream.indentation();
|
315 |
-
|
316 |
-
if (stream.eatSpace()) return null;
|
317 |
-
type = null;
|
318 |
-
var style = state.tokenize(stream, state);
|
319 |
-
if ((style || type) && style != "comment") {
|
320 |
-
setStyle = null;
|
321 |
-
state.state = state.state(type || style, stream, state);
|
322 |
-
if (setStyle)
|
323 |
-
style = setStyle == "error" ? style + " error" : setStyle;
|
324 |
-
}
|
325 |
-
return style;
|
326 |
-
},
|
327 |
-
|
328 |
-
indent: function(state, textAfter, fullLine) {
|
329 |
-
var context = state.context;
|
330 |
-
// Indent multi-line strings (e.g. css).
|
331 |
-
if (state.tokenize.isInAttribute) {
|
332 |
-
if (state.tagStart == state.indented)
|
333 |
-
return state.stringStartCol + 1;
|
334 |
-
else
|
335 |
-
return state.indented + indentUnit;
|
336 |
-
}
|
337 |
-
if (context && context.noIndent) return CodeMirror.Pass;
|
338 |
-
if (state.tokenize != inTag && state.tokenize != inText)
|
339 |
-
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
340 |
-
// Indent the starts of attribute names.
|
341 |
-
if (state.tagName) {
|
342 |
-
if (config.multilineTagIndentPastTag !== false)
|
343 |
-
return state.tagStart + state.tagName.length + 2;
|
344 |
-
else
|
345 |
-
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
346 |
-
}
|
347 |
-
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
348 |
-
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
349 |
-
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
350 |
-
while (context) {
|
351 |
-
if (context.tagName == tagAfter[2]) {
|
352 |
-
context = context.prev;
|
353 |
-
break;
|
354 |
-
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
355 |
-
context = context.prev;
|
356 |
-
} else {
|
357 |
-
break;
|
358 |
-
}
|
359 |
-
}
|
360 |
-
} else if (tagAfter) { // Opening tag spotted
|
361 |
-
while (context) {
|
362 |
-
var grabbers = config.contextGrabbers[context.tagName];
|
363 |
-
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
364 |
-
context = context.prev;
|
365 |
-
else
|
366 |
-
break;
|
367 |
-
}
|
368 |
-
}
|
369 |
-
while (context && context.prev && !context.startOfLine)
|
370 |
-
context = context.prev;
|
371 |
-
if (context) return context.indent + indentUnit;
|
372 |
-
else return state.baseIndent || 0;
|
373 |
-
},
|
374 |
-
|
375 |
-
electricInput: /<\/[\s\w:]+>$/,
|
376 |
-
blockCommentStart: "<!--",
|
377 |
-
blockCommentEnd: "-->",
|
378 |
-
|
379 |
-
configuration: config.htmlMode ? "html" : "xml",
|
380 |
-
helperType: config.htmlMode ? "html" : "xml",
|
381 |
-
|
382 |
-
skipAttribute: function(state) {
|
383 |
-
if (state.state == attrValueState)
|
384 |
-
state.state = attrState
|
385 |
-
}
|
386 |
-
};
|
387 |
-
});
|
388 |
-
|
389 |
-
CodeMirror.defineMIME("text/xml", "xml");
|
390 |
-
CodeMirror.defineMIME("application/xml", "xml");
|
391 |
-
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
392 |
-
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
393 |
-
|
394 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/jquery-ui/images/ui-icons_444444_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/images/ui-icons_555555_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/images/ui-icons_777620_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/images/ui-icons_777777_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/images/ui-icons_cc0000_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/images/ui-icons_ffffff_256x240.png
DELETED
Binary file
|
includes/js/jquery-ui/jquery-ui.min.css
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
/*! jQuery UI - v1.12.1 - 2016-09-14
|
2 |
-
* http://jqueryui.com
|
3 |
-
* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
-
* To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
|
5 |
-
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
6 |
-
|
7 |
-
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.003;filter:Alpha(Opacity=.3)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/jquery-ui/jquery-ui.min.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
/*! jQuery UI - v1.12.1 - 2016-09-14
|
2 |
-
* http://jqueryui.com
|
3 |
-
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
|
4 |
-
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
5 |
-
|
6 |
-
(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)
|
7 |
-
}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;
|
8 |
-
this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))
|
9 |
-
}},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:func
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|