MailChimp for WordPress - Version 4.0.13

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 MailChimp for WordPress
Version 4.0.13
Comparing to
See all releases

Code changes from version 4.0.12 to 4.0.13

CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
 
 
 
 
 
4
  #### 4.0.12 - January 16, 2017
5
 
6
  **Fixes**
1
  Changelog
2
  =========
3
 
4
+ #### 4.0.13 - February 8, 2017
5
+
6
+ **Improvements**
7
+
8
+ - Ensure fields are HTML decoded before sending to MailChimp.
9
+ - Better OptimizePress compatibility.
10
+ - Show all address-type fields as required when form contains 1 or more fields of the same address group.
11
+
12
+
13
  #### 4.0.12 - January 16, 2017
14
 
15
  **Fixes**
assets/js/forms-admin.js CHANGED
@@ -591,196 +591,196 @@ var FieldHelper = function(m, tabs, editor, fields, events, i18n) {
591
  module.exports = FieldHelper;
592
  },{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(require,module,exports){
593
  var FieldFactory = function(fields, i18n) {
594
- 'use strict';
595
-
596
- /**
597
- * Array of registered fields
598
- *
599
- * @type {Array}
600
- */
601
- var registeredFields = [];
602
-
603
- /**
604
- * Reset all previously registered fields
605
- */
606
- function reset() {
607
- // clear all of our fields
608
- registeredFields.forEach(fields.deregister);
609
- }
610
-
611
- /**
612
- * Helper function to quickly register a field and store it in local scope
613
- *
614
- * @param {object} data
615
- * @param {boolean} sticky
616
- */
617
- function register(category, data, sticky) {
618
- var field = fields.register(category, data);
619
-
620
- if( ! sticky ) {
621
- registeredFields.push(field);
622
- }
623
- }
624
-
625
- /**
626
- * Normalizes the field type which is passed by MailChimp
627
- *
628
- * @param type
629
- * @returns {*}
630
- */
631
- function getFieldType(type) {
632
 
633
- var map = {
634
- 'phone' : 'tel',
635
- 'dropdown': 'select',
636
- 'checkboxes': 'checkbox',
637
- 'birthday': 'text'
638
- };
 
639
 
640
- return typeof map[ type ] !== "undefined" ? map[type] : type;
641
- }
 
 
 
 
642
 
643
- /**
644
- * Register the various fields for a merge var
645
- *
646
- * @param mergeField
647
- * @returns {boolean}
648
- */
649
- function registerMergeField(mergeField) {
650
-
651
- var category = i18n.listFields;
652
- var fieldType = getFieldType(mergeField.field_type);
653
-
654
- // name, type, title, value, required, label, placeholder, choices, wrap
655
- var data = {
656
- name: mergeField.tag,
657
- title: mergeField.name,
658
- required: mergeField.required,
659
- forceRequired: mergeField.required,
660
- type: fieldType,
661
- choices: mergeField.choices,
662
- acceptsMultipleValues: false // merge fields never accept multiple values.
663
- };
 
 
 
664
 
665
- if( data.type !== 'address' ) {
666
- register(category, data, false);
667
- } else {
668
- register(category, { name: data.name + '[addr1]', type: 'text', title: i18n.streetAddress });
669
- register(category, { name: data.name + '[city]', type: 'text', title: i18n.city });
670
- register(category, { name: data.name + '[state]', type: 'text', title: i18n.state });
671
- register(category, { name: data.name + '[zip]', type: 'text', title: i18n.zip });
672
- register(category, { name: data.name + '[country]', type: 'select', title: i18n.country, choices: mc4wp_vars.countries });
673
- }
674
 
675
- return true;
676
- }
677
 
678
- /**
679
- * Register a field for a MailChimp grouping
680
- *
681
- * @param interestCategory
682
- */
683
- function registerInterestCategory(interestCategory){
684
- var category = i18n.interestCategories;
685
- var fieldType = getFieldType(interestCategory.field_type);
686
-
687
- var data = {
688
- title: interestCategory.name,
689
- name: 'INTERESTS[' + interestCategory.id + ']',
690
- type: fieldType,
691
- choices: interestCategory.interests,
692
- acceptsMultipleValues: fieldType === 'checkbox'
693
- };
694
- register(category, data, false);
695
- }
696
 
697
- /**
698
- * Register all fields belonging to a list
699
- *
700
- * @param list
701
- */
702
- function registerListFields(list) {
 
 
 
703
 
704
- // make sure EMAIL && public fields come first
705
- list.merge_fields = list.merge_fields.sort(function(a, b) {
706
- if( a.tag === 'EMAIL' || ( a.public && ! b.public ) ) {
707
- return -1;
708
- }
 
709
 
710
- if( ! a.public && b.public ) {
711
- return 1;
712
- }
 
 
713
 
714
- return 0;
715
- });
 
716
 
717
- // loop through merge vars
718
- list.merge_fields.forEach(registerMergeField);
719
 
720
- // loop through groupings
721
- list.interest_categories.forEach(registerInterestCategory);
722
- }
723
 
724
- /**
725
- * Register all lists fields
726
- *
727
- * @param lists
728
- */
729
- function registerListsFields(lists) {
730
- reset();
731
- lists.forEach(registerListFields);
732
- }
733
 
734
- function registerCustomFields(lists) {
 
 
 
 
 
 
 
 
735
 
736
- var choices,
737
- category = i18n.formFields;
738
 
739
- // register submit button
740
- register(category, {
741
- name: '',
742
- value: i18n.subscribe,
743
- type: "submit",
744
- title: i18n.submitButton
745
- }, true);
746
 
747
- // register lists choice field
748
- choices = {};
749
- for(var key in lists) {
750
- choices[lists[key].id] = lists[key].name;
751
- }
 
 
752
 
753
- register(category, {
754
- name: '_mc4wp_lists',
755
- type: 'checkbox',
756
- title: i18n.listChoice,
757
- choices: choices,
758
- help: i18n.listChoiceDescription,
759
- acceptsMultipleValues: true
760
- }, true);
761
-
762
- choices = {
763
- 'subscribe': "Subscribe",
764
- 'unsubscribe': "Unsubscribe"
765
- };
766
- register(category, {
767
- name: '_mc4wp_action',
768
- type: 'radio',
769
- title: i18n.formAction,
770
- choices: choices,
771
- value: 'subscribe',
772
- help: i18n.formActionDescription
773
- }, true);
774
- }
775
 
776
- /**
777
- * Expose some methods
778
- */
779
- return {
780
- 'registerCustomFields': registerCustomFields,
781
- 'registerListFields': registerListFields,
782
- 'registerListsFields': registerListsFields
783
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
 
785
  };
786
 
@@ -790,217 +790,218 @@ module.exports = FieldFactory;
790
 
791
  module.exports = function(m, events) {
792
  var timeout;
793
- var fields = [];
794
- var categories = [];
795
-
796
-
797
- /**
798
- * @internal
799
- *
800
- *
801
- * @param data
802
- * @constructor
803
- */
804
- var Field = function (data) {
805
- this.name = m.prop(data.name);
806
- this.title = m.prop(data.title || data.name);
807
- this.type = m.prop(data.type);
808
- this.label = m.prop(data.title || '');
809
- this.value = m.prop(data.value || '');
810
- this.placeholder = m.prop(data.placeholder || '');
811
- this.required = m.prop(data.required || false);
812
- this.forceRequired = m.prop( data.forceRequired || false );
813
- this.wrap = m.prop(data.wrap || true);
814
- this.min = m.prop(data.min || null);
815
- this.max = m.prop(data.max || null);
816
- this.help = m.prop(data.help || '');
817
- this.choices = m.prop(data.choices || []);
818
- this.inFormContent = m.prop(null);
819
- this.acceptsMultipleValues = data.acceptsMultipleValues;
820
-
821
- this.selectChoice = function(value) {
822
- var field = this;
823
-
824
- this.choices(this.choices().map(function(choice) {
825
-
826
- if( choice.value() === value ) {
827
- choice.selected(true);
828
- } else {
829
- // only checkboxes allow for multiple selections
830
- if( field.type() !== 'checkbox' ) {
831
- choice.selected(false);
832
- }
833
- }
 
834
 
835
- return choice;
836
 
837
- }));
838
- };
839
- };
840
 
841
- /**
842
- * @internal
843
- *
844
- * @param data
845
- * @constructor
846
- */
847
- var FieldChoice = function (data) {
848
- this.label = m.prop(data.label);
849
- this.title = m.prop(data.title || data.label);
850
- this.selected = m.prop(data.selected || false);
851
- this.value = m.prop(data.value || data.label);
852
- };
853
 
854
- /**
855
- * Creates FieldChoice objects from an (associative) array of data objects
856
- *
857
- * @param data
858
- * @returns {Array}
859
- */
860
- function createChoices(data) {
861
- var choices = [];
862
- if (typeof( data.map ) === "function") {
863
- choices = data.map(function (choiceLabel) {
864
- return new FieldChoice({label: choiceLabel});
865
- });
866
- } else {
867
- choices = Object.keys(data).map(function (key) {
868
- var choiceLabel = data[key];
869
- return new FieldChoice({label: choiceLabel, value: key});
870
- });
871
- }
872
 
873
- return choices;
874
- }
875
 
876
- /**
877
- * Factory method
878
- *
879
- * @api
880
- *
881
- * @param data
882
- * @returns {Field}
883
- */
884
- function register(category, data) {
885
 
886
- var field;
887
- var existingField = getAllWhere('name', data.name).shift();
888
 
889
- // a field with the same "name" already exists
890
- if(existingField) {
891
 
892
- // update "required" status
893
- if( ! existingField.required() && data.required ) {
894
- existingField.required(true);
895
- }
896
 
897
- // bail
898
- return undefined;
899
- }
900
 
901
- // array of choices given? convert to FieldChoice objects
902
- if (data.choices) {
903
- data.choices = createChoices(data.choices);
904
 
905
- if( data.value) {
906
- data.choices = data.choices.map(function(choice) {
907
- if(choice.value() === data.value) {
908
- choice.selected(true);
909
- }
910
- return choice;
911
- });
912
- }
913
- }
914
 
915
- // register category
916
- if( categories.indexOf(category) < 0 ) {
917
- categories.push(category);
918
- }
919
 
920
- // create Field object
921
- field = new Field(data);
922
- field.category = category;
923
 
924
- // add to array
925
- fields.push(field);
926
 
927
- // redraw view
928
  timeout && window.clearTimeout(timeout);
929
- timeout = window.setTimeout(m.redraw, 100);
930
 
931
- // trigger event
932
- events.trigger('fields.change');
933
-
934
- return field;
935
- }
936
 
937
- /**
938
- * @api
939
- *
940
- * @param field
941
- */
942
- function deregister(field) {
943
- var index = fields.indexOf(field);
944
- if (index > -1) {
945
- delete fields[index];
946
- m.redraw();
947
- }
948
- }
949
 
950
- /**
951
- * Get a field config object
952
- *
953
- * @param name
954
- * @returns {*}
955
- */
956
- function get(name) {
957
- return fields[name];
958
- }
 
 
 
959
 
960
- /**
961
- * Get all field config objects
962
- *
963
- * @returns {Array|*}
964
- */
965
- function getAll() {
966
- // rebuild index property on all fields
967
- fields = fields.map(function(f, i) {
968
- f.index = i;
969
- return f;
970
- });
 
 
 
 
 
 
 
 
 
 
971
 
972
- return fields;
973
- }
974
 
975
- function getCategories() {
976
- return categories;
977
- }
978
 
979
- /**
980
- * Get all fields where a property matches the given value
981
- *
982
- * @param searchKey
983
- * @param searchValue
984
- * @returns {Array|*}
985
- */
986
- function getAllWhere(searchKey, searchValue) {
987
- return fields.filter(function (field) {
988
- return field[searchKey]() === searchValue;
989
- });
990
- }
991
 
992
 
993
- /**
994
- * Exposed methods
995
- */
996
- return {
997
- 'get' : get,
998
- 'getAll' : getAll,
999
- 'getCategories': getCategories,
1000
- 'deregister' : deregister,
1001
- 'register' : register,
1002
- 'getAllWhere': getAllWhere
1003
- };
1004
  };
1005
  },{}],7:[function(require,module,exports){
1006
  'use strict';
@@ -1017,146 +1018,163 @@ require('codemirror/addon/edit/closetag.js');
1017
 
1018
  var FormEditor = function(element) {
1019
 
1020
- // create dom representation of form
1021
- var _dom = document.createElement('form'),
1022
- domDirty = false,
1023
- r = {},
1024
- editor;
1025
-
1026
- _dom.innerHTML = element.value.toLowerCase();
1027
-
1028
- if( CodeMirror ) {
1029
- editor = CodeMirror.fromTextArea(element, {
1030
- selectionPointer: true,
1031
- matchTags: { bothTags: true },
1032
- mode: "htmlmixed",
1033
- htmlMode: true,
1034
- autoCloseTags: true,
1035
- autoRefresh: true
1036
- });
1037
 
1038
- // dispatch regular "change" on element event every time editor changes (IE9+ only)
1039
- window.dispatchEvent && editor.on('change',function() {
1040
- if(typeof(Event) === "function") {
1041
- // Create a new 'change' event
1042
- var event = new Event('change', { bubbles: true });
1043
- element.dispatchEvent(event);
1044
- }
1045
- });
1046
- }
1047
 
1048
- window.addEventListener('load', function() {
1049
- CodeMirror.signal(editor, "change");
1050
- });
1051
 
1052
- // set domDirty to true everytime the "change" event fires (a lot..)
1053
- element.addEventListener('change',function() {
1054
- domDirty = true;
1055
- });
1056
 
1057
- function dom() {
1058
- if( domDirty ) {
1059
- _dom.innerHTML = r.getValue().toLowerCase();
1060
- domDirty = false;
1061
- }
1062
 
1063
- return _dom;
1064
- }
1065
 
1066
- r.getValue = function() {
1067
- return editor ? editor.getValue() : element.value;
1068
- };
1069
 
1070
- r.query = function(query) {
1071
- return dom().querySelectorAll(query);
1072
- };
1073
 
1074
- r.containsField = function(fieldName){
1075
- return dom().elements.namedItem(fieldName.toLowerCase()) !== null;
1076
- };
1077
 
1078
- r.insert = function( html ) {
1079
- if( editor ) {
1080
- editor.replaceSelection( html );
1081
- editor.focus();
1082
- } else {
1083
- element.value += html;
1084
- }
1085
- };
1086
 
1087
- r.on = function(event,callback) {
1088
- if( editor ) {
1089
- // translate "input" event for CodeMirror
1090
- event = ( event === 'input' ) ? 'changes' : event;
1091
- return editor.on(event,callback);
1092
- }
1093
 
1094
- return element.addEventListener(event,callback);
1095
- };
1096
 
1097
- r.refresh = function() {
1098
- editor && editor.refresh();
1099
- };
1100
 
1101
- return r;
1102
  };
1103
 
1104
  module.exports = FormEditor;
1105
  },{"codemirror":17,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchtags":15,"codemirror/addon/fold/xml-fold":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(require,module,exports){
1106
  var FormWatcher = function(m, editor, settings, fields, events, helpers) {
1107
- 'use strict';
1108
 
1109
- var requiredFieldsInput = document.getElementById('required-fields');
1110
 
1111
- function updateFields() {
1112
- fields.getAll().forEach(function(field) {
1113
- // don't run for empty field names
1114
- if(field.name().length <= 0) return;
1115
 
1116
- var fieldName = field.name();
1117
- if( field.type() === 'checkbox' ) {
1118
- fieldName += '[]';
1119
- }
1120
 
1121
- var inForm = editor.containsField( fieldName );
1122
- field.inFormContent( inForm );
1123
- });
1124
 
1125
- findRequiredFields();
1126
- m.redraw();
1127
- }
 
 
 
 
 
 
 
 
 
 
 
 
1128
 
1129
- function findRequiredFields() {
1130
 
1131
- // query fields required by MailChimp
1132
- var requiredFields = fields.getAllWhere('forceRequired', true).map(function(f) { return f.name().toUpperCase(); });
 
1133
 
1134
- // query fields in form with [required] attribute
1135
- var requiredFieldElements = editor.query('[required]');
1136
- Array.prototype.forEach.call(requiredFieldElements, function(el) {
1137
- var name = el.name.toUpperCase();
1138
 
1139
- // bail if name attr starts with underscore
1140
- if( name[0] === '_' ) {
1141
- return;
1142
- }
1143
 
1144
- // replace array brackets with dot style notation
1145
- name = name.replace(/\[(\w+)\]/g, '.$1' );
 
 
1146
 
1147
- // only add field if it's not already in it
1148
- if( requiredFields.indexOf(name) === -1 ) {
1149
- requiredFields.push(name);
1150
- }
1151
- });
1152
 
1153
- // update meta
1154
- requiredFieldsInput.value = requiredFields.join(',');
1155
- }
 
 
 
 
 
 
 
 
 
1156
 
1157
- // events
1158
- editor.on('change', helpers.debounce(updateFields, 500));
1159
- events.on('fields.change', helpers.debounce(updateFields, 500));
1160
 
1161
  };
1162
 
591
  module.exports = FieldHelper;
592
  },{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(require,module,exports){
593
  var FieldFactory = function(fields, i18n) {
594
+ 'use strict';
595
+
596
+ /**
597
+ * Array of registered fields
598
+ *
599
+ * @type {Array}
600
+ */
601
+ var registeredFields = [];
602
+
603
+ /**
604
+ * Reset all previously registered fields
605
+ */
606
+ function reset() {
607
+ // clear all of our fields
608
+ registeredFields.forEach(fields.deregister);
609
+ }
610
+
611
+ /**
612
+ * Helper function to quickly register a field and store it in local scope
613
+ *
614
+ * @param {object} data
615
+ * @param {boolean} sticky
616
+ */
617
+ function register(category, data, sticky) {
618
+ var field = fields.register(category, data);
619
+
620
+ if( ! sticky ) {
621
+ registeredFields.push(field);
622
+ }
623
+ }
 
 
 
 
 
 
 
 
624
 
625
+ /**
626
+ * Normalizes the field type which is passed by MailChimp
627
+ *
628
+ * @param type
629
+ * @returns {*}
630
+ */
631
+ function getFieldType(type) {
632
 
633
+ var map = {
634
+ 'phone' : 'tel',
635
+ 'dropdown': 'select',
636
+ 'checkboxes': 'checkbox',
637
+ 'birthday': 'text'
638
+ };
639
 
640
+ return typeof map[ type ] !== "undefined" ? map[type] : type;
641
+ }
642
+
643
+ /**
644
+ * Register the various fields for a merge var
645
+ *
646
+ * @param mergeField
647
+ * @returns {boolean}
648
+ */
649
+ function registerMergeField(mergeField) {
650
+
651
+ var category = i18n.listFields;
652
+ var fieldType = getFieldType(mergeField.field_type);
653
+
654
+ // name, type, title, value, required, label, placeholder, choices, wrap
655
+ var data = {
656
+ name: mergeField.tag,
657
+ title: mergeField.name,
658
+ required: mergeField.required,
659
+ forceRequired: mergeField.required,
660
+ type: fieldType,
661
+ choices: mergeField.choices,
662
+ acceptsMultipleValues: false // merge fields never accept multiple values.
663
+ };
664
 
665
+ if( data.type !== 'address' ) {
666
+ register(category, data, false);
667
+ } else {
668
+ register(category, { name: data.name + '[addr1]', type: 'text', mailchimpType: 'address', title: i18n.streetAddress });
669
+ register(category, { name: data.name + '[city]', type: 'text', mailchimpType: 'address', title: i18n.city });
670
+ register(category, { name: data.name + '[state]', type: 'text', mailchimpType: 'address', title: i18n.state });
671
+ register(category, { name: data.name + '[zip]', type: 'text', mailchimpType: 'address', title: i18n.zip });
672
+ register(category, { name: data.name + '[country]', type: 'select', mailchimpType: 'address', title: i18n.country, choices: mc4wp_vars.countries });
673
+ }
674
 
675
+ return true;
676
+ }
677
 
678
+ /**
679
+ * Register a field for a MailChimp grouping
680
+ *
681
+ * @param interestCategory
682
+ */
683
+ function registerInterestCategory(interestCategory){
684
+ var category = i18n.interestCategories;
685
+ var fieldType = getFieldType(interestCategory.field_type);
 
 
 
 
 
 
 
 
 
 
686
 
687
+ var data = {
688
+ title: interestCategory.name,
689
+ name: 'INTERESTS[' + interestCategory.id + ']',
690
+ type: fieldType,
691
+ choices: interestCategory.interests,
692
+ acceptsMultipleValues: fieldType === 'checkbox'
693
+ };
694
+ register(category, data, false);
695
+ }
696
 
697
+ /**
698
+ * Register all fields belonging to a list
699
+ *
700
+ * @param list
701
+ */
702
+ function registerListFields(list) {
703
 
704
+ // make sure EMAIL && public fields come first
705
+ list.merge_fields = list.merge_fields.sort(function(a, b) {
706
+ if( a.tag === 'EMAIL' || ( a.public && ! b.public ) ) {
707
+ return -1;
708
+ }
709
 
710
+ if( ! a.public && b.public ) {
711
+ return 1;
712
+ }
713
 
714
+ return 0;
715
+ });
716
 
717
+ // loop through merge vars
718
+ list.merge_fields.forEach(registerMergeField);
 
719
 
720
+ // loop through groupings
721
+ list.interest_categories.forEach(registerInterestCategory);
722
+ }
 
 
 
 
 
 
723
 
724
+ /**
725
+ * Register all lists fields
726
+ *
727
+ * @param lists
728
+ */
729
+ function registerListsFields(lists) {
730
+ reset();
731
+ lists.forEach(registerListFields);
732
+ }
733
 
734
+ function registerCustomFields(lists) {
 
735
 
736
+ var choices,
737
+ category = i18n.formFields;
 
 
 
 
 
738
 
739
+ // register submit button
740
+ register(category, {
741
+ name: '',
742
+ value: i18n.subscribe,
743
+ type: "submit",
744
+ title: i18n.submitButton
745
+ }, true);
746
 
747
+ // register lists choice field
748
+ choices = {};
749
+ for(var key in lists) {
750
+ choices[lists[key].id] = lists[key].name;
751
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
752
 
753
+ register(category, {
754
+ name: '_mc4wp_lists',
755
+ type: 'checkbox',
756
+ title: i18n.listChoice,
757
+ choices: choices,
758
+ help: i18n.listChoiceDescription,
759
+ acceptsMultipleValues: true
760
+ }, true);
761
+
762
+ choices = {
763
+ 'subscribe': "Subscribe",
764
+ 'unsubscribe': "Unsubscribe"
765
+ };
766
+ register(category, {
767
+ name: '_mc4wp_action',
768
+ type: 'radio',
769
+ title: i18n.formAction,
770
+ choices: choices,
771
+ value: 'subscribe',
772
+ help: i18n.formActionDescription
773
+ }, true);
774
+ }
775
+
776
+ /**
777
+ * Expose some methods
778
+ */
779
+ return {
780
+ 'registerCustomFields': registerCustomFields,
781
+ 'registerListFields': registerListFields,
782
+ 'registerListsFields': registerListsFields
783
+ }
784
 
785
  };
786
 
790
 
791
  module.exports = function(m, events) {
792
  var timeout;
793
+ var fields = [];
794
+ var categories = [];
795
+
796
+
797
+ /**
798
+ * @internal
799
+ *
800
+ *
801
+ * @param data
802
+ * @constructor
803
+ */
804
+ var Field = function (data) {
805
+ this.name = m.prop(data.name);
806
+ this.title = m.prop(data.title || data.name);
807
+ this.type = m.prop(data.type);
808
+ this.mailchimpType = m.prop(data.mailchimpType || '');
809
+ this.label = m.prop(data.title || '');
810
+ this.value = m.prop(data.value || '');
811
+ this.placeholder = m.prop(data.placeholder || '');
812
+ this.required = m.prop(data.required || false);
813
+ this.forceRequired = m.prop( data.forceRequired || false );
814
+ this.wrap = m.prop(data.wrap || true);
815
+ this.min = m.prop(data.min || null);
816
+ this.max = m.prop(data.max || null);
817
+ this.help = m.prop(data.help || '');
818
+ this.choices = m.prop(data.choices || []);
819
+ this.inFormContent = m.prop(null);
820
+ this.acceptsMultipleValues = data.acceptsMultipleValues;
821
+
822
+ this.selectChoice = function(value) {
823
+ var field = this;
824
+
825
+ this.choices(this.choices().map(function(choice) {
826
+
827
+ if( choice.value() === value ) {
828
+ choice.selected(true);
829
+ } else {
830
+ // only checkboxes allow for multiple selections
831
+ if( field.type() !== 'checkbox' ) {
832
+ choice.selected(false);
833
+ }
834
+ }
835
 
836
+ return choice;
837
 
838
+ }));
839
+ };
840
+ };
841
 
842
+ /**
843
+ * @internal
844
+ *
845
+ * @param data
846
+ * @constructor
847
+ */
848
+ var FieldChoice = function (data) {
849
+ this.label = m.prop(data.label);
850
+ this.title = m.prop(data.title || data.label);
851
+ this.selected = m.prop(data.selected || false);
852
+ this.value = m.prop(data.value || data.label);
853
+ };
854
 
855
+ /**
856
+ * Creates FieldChoice objects from an (associative) array of data objects
857
+ *
858
+ * @param data
859
+ * @returns {Array}
860
+ */
861
+ function createChoices(data) {
862
+ var choices = [];
863
+ if (typeof( data.map ) === "function") {
864
+ choices = data.map(function (choiceLabel) {
865
+ return new FieldChoice({label: choiceLabel});
866
+ });
867
+ } else {
868
+ choices = Object.keys(data).map(function (key) {
869
+ var choiceLabel = data[key];
870
+ return new FieldChoice({label: choiceLabel, value: key});
871
+ });
872
+ }
873
 
874
+ return choices;
875
+ }
876
 
877
+ /**
878
+ * Factory method
879
+ *
880
+ * @api
881
+ *
882
+ * @param data
883
+ * @returns {Field}
884
+ */
885
+ function register(category, data) {
886
 
887
+ var field;
888
+ var existingField = getAllWhere('name', data.name).shift();
889
 
890
+ // a field with the same "name" already exists
891
+ if(existingField) {
892
 
893
+ // update "required" status
894
+ if( ! existingField.forceRequired() && data.forceRequired ) {
895
+ existingField.forceRequired(true);
896
+ }
897
 
898
+ // bail
899
+ return undefined;
900
+ }
901
 
902
+ // array of choices given? convert to FieldChoice objects
903
+ if (data.choices) {
904
+ data.choices = createChoices(data.choices);
905
 
906
+ if( data.value) {
907
+ data.choices = data.choices.map(function(choice) {
908
+ if(choice.value() === data.value) {
909
+ choice.selected(true);
910
+ }
911
+ return choice;
912
+ });
913
+ }
914
+ }
915
 
916
+ // register category
917
+ if( categories.indexOf(category) < 0 ) {
918
+ categories.push(category);
919
+ }
920
 
921
+ // create Field object
922
+ field = new Field(data);
923
+ field.category = category;
924
 
925
+ // add to array
926
+ fields.push(field);
927
 
928
+ // redraw view
929
  timeout && window.clearTimeout(timeout);
930
+ timeout = window.setTimeout(m.redraw, 200);
931
 
932
+ // trigger event
933
+ events.trigger('fields.change');
 
 
 
934
 
935
+ return field;
936
+ }
 
 
 
 
 
 
 
 
 
 
937
 
938
+ /**
939
+ * @api
940
+ *
941
+ * @param field
942
+ */
943
+ function deregister(field) {
944
+ var index = fields.indexOf(field);
945
+ if (index > -1) {
946
+ delete fields[index];
947
+ m.redraw();
948
+ }
949
+ }
950
 
951
+ /**
952
+ * Get a field config object
953
+ *
954
+ * @param name
955
+ * @returns {*}
956
+ */
957
+ function get(name) {
958
+ return fields[name];
959
+ }
960
+
961
+ /**
962
+ * Get all field config objects
963
+ *
964
+ * @returns {Array|*}
965
+ */
966
+ function getAll() {
967
+ // rebuild index property on all fields
968
+ fields = fields.map(function(f, i) {
969
+ f.index = i;
970
+ return f;
971
+ });
972
 
973
+ return fields;
974
+ }
975
 
976
+ function getCategories() {
977
+ return categories;
978
+ }
979
 
980
+ /**
981
+ * Get all fields where a property matches the given value
982
+ *
983
+ * @param searchKey
984
+ * @param searchValue
985
+ * @returns {Array|*}
986
+ */
987
+ function getAllWhere(searchKey, searchValue) {
988
+ return fields.filter(function (field) {
989
+ return field[searchKey]() === searchValue;
990
+ });
991
+ }
992
 
993
 
994
+ /**
995
+ * Exposed methods
996
+ */
997
+ return {
998
+ 'get' : get,
999
+ 'getAll' : getAll,
1000
+ 'getCategories': getCategories,
1001
+ 'deregister' : deregister,
1002
+ 'register' : register,
1003
+ 'getAllWhere': getAllWhere
1004
+ };
1005
  };
1006
  },{}],7:[function(require,module,exports){
1007
  'use strict';
1018
 
1019
  var FormEditor = function(element) {
1020
 
1021
+ // create dom representation of form
1022
+ var _dom = document.createElement('form'),
1023
+ domDirty = false,
1024
+ r = {},
1025
+ editor;
1026
+
1027
+ _dom.innerHTML = element.value.toLowerCase();
1028
+
1029
+ if( CodeMirror ) {
1030
+ editor = CodeMirror.fromTextArea(element, {
1031
+ selectionPointer: true,
1032
+ matchTags: { bothTags: true },
1033
+ mode: "htmlmixed",
1034
+ htmlMode: true,
1035
+ autoCloseTags: true,
1036
+ autoRefresh: true
1037
+ });
1038
 
1039
+ // dispatch regular "change" on element event every time editor changes (IE9+ only)
1040
+ window.dispatchEvent && editor.on('change',function() {
1041
+ if(typeof(Event) === "function") {
1042
+ // Create a new 'change' event
1043
+ var event = new Event('change', { bubbles: true });
1044
+ element.dispatchEvent(event);
1045
+ }
1046
+ });
1047
+ }
1048
 
1049
+ window.addEventListener('load', function() {
1050
+ CodeMirror.signal(editor, "change");
1051
+ });
1052
 
1053
+ // set domDirty to true everytime the "change" event fires (a lot..)
1054
+ element.addEventListener('change',function() {
1055
+ domDirty = true;
1056
+ });
1057
 
1058
+ function dom() {
1059
+ if( domDirty ) {
1060
+ _dom.innerHTML = r.getValue().toLowerCase();
1061
+ domDirty = false;
1062
+ }
1063
 
1064
+ return _dom;
1065
+ }
1066
 
1067
+ r.getValue = function() {
1068
+ return editor ? editor.getValue() : element.value;
1069
+ };
1070
 
1071
+ r.query = function(query) {
1072
+ return dom().querySelectorAll(query.toLowerCase());
1073
+ };
1074
 
1075
+ r.containsField = function(fieldName){
1076
+ return dom().elements.namedItem(fieldName.toLowerCase()) !== null;
1077
+ };
1078
 
1079
+ r.insert = function( html ) {
1080
+ if( editor ) {
1081
+ editor.replaceSelection( html );
1082
+ editor.focus();
1083
+ } else {
1084
+ element.value += html;
1085
+ }
1086
+ };
1087
 
1088
+ r.on = function(event,callback) {
1089
+ if( editor ) {
1090
+ // translate "input" event for CodeMirror
1091
+ event = ( event === 'input' ) ? 'changes' : event;
1092
+ return editor.on(event,callback);
1093
+ }
1094
 
1095
+ return element.addEventListener(event,callback);
1096
+ };
1097
 
1098
+ r.refresh = function() {
1099
+ editor && editor.refresh();
1100
+ };
1101
 
1102
+ return r;
1103
  };
1104
 
1105
  module.exports = FormEditor;
1106
  },{"codemirror":17,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchtags":15,"codemirror/addon/fold/xml-fold":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(require,module,exports){
1107
  var FormWatcher = function(m, editor, settings, fields, events, helpers) {
1108
+ 'use strict';
1109
 
1110
+ var requiredFieldsInput = document.getElementById('required-fields');
1111
 
1112
+ function updateFields() {
1113
+ fields.getAll().forEach(function(field) {
1114
+ // don't run for empty field names
1115
+ if(field.name().length <= 0) return;
1116
 
1117
+ var fieldName = field.name();
1118
+ if( field.type() === 'checkbox' ) {
1119
+ fieldName += '[]';
1120
+ }
1121
 
1122
+ var inForm = editor.containsField( fieldName );
1123
+ field.inFormContent( inForm );
 
1124
 
1125
+ // if form contains 1 address field of group, mark all fields in this group as "required"
1126
+ if( field.mailchimpType() === 'address' ) {
1127
+ field.originalRequiredValue = field.originalRequiredValue === undefined ? field.forceRequired() : field.originalRequiredValue;
1128
+
1129
+ // query other fields for this address group
1130
+ var nameGroup = field.name().replace(/\[(\w+)\]/g, '' );
1131
+ if( editor.query('[name^="' + nameGroup + '"]').length > 0 ) {
1132
+ if( field.originalRequiredValue === undefined ) {
1133
+ field.originalRequiredValue = field.forceRequired();
1134
+ }
1135
+ field.forceRequired(true);
1136
+ } else {
1137
+ field.forceRequired(field.originalRequiredValue);
1138
+ }
1139
+ }
1140
 
1141
+ });
1142
 
1143
+ findRequiredFields();
1144
+ m.redraw();
1145
+ }
1146
 
1147
+ function findRequiredFields() {
 
 
 
1148
 
1149
+ // query fields required by MailChimp
1150
+ var requiredFields = fields.getAllWhere('forceRequired', true).map(function(f) { return f.name().toUpperCase().replace(/\[(\w+)\]/g, '.$1' ); });
 
 
1151
 
1152
+ // query fields in form with [required] attribute
1153
+ var requiredFieldElements = editor.query('[required]');
1154
+ Array.prototype.forEach.call(requiredFieldElements, function(el) {
1155
+ var name = el.name.toUpperCase();
1156
 
1157
+ // bail if name attr starts with underscore
1158
+ if( name[0] === '_' ) {
1159
+ return;
1160
+ }
 
1161
 
1162
+ // replace array brackets with dot style notation
1163
+ name = name.replace(/\[(\w+)\]/g, '.$1' );
1164
+
1165
+ // only add field if it's not already in it
1166
+ if( requiredFields.indexOf(name) === -1 ) {
1167
+ requiredFields.push(name);
1168
+ }
1169
+ });
1170
+
1171
+ // update meta
1172
+ requiredFieldsInput.value = requiredFields.join(',');
1173
+ }
1174
 
1175
+ // events
1176
+ editor.on('change', helpers.debounce(updateFields, 500));
1177
+ events.on('fields.change', helpers.debounce(updateFields, 500));
1178
 
1179
  };
1180
 
assets/js/forms-admin.min.js CHANGED
@@ -1,9 +1,9 @@
1
- !function(){var e=void 0,t=void 0;!function r(t,n,i){function o(l,s){if(!n[l]){if(!t[l]){var c="function"==typeof e&&e;if(!s&&c)return c(l,!0);if(a)return a(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[l]={exports:{}};t[l][0].call(d.exports,function(e){var r=t[l][1][e];return o(r?r:e)},d,d.exports,r,t,n,i)}return n[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,r){"use strict";var n=function(e,t){var r={};return r.showType=function(r){var n=r.type();return n=n.charAt(0).toUpperCase()+n.slice(1),e("div",[e("label",t.fieldType),e("span",n)])},r.label=function(r){return e("div",[e("label",t.fieldLabel),e("input.widefat",{type:"text",value:r.label(),onchange:e.withAttr("value",r.label),placeholder:r.title()})])},r.value=function(r){var n="hidden"===r.type();return e("div",[e("label",[n?t.value:t.initialValue," ",n?"":e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.value(),onchange:e.withAttr("value",r.value)}),n?"":e("p.help",t.valueHelp)])},r.numberMinMax=function(r){return e("div",[e("div.row",[e("div.col.col-3",[e("label",t.min),e("input",{type:"number",onchange:e.withAttr("value",r.min)})]),e("div.col.col-3",[e("label",t.max),e("input",{type:"number",onchange:e.withAttr("value",r.max)})])])])},r.isRequired=function(r){var n,i={type:"checkbox",checked:r.required(),onchange:e.withAttr("checked",r.required)};return r.forceRequired()&&(i.required=!0,i.disabled=!0,n=e("p.help",t.forceRequired)),e("div",[e("label.cb-wrap",[e("input",i),t.isFieldRequired]),n])},r.placeholder=function(r){return e("div",[e("label",[t.placeholder," ",e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.placeholder(),onchange:e.withAttr("value",r.placeholder),placeholder:""}),e("p.help",t.placeholderHelp)])},r.useParagraphs=function(r){return e("div",[e("label.cb-wrap",[e("input",{type:"checkbox",checked:r.wrap(),onchange:e.withAttr("checked",r.wrap)}),t.wrapInParagraphTags])])},r.choiceType=function(r){var n=[e("option",{value:"select",selected:"select"===r.type()&&"selected"},t.dropdown),e("option",{value:"radio",selected:"radio"===r.type()&&"selected"},t.radioButtons)];return r.acceptsMultipleValues&&n.push(e("option",{value:"checkbox",selected:"checkbox"===r.type()&&"selected"},t.checkboxes)),e("div",[e("label",t.choiceType),e("select",{value:r.type(),onchange:e.withAttr("value",r.type)},n)])},r.choices=function(r){var n=[];return n.push(e("div",[e("label",t.choices),e("div.limit-height",[e("table",[r.choices().map(function(n,i){return e("tr",{"data-id":i},[e("td.cb",e("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:e.withAttr("value",r.selectChoice.bind(r)),checked:n.selected(),value:n.value(),title:t.preselect})),e("td.stretch",e("input.widefat",{type:"text",value:n.label(),placeholder:n.title(),onchange:e.withAttr("value",n.label)})),e("td",e("span",{title:t.remove,"class":"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,i)},""))])})])])])),n},r};t.exports=n},{}],2:[function(e,t,r){var n=function(t,r){var n={},i=e("./field-forms-rows.js")(t,r);return n.render=function(e){var t=e.type();if("function"==typeof n[t])return n[t](e);switch(t){case"select":case"radio":case"checkbox":return n.choice(e)}return n.text(e)},n.text=function(e){return[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},n.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type()&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(i.isRequired(e)),t},n.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[i.showType(e),i.value(e)]},n.submit=function(e){return e.label(""),e.placeholder(""),[i.value(e),i.useParagraphs(e)]},n.number=function(e){return[n.text(e),i.numberMinMax(e)]},n};t.exports=n},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var n=e("../third-party/render.js"),i=e("../third-party/beautify-html.js"),o=function(e){function t(t){var o,a,l,s;return o=t.label().length?e("label",t.label()):"",a="function"==typeof r[t.type()]?r[t.type()](t):r["default"](t),l=t.wrap()?e("p",[o,a]):[o,a],s=n(l),s=i(s),s+"\n"}var r={};return r.select=function(t){var r={name:t.name(),required:t.required()},n=!1,i=t.choices().map(function(t){return t.selected()&&(n=!0),e("option",{value:t.value()!==t.label()?t.value():void 0,selected:t.selected()},t.label())}),o=t.placeholder();return o.length>0&&i.unshift(e("option",{disabled:!0,value:"",selected:!n},o)),e("select",r,i)},r.checkbox=function(t){var r=t.choices().map(function(r){var n=t.name()+("checkbox"===t.type()?"[]":""),i=t.required()&&"radio"===t.type();return e("label",[e("input",{name:n,type:t.type(),value:r.value(),checked:r.selected(),required:i})," ",e("span",r.label())])});return r},r.radio=r.checkbox,r["default"]=function(t){var r,n={type:t.type()};return t.name()&&(n.name=t.name()),t.min()&&(n.min=t.min()),t.max()&&(n.max=t.max()),t.value().length>0&&(n.value=t.value()),t.placeholder().length>0&&(n.placeholder=t.placeholder()),n.required=t.required(),r=e("input",n)},t};t.exports=o},{"../third-party/beautify-html.js":12,"../third-party/render.js":13}],4:[function(e,t,r){var n=function(t,r,n,i,o,a){"use strict";function l(e){d=i.get(e),d&&d.choices().length>0&&d.value(d.choices().map(function(e){return e.label()}).join("|")),t.redraw()}function s(){}function c(){var e=f(d);n.insert(e),l(""),t.redraw()}function u(){var e=i.getCategories(),r=i.getAll(),n=t("div.available-fields.small-margin",[t("h4",a.chooseField),e.map(function(e){var n=r.filter(function(t){return t.category===e});if(n.length)return t("div.tiny-margin",[t("strong",e),n.map(function(e){var r="button";e.forceRequired()&&(r+=" is-required");var n=e.inFormContent();return null!==n&&(r+=" "+(n?"in-form":"not-in-form")),t("button",{className:r,type:"button",onclick:t.withAttr("value",l),value:e.index},e.title())})])})]),o=null;return d&&(o=h(t("div.field-wizard",[t("h3",[d.title(),d.forceRequired()?t("span.red","*"):"",d.name().length?t("code",d.name()):""]),d.help().length?t("p",t.trust(d.help())):"",p.render(d),t("p",[t("button",{"class":"button-primary",type:"button",onkeydown:function(e){e=e||window.event,13==e.keyCode&&c()},onclick:c},a.addToForm)])]),l)),[n,o]}var d,f=e("./field-generator.js")(t),h=e("./overlay.js")(t,a),p=e("./field-forms.js")(t,a);return n.on("blur",t.redraw),{view:u,controller:s}};t.exports=n},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){var n=function(e,t){"use strict";function r(){u.forEach(e.deregister)}function n(t,r,n){var i=e.register(t,r);n||u.push(i)}function i(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return"undefined"!=typeof t[e]?t[e]:e}function o(e){var r=t.listFields,o=i(e.field_type),a={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:o,choices:e.choices,acceptsMultipleValues:!1};return"address"!==a.type?n(r,a,!1):(n(r,{name:a.name+"[addr1]",type:"text",title:t.streetAddress}),n(r,{name:a.name+"[city]",type:"text",title:t.city}),n(r,{name:a.name+"[state]",type:"text",title:t.state}),n(r,{name:a.name+"[zip]",type:"text",title:t.zip}),n(r,{name:a.name+"[country]",type:"select",title:t.country,choices:mc4wp_vars.countries})),!0}function a(e){var r=t.interestCategories,o=i(e.field_type),a={title:e.name,name:"INTERESTS["+e.id+"]",type:o,choices:e.interests,acceptsMultipleValues:"checkbox"===o};n(r,a,!1)}function l(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e["public"]&&!t["public"]?-1:!e["public"]&&t["public"]?1:0}),e.merge_fields.forEach(o),e.interest_categories.forEach(a)}function s(e){r(),e.forEach(l)}function c(e){var r,i=t.formFields;n(i,{name:"",value:t.subscribe,type:"submit",title:t.submitButton},!0),r={};for(var o in e)r[e[o].id]=e[o].name;n(i,{name:"_mc4wp_lists",type:"checkbox",title:t.listChoice,choices:r,help:t.listChoiceDescription,acceptsMultipleValues:!0},!0),r={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},n(i,{name:"_mc4wp_action",type:"radio",title:t.formAction,choices:r,value:"subscribe",help:t.formActionDescription},!0)}var u=[];return{registerCustomFields:c,registerListFields:l,registerListsFields:s}};t.exports=n},{}],6:[function(e,t,r){"use strict";t.exports=function(e,t){function r(e){var t=[];return t="function"==typeof e.map?e.map(function(e){return new h({label:e})}):Object.keys(e).map(function(t){var r=e[t];return new h({label:r,value:t})})}function n(n,i){var o,a=s("name",i.name).shift();return a?void(!a.required()&&i.required&&a.required(!0)):(i.choices&&(i.choices=r(i.choices),i.value&&(i.choices=i.choices.map(function(e){return e.value()===i.value&&e.selected(!0),e}))),d.indexOf(n)<0&&d.push(n),o=new f(i),o.category=n,u.push(o),c&&window.clearTimeout(c),c=window.setTimeout(e.redraw,100),t.trigger("fields.change"),o)}function i(t){var r=u.indexOf(t);r>-1&&(delete u[r],e.redraw())}function o(e){return u[e]}function a(){return u=u.map(function(e,t){return e.index=t,e})}function l(){return d}function s(e,t){return u.filter(function(r){return r[e]()===t})}var c,u=[],d=[],f=function(t){this.name=e.prop(t.name),this.title=e.prop(t.title||t.name),this.type=e.prop(t.type),this.label=e.prop(t.title||""),this.value=e.prop(t.value||""),this.placeholder=e.prop(t.placeholder||""),this.required=e.prop(t.required||!1),this.forceRequired=e.prop(t.forceRequired||!1),this.wrap=e.prop(t.wrap||!0),this.min=e.prop(t.min||null),this.max=e.prop(t.max||null),this.help=e.prop(t.help||""),this.choices=e.prop(t.choices||[]),this.inFormContent=e.prop(null),this.acceptsMultipleValues=t.acceptsMultipleValues,this.selectChoice=function(e){var t=this;this.choices(this.choices().map(function(r){return r.value()===e?r.selected(!0):"checkbox"!==t.type()&&r.selected(!1),r}))}},h=function(t){this.label=e.prop(t.label),this.title=e.prop(t.title||t.label),this.selected=e.prop(t.selected||!1),this.value=e.prop(t.value||t.label)};return{get:o,getAll:a,getCategories:l,deregister:i,register:n,getAllWhere:s}}},{}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold"),e("codemirror/addon/edit/matchtags"),e("codemirror/addon/edit/closetag.js");var i=function(e){function t(){return o&&(i.innerHTML=a.getValue().toLowerCase(),o=!1),i}var r,i=document.createElement("form"),o=!1,a={};return i.innerHTML=e.value.toLowerCase(),n&&(r=n.fromTextArea(e,{selectionPointer:!0,matchTags:{bothTags:!0},mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0}),window.dispatchEvent&&r.on("change",function(){if("function"==typeof Event){var t=new Event("change",{bubbles:!0});e.dispatchEvent(t)}})),window.addEventListener("load",function(){n.signal(r,"change")}),e.addEventListener("change",function(){o=!0}),a.getValue=function(){return r?r.getValue():e.value},a.query=function(e){return t().querySelectorAll(e)},a.containsField=function(e){return null!==t().elements.namedItem(e.toLowerCase())},a.insert=function(t){r?(r.replaceSelection(t),r.focus()):e.value+=t},a.on=function(t,n){return r?(t="input"===t?"changes":t,r.on(t,n)):e.addEventListener(t,n)},a.refresh=function(){r&&r.refresh()},a};t.exports=i},{codemirror:17,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchtags":15,"codemirror/addon/fold/xml-fold":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(e,t,r){var n=function(e,t,r,n,i,o){"use strict";function a(){n.getAll().forEach(function(e){if(!(e.name().length<=0)){var r=e.name();"checkbox"===e.type()&&(r+="[]");var n=t.containsField(r);e.inFormContent(n)}}),l(),e.redraw()}function l(){var e=n.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase()}),r=t.query("[required]");Array.prototype.forEach.call(r,function(t){var r=t.name.toUpperCase();"_"!==r[0]&&(r=r.replace(/\[(\w+)\]/g,".$1"),e.indexOf(r)===-1&&e.push(r))}),s.value=e.join(",")}var s=document.getElementById("required-fields");t.on("change",o.debounce(a,500)),i.on("fields.change",o.debounce(a,500))};t.exports=n},{}],9:[function(e,t,r){"use strict";function n(e,t){l[e]=t,o()}function i(e){delete l[e],o()}function o(){var e="";for(var t in l)e+='<div class="notice notice-warning inline"><p>'+l[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){r=document.createElement("div"),r.className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}function a(e,t){var r=function(){var t="Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly.",r=e.getValue().toLowerCase();r.indexOf('name="groupings')>-1?n("deprecated_groupings",t):i("deprecated_groupings")},o=function(){var r=t.getAllWhere("forceRequired",!0),o=r.filter(function(t){return!e.containsField(t.name().toUpperCase())}),a="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";a+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+o.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",o.length>0?n("required_fields_missing",a):i("required_fields_missing")};r(),e.on("focus",r),e.on("blur",r),o(),e.on("blur",o),e.on("focus",o)}var l={};t.exports={init:a}},{}],10:[function(e,t,r){var n=function(e,t){"use strict";function r(){document.removeEventListener("keydown",n),window.removeEventListener("resize",i),a()}function n(e){e=e||window.event,27==e.keyCode&&r(),13==e.keyCode&&e.preventDefault()}function i(){if(o){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-o.clientWidth-40)/2,n=(t-o.clientHeight-40)/2;o.style.left=(r>0?r:0)+"px",o.style.top=(n>0?n:0)+"px"}}var o,a;return function(l,s){return a=s,document.addEventListener("keydown",n),window.addEventListener("resize",i),[e("div.overlay-wrap",e("div.overlay",{config:function(e){o=e,i()}},[e("span",{"class":"close dashicons dashicons-no",title:t.close,onclick:r}),l])),e("div.overlay-background",{title:t.close,onclick:r})]}};t.exports=n},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=document.getElementById("mc4wp-form-content"),g=window.formEditor=new u(p),m=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),v=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),m);var y=new f(h,n);o.on("selectedLists.change",y.registerListsFields),y.registerListsFields(a.getSelectedLists()),y.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),v.init(g,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=g,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,t,r){!function(){function e(e){return e.replace(/^\s+|\s+$/g,"")}function r(e){return e.replace(/^\s+/g,"")}function n(t,n,i,o){function a(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=s,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)p&&"\n"===e&&this.newlines<=g&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())t.length&&(r=!0);else{if(indent_handlebars){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,r&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,t),this.print_indentation(t)):(this.line_char_count++,t.push(" ")),r=!1),this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?(this.tags[e+"count"]++,this.tags[e+this.tags[e+"count"]]=this.indent_level):(this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level),this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,r,n,i="",o=[],a="",l=!1,s=this.pos,c=this.line_char_count;e=void 0!==e&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=s,this.line_char_count=c),o.length?o.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))l=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),l=!0),"="===i&&(l=!1),o.length&&"="!==o[o.length-1]&&">"!==i&&l&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,o),this.print_indentation(o)):(o.push(" "),this.line_char_count++),l=!1),indent_handlebars&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),o.length&&" "!==o[o.length-1]&&"<"!==o[o.length-1]&&(i=" "+i),l=!0),"<"!==i||n||(t=this.pos-1,n="<"),indent_handlebars&&!n&&o.length>=2&&"{"===o[o.length-1]&&"{"==o[o.length-2]&&(t="#"===i||"/"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,o.push(i),o[1]&&"!"===o[1]){o=[this.get_comment(t)];break}if(indent_handlebars&&"{"===n&&o.length>2&&"}"===o[o.length-2]&&"}"===o[o.length-1])break}}while(">"!==i);var u,d,f=o.join("");u=f.indexOf(" ")!==-1?f.indexOf(" "):"{"===f[0]?f.indexOf("}"):f.indexOf(">"),d="<"!==f[0]&&indent_handlebars?"#"===f[2]?3:2:1;var p=f.substring(d,u).toLowerCase();return"/"===f.charAt(f.length-2)||this.Utils.in_array(p,this.Utils.single_token)?e||(this.tag_type="SINGLE"):indent_handlebars&&"{"===f[0]&&"else"===p?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):"script"===p?e||(this.record_tag(p),this.tag_type="SCRIPT"):"style"===p?e||(this.record_tag(p),this.tag_type="STYLE"):this.is_unformatted(p,h)?(a=this.get_unformatted("</"+p+">",f),o.push(a),t>0&&this.Utils.in_array(this.input.charAt(t-1),this.Utils.whitespace)&&o.splice(0,0,this.input.charAt(t-1)),r=this.pos-1,this.Utils.in_array(this.input.charAt(r+1),this.Utils.whitespace)&&o.push(this.input.charAt(r+1)),this.tag_type="SINGLE"):"!"===p.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===p.charAt(0)?(this.retrieve_tag(p.substring(1)),this.tag_type="END",this.traverse_whitespace()):(this.record_tag(p),"html"!==p.toLowerCase()&&(this.indent_content=!0),this.tag_type="START",this.traverse_whitespace()),this.Utils.in_array(p,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!==this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=s,this.line_char_count=c),o.join("")},this.get_comment=function(e){var t="",r=">",n=!1;for(this.pos=e,input_char=this.input.charAt(this.pos),this.pos++;this.pos<=this.input.length&&(t+=input_char,t[t.length-1]!==r[r.length-1]||t.indexOf(r)===-1);)!n&&t.length<10&&(0===t.indexOf("<![if")?(r="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(r="]]>",n=!0):0===t.indexOf("<![")?(r="]>",n=!0):0===t.indexOf("<!--")&&(r="-->",n=!0)),input_char=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&t.toLowerCase().indexOf(e)!==-1)return"";var r="",n="",i=0,o=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!o){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,o=!0,indent_handlebars&&"{"===r&&n.length&&"{"===n[n.length-2]&&(n+=this.get_unformatted("}}"),i=n.length)}while(n.toLowerCase().indexOf(e,i)===-1);return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return e=this.get_contents_to(t),"string"!=typeof e?e:[e,"TK_"+t]}if("CONTENT"===this.current_mode)return e=this.get_content(),"string"!=typeof e?e:[e,"TK_CONTENT"];if("TAG"===this.current_mode){if(e=this.get_tag(),"string"!=typeof e)return e;var r="TK_TAG_"+this.tag_type;return[e,r]}},this.get_full_indent=function(e){return e=this.indent_level+e||0,e<1?"":Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!==e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var r=this.get_tag(!0),n=(r||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,o){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=o,this.indent_level=0,this.wrap_line_length=i,this.line_char_count=0;for(var a=0;a<this.indent_size;a++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!==t[t.length-1])&&t.push("\n")},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){(e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=r(e)),this.print_token_raw(e)},this.print_token_raw=function(e){e&&""!==e&&(e.length>1&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(t>0,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var l,s,c,u,d,f,h,p,g;for(n=n||{},void 0!==n.wrap_line_length&&0!==parseInt(n.wrap_line_length,10)||void 0!==n.max_char&&0!==parseInt(n.max_char,10)||(n.wrap_line_length=n.max_char),s=n.indent_inner_html||!1,c=parseInt(n.indent_size||4,10),u=n.indent_char||" ",f=n.brace_style||"collapse",d=0===parseInt(n.wrap_line_length,10)?32786:parseInt(n.wrap_line_length||250,10),h=n.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],p=n.preserve_newlines||!0,g=p?parseInt(n.max_preserve_newlines||32786,10):0,indent_handlebars=n.indent_handlebars||!1,l=new a,l.printer(t,u,c,d,f);;){var m=l.get_token();if(l.token_text=m[0],l.token_type=m[1],"TK_EOF"===l.token_type)break;switch(l.token_type){case"TK_TAG_START":l.print_newline(!1,l.output),l.print_token(l.token_text),l.indent_content&&(l.indent(),l.indent_content=!1),l.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":l.print_newline(!1,l.output),l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===l.last_token&&""===l.last_text){var v=l.token_text.match(/\w+/)[0],y=null;l.output.length&&(y=l.output[l.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),null!==y&&y[1]===v||l.print_newline(!1,l.output)}l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var b=l.token_text.match(/^\s*<([a-z]+)/i);b&&l.Utils.in_array(b[1],h)||l.print_newline(!1,l.output),l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":l.print_token(l.token_text),l.indent_content&&(l.indent(),l.indent_content=!1),l.current_mode="CONTENT";break;case"TK_CONTENT":l.print_token(l.token_text),l.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==l.token_text){l.print_newline(!1,l.output);var w,x=l.token_text,k=1;"TK_SCRIPT"===l.token_type?w="function"==typeof i&&i:"TK_STYLE"===l.token_type&&(w="function"==typeof o&&o),"keep"===n.indent_scripts?k=0:"separate"===n.indent_scripts&&(k=-l.indent_level);var C=l.get_full_indent(k);if(w)x=w(x.replace(/^\s*/,C),n);else{var S=x.match(/^\s*/)[0],T=S.match(/[^\n\r]*$/)[0].split(l.indent_string).length-1,L=l.get_full_indent(k-T);x=x.replace(/^\s*/,C).replace(/\r\n|\r|\n/g,"\n"+L).replace(/\s+$/,"")}x&&(l.print_token_raw(C+e(x)),l.print_newline(!1,l.output))}l.current_mode="TAG"}l.last_token=l.token_type,l.last_text=l.token_text}return l.output.join("")}"undefined"!=typeof t&&"undefined"!=typeof t.exports?t.exports=n:"undefined"!=typeof window&&(window.html_beautify=n)}()},{}],13:[function(e,t,r){"use strict";function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2")}function o(e){return""!=e}function a(e,t){return"undefined"===e&&(e=""),"string"!=typeof e&&(e+=""),e=e.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/\>/g,"&gt;"),t?e.replace(/\"/g,"&quot;"):e}function l(e){return e&&Object.keys(e).length?Object.keys(e).map(function(t){var r=e[t];if("undefined"!=typeof r&&null!==r&&"function"!=typeof r){if("boolean"==typeof r)return r?" "+t:"";if("style"===t){if(!r)return;var n=e.style;return"object"==typeof n&&(n=Object.keys(n).map(function(e){return""!=n[e]?[i(e).toLowerCase(),n[e]].join(":"):""}).filter(o).join(";")),""!=n?' style="'+a(n,!0)+'"':""}return" "+a("className"===t?"class":t)+'="'+a(r,!0)+'"'}}).join(""):""}function s(e){return n(e.children)&&!e.children.length?"":c(e.children)}function c(e){var t=typeof e;if("string"===t)return a(e);if("number"===t||"boolean"===t)return e;if(!e)return"";if(n(e))return e.map(c).join("");if(e.view){var r=e.controller?new e.controller:{},i=c(e.view(r));return r.onunload&&r.onunload(),i}if(e.$trusted)return""+e;var o=s(e);return!o&&u.indexOf(e.tag.toLowerCase())>=0?"<"+e.tag+l(e.attrs)+">":["<",e.tag,l(e.attrs),">",o,"</",e.tag,">"].join("")}var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","!doctype"];t.exports=c},{}],14:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r=t.listSelections(),n=[],s=0;s<r.length;s++){if(!r[s].empty())return e.Pass;var c=r[s].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),f=d.state;if("xml"!=d.mode.name||!f.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==d.mode.configuration,g="object"==typeof h&&h.dontCloseTags||p&&a,m="object"==typeof h&&h.indentTags||p&&l,v=f.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==f.type||u.string.indexOf("/")==u.string.length-1||g&&i(g,y)>-1||o(t,v,c,f,!0))return e.Pass;var b=m&&i(m,y)>-1;n[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=r.length-1;s>=0;s--){var w=n[s];t.replaceRange(w.text,r[s].head,r[s].anchor,"+insert");var x=t.listSelections().slice(0);x[s]={head:w.newPos,anchor:w.newPos},t.setSelections(x),w.indent&&(t.indentLine(w.newPos.line,null,!0),t.indentLine(w.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),i=[],a=r?"/":"</",l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var s=n[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),d=u.state;if(r&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;var f;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)f=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;f=a+"style"}else{if(!d.context||!d.context.tagName||o(t,d.context.tagName,s,d))return e.Pass;f=a+d.context.tagName}">"!=t.getLine(s.line).charAt(c.end)&&(f+=">"),i[l]=f}t.replaceSelections(i),n=t.listSelections();for(var l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&t.indentLine(n[l].head.line)}function n(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function o(t,r,n,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),l=e.scanForClosingTag(t,n,null,a);if(!l||l.tag!=r)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==r;s=s.prev)++c;n=l.to;for(var u=1;u<c;u++){var d=e.scanForClosingTag(t,n,null,a);if(!d||d.tag!=r)return!1;n=d.to}return!0}e.defineOption("autoCloseTags",!1,function(r,i,o){if(o!=e.Init&&o&&r.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return r(e)}})},{"../../lib/codemirror":17,"../fold/xml-fold":16}],15:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),i=r.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=e.findMatchingTag(r,n,i);if(o){if(r.state.matchBothTags){var a="open"==o.at?o.open:o.close;
2
- a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?r.state.tagOther=r.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",r),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",r),i.on("viewportChange",n),r(i))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}})},{"../../lib/codemirror":17,"../fold/xml-fold":16}],16:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function r(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function n(e,t){var r=e.cm.getTokenTypeAt(f(e.line,t));return r&&/\btag\b/.test(r)}function i(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(n(e,t+1)){g.lastIndex=t,e.ch=t;var r=g.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function s(e){for(;;){g.lastIndex=e.ch;var t=g.exec(e.text);if(!t){if(i(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(n=a(e)))return;if("selfClose"!=n)if(i[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==i[2]){r.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:f(o,l),to:f(e.line,e.ch)}}else r.push(i[2])}}function d(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;s>=0;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:f(e.line,e.ch),to:f(i,o)}}}else l(e)}}var f=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+h+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var i,o=s(n);if(!o||n.line!=t.line||!(i=a(n)))return;if(!o[1]&&"selfClose"!=i){var l=f(n.line,n.ch),c=u(n,o[2]);return c&&{from:l,to:c.from}}}}),e.findMatchingTag=function(e,n,i){var o=new r(e,n.line,n.ch,i);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var s=a(o),c=s&&f(o.line,o.ch),h=s&&l(o);if(s&&h&&!(t(o,n)>0)){var p={from:f(o.line,o.ch),to:c,tag:h[2]};return"selfClose"==s?{open:p,close:null,at:"open"}:h[1]?{open:d(o,h[2]),close:p,at:"close"}:(o=new r(e,c.line,c.ch,i),{open:p,close:u(o,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var i=new r(e,t.line,t.ch,n);;){var o=d(i);if(!o)break;var a=new r(e,t.line,t.ch,n),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,n,i){var o=new r(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,n)}})},{"../../lib/codemirror":17}],17:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.CodeMirror=i()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(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 i(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 o(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function a(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function l(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function s(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function c(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function u(){this.id=null}function d(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function f(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function h(e){for(;za.length<=e;)za.push(p(za)+" ");return za[e]}function p(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function m(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function v(){}function y(e,t){var r;return Object.create?r=Object.create(e):(v.prototype=e,r=new v),t&&s(t,r),r}function b(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Pa.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function k(e){return e.charCodeAt(0)>=768&&Da.test(e)}function C(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+Aa+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),aa&&la<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),sa||na&&ma||(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,r.init(i)}function S(e,t){if(t-=e.first,t<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 T(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function L(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function M(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function _(e){if(null==e.parent)return null;for(var t=e.parent,r=d(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function A(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 a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function N(e,t){return t>=e.first&&t<e.first+e.size}function O(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function W(e,t){return this instanceof W?(this.line=e,void(this.ch=t)):new W(e,t)}function E(e,t){return e.line-t.line||e.ch-t.ch}function z(e){return W(e.line,e.ch)}function P(e,t){return E(e,t)<0?t:e}function D(e,t){return E(e,t)<0?e:t}function H(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function I(e,t){if(t.line<e.first)return W(e.first,0);var r=e.first+e.size-1;return t.line>r?W(r,S(e,r).text.length):F(t,S(e,t.line).text.length)}function F(e,t){var r=e.ch;return null==r||r>t?W(e.line,t):r<0?W(e.line,0):e}function j(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=I(e,t[n]);return r}function R(){Ha=!0}function B(){Ia=!0}function q(e,t,r){this.marker=e,this.from=t,this.to=r}function K(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function U(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function G(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function V(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new q(a,o.from,s?null:o.to))}}return n}function $(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new q(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Y(e,t){if(t.full)return null;var r=N(e,t.from.line)&&S(e,t.from.line).markedSpans,n=N(e,t.to.line)&&S(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==E(t.from,t.to),l=V(r,i,a),s=$(n,o,a),c=1==t.text.length,u=p(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=K(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var g=0;g<s.length;++g){var m=s[g];if(null!=m.to&&(m.to+=u),null==m.from){var v=K(l,m.marker);v||(m.from=u,c&&(l||(l=[])).push(m))}else m.from+=u,c&&(l||(l=[])).push(m)}l&&(l=X(l)),s&&s!=l&&(s=X(s));var y=[l];if(!c){var b,w=t.text.length-2;if(w>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(b||(b=[])).push(new q(l[x].marker,null,null));for(var k=0;k<w;++k)y.push(b);y.push(s)}return y}function X(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Z(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&&d(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(E(c.to,l.from)<0||E(c.from,l.to)>0)){var u=[s,1],f=E(c.from,l.from),h=E(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function Q(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function J(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ee(e){return e.inclusiveLeft?-1:0}function te(e){return e.inclusiveRight?1:0}function re(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=E(n.from,i.from)||ee(e)-ee(t);if(o)return-o;var a=E(n.to,i.to)||te(e)-te(t);return a?a:t.id-e.id}function ne(e,t){var r,n=Ia&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||re(r,i.marker)<0)&&(r=i.marker);return r}function ie(e){return ne(e,!0)}function oe(e){return ne(e,!1)}function ae(e,t,r,n,i){var o=S(e,t),a=Ia&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=E(c.from,r)||ee(s.marker)-ee(i),d=E(c.to,n)||te(s.marker)-te(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?E(c.to,r)>=0:E(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?E(c.from,n)<=0:E(c.from,n)<0)))return!0}}}function le(e){for(var t;t=ie(e);)e=t.find(-1,!0).line;return e}function se(e){for(var t,r;t=oe(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ce(e,t){var r=S(e,t),n=le(r);return r==n?t:_(n)}function ue(e,t){if(t>e.lastLine())return t;var r,n=S(e,t);if(!de(e,n))return t;for(;r=oe(n);)n=r.find(1,!0).line;return _(n)+1}function de(e,t){var r=Ia&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&fe(e,t,n))return!0}}function fe(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return fe(e,n.line,K(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],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&fe(e,t,i))return!0}function he(e){e=le(e);for(var t=0,r=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;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function pe(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=ie(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=oe(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function ge(e){var t=e.display,r=e.doc;t.maxLine=S(r,r.first),t.maxLineLength=pe(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=pe(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function me(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ve(e){return e.level%2?e.to:e.from}function ye(e){return e.level%2?e.from:e.to}function be(e){var t=Le(e);return t?ve(t[0]):0}function we(e){var t=Le(e);return t?ye(p(t)):e.text.length}function xe(e,t,r){var n=e[0].level;return t==n||r!=n&&t<r}function ke(e,t){var r;Fa=null;for(var n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return xe(e,i.level,e[r].level)?(i.from!=i.to&&(Fa=r),n):(i.from!=i.to&&(Fa=n),r);r=n}}return r}function Ce(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&k(e.text.charAt(t)));return t}function Se(e,t,r,n){var i=Le(e);if(!i)return Te(e,t,r,n);for(var o=ke(i,t),a=i[o],l=Ce(e,t,a.level%2?-r:r,n);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return ke(i,l)==o?l:(a=i[o+=r],r>0==a.level%2?a.to:a.from);if(a=i[o+=r],!a)return null;l=r>0==a.level%2?Ce(e,a.to,-1,n):Ce(e,a.from,1,n)}}function Te(e,t,r,n){var i=t+r;if(n)for(;i>0&&k(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}function Le(e){var t=e.order;return null==t&&(t=e.order=ja(e.text)),t}function Me(e,t,r){var n=e._handlers&&e._handlers[t];return r?n&&n.length>0?n.slice():Ba:n||Ba}function _e(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else for(var n=Me(e,t,!1),i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}}function Ae(e,t){var r=Me(e,t,!0);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ne(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,r||t.type,e,t),De(t)||t.codemirrorIgnore}function Oe(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)d(r,t[n])==-1&&r.push(t[n])}function We(e,t){return Me(e,t).length>0}function Ee(e){e.prototype.on=function(e,t){Ra(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function He(e){ze(e),Pe(e)}function Ie(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),va&&e.ctrlKey&&1==t&&(t=3),t}function je(e){if(null==Ma){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ma=t.offsetWidth<=1&&t.offsetHeight>2&&!(aa&&la<8))}var i=Ma?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Re(e){if(null!=_a)return _a;var n=r(e,document.createTextNode("AخA")),i=xa(n,0,1).getBoundingClientRect(),o=xa(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(_a=o.right-i.right<3)}function Be(e){if(null!=Va)return Va;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=xa(t,0,1).getBoundingClientRect();return Va=Math.abs(i.left-o.left)>1}function qe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$a[e]=t}function Ke(e,t){Ya[e]=t}function Ue(e){if("string"==typeof e&&Ya.hasOwnProperty(e))e=Ya[e];else if(e&&"string"==typeof e.name&&Ya.hasOwnProperty(e.name)){var t=Ya[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Ue(t);var r=$a[t.name];if(!r)return Ge(e,"text/plain");var n=r(e,t);if(Xa.hasOwnProperty(t.name)){var i=Xa[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 a in t.modeProps)n[a]=t.modeProps[a];return n}function Ve(e,t){var r=Xa.hasOwnProperty(e)?Xa[e]:Xa[e]={};s(t,r)}function $e(e,t){if(t===!0)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 Ye(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Xe(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)},l=0;l<e.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Je(e,_(t)),i=Ze(e,t,t.text.length>e.options.maxHighlightLength?$e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),a=o>n.first&&S(n,o-1).stateAfter;return a=a?$e(n.mode,a):Xe(n.mode),n.iter(o,t,function(r){et(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?$e(n.mode,a):null,++o}),r&&(n.frontier=o),a}function et(e,t,r,n){var i=e.doc.mode,o=new Za(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&tt(i,r);!o.eol();)rt(i,o,r),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ye(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function rt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ye(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.")}function nt(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?$e(a.mode,u):u}},a=e.doc,l=a.mode;t=I(a,t);var s,c=S(a,t.line),u=Je(e,t.line,r),d=new Za(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=rt(l,d,u),n&&s.push(o(!0));return n?s:o()}function it(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 ot(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Za(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&it(tt(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&et(e,t,n,d.pos),d.pos=t.length,s=null):s=it(rt(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}function at(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=S(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var u=c(s.text,null,e.options.tabSize);(null==i||n>u)&&(i=l-1,n=u)}return i}function lt(e,t,r){this.text=e,J(this,t),this.height=r?r(this):1}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Q(e),J(e,r);var i=n?n(e):1;i!=e.height&&M(e,i)}function ct(e){e.parent=null,Q(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?el:Ja;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dt(e,t){var r=n("span",null,null,sa?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(aa||sa)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=ht,Re(e.display.measure)&&(s=Le(l))&&(i.addToken=gt(i.addToken,s)),i.map=[];var c=t!=e.display.externalMeasured&&_(l);vt(l,i,Qe(e,l,c)),l.styleClasses&&(l.styleClasses.bgClass&&(i.bgClass=a(l.styleClasses.bgClass,i.bgClass||"")),l.styleClasses.textClass&&(i.textClass=a(l.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(sa){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=a(i.pre.className,i.textClass||"")),i}function ft(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var p=u.exec(t),g=p?p.index-f:t.length-f;if(g){var m=document.createTextNode(c.slice(f,f+g));aa&&la<9?s.appendChild(n("span",[m])):s.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",h(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=s.appendChild(n("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),aa&&la<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),aa&&la<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.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}function gt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function mt(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"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==p&&k.widgetNode?y.push(k):x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||re(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==p)for(var S=0;S<y.length;++S)mt(t,0,y[S]);if(f&&(f.from||0)==p){if(mt(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var T=Math.min(h,v);;){if(m){var L=p+m.length;if(!f){var M=L>T?m.slice(0,T-p):m;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",d,l)}if(L>=T){m=m.slice(T-p),p=T;break}p=L,u=""}m=i.slice(o,o=r[g++]),a=ut(r[g++],t.cm.options)}}else for(var _=1;_<r.length;_+=2)t.addToken(t,i.slice(o,o=r[_]),ut(r[_+1],t.cm.options))}function yt(e,t,r){this.line=t,this.rest=se(t),this.size=this.rest?_(p(this.rest))-r+1:1,this.node=this.text=null,this.hidden=de(e,t)}function bt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new yt(e.doc,S(e.doc,o),o);n=o+a.size,i.push(a)}return i}function wt(e){tl?tl.ops.push(e):e.ownsGroup=tl={ops:[e],delayedCallbacks:[]}}function xt(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)}function kt(e,t){var r=e.ownsGroup;if(r)try{xt(r)}finally{tl=null,t(r)}}function Ct(e,t){var r=Me(e,t,!1);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);tl?n=tl.delayedCallbacks:rl?n=rl:(n=rl=[],setTimeout(St,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function St(){var e=rl;rl=null;for(var t=0;t<e.length;++t)e[t]()}function Tt(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Ot(e,t,r,n):"class"==o?Nt(t):"widget"==o&&Wt(e,t,n)}t.changes=null}function Lt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),aa&&la<8&&(e.node.style.zIndex=2)),e.node}function Mt(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=Lt(e);e.background=r.insertBefore(n("div",null,t),r.firstChild)}}function _t(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):dt(e,t)}function At(e,t){var r=t.text.className,n=_t(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,Nt(t)):r&&(t.text.className=r)}function Nt(e){Mt(e),e.line.wrapClass?Lt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(e,t,r,i){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 o=Lt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Lt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",O(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Wt(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);zt(e,t,r)}function Et(e,t,r,n){var i=_t(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Nt(t),Ot(e,t,r,n),zt(e,t,n),t.node}function zt(e,t,r){if(Pt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Pt(e,t.rest[n],t,r,!1)}function Pt(e,t,r,i,o){if(t.widgets)for(var a=Lt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Dt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),Ct(c,"redraw")}}function Dt(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,
3
- t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ht(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function It(e,t){for(var r=Ie(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!0}function Ft(e){return e.lineSpace.offsetTop}function jt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Rt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Bt(e){return Aa-e.display.nativeBarWidth}function qt(e){return e.display.scroller.clientWidth-Bt(e)-e.display.barWidth}function Kt(e){return e.display.scroller.clientHeight-Bt(e)-e.display.barHeight}function Ut(e,t,r){var n=e.options.lineWrapping,i=n&&qt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Gt(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(_(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Vt(e,t){t=le(t);var n=_(t),i=e.display.externalMeasured=new yt(e.doc,t,n);i.lineN=n;var o=i.built=dt(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function $t(e,t,r,n){return Zt(e,Xt(e,t),r,n)}function Yt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Xt(e,t){var r=_(t),n=Yt(e,r);n&&!n.text?n=null:n&&n.changes&&(Tt(e,n,r,vr(e)),e.curOp.forceUpdate=!0),n||(n=Vt(e,t));var i=Gt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Zt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=er(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Qt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Jt(e,t){var r=nl;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function er(e,t,r,n){var i,o=Qt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&k(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&k(t.line.text.charAt(o.coverStart+s));)++s;if(i=aa&&la<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Jt(xa(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}aa&&la<11&&(i=tr(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(aa&&la<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+mr(e.display),top:f.top,bottom:f.bottom}:nl}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(h+p)/2,m=t.view.measure.heights,v=0;v<m.length-1&&!(g<m[v]);v++);var y=v?m[v-1]:0,b=m[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p),w}function tr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Be(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}}function rr(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 nr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)rr(e.display.view[r])}function ir(e){nr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function or(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ar(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Ht(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=he(t);if("local"==n?a+=Ft(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:ar());var s=l.left+("window"==n?0:or());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=or(),i-=ar();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function cr(e,t,r,n,i){return n||(n=S(e.doc,t.line)),lr(e,n,$t(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function a(t,a){var l=Zt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,lr(e,n,l,r)}function l(e,t){var r=s[t],n=r.level%2;return e==ve(r)&&t&&r.level<s[t-1].level?(r=s[--t],e=ye(r)-(r.level%2?0:1),n=!0):e==ye(r)&&t<s.length-1&&r.level<s[t+1].level&&(r=s[++t],e=ve(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?a(e-1):a(e,n)}n=n||S(e.doc,t.line),i||(i=Xt(e,n));var s=Le(n),c=t.ch;if(!s)return a(c);var u=ke(s,c),d=l(c,u);return null!=Fa&&(d.other=l(c,Fa)),d}function dr(e,t){var r=0;t=I(e.doc,t),e.options.lineWrapping||(r=mr(e.display)*t.ch);var n=S(e.doc,t.line),i=he(n)+Ft(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function fr(e,t,r,n){var i=W(e,t);return i.xRel=n,r&&(i.outside=!0),i}function hr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return fr(n.first,0,!0,-1);var i=A(n,r),o=n.first+n.size-1;if(i>o)return fr(n.first+n.size-1,S(n,o).text.length,!0,1);t<0&&(t=0);for(var a=S(n,i);;){var l=pr(e,a,i,t,r),s=oe(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=_(a=c.to.line)}}function pr(e,t,r,n,i){function o(n){var i=ur(e,W(r,n),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-he(t),l=!1,s=2*e.display.wrapper.clientWidth,c=Xt(e,t),u=Le(t),d=t.text.length,f=be(t),h=we(t),p=o(f),g=l,m=o(h),v=l;if(n>m)return fr(r,h,v,1);for(;;){if(u?h==f||h==Se(t,f,1):h-f<=1){var y=n<p||n-p<=m-n?f:h,b=y==f?g:v,w=n-(y==f?p:m);if(v&&!u&&!/\s/.test(t.text.charAt(y))&&w>0&&y<t.text.length&&c.view.measure.heights.length>1){var x=Zt(e,c,y,"right");a<=x.bottom&&a>=x.top&&Math.abs(n-x.right)<w&&(b=!1,y++,w=n-x.right)}for(;k(t.text.charAt(y));)++y;var C=fr(r,y,b,w<-1?-1:w>1?1:0);return C}var S=Math.ceil(d/2),T=f+S;if(u){T=f;for(var L=0;L<S;++L)T=Se(t,T,1)}var M=o(T);M>n?(h=T,m=M,(v=l)&&(m+=1e3),d=S):(f=T,p=M,g=l,d-=S)}}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Qa){Qa=n("pre");for(var i=0;i<49;++i)Qa.appendChild(document.createTextNode("x")),Qa.appendChild(n("br"));Qa.appendChild(document.createTextNode("x"))}r(e.measure,Qa);var o=Qa.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function vr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:yr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function yr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function br(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/mr(e.display)-3);return function(i){if(de(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function wr(e){var t=e.doc,r=br(e);t.iter(function(e){var t=r(e);t!=e.height&&M(e,t)})}function xr(e,t,r,n){var i=e.display;if(!r&&"true"==Ie(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,u=hr(e,o,a);if(n&&1==u.xRel&&(s=S(e.doc,u.line).text).length==u.ch){var d=c(s,s.length,e.options.tabSize)-s.length;u=W(u.line,Math.max(0,Math.round((o-Rt(e.display).left)/mr(e.display))-d))}return u}function kr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Cr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Sr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t!==!1||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Tr(e,l.head,i),s||Lr(e,l,o)}}return n}function Tr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Lr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return cr(e,W(t,r),"div",c,n)}var a,s,c=S(l,t),f=c.text.length;return me(Le(c),r||0,null==n?f:n,function(e,t,l){var c,h,p,g=o(e,"left");if(e==t)c=g,h=p=g.left;else{if(c=o(t-1,"right"),"rtl"==l){var m=g;g=c,c=m}h=g.left,p=c.right}null==r&&0==e&&(h=u),c.top-g.top>3&&(i(h,g.top,null,g.bottom),h=u,g.bottom<c.top&&i(h,g.bottom,null,c.top)),null==n&&t==f&&(p=d),(!a||g.top<a.top||g.top==a.top&&g.left<a.left)&&(a=g),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),h<u+1&&(h=u),i(h,c.top,p-h,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Rt(e.display),u=c.left,d=Math.max(a.sizerWidth,qt(e)-a.sizer.offsetLeft)-c.right,f=t.from(),h=t.to();if(f.line==h.line)o(f.line,f.ch,h.ch);else{var p=S(l,f.line),g=S(l,h.line),m=le(p)==le(g),v=o(f.line,f.ch,m?p.text.length+1:null).end,y=o(h.line,m?0:null,h.ch).start;m&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Mr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?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 _r(e){e.state.focused||(e.display.input.focus(),Nr(e))}function Ar(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))},100)}function Nr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,o(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),sa&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mr(e))}function Or(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,Sa(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Wr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=yr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Er(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=O(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",_n(e),!0}return!1}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(aa&&la<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=gr(t)),(s>.001||s<-.001)&&(M(i.line,o),Pr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Pr(i.rest[c])}}}function Pr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Dr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ft(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=A(t,n),a=A(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=A(t,he(S(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=A(t,he(S(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,na||Ln(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),na&&Ln(e),wn(e,100))}function Ir(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(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 jr(e){var t=Fr(e);return t.x*=ol,t.y*=ol,t}function Rr(e,t){var r=Fr(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&va&&sa)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!na&&!da&&null!=ol)return i&&s&&Hr(e,Math.max(0,Math.min(a.scrollTop+i*ol,a.scrollHeight-a.clientHeight))),Ir(e,Math.max(0,Math.min(a.scrollLeft+n*ol,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&ze(t),void(o.wheelStartX=null);if(i&&null!=ol){var f=i*ol,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):p=Math.min(e.doc.height,p+f+50),Ln(e,{top:h,bottom:p})}il<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(ol=(ol*il+r)/(il+1),++il)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Br(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+jt(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+Bt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function qr(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Ra(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ra(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,aa&&la<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Kr(){}function Ur(e,t){t||(t=Br(e));var r=e.display.barWidth,n=e.display.barHeight;Gr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Gr(e,Br(e)),r=e.display.barWidth,n=e.display.barHeight}function Gr(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=""}function Vr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Sa(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ra(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Ir(e,t):Hr(e,t)},e),e.display.scrollbars.addClass&&o(e.display.wrapper,e.display.scrollbars.addClass)}function $r(e,t){if(!Ne(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!pa){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ft(e.display))+"px;\n height: "+(t.bottom-t.top+Bt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Yr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1;i=ur(e,t);var l=r&&r!=t?ur(e,r):i,s=Zr(e,Math.min(i.left,l.left),Math.min(i.top,l.top)-n,Math.max(i.left,l.left),Math.max(i.bottom,l.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Hr(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(Ir(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function Xr(e,t,r,n,i){var o=Zr(e,t,r,n,i);null!=o.scrollTop&&Hr(e,o.scrollTop),null!=o.scrollLeft&&Ir(e,o.scrollLeft)}function Zr(e,t,r,n,i){var o=e.display,a=gr(e.display);r<0&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Kt(e),c={};i-r>s&&(i=r+s);var u=e.doc.height+jt(o),d=r<a,f=i>u-a;if(r<l)c.scrollTop=d?0:r;else if(i>l+s){var h=Math.min(r,(f?u:i)-s);h!=l&&(c.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=qt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=n-t>g;return m&&(n=t+g),t<10?c.scrollLeft=0:t<p?c.scrollLeft=Math.max(0,t-(m?0:10)):n>g+p-3&&(c.scrollLeft=n+(m?0:10)-g),c}function Qr(e,t,r){null==t&&null==r||en(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Jr(e){en(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?W(t.line,t.ch-1):t,n=W(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function en(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=dr(e,t.from),n=dr(e,t.to),i=Zr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function tn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ll},wt(e.curOp)}function rn(e){var t=e.curOp;kt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;nn(e)})}function nn(e){for(var t=e.ops,r=0;r<t.length;r++)on(t[r]);for(var n=0;n<t.length;n++)an(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var a=0;a<t.length;a++)cn(t[a])}function on(e){var t=e.cm,r=t.display;Cn(t),e.updateMaxLine&&ge(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new kn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function an(e){e.updatedDisplay=e.mustUpdate&&Sn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=Br(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(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+Bt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==Ta()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&An(t,e.barMeasure),e.selectionChanged&&Mr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&_r(e.cm)}function cn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Tn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,Wr(t)),e.scrollToPos){var i=Yr(t,I(n,e.scrollToPos.from),I(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&$r(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Ae(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Ae(a[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ae(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();tn(e);try{return t()}finally{rn(e)}}function dn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tn(e);try{return t.apply(e,arguments)}finally{rn(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);tn(this);try{return e.apply(this,arguments)}finally{rn(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tn(t);try{return e.apply(this,arguments)}finally{rn(t)}}}function pn(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)Ia&&ce(e.doc,t)<i.viewTo&&mn(e);else if(r<=i.viewFrom)Ia&&ue(e.doc,r+n)>i.viewFrom?mn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)mn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):mn(e)}else if(r>=i.viewTo){var a=vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mn(e)}else{var l=vn(e,t,t,-1),s=vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(bt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):mn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function gn(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[kr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);d(a,r)==-1&&a.push(r)}}}function mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=kr(e,t),a=e.display.view;if(!Ia||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;ce(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function yn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=bt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(kr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,kr(e,r)))),n.viewTo=r}function bn(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 wn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,l(xn,e))}function xn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=$e(t.mode,Je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,l?$e(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(t.frontier),o.stateAfter=l?n:$e(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&et(e,o.text,n),o.stateAfter=t.frontier%5==0?$e(t.mode,n):null;if(++t.frontier,+new Date>r)return wn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)gn(e,i[t],"text")})}}function kn(e,t,r){var n=e.display;this.viewport=t,this.visible=Dr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=qt(e),this.force=r,this.dims=vr(e),this.events=[]}function Cn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Bt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Bt(e)+"px",t.scrollbarsClipped=!0)}function Sn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return mn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==bn(e))return!1;Er(e)&&(mn(e),r.dims=vr(e));var o=i.first+i.size,a=Math.max(r.visible.from-e.options.viewportMargin,i.first),l=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(i.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),Ia&&(a=ce(e.doc,a),l=ue(e.doc,l));var s=a!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;yn(e,a,l),n.viewOffset=he(S(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=bn(e);if(!s&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ta();return c>4&&(n.lineDiv.style.display="none"),Mn(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,u&&Ta()!=u&&u.offsetHeight&&u.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function Tn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=qt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+jt(e.display)-Kt(e),r.top)}),t.visible=Dr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Sn(e,t);n=!1){zr(e);var i=Br(e);Cr(e),Ur(e,i),An(e,i)}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 Ln(e,t){var r=new kn(e,t);if(Sn(e,r)){zr(e),Tn(e,r);var n=Br(e);Cr(e),Ur(e,n),An(e,n),r.finish()}}function Mn(e,r,n){function i(t){var r=t.nextSibling;return sa&&va&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=i(s);var p=a&&null!=r&&r<=u&&h.lineNumber;h.changes&&(d(h.changes,"gutter")>-1&&(p=!1),Tt(e,h,u,n)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(O(e.options,u)))),s=h.node.nextSibling}else{var g=Et(e,h,u,n);l.insertBefore(g,s)}u+=h.size}for(;s;)s=i(s)}function _n(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px";
4
- }function An(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+Bt(e)+"px"}function Nn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",_n(e)}function On(e){var t=d(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Wn(e,t){this.ranges=e,this.primIndex=t}function En(e,t){this.anchor=e,this.head=t}function zn(e,t){var r=e[t];e.sort(function(e,t){return E(e.from(),t.from())}),t=d(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(E(o.to(),i.from())>=0){var a=D(o.from(),i.from()),l=P(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new En(s?l:a,s?a:l))}}return new Wn(e,t)}function Pn(e,t){return new Wn([new En(e,t||e)],0)}function Dn(e){return e.text?W(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Hn(e,t){if(E(e,t.from)<0)return e;if(E(e,t.to)<=0)return Dn(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+=Dn(t).ch-t.to.ch),W(r,n)}function In(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new En(Hn(i.anchor,t),Hn(i.head,t)))}return zn(r,e.sel.primIndex)}function Fn(e,t,r){return e.line==t.line?W(r.line,e.ch-t.ch+r.ch):W(r.line+(e.line-t.line),e.ch)}function jn(e,t,r){for(var n=[],i=W(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Fn(l.from,i,o),c=Fn(Dn(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=E(u.head,u.anchor)<0;n[a]=new En(d?c:s,d?s:c)}else n[a]=new En(s,s)}return new Wn(n,e.sel.primIndex)}function Rn(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Bn(e)}function Bn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,wn(e,100),e.state.modeGen++,e.curOp&&pn(e)}function qn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==p(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Kn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),Ct(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new lt(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=S(e,l.line),d=S(e,s.line),f=p(c),h=i(c.length-1),g=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(qn(e,t)){var m=a(0,c.length-1);o(d,d.text,h),g&&e.remove(l.line,g),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var v=a(1,c.length-1);v.push(new lt(f+u.text.slice(s.ch),h,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,g);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),h);var y=a(1,c.length-1);g>1&&e.remove(l.line+1,g-1),e.insert(l.line+1,y)}Ct(e,"change",e,t)}function Un(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function Gn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wr(e),Rn(e),e.options.lineWrapping||ge(e),e.options.mode=t.modeOption,pn(e)}function Vn(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 $n(e,t){var r={from:z(t.from),to:Dn(t),text:T(e,t.from,t.to)};return ti(e,r,t.from.line,t.to.line+1),Un(e,function(e){return ti(e,r,t.from.line,t.to.line+1)},!0),r}function Yn(e){for(;e.length;){var t=p(e);if(!t.ranges)break;e.pop()}}function Xn(e,t){return t?(Yn(e.done),p(e.done)):e.done.length&&!p(e.done).ranges?p(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),p(e.done)):void 0}function Zn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))a=p(o.changes),0==E(t.from,t.to)&&0==E(t.from,a.to)?a.to=Dn(t):o.changes.push($n(e,t));else{var s=p(i.done);for(s&&s.ranges||ei(e.sel,i.done),o={changes:[$n(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=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ae(e,"historyAdded")}function Qn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Jn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Qn(e,o,p(i.done),t))?i.done[i.done.length-1]=t:ei(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Yn(i.undone)}function ei(e,t){var r=p(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ti(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ri(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 ni(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ri(r[i]));return n}function ii(e,t){var r=ni(e,t),n=Y(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function oi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Wn.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&d(t,Number(u[1]))>-1&&(p(l)[f]=c[f],delete c[f])}}}return n}function ai(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=E(r,i)<0;o!=E(n,i)<0?(i=r,r=n):o!=E(r,n)<0&&(r=n)}return new En(i,r)}return new En(n||r,r)}function li(e,t,r,n){hi(e,new Wn([ai(e,e.sel.primary(),t,r)],0),n)}function si(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=ai(e,e.sel.ranges[i],t[i],null);var o=zn(n,e.sel.primIndex);hi(e,o,r)}function ci(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,hi(e,zn(i,e.sel.primIndex),n)}function ui(e,t,r,n){hi(e,Pn(t,r),n)}function di(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new En(I(e,t[n].anchor),I(e,t[n].head))},origin:r&&r.origin};return Ae(e,"beforeSelectionChange",e,n),e.cm&&Ae(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?zn(n.ranges,n.ranges.length-1):t}function fi(e,t,r){var n=e.history.done,i=p(n);i&&i.ranges?(n[n.length-1]=t,pi(e,t,r)):hi(e,t,r)}function hi(e,t,r){pi(e,t,r),Jn(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function pi(e,t,r){(We(e,"beforeSelectionChange")||e.cm&&We(e.cm,"beforeSelectionChange"))&&(t=di(e,t,r));var n=r&&r.bias||(E(t.primary().head,e.sel.primary().head)<0?-1:1);gi(e,vi(e,t,n,!0)),r&&r.scroll===!1||!e.cm||Jr(e.cm)}function gi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Oe(e.cm)),Ct(e,"cursorActivity",e))}function mi(e){gi(e,vi(e,e.sel,null,!1),Oa)}function vi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=bi(e,a.anchor,l&&l.anchor,r,n),c=bi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new En(s,c))}return i?zn(i,t.primIndex):t}function yi(e,t,r,n,i){var o=S(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Ae(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=wi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=E(c,r))&&(n<0?u<0:u>0))return yi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=wi(e,d,n,d.line==t.line?o:null)),d?yi(e,d,t,n,i):null}}return t}function bi(e,t,r,n,i){var o=n||1,a=yi(e,t,r,o,i)||!i&&yi(e,t,r,o,!0)||yi(e,t,r,-o,i)||!i&&yi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,W(e.first,0))}function wi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?I(e,W(t.line-1)):null:r>0&&t.ch==(n||S(e,t.line)).text.length?t.line<e.first+e.size-1?W(t.line+1,0):null:new W(t.line,t.ch+r)}function xi(e){e.setSelection(W(e.firstLine(),0),W(e.lastLine()),Oa)}function ki(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=I(e,t)),r&&(n.to=I(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Ae(e,"beforeChange",e,n),e.cm&&Ae(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Ci(e,t,r){if(e.cm){if(!e.cm.curOp)return dn(e.cm,Ci)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"))||(t=ki(e,t,!0))){var n=Ha&&!r&&Z(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Si(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Si(e,t)}}function Si(e,t){if(1!=t.text.length||""!=t.text[0]||0!=E(t.from,t.to)){var r=In(e,t);Zn(e,t,r,e.cm?e.cm.curOp.id:NaN),Mi(e,t,r,Y(e,t));var n=[];Un(e,function(e,r){r||d(n,e.history)!=-1||(Wi(e.history,t),n.push(e.history)),Mi(e,t,null,Y(e,t))})}}function Ti(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(ei(n,l),r&&!n.equals(e.sel))return void hi(e,n,{clearRedo:!1});o=n}var c=[];ei(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"),f=function(r){var i=n.changes[r];if(i.origin=t,u&&!ki(e,i,!1))return a.length=0,{};c.push($n(e,i));var o=r?In(e,i):p(a);Mi(e,i,o,ii(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Dn(i)});var l=[];Un(e,function(e,t){t||d(l,e.history)!=-1||(Wi(e.history,i),l.push(e.history)),Mi(e,i,null,ii(e,i))})},h=n.changes.length-1;h>=0;--h){var g=f(h);if(g)return g.v}}}}function Li(e,t){if(0!=t&&(e.first+=t,e.sel=new Wn(g(e.sel.ranges,function(e){return new En(W(e.anchor.line+t,e.anchor.ch),W(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)gn(e.cm,n,"gutter")}}function Mi(e,t,r,n){if(e.cm&&!e.cm.curOp)return dn(e.cm,Mi)(e,t,r,n);if(t.to.line<e.first)return void Li(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Li(e,i),t={from:W(e.first,0),to:W(t.to.line+i,t.to.ch),text:[p(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:W(o,S(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=In(e,t)),e.cm?_i(e.cm,t,n):Kn(e,t,n),pi(e,r,Oa)}}function _i(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=_(le(S(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Oe(e),Kn(n,t,r,br(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=pe(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),wn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||qn(e.doc,t)?pn(e,o.line,a.line+1,c):gn(e,o.line,"text");var u=We(e,"changes"),d=We(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ct(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ai(e,t,r,n,i){if(n||(n=r),E(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Ci(e,{from:r,to:n,text:t,origin:i})}function Ni(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Oi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Ni(o.ranges[l].anchor,t,r,n),Ni(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=W(c.from.line+n,c.from.ch),c.to=W(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Wi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Oi(e.done,r,n,i),Oi(e.undone,r,n,i)}function Ei(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=S(e,H(e,t)):i=_(t),null==i?null:(n(o,i)&&e.cm&&gn(e.cm,i,r),o)}function zi(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r}function Pi(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null}function Di(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t}function Hi(e,t,r){he(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Qr(e,null,r)}function Ii(e,t,r,n){var i=new Di(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ei(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!de(e,t)){var n=he(t)<e.scrollTop;M(t,t.height+Ht(i)),n&&Qr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Fi(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++sl}function ji(e,t,r,i,o){if(i&&i.shared)return Bi(e,t,r,i,o);if(e.cm&&!e.cm.curOp)return dn(e.cm,ji)(e,t,r,i,o);var a=new Fi(e,o),l=E(t,r);if(i&&s(i,a,!1),l>0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=n("span",[a.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ae(e,t.line,t,r,a)||t.line!=r.line&&ae(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");B()}a.addToHistory&&Zn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var c,u=t.line,d=e.cm;if(e.iter(u,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&le(e)==d.display.maxLine&&(c=!0),a.collapsed&&u!=t.line&&M(e,0),G(e,new q(a,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),a.collapsed&&e.iter(t.line,r.line+1,function(t){de(e,t)&&M(t,0)}),a.clearOnEnter&&Ra(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(R(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++sl,a.atomic=!0),d){if(c&&(d.curOp.updateMaxLine=!0),a.collapsed)pn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)gn(d,f,"text");a.atomic&&mi(d.doc),Ct(d,"markerAdded",d,a)}return a}function Ri(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r}function Bi(e,t,r,n,i){n=s(n),n.shared=!1;var o=[ji(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Un(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(ji(e,I(e,t),I(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=p(o)}),new Ri(o,a)}function qi(e){return e.findMarks(W(e.first,0),e.clipPos(W(e.lastLine())),function(e){return e.parent})}function Ki(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(E(o,a)){var l=ji(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function Ui(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Un(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];d(n,o.doc)==-1&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}function Gi(e){var t=this;if(Yi(t),!Ne(t,e)&&!It(t.display,e)){ze(e),aa&&(dl=+new Date);var r=xr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(e,n){if(!t.options.allowDropFileTypes||d(t.options.allowDropFileTypes,e.type)!=-1){var l=new FileReader;l.onload=dn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=I(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ci(t.doc,s),fi(t.doc,Pn(r,Dn(s)))}}),l.readAsText(e)}},s=0;s<i;++s)l(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),pi(t.doc,Pn(r,r)),u)for(var f=0;f<u.length;++f)Ai(t.doc,"",u[f].anchor,u[f].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Vi(e,t){if(aa&&(!e.state.draggingText||+new Date-dl<100))return void He(t);if(!Ne(e,t)&&!It(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!fa)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",da&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),da&&r.parentNode.removeChild(r)}}function $i(e,t){var i=xr(e,t);if(i){var o=document.createDocumentFragment();Tr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Yi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Xi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Zi(){fl||(Qi(),fl=!0)}function Qi(){var e;Ra(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Xi(Ji)},100))}),Ra(window,"blur",function(){return Xi(Or)})}function Ji(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function eo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function to(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=g(r.split(" "),eo),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function ro(e,t,r,n){t=oo(t);var i=t.call?t.call(e,n):t[e];if(i===!1)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 ro(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=ro(e,t.fallthrough[o],r,n);if(a)return a}}}function no(e){var t="string"==typeof e?e:hl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function io(e,t){if(da&&34==e.keyCode&&e["char"])return!1;var r=hl[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(ka?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(ka?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function oo(e){return"string"==typeof e?vl[e]:e}function ao(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&E(o.from,p(n).to)<=0;){var a=n.pop();if(E(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ai(e.doc,"",n[t].from,n[t].to,"+delete");Jr(e)})}function lo(e,t){var r=S(e.doc,t),n=le(r);n!=r&&(t=_(n));var i=Le(n),o=i?i[0].level%2?we(n):be(n):0;return W(t,o)}function so(e,t){for(var r,n=S(e.doc,t);r=oe(n);)n=r.find(1,!0).line,t=null;var i=Le(n),o=i?i[0].level%2?be(n):we(n):n.text.length;return W(null==t?_(n):t,o)}function co(e,t){var r=lo(e,t.line),n=S(e.doc,r.line),i=Le(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return W(r.line,a?0:o)}return r}function uo(e,t,r){if("string"==typeof t&&(t=wl[t],!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)!=Na}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function fo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=ro(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&ro(t,e.options.extraKeys,r,e)||ro(t,e.options.keyMap,r,e)}function ho(e,t,r,n){var i=e.state.keySeq;if(i){if(no(t))return"handled";xl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=fo(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ct(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(ze(r),Mr(e)),i&&!o&&/\'$/.test(t)?(ze(r),!0):!!o}function po(e,t){var r=io(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+r,t,function(t){return uo(e,t,!0)})||ho(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return uo(e,t)}):ho(e,r,t,function(t){return uo(e,t)}))}function go(e,t,r){return ho(e,"'"+r+"'",t,function(t){return uo(e,t,!0)})}function mo(e){var t=this;if(t.curOp.focus=Ta(),!Ne(t,e)){aa&&la<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=po(t,e);da&&(kl=n?r:null,!n&&88==r&&!Ga&&(va?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||vo(t)}}function vo(e){function t(e){18!=e.keyCode&&e.altKey||(Sa(r,"CodeMirror-crosshair"),_e(document,"keyup",t),_e(document,"mouseover",t))}var r=e.display.lineDiv;o(r,"CodeMirror-crosshair"),Ra(document,"keyup",t),Ra(document,"mouseover",t)}function yo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ne(this,e)}function bo(e){var t=this;if(!(It(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||va&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(da&&r==kl)return kl=null,void ze(e);if(!da||e.which&&!(e.which<10)||!po(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(go(t,e,i)||t.display.input.onKeyPress(e))}}}function wo(e){var t=this,r=t.display;if(!(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,It(r,e))return void(sa||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!To(t,e)){var n=xr(t,e);switch(window.focus(),Fe(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?xo(t,e,n):Ie(e)==r.scroller&&ze(e);break;case 2:sa&&(t.state.lastMiddleDown=+new Date),n&&li(t.doc,n),setTimeout(function(){return r.input.focus()},20),ze(e);break;case 3:Ca?Lo(t,e):Ar(t)}}}}function xo(e,t,r){aa?setTimeout(l(_r,e),0):e.curOp.focus=Ta();var n,i=+new Date;bl&&bl.time>i-400&&0==E(bl.pos,r)?n="triple":yl&&yl.time>i-400&&0==E(yl.pos,r)?(n="double",bl={time:i,pos:r}):(n="single",yl={time:i,pos:r});var o,a=e.doc.sel,s=va?t.metaKey:t.ctrlKey;e.options.dragDrop&&qa&&!e.isReadOnly()&&"single"==n&&(o=a.contains(r))>-1&&(E((o=a.ranges[o]).from(),r)<0||r.xRel>0)&&(E(o.to(),r)>0||r.xRel<0)?ko(e,t,r,s):Co(e,t,r,n,s)}function ko(e,t,r,n){var i=e.display,o=+new Date,a=dn(e,function(l){sa&&(i.scroller.draggable=!1),e.state.draggingText=!1,_e(document,"mouseup",a),_e(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ze(l),!n&&+new Date-200<o&&li(e.doc,r),sa||aa&&9==la?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});sa&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=va?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Ra(document,"mouseup",a),Ra(i.scroller,"drop",a)}function Co(e,t,r,n,i){function o(t){if(0!=E(y,t))if(y=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=c(S(u,r.line).text,r.ch,o),l=c(S(u,t.line).text,t.ch,o),s=Math.min(a,l),g=Math.max(a,l),m=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=v;m++){var b=S(u,m).text,w=f(b,s,o);s==g?i.push(new En(W(m,w),W(m,w))):b.length>w&&i.push(new En(W(m,w),W(m,f(b,g,o))))}i.length||i.push(new En(r,r)),hi(u,zn(p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=d,k=x.anchor,C=t;if("single"!=n){var T;T="double"==n?e.findWordAt(t):new En(W(t.line,0),I(u,W(t.line+1,0))),E(T.anchor,k)>0?(C=T.head,k=D(x.from(),T.anchor)):(C=T.anchor,k=P(x.to(),T.head))}var L=p.ranges.slice(0);L[h]=new En(I(u,k),C),hi(u,zn(L,h),Wa)}}function a(t){var r=++w,i=xr(e,t,!0,"rect"==n);if(i)if(0!=E(i,y)){e.curOp.focus=Ta(),o(i);var l=Dr(s,u);(i.line>=l.to||i.line<l.from)&&setTimeout(dn(e,function(){w==r&&a(t)}),150)}else{var c=t.clientY<b.top?-20:t.clientY>b.bottom?20:0;c&&setTimeout(dn(e,function(){w==r&&(s.scroller.scrollTop+=c,a(t))}),50)}}function l(t){e.state.selectingText=!1,w=1/0,ze(t),s.input.focus(),_e(document,"mousemove",x),_e(document,"mouseup",k),u.history.lastSelOrigin=null}var s=e.display,u=e.doc;ze(t);var d,h,p=u.sel,g=p.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),d=h>-1?g[h]:new En(r,r)):(d=u.sel.primary(),h=u.sel.primIndex),ya?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(d=new En(r,r)),r=xr(e,t,!0,!0),h=-1;else if("double"==n){var m=e.findWordAt(r);d=e.display.shift||u.extend?ai(u,d,m.anchor,m.head):m}else if("triple"==n){var v=new En(W(r.line,0),I(u,W(r.line+1,0)));d=e.display.shift||u.extend?ai(u,d,v.anchor,v.head):v}else d=ai(u,d,r);i?h==-1?(h=g.length,hi(u,zn(g.concat([d]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"single"==n&&!t.shiftKey?(hi(u,zn(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):ci(u,h,d,Wa):(h=0,hi(u,new Wn([d],0),Wa),p=u.sel);var y=r,b=s.wrapper.getBoundingClientRect(),w=0,x=dn(e,function(e){Fe(e)?a(e):l(e)}),k=dn(e,l);e.state.selectingText=k,Ra(document,"mousemove",x),Ra(document,"mouseup",k)}function So(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!We(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=A(e.doc,o),d=e.options.gutters[s];return Ae(e,r,e,u,d,t),De(t)}}}function To(e,t){return So(e,t,"gutterClick",!0)}function Lo(e,t){It(e.display,t)||Mo(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Mo(e,t){return!!We(e,"gutterContextMenu")&&So(e,t,"gutterContextMenu",!1)}function _o(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ir(e)}function Ao(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Cl&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Cl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Rn(e)},!0),t("indentUnit",2,Rn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Bn(e),ir(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(W(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ai(e.doc,t,r[i],W(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Cl&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ma?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ba),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){_o(e),No(e)},!0),t("keyMap","default",function(e,t,r){var n=oo(t),i=r!=Cl&&oo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Wo,!0),t("gutters",[],function(e){On(e.options),No(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?yr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Ur(e)},!0),t("scrollbarStyle","native",function(e){Vr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){On(e.options),No(e)},!0),t("firstLineNumber",1,No,!0),t("lineNumberFormatter",function(e){return e},No,!0),t("showCursorWhenSelecting",!1,Cr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Or(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Oo),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Cr,!0),t("singleCursorHeightPerLine",!0,Cr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Bn,!0),t("addModeClass",!1,Bn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Bn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function No(e){Nn(e),pn(e),setTimeout(function(){return Wr(e)},20)}function Oo(e,t,r){var n=r&&r!=Cl;if(!t!=!n){var i=e.display.dragFunctions,o=t?Ra:_e;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Wo(e){e.options.lineWrapping?(o(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Sa(e.display.wrapper,"CodeMirror-wrap"),ge(e)),wr(e),pn(e),ir(e),setTimeout(function(){return Ur(e)},100)}function Eo(e,t){var r=this;if(!(this instanceof Eo))return new Eo(e,t);this.options=t=t?s(t):{},s(Sl,t,!1),On(t);var n=t.value;"string"==typeof n&&(n=new ul(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new Eo.inputStyles[t.inputStyle](this),o=this.display=new C(e,n,i);
5
- o.wrapper.CodeMirror=this,Nn(this),_o(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!ma&&o.input.focus(),Vr(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 u,keySeq:null,specialChars:null},aa&&la<11&&setTimeout(function(){return r.display.input.reset(!0)},20),zo(this),Zi(),tn(this),this.curOp.forceUpdate=!0,Gn(this,n),t.autofocus&&!ma||this.hasFocus()?setTimeout(l(Nr,this),20):Or(this);for(var a in Tl)Tl.hasOwnProperty(a)&&Tl[a](r,t[a],Cl);Er(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Ll.length;++c)Ll[c](r);rn(this),sa&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function zo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Ra(i.scroller,"mousedown",dn(e,wo)),aa&&la<11?Ra(i.scroller,"dblclick",dn(e,function(t){if(!Ne(e,t)){var r=xr(e,t);if(r&&!To(e,t)&&!It(e.display,t)){ze(t);var n=e.findWordAt(r);li(e.doc,n.anchor,n.head)}}})):Ra(i.scroller,"dblclick",function(t){return Ne(e,t)||ze(t)}),Ca||Ra(i.scroller,"contextmenu",function(t){return Lo(e,t)});var o,a={end:0};Ra(i.scroller,"touchstart",function(t){if(!Ne(e,t)&&!r(t)){clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ra(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ra(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!It(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new En(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new En(W(l.line,0),I(e.doc,W(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ze(r)}t()}),Ra(i.scroller,"touchcancel",t),Ra(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Hr(e,i.scroller.scrollTop),Ir(e,i.scroller.scrollLeft,!0),Ae(e,"scroll",e))}),Ra(i.scroller,"mousewheel",function(t){return Rr(e,t)}),Ra(i.scroller,"DOMMouseScroll",function(t){return Rr(e,t)}),Ra(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ne(e,t)||He(t)},over:function(t){Ne(e,t)||($i(e,t),He(t))},start:function(t){return Vi(e,t)},drop:dn(e,Gi),leave:function(t){Ne(e,t)||Yi(e)}};var l=i.input.getField();Ra(l,"keyup",function(t){return yo.call(e,t)}),Ra(l,"keydown",dn(e,mo)),Ra(l,"keypress",dn(e,bo)),Ra(l,"focus",function(t){return Nr(e,t)}),Ra(l,"blur",function(t){return Or(e,t)})}function Po(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Je(e,t):r="prev");var a=e.options.tabSize,l=S(o,t),s=c(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,d=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(u=o.mode.indent(i,l.text.slice(d.length),l.text),u==Na||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?c(S(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/a);g;--g)p+=a,f+="\t";if(p<u&&(f+=h(u-p)),f!=d)return Ai(o,f,W(t,0),W(t,d.length),"+input"),l.stateAfter=null,!0;for(var m=0;m<o.sel.ranges.length;m++){var v=o.sel.ranges[m];if(v.head.line==t&&v.head.ch<d.length){var y=W(t,d.length);ci(o,m,new En(y,y));break}}}function Do(e){Ml=e}function Ho(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Ka(t),s=null;if(a&&n.ranges.length>1)if(Ml&&Ml.text.join("\n")==t){if(n.ranges.length%Ml.text.length==0){s=[];for(var c=0;c<Ml.text.length;c++)s.push(o.splitLines(Ml.text[c]))}}else l.length==n.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],h=f.from(),m=f.to();f.empty()&&(r&&r>0?h=W(h.line,h.ch-r):e.state.overwrite&&!a?m=W(m.line,Math.min(S(o,m.line).text.length,m.ch+p(l).length)):Ml&&Ml.lineWise&&Ml.text.join("\n")==t&&(h=m=W(h.line,0))),u=e.curOp.updateInput;var v={from:h,to:m,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Ci(e.doc,v),Ct(e,"inputRead",e,v)}t&&!a&&Fo(e,t),Jr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Io(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Ho(t,r,0,null,"paste")}),!0}function Fo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Po(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(S(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Po(e,i.head.line,"smart"));a&&Ct(e,"electricInput",e,i.head.line)}}}function jo(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:W(i,0),head:W(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ro(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Bo(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return sa?e.style.width="1000px":e.setAttribute("wrap","off"),ga&&(e.style.border="1px solid black"),Ro(e),t}function qo(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&dn(this,t[e])(this,r,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](oo(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:fn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,pn(this)}),removeOverlay:fn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void pn(t)}}),indentLine:fn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),N(this.doc,e)&&Po(this,e,t,r)}),indentSelection:fn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Po(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Jr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Po(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&ci(t.doc,i,new En(a,u[i].to()),Oa)}}}),getTokenAt:function(e,t){return nt(this,e,t)},getLineTokens:function(e,t){return nt(this,W(e),t,!0)},getTokenTypeAt:function(e){e=I(this.doc,e);var t,r=Qe(this,S(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&d(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=H(r,null==e?r.first+r.size-1:e),Je(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?I(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return cr(this,I(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),hr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,A(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=S(this.doc,e)}else r=e;return lr(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-he(r):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return mr(this.display)},setGutterMarker:fn(function(e,t,r){return Ei(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&x(n)&&(e.gutterMarkers=null),!0})}),clearGutter:fn(function(e){var t=this,r=this.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,gn(t,n,"gutter"),x(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){var t;if("number"==typeof e){if(!N(this.doc,e))return null;if(t=e,e=S(this.doc,e),!e)return null}else if(t=_(e),null==t)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}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,I(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Xr(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:fn(mo),triggerOnKeyPress:fn(bo),triggerOnKeyUp:yo,execCommand:function(e){if(wl.hasOwnProperty(e))return wl[e].call(null,this)},triggerElectric:fn(function(e){Fo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=I(this.doc,e),l=0;l<t&&(a=Ko(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:fn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ko(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Ea)}),deleteH:fn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):ao(this,function(r){var i=Ko(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=I(this.doc,e),s=0;s<t;++s){var c=ur(i,l,"div");if(null==a?a=c.left:c.left=a,l=Uo(i,c,o,r),l.hitSide)break}return l},moveV:fn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=ur(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Uo(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Qr(r,null,cr(r,s,"div").top-l.top),s},Ea),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=S(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var a=r.charAt(n),l=w(a,o)?function(e){return w(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new En(W(e.line,n),W(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?o(this.display.cursorDiv,"CodeMirror-overwrite"):Sa(this.display.cursorDiv,"CodeMirror-overwrite"),Ae(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ta()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:fn(function(e,t){null==e&&null==t||en(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Bt(this)-this.display.barHeight,width:e.scrollWidth-Bt(this)-this.display.barWidth,clientHeight:Kt(this),clientWidth:qt(this)}},scrollIntoView:fn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:W(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)en(this),this.curOp.scrollToPos=e;else{var r=Zr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:fn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&nr(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){gn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ae(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:fn(function(){var e=this.display.cachedTextHeight;pn(this),this.curOp.forceUpdate=!0,ir(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),_n(this),(null==e||Math.abs(e-gr(this.display))>.5)&&wr(this),Ae(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Gn(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),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}},Ee(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Ko(e,t,r,n,i){function o(){var t=l+r;return!(t<e.first||t>=e.first+e.size)&&(l=t,u=S(e,t))}function a(e){var t=(i?Se:Te)(u,s,r,!0);if(null==t){if(e||!o())return!1;s=i?(r<0?we:be)(u):r<0?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=r,u=S(e,l);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var d=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var g=u.text.charAt(s)||"\n",m=w(g,h)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||m||(m="s"),d&&d!=m){r<0&&(r=1,a());break}if(m&&(d=m),r>0&&!a(!p))break}var v=bi(e,W(l,s),t,c,!0);return E(t,v)||(v.hitSide=!0),v}function Uo(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*gr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=hr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Go(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new u,this.gracePeriod=!1}function Vo(e,t){var r=Yt(e,t.line);if(!r||r.hidden)return null;var n=S(e.doc,t.line),i=Gt(r,n,t.line),o=Le(n),a="left";if(o){var l=ke(o,t.ch);a=l%2?"right":"left"}var s=Qt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $o(e,t){return t&&(e.bad=!0),e}function Yo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(l+=r);var u,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(W(n,0),W(i+1,0),o(+d));return void(f.length&&(u=f[0].find())&&(l+=T(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h<t.childNodes.length;h++)a(t.childNodes[h]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+=c,s=!1),l+=p}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=r;)t=t.nextSibling;return l}function Xo(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return $o(e.clipPos(W(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 Zo(o,t,r)}}function Zo(e,t,r){function n(t,r,n){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=_(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),W(s,c)}}}var o=e.text.firstChild,a=!1;if(!t||!i(o,t))return $o(W(_(e.line),0),!0);if(t==o&&(a=!0,t=o.childNodes[r],r=0,!t)){var l=e.rest?p(e.rest):e.line;return $o(W(_(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=o;)c=c.parentNode;var u=e.measure,d=u.maps,f=n(s,c,r);if(f)return $o(f,a);for(var h=c.nextSibling,g=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return $o(W(f.line,f.ch-g),a);g+=h.textContent.length}for(var m=c.previousSibling,v=r;m;m=m.previousSibling){if(f=n(m,m.firstChild,-1))return $o(W(f.line,f.ch+v),a);v+=m.textContent.length}}function Qo(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new u,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Jo(e,t){function r(){e.value=c.getValue()}if(t=t?s(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=Ta();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(Ra(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var c=Eo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return c}function ea(e){e.off=_e,e.on=Ra,e.wheelEventPixels=jr,e.Doc=ul,e.splitLines=Ka,e.countColumn=c,e.findColumn=f,e.isWordChar=b,e.Pass=Na,e.signal=Ae,e.Line=lt,e.changeEnd=Dn,e.scrollbarModel=al,e.Pos=W,e.cmpPos=E,e.modes=$a,e.mimeModes=Ya,e.resolveMode=Ue,e.getMode=Ge,e.modeExtensions=Xa,e.extendMode=Ve,e.copyState=$e,e.startState=Xe,e.innerMode=Ye,e.commands=wl,e.keyMap=vl,e.keyName=io,e.isModifierKey=no,e.lookupKey=ro,e.normalizeKeyMap=to,e.StringStream=Za,e.SharedTextMarker=Ri,e.TextMarker=Fi,e.LineWidget=Di,e.e_preventDefault=ze,e.e_stopPropagation=Pe,e.e_stop=He,e.addClass=o,e.contains=i,e.rmClass=Sa,e.keyNames=hl}var ta=navigator.userAgent,ra=navigator.platform,na=/gecko\/\d/i.test(ta),ia=/MSIE \d/.test(ta),oa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ta),aa=ia||oa,la=aa&&(ia?document.documentMode||6:oa[1]),sa=/WebKit\//.test(ta),ca=sa&&/Qt\/\d+\.\d+/.test(ta),ua=/Chrome\//.test(ta),da=/Opera\//.test(ta),fa=/Apple Computer/.test(navigator.vendor),ha=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ta),pa=/PhantomJS/.test(ta),ga=/AppleWebKit/.test(ta)&&/Mobile\/\w+/.test(ta),ma=ga||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ta),va=ga||/Mac/.test(ra),ya=/\bCrOS\b/.test(ta),ba=/win/i.test(ra),wa=da&&ta.match(/Version\/(\d*\.\d*)/);wa&&(wa=Number(wa[1])),wa&&wa>=15&&(da=!1,sa=!0);var xa,ka=va&&(ca||da&&(null==wa||wa<12.11)),Ca=na||aa&&la>=9,Sa=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};xa=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(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Ta=function(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e};aa&&la<11&&(Ta=function(){try{return document.activeElement}catch(e){return document.body}});var La=function(e){e.select()};ga?La=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:aa&&(La=function(e){try{e.select()}catch(t){}}),u.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Ma,_a,Aa=30,Na={toString:function(){return"CodeMirror.Pass"}},Oa={scroll:!1},Wa={origin:"*mouse"},Ea={origin:"+move"},za=[""],Pa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Da=/[\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]/,Ha=!1,Ia=!1,Fa=null,ja=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,u=[],d=0;d<n;++d)u.push(e(r.charCodeAt(d)));for(var f=0,h=c;f<n;++f){var g=u[f];"m"==g?u[f]=h:h=g}for(var m=0,v=c;m<n;++m){var y=u[m];"1"==y&&"r"==v?u[m]="n":a.test(y)&&(v=y,"r"==y&&(u[m]="R"))}for(var b=1,w=u[0];b<n-1;++b){var x=u[b];"+"==x&&"1"==w&&"1"==u[b+1]?u[b]="1":","!=x||w!=u[b+1]||"1"!=w&&"n"!=w||(u[b]=w),w=x}for(var k=0;k<n;++k){var C=u[k];if(","==C)u[k]="N";else if("%"==C){var S=void 0;for(S=k+1;S<n&&"%"==u[S];++S);for(var T=k&&"!"==u[k-1]||S<n&&"1"==u[S]?"1":"N",L=k;L<S;++L)u[L]=T;k=S-1}}for(var M=0,_=c;M<n;++M){var A=u[M];"L"==_&&"1"==A?u[M]="L":a.test(A)&&(_=A)}for(var N=0;N<n;++N)if(o.test(u[N])){var O=void 0;for(O=N+1;O<n&&o.test(u[O]);++O);for(var W="L"==(N?u[N-1]:c),E="L"==(O<n?u[O]:c),z=W||E?"L":"R",P=N;P<O;++P)u[P]=z;N=O-1}for(var D,H=[],I=0;I<n;)if(l.test(u[I])){var F=I;for(++I;I<n&&l.test(u[I]);++I);H.push(new t(0,F,I))}else{var j=I,R=H.length;for(++I;I<n&&"L"!=u[I];++I);for(var B=j;B<I;)if(s.test(u[B])){j<B&&H.splice(R,0,new t(1,j,B));var q=B;for(++B;B<I&&s.test(u[B]);++B);H.splice(R,0,new t(2,q,B)),j=B}else++B;j<I&&H.splice(R,0,new t(1,j,I))}return 1==H[0].level&&(D=r.match(/^\s+/))&&(H[0].from=D[0].length,H.unshift(new t(0,0,D[0].length))),1==p(H).level&&(D=r.match(/\s+$/))&&(p(H).to-=D[0].length,H.push(new t(0,n-D[0].length,n))),2==H[0].level&&H.unshift(new t(1,H[0].to,H[0].to)),H[0].level!=p(H).level&&H.push(new t(H[0].level,n,n)),H}}(),Ra=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={}),i=n[t]||(n[t]=[]);i.push(r)}},Ba=[],qa=function(){if(aa&&la<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Ka=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ua=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ga=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Va=null,$a={},Ya={},Xa={},Za=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Za.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t,r=this.string.charAt(this.pos);if(t="string"==typeof e?r==e:r&&(e.test?e.test(r):e(r)))return++this.pos,r},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=c(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return c(this.string,null,this.tabSize)-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},Ee(lt),lt.prototype.lineNo=function(){return _(this)};var Qa,Ja={},el={},tl=null,rl=null,nl={left:0,right:0,top:0,bottom:0},il=0,ol=null;aa?ol=-.53:na?ol=15:ua?ol=-.7:fa&&(ol=-1/3),qr.prototype=s({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=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=va&&!ha?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new u,this.disableVert=new u},enableZeroWidthBar:function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},qr.prototype),Kr.prototype=s({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},Kr.prototype);var al={"native":qr,"null":Kr},ll=0;kn.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)},kn.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Ae.apply(null,e.events[t])},Wn.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(0!=E(n.anchor,i.anchor)||0!=E(n.head,i.head))return!1}return!0},deepCopy:function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new En(z(e.ranges[r].anchor),z(e.ranges[r].head));return new Wn(t,this.primIndex);
6
- },somethingSelected:function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},contains:function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(E(t,i.from())>=0&&E(e,i.to())<=0)return n}return-1}},En.prototype={from:function(){return D(this.anchor,this.head)},to:function(){return P(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},zi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ct(o),Ct(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},iterN:function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0}},Pi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof zi))){var s=[];this.collapse(s),this.children=[new zi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new zi(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Pi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=d(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Pi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}}},Ee(Di),Di.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=_(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=Ht(this);M(n,Math.max(0,n.height-a)),t&&un(t,function(){Hi(t,n,-a),gn(t,i,"widget")})}},Di.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=Ht(this)-e;n&&(M(r,r.height+n),t&&un(t,function(){t.curOp.forceUpdate=!0,Hi(t,r,n)}))};var sl=0;Ee(Fi),Fi.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&tn(t),We(this,"clear")){var n=this.find();n&&Ct(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=K(l.markedSpans,e);t&&!e.collapsed?gn(t,_(l),"text"):t&&(null!=s.to&&(o=_(l)),null!=s.from&&(i=_(l))),l.markedSpans=U(l.markedSpans,s),null==s.from&&e.collapsed&&!de(e.doc,l)&&t&&M(l,gr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=le(e.lines[c]),d=pe(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&mi(t.doc)),t&&Ct(t,"markerCleared",t,this),r&&rn(t),this.parent&&this.parent.clear()}},Fi.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=K(a.markedSpans,r);if(null!=l.from&&(n=W(t?a:_(a),l.from),e==-1))return n;if(null!=l.to&&(i=W(t?a:_(a),l.to),1==e))return i}return n&&{from:n,to:i}},Fi.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&un(r,function(){var n=e.line,i=_(e.line),o=Yt(r,i);if(o&&(rr(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!de(t.doc,n)&&null!=t.height){var a=t.height;t.height=null;var l=Ht(t)-a;l&&M(n,n.height+l)}})},Fi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&d(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Fi.prototype.detachLine=function(e){if(this.lines.splice(d(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ee(Ri),Ri.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Ct(this,"clear")}},Ri.prototype.find=function(e,t){return this.primary.find(e,t)};var cl=0,ul=function(e,t,r,n){if(!(this instanceof ul))return new ul(e,t,r,n);null==r&&(r=0),Pi.call(this,[new zi([new lt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=W(r,0);this.sel=Pn(i),this.history=new Vn(null),this.id=++cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Kn(this,{from:i,to:i,text:e}),hi(this,Pn(i),Oa)};ul.prototype=y(Pi.prototype,{constructor:ul,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=L(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=W(this.first,0),r=this.first+this.size-1;Ci(this,{from:t,to:W(r,S(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),hi(this,Pn(t))}),replaceRange:function(e,t,r,n){t=I(this,t),r=r?I(this,r):t,Ai(this,e,t,r,n)},getRange:function(e,t,r){var n=T(this,I(this,e),I(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(N(this,e))return S(this,e)},getLineNumber:function(e){return _(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=S(this,e)),le(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return I(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,r){ui(this,I(this,"number"==typeof e?W(e,t||0):e),null,r)}),setSelection:hn(function(e,t,r){ui(this,I(this,e),I(this,t||e),r)}),extendSelection:hn(function(e,t,r){li(this,I(this,e),t&&I(this,t),r)}),extendSelections:hn(function(e,t){si(this,j(this,e),t)}),extendSelectionsBy:hn(function(e,t){var r=g(this.sel.ranges,e);si(this,j(this,r),t)}),setSelections:hn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new En(I(n,e[o].anchor),I(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),hi(this,zn(i,t),r)}}),addSelection:hn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new En(I(this,e),I(this,t||e))),hi(this,zn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=T(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=T(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},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:hn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&jn(this,i,t),c=i.length-1;c>=0;c--)Ci(n,i[c]);s?fi(this,s):this.cm&&Jr(this.cm)}),undo:hn(function(){Ti(this,"undo")}),redo:hn(function(){Ti(this,"redo")}),undoSelection:hn(function(){Ti(this,"undo",!0)}),redoSelection:hn(function(){Ti(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(){this.history=new Vn(this.history.maxGeneration)},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:oi(this.history.done),undone:oi(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=oi(e.done.slice(0),null,!0),t.undone=oi(e.undone.slice(0),null,!0)},addLineClass:hn(function(t,r,n){return Ei(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:hn(function(t,r,n){return Ei(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:hn(function(e,t,r){return Ii(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ji(this,I(this,e),I(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 e=I(this,e),ji(this,e,e,r,"bookmark")},findMarksAt:function(e){e=I(this,e);var t=[],r=S(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(e,t,r){e=I(this,e),t=I(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;return o>e?(t=e,!0):(e-=o,void++r)}),I(this,W(r,t))},indexFromPos:function(e){e=I(this,e);var t=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 ul(L(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);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 ul(L(this,t,r),e.mode||this.modeOption,t,this.lineSep);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}],Ki(n,qi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Eo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Ui(qi(t));break}}if(e.history==this.history){var i=[e.id];Un(e,function(e){return i.push(e.id)},!0),e.history=new Vn(null),e.history.done=oi(this.history.done,i),e.history.undone=oi(this.history.undone,i)}},iterLinkedDocs:function(e){Un(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ka(e)},lineSeparator:function(){return this.lineSep||"\n"}}),ul.prototype.eachLine=ul.prototype.iter;for(var dl=0,fl=!1,hl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",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"},pl=0;pl<10;pl++)hl[pl+48]=hl[pl+96]=String(pl);for(var gl=65;gl<=90;gl++)hl[gl]=String.fromCharCode(gl);for(var ml=1;ml<=12;ml++)hl[ml+111]=hl[ml+63235]="F"+ml;var vl={};vl.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"},vl.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"},vl.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"},vl.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"]},vl["default"]=va?vl.macDefault:vl.pcDefault;var yl,bl,wl={selectAll:xi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oa)},killLine:function(e){return ao(e,function(t){if(t.empty()){var r=S(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:W(t.head.line+1,0)}:{from:t.head,to:W(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ao(e,function(t){return{from:W(t.from().line,0),to:I(e.doc,W(t.to().line+1,0))}})},delLineLeft:function(e){return ao(e,function(e){return{from:W(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return ao(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ao(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},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(W(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(W(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return co(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return so(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ea)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ea)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?co(e,t.head):n},Ea)},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(),a=c(e.getLine(o.line),o.ch,n);t.push(h(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=S(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new W(i.line,i.ch-1)),i.ch>0)i=new W(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),W(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=S(e.doc,i.line-1).text;a&&(i=new W(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),W(i.line-1,a.length-1),i,"+transpose"))}r.push(new En(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Jr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},xl=new u,kl=null,Cl={toString:function(){return"CodeMirror.Init"}},Sl={},Tl={};Eo.defaults=Sl,Eo.optionHandlers=Tl;var Ll=[];Eo.defineInitHook=function(e){return Ll.push(e)};var Ml=null;Go.prototype=s({init:function(e){function t(e){if(!Ne(n,e)){if(n.somethingSelected())Do({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=jo(n);Do({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Oa),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Ml.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Bo(),l=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),l.value=Ml.text.join("\n");var s=document.activeElement;La(l),setTimeout(function(){n.display.lineSpace.removeChild(a),s.focus(),s==i&&r.showPrimarySelection()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;Ro(i,n.options.spellcheck),Ra(i,"paste",function(e){Ne(n,e)||Io(e,n)||la<=11&&setTimeout(dn(n,function(){r.pollContent()||pn(n)}),20)}),Ra(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(r.composing.sel=Pn(W(i.head.line,a),W(i.head.line,a+t.length)))}}),Ra(i,"compositionupdate",function(e){return r.composing.data=e.data}),Ra(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Ra(i,"touchstart",function(){return r.forceCompositionEnd()}),Ra(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||un(r.cm,function(){return pn(n)})}),Ra(i,"copy",t),Ra(i,"cut",t)},prepareSelection:function(){var e=Sr(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Xo(this.cm,e.anchorNode,e.anchorOffset),n=Xo(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=E(D(r,n),t.from())||0!=E(P(r,n),t.to())){var i=Vo(this.cm,t.from()),o=Vo(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};var u;try{u=xa(i.node,i.offset,o.offset,o.node)}catch(d){}u&&(!na&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||(e.removeAllRanges(),e.addRange(u))):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):na&&this.startGracePeriod()),this.rememberSelection()}}},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)},showMultipleSelections:function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return i(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=Xo(t,e.anchorNode,e.anchorOffset),n=Xo(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){hi(t.doc,Pn(r,n),Oa),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=kr(e,n.line))?(a=_(t.view[0].line),l=t.view[0].node):(a=_(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=kr(e,i.line);u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=_(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling);for(var d=e.doc.splitLines(Yo(e,l,c,a,s)),f=T(e.doc,W(a,0),W(s,S(e.doc,s).text.length));d.length>1&&f.length>1;)if(p(d)==p(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,g=0,m=d[0],v=f[0],y=Math.min(m.length,v.length);h<y&&m.charCodeAt(h)==v.charCodeAt(h);)++h;for(var b=p(d),w=p(f),x=Math.min(b.length-(1==d.length?h:0),w.length-(1==f.length?h:0));g<x&&b.charCodeAt(b.length-g-1)==w.charCodeAt(w.length-g-1);)++g;d[d.length-1]=b.slice(0,b.length-g),d[0]=d[0].slice(h);var k=W(a,h),C=W(s,f.length?p(f).length-g:0);return d.length>1||d[0]||E(k,C)?(Ai(e.doc,d,k,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?dn(this.cm,pn)(this.cm):e.data&&e.data!=e.startData&&dn(this.cm,Ho)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||dn(this.cm,Ho)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:v,resetPosition:v,needsContentAttribute:!0},Go.prototype),Qo.prototype=s({init:function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())Do({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Ml.text.join("\n"),La(a));else{if(!i.options.lineWiseCopyCut)return;var t=jo(i);Do({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Oa):(n.prevInput="",a.value=t.text.join("\n"),La(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Bo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),ga&&(a.style.width="0px"),Ra(a,"input",function(){aa&&la>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Ra(a,"paste",function(e){Ne(i,e)||Io(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Ra(a,"cut",t),Ra(a,"copy",t),Ra(e.scroller,"paste",function(t){It(e,t)||Ne(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Ra(e.lineSpace,"selectstart",function(t){It(e,t)||ze(t)}),Ra(a,"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"})}}),Ra(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Sr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},showSelection:function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Ga&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&La(this.textarea),aa&&la>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",aa&&la>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!ma||Ta()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ua(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(aa&&la>=9&&this.hasSelection===i||va&&/[\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 a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return un(t,function(){Ho(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?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},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){aa&&la>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=d,a.style.cssText=u,aa&&la<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!aa||aa&&la<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?dn(i,xi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=xr(i,e),s=o.scroller.scrollTop;if(l&&!da){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(l)==-1&&dn(i,hi)(i.doc,Pn(l),Oa);var u=a.style.cssText,d=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();
7
- a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(aa?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(sa&&(h=window.scrollY),o.input.focus(),sa&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),aa&&la>=9&&t(),Ca){He(e);var p=function(){_e(window,"mouseup",p),setTimeout(r,20)};Ra(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:v,needsContentAttribute:!1},Qo.prototype),Ao(Eo),qo(Eo);var _l="iter insert remove copy getEditor constructor".split(" ");for(var Al in ul.prototype)ul.prototype.hasOwnProperty(Al)&&d(_l,Al)<0&&(Eo.prototype[Al]=function(e){return function(){return e.apply(this.doc,arguments)}}(ul.prototype[Al]));return Ee(ul),Eo.inputStyles={textarea:Qo,contenteditable:Go},Eo.defineMode=function(e){Eo.defaults.mode||"null"==e||(Eo.defaults.mode=e),qe.apply(this,arguments)},Eo.defineMIME=Ke,Eo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Eo.defineMIME("text/plain","null"),Eo.defineExtension=function(e,t){Eo.prototype[e]=t},Eo.defineDocExtension=function(e,t){ul.prototype[e]=t},Eo.fromTextArea=Jo,ea(Eo),Eo.version="5.20.2",Eo})},{}],18:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return p=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:m),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();g=M.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,g,m=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},T=r.counterDescriptors||{},L=r.colorKeywords||{},M=r.valueKeywords||{},_=r.allowNested,A=r.supportsAtComponent===!0,N={};return N.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(A&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(_&&"("==e)return s(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(g="property","maybeprop"):C.hasOwnProperty(n)?(g="string-2","maybeprop"):_?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":_||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(g="error","block")},N.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},N.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&_)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else g+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(g="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},N.pseudo=function(e,t,r){return"word"==e?(g="variable-3",r.context.type):u(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(g="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,_?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();g="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,_?"block":"top",!1):("word"==e&&(g="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(g="variable","restricted_atBlock_before"):u(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(g="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!T.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(g="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},N.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),g=r,t.state=N[t.state](p,e,t),g},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-m),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(g),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(h).concat(b).concat(x);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})},{"../../lib/codemirror":17}],19:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,d=c.token(n,o.htmlState),f=/\btag\b/.test(d);if(f&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),g=e.getMode(r,p),m=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(m,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=g,o.localState=e.startState(g,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);return{startState:function(){var t=e.startState(c);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},{"../../lib/codemirror":17,"../css/css":18,"../javascript/javascript":20,"../xml/xml":21}],20:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Ce=e,Se=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(We),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(We.test(n))return e.eatWhile(We),o("operator","operator",e.current());if(Ne.test(n)){e.eatWhile(Ne);var a=e.current(),u=Oe.propertyIsEnumerable(a)&&Oe[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Me&&"@"==t.peek()&&t.match(Ee))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ae){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=ze.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ne.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(De.state=e,De.stream=i,De.marked=null,De.cc=o,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){
8
- var a=o.length?o.pop():_e?C:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function g(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=De.state;if(De.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=He}function y(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function b(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?g():";"==e?p():g(t)}return t}function k(e,t){return"var"==e?g(b("vardef",t.length),Q,x(";"),w):"keyword a"==e?g(b("form"),T,k,w):"keyword b"==e?g(b("form"),k,w):"{"==e?g(b("}"),U,w):";"==e?g():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==w&&De.state.cc.pop()(),g(b("form"),T,k,w,ne)):"function"==e?g(ce):"for"==e?g(b("form"),ie,k,w):"variable"==e?g(b("stat"),I):"switch"==e?g(b("form"),T,b("}","switch"),x("{"),U,w,w):"case"==e?g(C,x(":")):"default"==e?g(x(":")):"catch"==e?g(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?g(b("form"),fe,w):"export"==e?g(b("stat"),me,w):"import"==e?g(b("stat"),ve,w):"module"==e?g(b("form"),J,b("}"),x("{"),U,w,w):"type"==e?g(V,x("operator"),V,x(";")):"async"==e?g(k):p(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function T(e){return"("!=e?p():g(b(")"),C,x(")"),w)}function L(e,t){if(De.state.fatArrowAt==De.stream.start){var r=t?z:E;if("("==e)return g(v,b(")"),q(J,")"),w,x("=>"),r,y);if("variable"==e)return p(v,J,x("=>"),r,y)}var n=t?N:A;return Pe.hasOwnProperty(e)?g(n):"function"==e?g(ce,n):"class"==e?g(b("form"),de,w):"keyword c"==e||"async"==e?g(t?_:M):"("==e?g(b(")"),M,x(")"),w,n):"operator"==e||"spread"==e?g(t?S:C):"["==e?g(b("]"),xe,w,n):"{"==e?K(j,"}",null,n):"quasi"==e?p(O,n):"new"==e?g(P(t)):g()}function M(e){return e.match(/[;\}\)\],]/)?p():p(C)}function _(e){return e.match(/[;\}\)\],]/)?p():p(S)}function A(e,t){return","==e?g(C):N(e,t,!1)}function N(e,t,r){var n=0==r?A:N,i=0==r?C:S;return"=>"==e?g(v,r?z:E,y):"operator"==e?/\+\+|--/.test(t)?g(n):"?"==t?g(C,x(":"),i):g(i):"quasi"==e?p(O,n):";"!=e?"("==e?K(S,")","call",n):"."==e?g(F,n):"["==e?g(b("]"),M,x("]"),w,n):void 0:void 0}function O(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?g(O):g(C,W)}function W(e){if("}"==e)return De.marked="string-2",De.state.tokenize=c,g(O)}function E(e){return u(De.stream,De.state),p("{"==e?k:C)}function z(e){return u(De.stream,De.state),p("{"==e?k:S)}function P(e){return function(t){return"."==t?g(e?H:D):p(e?S:C)}}function D(e,t){if("target"==t)return De.marked="keyword",g(A)}function H(e,t){if("target"==t)return De.marked="keyword",g(N)}function I(e){return":"==e?g(w,k):p(A,x(";"),w)}function F(e){if("variable"==e)return De.marked="property",g()}function j(e,t){return"async"==e?(De.marked="property",g(j)):"variable"==e||"keyword"==De.style?(De.marked="property",g("get"==t||"set"==t?R:B)):"number"==e||"string"==e?(De.marked=Me?"property":De.style+" property",g(B)):"jsonld-keyword"==e?g(B):"modifier"==e?g(j):"["==e?g(C,x("]"),B):"spread"==e?g(C):":"==e?p(B):void 0}function R(e){return"variable"!=e?p(B):(De.marked="property",g(ce))}function B(e){return":"==e?g(S):"("==e?p(ce):void 0}function q(e,t){function r(n,i){if(","==n){var o=De.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),g(function(r,n){return r==t||n==t?p():p(e)},r)}return n==t||i==t?g():g(x(t))}return function(n,i){return n==t||i==t?g():p(e,r)}}function K(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return g(b(t,r),q(e,t),w)}function U(e){return"}"==e?g():p(k,U)}function G(e,t){if(Ae){if(":"==e)return g(V);if("?"==t)return g(G)}}function V(e){return"variable"==e?(De.marked="variable-3",g(Z)):"{"==e?g(q(Y,"}")):"("==e?g(q(X,")"),$):void 0}function $(e){if("=>"==e)return g(V)}function Y(e){return"variable"==e||"keyword"==De.style?(De.marked="property",g(Y)):":"==e?g(V):void 0}function X(e){return"variable"==e?g(X):":"==e?g(V):void 0}function Z(e,t){return"<"==t?g(q(V,">"),Z):"["==e?g(x("]"),Z):void 0}function Q(){return p(J,G,te,re)}function J(e,t){return"modifier"==e?g(J):"variable"==e?(m(t),g()):"spread"==e?g(J):"["==e?K(J,"]"):"{"==e?K(ee,"}"):void 0}function ee(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?g(J):"}"==e?p():g(x(":"),J,te)):(m(t),g(te))}function te(e,t){if("="==t)return g(S)}function re(e){if(","==e)return g(Q)}function ne(e,t){if("keyword b"==e&&"else"==t)return g(b("form","else"),k,w)}function ie(e){if("("==e)return g(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?g(Q,x(";"),le):";"==e?g(le):"variable"==e?g(ae):p(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(De.marked="keyword",g(C)):g(A,le)}function le(e,t){return";"==e?g(se):"in"==t||"of"==t?(De.marked="keyword",g(C)):p(C,x(";"),se)}function se(e){")"!=e&&g(C)}function ce(e,t){return"*"==t?(De.marked="keyword",g(ce)):"variable"==e?(m(t),g(ce)):"("==e?g(v,b(")"),q(ue,")"),w,G,k,y):void 0}function ue(e){return"spread"==e?g(ue):p(J,G,te)}function de(e,t){return"variable"==e?fe(e,t):he(e,t)}function fe(e,t){if("variable"==e)return m(t),g(he)}function he(e,t){return"extends"==t||"implements"==t?g(Ae?V:C,he):"{"==e?g(b("}"),pe,w):void 0}function pe(e,t){return"variable"==e||"keyword"==De.style?("static"==t||"get"==t||"set"==t||Ae&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",g(pe)):(De.marked="property",g(Ae?ge:ce,pe)):"*"==t?(De.marked="keyword",g(pe)):";"==e?g(pe):"}"==e?g():void 0}function ge(e,t){return"?"==t?g(ge):":"==e?g(V,te):p(ce)}function me(e,t){return"*"==t?(De.marked="keyword",g(we,x(";"))):"default"==t?(De.marked="keyword",g(C,x(";"))):p(k)}function ve(e){return"string"==e?g():p(ye,we)}function ye(e,t){return"{"==e?K(ye,"}"):("variable"==e&&m(t),"*"==t&&(De.marked="keyword"),g(be))}function be(e,t){if("as"==t)return De.marked="keyword",g(ye)}function we(e,t){if("from"==t)return De.marked="keyword",g(C)}function xe(e){return"]"==e?g():p(q(S,"]"))}function ke(e,t){return"operator"==e.lastType||","==e.lastType||We.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Ce,Se,Te=r.indentUnit,Le=n.statementIndent,Me=n.jsonld,_e=n.json||Me,Ae=n.typescript,Ne=n.wordCharacters||/[\w$\xa1-\uffff]/,Oe=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":r,"do":r,"try":r,"finally":r,"return":n,"break":n,"continue":n,"new":e("new"),"delete":n,"throw":n,"debugger":n,"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":n,"export":e("export"),"import":e("import"),"extends":n,await:n,async:e("async")};if(Ae){var l={type:"variable",style:"variable-3"},s={"interface":e("class"),"implements":n,namespace:n,module:e("module"),"enum":e("module"),type:e("type"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:i,string:l,number:l,"boolean":l,any:l};for(var c in s)a[c]=s[c]}return a}(),We=/[+\-*&%=<>!?|~^]/,Ee=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,ze="([{}])",Pe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},He={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Te,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Ce?r:(t.lastType="operator"!=Ce||"++"!=Se&&"--"!=Se?Ce:"incdec",h(t,r,Ce,Se,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Le&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Te:"stat"==d?l.indented+(ke(t,r)?Le||Te:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Te):l.indented+(/^(?:case|default)\b/.test(r)?Te:2*Te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:_e?null:"/*",blockCommentEnd:_e?null:"*/",lineComment:_e?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:_e?"json":"javascript",jsonldMode:Me,jsonMode:_e,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":17}],21:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?g:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",p)}function g(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(M="tag",m):(M="tag error",v)}return M="error",v}function m(e,t,r){return"endTag"!=e?(M="error",m):(d(r),h)}function v(e,t,r){return M="error",m(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),h}return M="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(M="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var T in S)C[T]=S[T];for(var T in i)C[T]=i[T];var L,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(M=null,t.state=t.state(L||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":17}]},{},[11])}();
9
  //# sourceMappingURL=forms-admin.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function r(t,n,i){function o(l,s){if(!n[l]){if(!t[l]){var c="function"==typeof e&&e;if(!s&&c)return c(l,!0);if(a)return a(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[l]={exports:{}};t[l][0].call(d.exports,function(e){var r=t[l][1][e];return o(r?r:e)},d,d.exports,r,t,n,i)}return n[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,r){"use strict";var n=function(e,t){var r={};return r.showType=function(r){var n=r.type();return n=n.charAt(0).toUpperCase()+n.slice(1),e("div",[e("label",t.fieldType),e("span",n)])},r.label=function(r){return e("div",[e("label",t.fieldLabel),e("input.widefat",{type:"text",value:r.label(),onchange:e.withAttr("value",r.label),placeholder:r.title()})])},r.value=function(r){var n="hidden"===r.type();return e("div",[e("label",[n?t.value:t.initialValue," ",n?"":e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.value(),onchange:e.withAttr("value",r.value)}),n?"":e("p.help",t.valueHelp)])},r.numberMinMax=function(r){return e("div",[e("div.row",[e("div.col.col-3",[e("label",t.min),e("input",{type:"number",onchange:e.withAttr("value",r.min)})]),e("div.col.col-3",[e("label",t.max),e("input",{type:"number",onchange:e.withAttr("value",r.max)})])])])},r.isRequired=function(r){var n,i={type:"checkbox",checked:r.required(),onchange:e.withAttr("checked",r.required)};return r.forceRequired()&&(i.required=!0,i.disabled=!0,n=e("p.help",t.forceRequired)),e("div",[e("label.cb-wrap",[e("input",i),t.isFieldRequired]),n])},r.placeholder=function(r){return e("div",[e("label",[t.placeholder," ",e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.placeholder(),onchange:e.withAttr("value",r.placeholder),placeholder:""}),e("p.help",t.placeholderHelp)])},r.useParagraphs=function(r){return e("div",[e("label.cb-wrap",[e("input",{type:"checkbox",checked:r.wrap(),onchange:e.withAttr("checked",r.wrap)}),t.wrapInParagraphTags])])},r.choiceType=function(r){var n=[e("option",{value:"select",selected:"select"===r.type()&&"selected"},t.dropdown),e("option",{value:"radio",selected:"radio"===r.type()&&"selected"},t.radioButtons)];return r.acceptsMultipleValues&&n.push(e("option",{value:"checkbox",selected:"checkbox"===r.type()&&"selected"},t.checkboxes)),e("div",[e("label",t.choiceType),e("select",{value:r.type(),onchange:e.withAttr("value",r.type)},n)])},r.choices=function(r){var n=[];return n.push(e("div",[e("label",t.choices),e("div.limit-height",[e("table",[r.choices().map(function(n,i){return e("tr",{"data-id":i},[e("td.cb",e("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:e.withAttr("value",r.selectChoice.bind(r)),checked:n.selected(),value:n.value(),title:t.preselect})),e("td.stretch",e("input.widefat",{type:"text",value:n.label(),placeholder:n.title(),onchange:e.withAttr("value",n.label)})),e("td",e("span",{title:t.remove,"class":"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,i)},""))])})])])])),n},r};t.exports=n},{}],2:[function(e,t,r){var n=function(t,r){var n={},i=e("./field-forms-rows.js")(t,r);return n.render=function(e){var t=e.type();if("function"==typeof n[t])return n[t](e);switch(t){case"select":case"radio":case"checkbox":return n.choice(e)}return n.text(e)},n.text=function(e){return[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},n.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type()&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(i.isRequired(e)),t},n.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[i.showType(e),i.value(e)]},n.submit=function(e){return e.label(""),e.placeholder(""),[i.value(e),i.useParagraphs(e)]},n.number=function(e){return[n.text(e),i.numberMinMax(e)]},n};t.exports=n},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var n=e("../third-party/render.js"),i=e("../third-party/beautify-html.js"),o=function(e){function t(t){var o,a,l,s;return o=t.label().length?e("label",t.label()):"",a="function"==typeof r[t.type()]?r[t.type()](t):r["default"](t),l=t.wrap()?e("p",[o,a]):[o,a],s=n(l),s=i(s),s+"\n"}var r={};return r.select=function(t){var r={name:t.name(),required:t.required()},n=!1,i=t.choices().map(function(t){return t.selected()&&(n=!0),e("option",{value:t.value()!==t.label()?t.value():void 0,selected:t.selected()},t.label())}),o=t.placeholder();return o.length>0&&i.unshift(e("option",{disabled:!0,value:"",selected:!n},o)),e("select",r,i)},r.checkbox=function(t){var r=t.choices().map(function(r){var n=t.name()+("checkbox"===t.type()?"[]":""),i=t.required()&&"radio"===t.type();return e("label",[e("input",{name:n,type:t.type(),value:r.value(),checked:r.selected(),required:i})," ",e("span",r.label())])});return r},r.radio=r.checkbox,r["default"]=function(t){var r,n={type:t.type()};return t.name()&&(n.name=t.name()),t.min()&&(n.min=t.min()),t.max()&&(n.max=t.max()),t.value().length>0&&(n.value=t.value()),t.placeholder().length>0&&(n.placeholder=t.placeholder()),n.required=t.required(),r=e("input",n)},t};t.exports=o},{"../third-party/beautify-html.js":12,"../third-party/render.js":13}],4:[function(e,t,r){var n=function(t,r,n,i,o,a){"use strict";function l(e){d=i.get(e),d&&d.choices().length>0&&d.value(d.choices().map(function(e){return e.label()}).join("|")),t.redraw()}function s(){}function c(){var e=f(d);n.insert(e),l(""),t.redraw()}function u(){var e=i.getCategories(),r=i.getAll(),n=t("div.available-fields.small-margin",[t("h4",a.chooseField),e.map(function(e){var n=r.filter(function(t){return t.category===e});if(n.length)return t("div.tiny-margin",[t("strong",e),n.map(function(e){var r="button";e.forceRequired()&&(r+=" is-required");var n=e.inFormContent();return null!==n&&(r+=" "+(n?"in-form":"not-in-form")),t("button",{className:r,type:"button",onclick:t.withAttr("value",l),value:e.index},e.title())})])})]),o=null;return d&&(o=h(t("div.field-wizard",[t("h3",[d.title(),d.forceRequired()?t("span.red","*"):"",d.name().length?t("code",d.name()):""]),d.help().length?t("p",t.trust(d.help())):"",p.render(d),t("p",[t("button",{"class":"button-primary",type:"button",onkeydown:function(e){e=e||window.event,13==e.keyCode&&c()},onclick:c},a.addToForm)])]),l)),[n,o]}var d,f=e("./field-generator.js")(t),h=e("./overlay.js")(t,a),p=e("./field-forms.js")(t,a);return n.on("blur",t.redraw),{view:u,controller:s}};t.exports=n},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){var n=function(e,t){"use strict";function r(){u.forEach(e.deregister)}function n(t,r,n){var i=e.register(t,r);n||u.push(i)}function i(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return"undefined"!=typeof t[e]?t[e]:e}function o(e){var r=t.listFields,o=i(e.field_type),a={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:o,choices:e.choices,acceptsMultipleValues:!1};return"address"!==a.type?n(r,a,!1):(n(r,{name:a.name+"[addr1]",type:"text",mailchimpType:"address",title:t.streetAddress}),n(r,{name:a.name+"[city]",type:"text",mailchimpType:"address",title:t.city}),n(r,{name:a.name+"[state]",type:"text",mailchimpType:"address",title:t.state}),n(r,{name:a.name+"[zip]",type:"text",mailchimpType:"address",title:t.zip}),n(r,{name:a.name+"[country]",type:"select",mailchimpType:"address",title:t.country,choices:mc4wp_vars.countries})),!0}function a(e){var r=t.interestCategories,o=i(e.field_type),a={title:e.name,name:"INTERESTS["+e.id+"]",type:o,choices:e.interests,acceptsMultipleValues:"checkbox"===o};n(r,a,!1)}function l(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e["public"]&&!t["public"]?-1:!e["public"]&&t["public"]?1:0}),e.merge_fields.forEach(o),e.interest_categories.forEach(a)}function s(e){r(),e.forEach(l)}function c(e){var r,i=t.formFields;n(i,{name:"",value:t.subscribe,type:"submit",title:t.submitButton},!0),r={};for(var o in e)r[e[o].id]=e[o].name;n(i,{name:"_mc4wp_lists",type:"checkbox",title:t.listChoice,choices:r,help:t.listChoiceDescription,acceptsMultipleValues:!0},!0),r={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},n(i,{name:"_mc4wp_action",type:"radio",title:t.formAction,choices:r,value:"subscribe",help:t.formActionDescription},!0)}var u=[];return{registerCustomFields:c,registerListFields:l,registerListsFields:s}};t.exports=n},{}],6:[function(e,t,r){"use strict";t.exports=function(e,t){function r(e){var t=[];return t="function"==typeof e.map?e.map(function(e){return new h({label:e})}):Object.keys(e).map(function(t){var r=e[t];return new h({label:r,value:t})})}function n(n,i){var o,a=s("name",i.name).shift();return a?void(!a.forceRequired()&&i.forceRequired&&a.forceRequired(!0)):(i.choices&&(i.choices=r(i.choices),i.value&&(i.choices=i.choices.map(function(e){return e.value()===i.value&&e.selected(!0),e}))),d.indexOf(n)<0&&d.push(n),o=new f(i),o.category=n,u.push(o),c&&window.clearTimeout(c),c=window.setTimeout(e.redraw,200),t.trigger("fields.change"),o)}function i(t){var r=u.indexOf(t);r>-1&&(delete u[r],e.redraw())}function o(e){return u[e]}function a(){return u=u.map(function(e,t){return e.index=t,e})}function l(){return d}function s(e,t){return u.filter(function(r){return r[e]()===t})}var c,u=[],d=[],f=function(t){this.name=e.prop(t.name),this.title=e.prop(t.title||t.name),this.type=e.prop(t.type),this.mailchimpType=e.prop(t.mailchimpType||""),this.label=e.prop(t.title||""),this.value=e.prop(t.value||""),this.placeholder=e.prop(t.placeholder||""),this.required=e.prop(t.required||!1),this.forceRequired=e.prop(t.forceRequired||!1),this.wrap=e.prop(t.wrap||!0),this.min=e.prop(t.min||null),this.max=e.prop(t.max||null),this.help=e.prop(t.help||""),this.choices=e.prop(t.choices||[]),this.inFormContent=e.prop(null),this.acceptsMultipleValues=t.acceptsMultipleValues,this.selectChoice=function(e){var t=this;this.choices(this.choices().map(function(r){return r.value()===e?r.selected(!0):"checkbox"!==t.type()&&r.selected(!1),r}))}},h=function(t){this.label=e.prop(t.label),this.title=e.prop(t.title||t.label),this.selected=e.prop(t.selected||!1),this.value=e.prop(t.value||t.label)};return{get:o,getAll:a,getCategories:l,deregister:i,register:n,getAllWhere:s}}},{}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold"),e("codemirror/addon/edit/matchtags"),e("codemirror/addon/edit/closetag.js");var i=function(e){function t(){return o&&(i.innerHTML=a.getValue().toLowerCase(),o=!1),i}var r,i=document.createElement("form"),o=!1,a={};return i.innerHTML=e.value.toLowerCase(),n&&(r=n.fromTextArea(e,{selectionPointer:!0,matchTags:{bothTags:!0},mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0}),window.dispatchEvent&&r.on("change",function(){if("function"==typeof Event){var t=new Event("change",{bubbles:!0});e.dispatchEvent(t)}})),window.addEventListener("load",function(){n.signal(r,"change")}),e.addEventListener("change",function(){o=!0}),a.getValue=function(){return r?r.getValue():e.value},a.query=function(e){return t().querySelectorAll(e.toLowerCase())},a.containsField=function(e){return null!==t().elements.namedItem(e.toLowerCase())},a.insert=function(t){r?(r.replaceSelection(t),r.focus()):e.value+=t},a.on=function(t,n){return r?(t="input"===t?"changes":t,r.on(t,n)):e.addEventListener(t,n)},a.refresh=function(){r&&r.refresh()},a};t.exports=i},{codemirror:17,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchtags":15,"codemirror/addon/fold/xml-fold":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(e,t,r){var n=function(e,t,r,n,i,o){"use strict";function a(){n.getAll().forEach(function(e){if(!(e.name().length<=0)){var r=e.name();"checkbox"===e.type()&&(r+="[]");var n=t.containsField(r);if(e.inFormContent(n),"address"===e.mailchimpType()){e.originalRequiredValue=void 0===e.originalRequiredValue?e.forceRequired():e.originalRequiredValue;var i=e.name().replace(/\[(\w+)\]/g,"");t.query('[name^="'+i+'"]').length>0?(void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired()),e.forceRequired(!0)):e.forceRequired(e.originalRequiredValue)}}}),l(),e.redraw()}function l(){var e=n.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase().replace(/\[(\w+)\]/g,".$1")}),r=t.query("[required]");Array.prototype.forEach.call(r,function(t){var r=t.name.toUpperCase();"_"!==r[0]&&(r=r.replace(/\[(\w+)\]/g,".$1"),e.indexOf(r)===-1&&e.push(r))}),s.value=e.join(",")}var s=document.getElementById("required-fields");t.on("change",o.debounce(a,500)),i.on("fields.change",o.debounce(a,500))};t.exports=n},{}],9:[function(e,t,r){"use strict";function n(e,t){l[e]=t,o()}function i(e){delete l[e],o()}function o(){var e="";for(var t in l)e+='<div class="notice notice-warning inline"><p>'+l[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){r=document.createElement("div"),r.className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}function a(e,t){var r=function(){var t="Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly.",r=e.getValue().toLowerCase();r.indexOf('name="groupings')>-1?n("deprecated_groupings",t):i("deprecated_groupings")},o=function(){var r=t.getAllWhere("forceRequired",!0),o=r.filter(function(t){return!e.containsField(t.name().toUpperCase())}),a="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";a+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+o.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",o.length>0?n("required_fields_missing",a):i("required_fields_missing")};r(),e.on("focus",r),e.on("blur",r),o(),e.on("blur",o),e.on("focus",o)}var l={};t.exports={init:a}},{}],10:[function(e,t,r){var n=function(e,t){"use strict";function r(){document.removeEventListener("keydown",n),window.removeEventListener("resize",i),a()}function n(e){e=e||window.event,27==e.keyCode&&r(),13==e.keyCode&&e.preventDefault()}function i(){if(o){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-o.clientWidth-40)/2,n=(t-o.clientHeight-40)/2;o.style.left=(r>0?r:0)+"px",o.style.top=(n>0?n:0)+"px"}}var o,a;return function(l,s){return a=s,document.addEventListener("keydown",n),window.addEventListener("resize",i),[e("div.overlay-wrap",e("div.overlay",{config:function(e){o=e,i()}},[e("span",{"class":"close dashicons dashicons-no",title:t.close,onclick:r}),l])),e("div.overlay-background",{title:t.close,onclick:r})]}};t.exports=n},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=document.getElementById("mc4wp-form-content"),g=window.formEditor=new u(p),m=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),v=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),m);var y=new f(h,n);o.on("selectedLists.change",y.registerListsFields),y.registerListsFields(a.getSelectedLists()),y.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),v.init(g,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=g,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,t,r){!function(){function e(e){return e.replace(/^\s+|\s+$/g,"")}function r(e){return e.replace(/^\s+/g,"")}function n(t,n,i,o){function a(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=s,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)p&&"\n"===e&&this.newlines<=g&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())t.length&&(r=!0);else{if(indent_handlebars){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,r&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,t),this.print_indentation(t)):(this.line_char_count++,t.push(" ")),r=!1),this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos===this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?(this.tags[e+"count"]++,this.tags[e+this.tags[e+"count"]]=this.indent_level):(this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level),this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1===this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,r,n,i="",o=[],a="",l=!1,s=this.pos,c=this.line_char_count;e=void 0!==e&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=s,this.line_char_count=c),o.length?o.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))l=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),l=!0),"="===i&&(l=!1),o.length&&"="!==o[o.length-1]&&">"!==i&&l&&(this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,o),this.print_indentation(o)):(o.push(" "),this.line_char_count++),l=!1),indent_handlebars&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),o.length&&" "!==o[o.length-1]&&"<"!==o[o.length-1]&&(i=" "+i),l=!0),"<"!==i||n||(t=this.pos-1,n="<"),indent_handlebars&&!n&&o.length>=2&&"{"===o[o.length-1]&&"{"==o[o.length-2]&&(t="#"===i||"/"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,o.push(i),o[1]&&"!"===o[1]){o=[this.get_comment(t)];break}if(indent_handlebars&&"{"===n&&o.length>2&&"}"===o[o.length-2]&&"}"===o[o.length-1])break}}while(">"!==i);var u,d,f=o.join("");u=f.indexOf(" ")!==-1?f.indexOf(" "):"{"===f[0]?f.indexOf("}"):f.indexOf(">"),d="<"!==f[0]&&indent_handlebars?"#"===f[2]?3:2:1;var p=f.substring(d,u).toLowerCase();return"/"===f.charAt(f.length-2)||this.Utils.in_array(p,this.Utils.single_token)?e||(this.tag_type="SINGLE"):indent_handlebars&&"{"===f[0]&&"else"===p?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):"script"===p?e||(this.record_tag(p),this.tag_type="SCRIPT"):"style"===p?e||(this.record_tag(p),this.tag_type="STYLE"):this.is_unformatted(p,h)?(a=this.get_unformatted("</"+p+">",f),o.push(a),t>0&&this.Utils.in_array(this.input.charAt(t-1),this.Utils.whitespace)&&o.splice(0,0,this.input.charAt(t-1)),r=this.pos-1,this.Utils.in_array(this.input.charAt(r+1),this.Utils.whitespace)&&o.push(this.input.charAt(r+1)),this.tag_type="SINGLE"):"!"===p.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"===p.charAt(0)?(this.retrieve_tag(p.substring(1)),this.tag_type="END",this.traverse_whitespace()):(this.record_tag(p),"html"!==p.toLowerCase()&&(this.indent_content=!0),this.tag_type="START",this.traverse_whitespace()),this.Utils.in_array(p,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!==this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=s,this.line_char_count=c),o.join("")},this.get_comment=function(e){var t="",r=">",n=!1;for(this.pos=e,input_char=this.input.charAt(this.pos),this.pos++;this.pos<=this.input.length&&(t+=input_char,t[t.length-1]!==r[r.length-1]||t.indexOf(r)===-1);)!n&&t.length<10&&(0===t.indexOf("<![if")?(r="<![endif]>",n=!0):0===t.indexOf("<![cdata[")?(r="]]>",n=!0):0===t.indexOf("<![")?(r="]>",n=!0):0===t.indexOf("<!--")&&(r="-->",n=!0)),input_char=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&t.toLowerCase().indexOf(e)!==-1)return"";var r="",n="",i=0,o=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!o){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,o=!0,indent_handlebars&&"{"===r&&n.length&&"{"===n[n.length-2]&&(n+=this.get_unformatted("}}"),i=n.length)}while(n.toLowerCase().indexOf(e,i)===-1);return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return e=this.get_contents_to(t),"string"!=typeof e?e:[e,"TK_"+t]}if("CONTENT"===this.current_mode)return e=this.get_content(),"string"!=typeof e?e:[e,"TK_CONTENT"];if("TAG"===this.current_mode){if(e=this.get_tag(),"string"!=typeof e)return e;var r="TK_TAG_"+this.tag_type;return[e,r]}},this.get_full_indent=function(e){return e=this.indent_level+e||0,e<1?"":Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!==e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var r=this.get_tag(!0),n=(r||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,o){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=o,this.indent_level=0,this.wrap_line_length=i,this.line_char_count=0;for(var a=0;a<this.indent_size;a++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!==t[t.length-1])&&t.push("\n")},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){(e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=r(e)),this.print_token_raw(e)},this.print_token_raw=function(e){e&&""!==e&&(e.length>1&&"\n"===e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(t>0,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var l,s,c,u,d,f,h,p,g;for(n=n||{},void 0!==n.wrap_line_length&&0!==parseInt(n.wrap_line_length,10)||void 0!==n.max_char&&0!==parseInt(n.max_char,10)||(n.wrap_line_length=n.max_char),s=n.indent_inner_html||!1,c=parseInt(n.indent_size||4,10),u=n.indent_char||" ",f=n.brace_style||"collapse",d=0===parseInt(n.wrap_line_length,10)?32786:parseInt(n.wrap_line_length||250,10),h=n.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],p=n.preserve_newlines||!0,g=p?parseInt(n.max_preserve_newlines||32786,10):0,indent_handlebars=n.indent_handlebars||!1,l=new a,l.printer(t,u,c,d,f);;){var m=l.get_token();if(l.token_text=m[0],l.token_type=m[1],"TK_EOF"===l.token_type)break;switch(l.token_type){case"TK_TAG_START":l.print_newline(!1,l.output),l.print_token(l.token_text),l.indent_content&&(l.indent(),l.indent_content=!1),l.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":l.print_newline(!1,l.output),l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===l.last_token&&""===l.last_text){var v=l.token_text.match(/\w+/)[0],y=null;l.output.length&&(y=l.output[l.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),null!==y&&y[1]===v||l.print_newline(!1,l.output)}l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var b=l.token_text.match(/^\s*<([a-z]+)/i);b&&l.Utils.in_array(b[1],h)||l.print_newline(!1,l.output),l.print_token(l.token_text),l.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":l.print_token(l.token_text),l.indent_content&&(l.indent(),l.indent_content=!1),l.current_mode="CONTENT";break;case"TK_CONTENT":l.print_token(l.token_text),l.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==l.token_text){l.print_newline(!1,l.output);var w,x=l.token_text,k=1;"TK_SCRIPT"===l.token_type?w="function"==typeof i&&i:"TK_STYLE"===l.token_type&&(w="function"==typeof o&&o),"keep"===n.indent_scripts?k=0:"separate"===n.indent_scripts&&(k=-l.indent_level);var C=l.get_full_indent(k);if(w)x=w(x.replace(/^\s*/,C),n);else{var S=x.match(/^\s*/)[0],T=S.match(/[^\n\r]*$/)[0].split(l.indent_string).length-1,L=l.get_full_indent(k-T);x=x.replace(/^\s*/,C).replace(/\r\n|\r|\n/g,"\n"+L).replace(/\s+$/,"")}x&&(l.print_token_raw(C+e(x)),l.print_newline(!1,l.output))}l.current_mode="TAG"}l.last_token=l.token_type,l.last_text=l.token_text}return l.output.join("")}"undefined"!=typeof t&&"undefined"!=typeof t.exports?t.exports=n:"undefined"!=typeof window&&(window.html_beautify=n)}()},{}],13:[function(e,t,r){"use strict";function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2")}function o(e){return""!=e}function a(e,t){return"undefined"===e&&(e=""),"string"!=typeof e&&(e+=""),e=e.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/\>/g,"&gt;"),t?e.replace(/\"/g,"&quot;"):e}function l(e){return e&&Object.keys(e).length?Object.keys(e).map(function(t){var r=e[t];if("undefined"!=typeof r&&null!==r&&"function"!=typeof r){if("boolean"==typeof r)return r?" "+t:"";if("style"===t){if(!r)return;var n=e.style;return"object"==typeof n&&(n=Object.keys(n).map(function(e){return""!=n[e]?[i(e).toLowerCase(),n[e]].join(":"):""}).filter(o).join(";")),""!=n?' style="'+a(n,!0)+'"':""}return" "+a("className"===t?"class":t)+'="'+a(r,!0)+'"'}}).join(""):""}function s(e){return n(e.children)&&!e.children.length?"":c(e.children)}function c(e){var t=typeof e;if("string"===t)return a(e);if("number"===t||"boolean"===t)return e;if(!e)return"";if(n(e))return e.map(c).join("");if(e.view){var r=e.controller?new e.controller:{},i=c(e.view(r));return r.onunload&&r.onunload(),i}if(e.$trusted)return""+e;var o=s(e);return!o&&u.indexOf(e.tag.toLowerCase())>=0?"<"+e.tag+l(e.attrs)+">":["<",e.tag,l(e.attrs),">",o,"</",e.tag,">"].join("")}var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","!doctype"];t.exports=c},{}],14:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r=t.listSelections(),n=[],s=0;s<r.length;s++){if(!r[s].empty())return e.Pass;var c=r[s].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),f=d.state;if("xml"!=d.mode.name||!f.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==d.mode.configuration,g="object"==typeof h&&h.dontCloseTags||p&&a,m="object"==typeof h&&h.indentTags||p&&l,v=f.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==f.type||u.string.indexOf("/")==u.string.length-1||g&&i(g,y)>-1||o(t,v,c,f,!0))return e.Pass;var b=m&&i(m,y)>-1;n[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=r.length-1;s>=0;s--){var w=n[s];t.replaceRange(w.text,r[s].head,r[s].anchor,"+insert");var x=t.listSelections().slice(0);x[s]={head:w.newPos,anchor:w.newPos},t.setSelections(x),w.indent&&(t.indentLine(w.newPos.line,null,!0),t.indentLine(w.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),i=[],a=r?"/":"</",l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var s=n[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),d=u.state;if(r&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;var f;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)f=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;f=a+"style"}else{if(!d.context||!d.context.tagName||o(t,d.context.tagName,s,d))return e.Pass;f=a+d.context.tagName}">"!=t.getLine(s.line).charAt(c.end)&&(f+=">"),i[l]=f}t.replaceSelections(i),n=t.listSelections();for(var l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&t.indentLine(n[l].head.line)}function n(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function o(t,r,n,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),l=e.scanForClosingTag(t,n,null,a);if(!l||l.tag!=r)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==r;s=s.prev)++c;n=l.to;for(var u=1;u<c;u++){var d=e.scanForClosingTag(t,n,null,a);if(!d||d.tag!=r)return!1;n=d.to}return!0}e.defineOption("autoCloseTags",!1,function(r,i,o){if(o!=e.Init&&o&&r.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return r(e)}})},{"../../lib/codemirror":17,"../fold/xml-fold":16}],15:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror);
2
+ }(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),i=r.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=e.findMatchingTag(r,n,i);if(o){if(r.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?r.state.tagOther=r.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",r),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",r),i.on("viewportChange",n),r(i))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}})},{"../../lib/codemirror":17,"../fold/xml-fold":16}],16:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function r(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function n(e,t){var r=e.cm.getTokenTypeAt(f(e.line,t));return r&&/\btag\b/.test(r)}function i(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(n(e,t+1)){g.lastIndex=t,e.ch=t;var r=g.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function s(e){for(;;){g.lastIndex=e.ch;var t=g.exec(e.text);if(!t){if(i(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(n=a(e)))return;if("selfClose"!=n)if(i[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==i[2]){r.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:f(o,l),to:f(e.line,e.ch)}}else r.push(i[2])}}function d(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;s>=0;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:f(e.line,e.ch),to:f(i,o)}}}else l(e)}}var f=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+h+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var i,o=s(n);if(!o||n.line!=t.line||!(i=a(n)))return;if(!o[1]&&"selfClose"!=i){var l=f(n.line,n.ch),c=u(n,o[2]);return c&&{from:l,to:c.from}}}}),e.findMatchingTag=function(e,n,i){var o=new r(e,n.line,n.ch,i);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var s=a(o),c=s&&f(o.line,o.ch),h=s&&l(o);if(s&&h&&!(t(o,n)>0)){var p={from:f(o.line,o.ch),to:c,tag:h[2]};return"selfClose"==s?{open:p,close:null,at:"open"}:h[1]?{open:d(o,h[2]),close:p,at:"close"}:(o=new r(e,c.line,c.ch,i),{open:p,close:u(o,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var i=new r(e,t.line,t.ch,n);;){var o=d(i);if(!o)break;var a=new r(e,t.line,t.ch,n),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,n,i){var o=new r(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,n)}})},{"../../lib/codemirror":17}],17:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.CodeMirror=i()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(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 i(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 o(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function a(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function l(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function s(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function c(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function u(){this.id=null}function d(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function f(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function h(e){for(;za.length<=e;)za.push(p(za)+" ");return za[e]}function p(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function m(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function v(){}function y(e,t){var r;return Object.create?r=Object.create(e):(v.prototype=e,r=new v),t&&s(t,r),r}function b(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Pa.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function k(e){return e.charCodeAt(0)>=768&&Da.test(e)}function C(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+Aa+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),aa&&la<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),sa||na&&ma||(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,r.init(i)}function S(e,t){if(t-=e.first,t<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 T(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function L(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function M(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function _(e){if(null==e.parent)return null;for(var t=e.parent,r=d(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function A(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 a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function N(e,t){return t>=e.first&&t<e.first+e.size}function O(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function W(e,t){return this instanceof W?(this.line=e,void(this.ch=t)):new W(e,t)}function E(e,t){return e.line-t.line||e.ch-t.ch}function z(e){return W(e.line,e.ch)}function P(e,t){return E(e,t)<0?t:e}function D(e,t){return E(e,t)<0?e:t}function H(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function I(e,t){if(t.line<e.first)return W(e.first,0);var r=e.first+e.size-1;return t.line>r?W(r,S(e,r).text.length):F(t,S(e,t.line).text.length)}function F(e,t){var r=e.ch;return null==r||r>t?W(e.line,t):r<0?W(e.line,0):e}function j(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=I(e,t[n]);return r}function R(){Ha=!0}function B(){Ia=!0}function q(e,t,r){this.marker=e,this.from=t,this.to=r}function K(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function U(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function V(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function G(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new q(a,o.from,s?null:o.to))}}return n}function $(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new q(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Y(e,t){if(t.full)return null;var r=N(e,t.from.line)&&S(e,t.from.line).markedSpans,n=N(e,t.to.line)&&S(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==E(t.from,t.to),l=G(r,i,a),s=$(n,o,a),c=1==t.text.length,u=p(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=K(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var g=0;g<s.length;++g){var m=s[g];if(null!=m.to&&(m.to+=u),null==m.from){var v=K(l,m.marker);v||(m.from=u,c&&(l||(l=[])).push(m))}else m.from+=u,c&&(l||(l=[])).push(m)}l&&(l=X(l)),s&&s!=l&&(s=X(s));var y=[l];if(!c){var b,w=t.text.length-2;if(w>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(b||(b=[])).push(new q(l[x].marker,null,null));for(var k=0;k<w;++k)y.push(b);y.push(s)}return y}function X(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Z(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&&d(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(E(c.to,l.from)<0||E(c.from,l.to)>0)){var u=[s,1],f=E(c.from,l.from),h=E(c.to,l.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function Q(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function J(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ee(e){return e.inclusiveLeft?-1:0}function te(e){return e.inclusiveRight?1:0}function re(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=E(n.from,i.from)||ee(e)-ee(t);if(o)return-o;var a=E(n.to,i.to)||te(e)-te(t);return a?a:t.id-e.id}function ne(e,t){var r,n=Ia&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||re(r,i.marker)<0)&&(r=i.marker);return r}function ie(e){return ne(e,!0)}function oe(e){return ne(e,!1)}function ae(e,t,r,n,i){var o=S(e,t),a=Ia&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=E(c.from,r)||ee(s.marker)-ee(i),d=E(c.to,n)||te(s.marker)-te(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?E(c.to,r)>=0:E(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?E(c.from,n)<=0:E(c.from,n)<0)))return!0}}}function le(e){for(var t;t=ie(e);)e=t.find(-1,!0).line;return e}function se(e){for(var t,r;t=oe(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ce(e,t){var r=S(e,t),n=le(r);return r==n?t:_(n)}function ue(e,t){if(t>e.lastLine())return t;var r,n=S(e,t);if(!de(e,n))return t;for(;r=oe(n);)n=r.find(1,!0).line;return _(n)+1}function de(e,t){var r=Ia&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&fe(e,t,n))return!0}}function fe(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return fe(e,n.line,K(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],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&fe(e,t,i))return!0}function he(e){e=le(e);for(var t=0,r=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;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function pe(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=ie(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=oe(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function ge(e){var t=e.display,r=e.doc;t.maxLine=S(r,r.first),t.maxLineLength=pe(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=pe(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function me(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ve(e){return e.level%2?e.to:e.from}function ye(e){return e.level%2?e.from:e.to}function be(e){var t=Le(e);return t?ve(t[0]):0}function we(e){var t=Le(e);return t?ye(p(t)):e.text.length}function xe(e,t,r){var n=e[0].level;return t==n||r!=n&&t<r}function ke(e,t){var r;Fa=null;for(var n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return xe(e,i.level,e[r].level)?(i.from!=i.to&&(Fa=r),n):(i.from!=i.to&&(Fa=n),r);r=n}}return r}function Ce(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&k(e.text.charAt(t)));return t}function Se(e,t,r,n){var i=Le(e);if(!i)return Te(e,t,r,n);for(var o=ke(i,t),a=i[o],l=Ce(e,t,a.level%2?-r:r,n);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return ke(i,l)==o?l:(a=i[o+=r],r>0==a.level%2?a.to:a.from);if(a=i[o+=r],!a)return null;l=r>0==a.level%2?Ce(e,a.to,-1,n):Ce(e,a.from,1,n)}}function Te(e,t,r,n){var i=t+r;if(n)for(;i>0&&k(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}function Le(e){var t=e.order;return null==t&&(t=e.order=ja(e.text)),t}function Me(e,t,r){var n=e._handlers&&e._handlers[t];return r?n&&n.length>0?n.slice():Ba:n||Ba}function _e(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else for(var n=Me(e,t,!1),i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}}function Ae(e,t){var r=Me(e,t,!0);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ne(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ae(e,r||t.type,e,t),De(t)||t.codemirrorIgnore}function Oe(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)d(r,t[n])==-1&&r.push(t[n])}function We(e,t){return Me(e,t).length>0}function Ee(e){e.prototype.on=function(e,t){Ra(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function He(e){ze(e),Pe(e)}function Ie(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),va&&e.ctrlKey&&1==t&&(t=3),t}function je(e){if(null==Ma){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ma=t.offsetWidth<=1&&t.offsetHeight>2&&!(aa&&la<8))}var i=Ma?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Re(e){if(null!=_a)return _a;var n=r(e,document.createTextNode("AخA")),i=xa(n,0,1).getBoundingClientRect(),o=xa(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(_a=o.right-i.right<3)}function Be(e){if(null!=Ga)return Ga;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=xa(t,0,1).getBoundingClientRect();return Ga=Math.abs(i.left-o.left)>1}function qe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$a[e]=t}function Ke(e,t){Ya[e]=t}function Ue(e){if("string"==typeof e&&Ya.hasOwnProperty(e))e=Ya[e];else if(e&&"string"==typeof e.name&&Ya.hasOwnProperty(e.name)){var t=Ya[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=Ue(t);var r=$a[t.name];if(!r)return Ve(e,"text/plain");var n=r(e,t);if(Xa.hasOwnProperty(t.name)){var i=Xa[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 a in t.modeProps)n[a]=t.modeProps[a];return n}function Ge(e,t){var r=Xa.hasOwnProperty(e)?Xa[e]:Xa[e]={};s(t,r)}function $e(e,t){if(t===!0)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 Ye(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Xe(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)},l=0;l<e.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Je(e,_(t)),i=Ze(e,t,t.text.length>e.options.maxHighlightLength?$e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),a=o>n.first&&S(n,o-1).stateAfter;return a=a?$e(n.mode,a):Xe(n.mode),n.iter(o,t,function(r){et(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?$e(n.mode,a):null,++o}),r&&(n.frontier=o),a}function et(e,t,r,n){var i=e.doc.mode,o=new Za(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&tt(i,r);!o.eol();)rt(i,o,r),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ye(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function rt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ye(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.")}function nt(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?$e(a.mode,u):u}},a=e.doc,l=a.mode;t=I(a,t);var s,c=S(a,t.line),u=Je(e,t.line,r),d=new Za(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=rt(l,d,u),n&&s.push(o(!0));return n?s:o()}function it(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 ot(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Za(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&it(tt(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&et(e,t,n,d.pos),d.pos=t.length,s=null):s=it(rt(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}function at(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=S(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var u=c(s.text,null,e.options.tabSize);(null==i||n>u)&&(i=l-1,n=u)}return i}function lt(e,t,r){this.text=e,J(this,t),this.height=r?r(this):1}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Q(e),J(e,r);var i=n?n(e):1;i!=e.height&&M(e,i)}function ct(e){e.parent=null,Q(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?el:Ja;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dt(e,t){var r=n("span",null,null,sa?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(aa||sa)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=ht,Re(e.display.measure)&&(s=Le(l))&&(i.addToken=gt(i.addToken,s)),i.map=[];var c=t!=e.display.externalMeasured&&_(l);vt(l,i,Qe(e,l,c)),l.styleClasses&&(l.styleClasses.bgClass&&(i.bgClass=a(l.styleClasses.bgClass,i.bgClass||"")),l.styleClasses.textClass&&(i.textClass=a(l.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(sa){var u=i.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ae(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=a(i.pre.className,i.textClass||"")),i}function ft(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var p=u.exec(t),g=p?p.index-f:t.length-f;if(g){var m=document.createTextNode(c.slice(f,f+g));aa&&la<9?s.appendChild(n("span",[m])):s.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",h(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=s.appendChild(n("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),aa&&la<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),aa&&la<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.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}function gt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function mt(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"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==p&&k.widgetNode?y.push(k):x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||re(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==p)for(var S=0;S<y.length;++S)mt(t,0,y[S]);if(f&&(f.from||0)==p){if(mt(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var T=Math.min(h,v);;){if(m){var L=p+m.length;if(!f){var M=L>T?m.slice(0,T-p):m;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",d,l)}if(L>=T){m=m.slice(T-p),p=T;break}p=L,u=""}m=i.slice(o,o=r[g++]),a=ut(r[g++],t.cm.options)}}else for(var _=1;_<r.length;_+=2)t.addToken(t,i.slice(o,o=r[_]),ut(r[_+1],t.cm.options))}function yt(e,t,r){this.line=t,this.rest=se(t),this.size=this.rest?_(p(this.rest))-r+1:1,this.node=this.text=null,this.hidden=de(e,t)}function bt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new yt(e.doc,S(e.doc,o),o);n=o+a.size,i.push(a)}return i}function wt(e){tl?tl.ops.push(e):e.ownsGroup=tl={ops:[e],delayedCallbacks:[]}}function xt(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)}function kt(e,t){var r=e.ownsGroup;if(r)try{xt(r)}finally{tl=null,t(r)}}function Ct(e,t){var r=Me(e,t,!1);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);tl?n=tl.delayedCallbacks:rl?n=rl:(n=rl=[],setTimeout(St,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function St(){var e=rl;rl=null;for(var t=0;t<e.length;++t)e[t]()}function Tt(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?At(e,t):"gutter"==o?Ot(e,t,r,n):"class"==o?Nt(t):"widget"==o&&Wt(e,t,n)}t.changes=null}function Lt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),aa&&la<8&&(e.node.style.zIndex=2)),e.node}function Mt(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=Lt(e);e.background=r.insertBefore(n("div",null,t),r.firstChild)}}function _t(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):dt(e,t)}function At(e,t){var r=t.text.className,n=_t(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,Nt(t)):r&&(t.text.className=r)}function Nt(e){Mt(e),e.line.wrapClass?Lt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(e,t,r,i){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 o=Lt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Lt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",O(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Wt(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);zt(e,t,r)}function Et(e,t,r,n){var i=_t(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Nt(t),Ot(e,t,r,n),zt(e,t,n),t.node}function zt(e,t,r){if(Pt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Pt(e,t.rest[n],t,r,!1)}function Pt(e,t,r,i,o){if(t.widgets)for(var a=Lt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");
3
+ c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Dt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),Ct(c,"redraw")}}function Dt(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 Ht(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function It(e,t){for(var r=Ie(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!0}function Ft(e){return e.lineSpace.offsetTop}function jt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Rt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Bt(e){return Aa-e.display.nativeBarWidth}function qt(e){return e.display.scroller.clientWidth-Bt(e)-e.display.barWidth}function Kt(e){return e.display.scroller.clientHeight-Bt(e)-e.display.barHeight}function Ut(e,t,r){var n=e.options.lineWrapping,i=n&&qt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Vt(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(_(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Gt(e,t){t=le(t);var n=_(t),i=e.display.externalMeasured=new yt(e.doc,t,n);i.lineN=n;var o=i.built=dt(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function $t(e,t,r,n){return Zt(e,Xt(e,t),r,n)}function Yt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Xt(e,t){var r=_(t),n=Yt(e,r);n&&!n.text?n=null:n&&n.changes&&(Tt(e,n,r,vr(e)),e.curOp.forceUpdate=!0),n||(n=Gt(e,t));var i=Vt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Zt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=er(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Qt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Jt(e,t){var r=nl;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function er(e,t,r,n){var i,o=Qt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&k(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&k(t.line.text.charAt(o.coverStart+s));)++s;if(i=aa&&la<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Jt(xa(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}aa&&la<11&&(i=tr(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(aa&&la<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+mr(e.display),top:f.top,bottom:f.bottom}:nl}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(h+p)/2,m=t.view.measure.heights,v=0;v<m.length-1&&!(g<m[v]);v++);var y=v?m[v-1]:0,b=m[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p),w}function tr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Be(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}}function rr(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 nr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)rr(e.display.view[r])}function ir(e){nr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function or(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ar(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Ht(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=he(t);if("local"==n?a+=Ft(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:ar());var s=l.left+("window"==n?0:or());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=or(),i-=ar();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function cr(e,t,r,n,i){return n||(n=S(e.doc,t.line)),lr(e,n,$t(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function a(t,a){var l=Zt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,lr(e,n,l,r)}function l(e,t){var r=s[t],n=r.level%2;return e==ve(r)&&t&&r.level<s[t-1].level?(r=s[--t],e=ye(r)-(r.level%2?0:1),n=!0):e==ye(r)&&t<s.length-1&&r.level<s[t+1].level&&(r=s[++t],e=ve(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?a(e-1):a(e,n)}n=n||S(e.doc,t.line),i||(i=Xt(e,n));var s=Le(n),c=t.ch;if(!s)return a(c);var u=ke(s,c),d=l(c,u);return null!=Fa&&(d.other=l(c,Fa)),d}function dr(e,t){var r=0;t=I(e.doc,t),e.options.lineWrapping||(r=mr(e.display)*t.ch);var n=S(e.doc,t.line),i=he(n)+Ft(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function fr(e,t,r,n){var i=W(e,t);return i.xRel=n,r&&(i.outside=!0),i}function hr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return fr(n.first,0,!0,-1);var i=A(n,r),o=n.first+n.size-1;if(i>o)return fr(n.first+n.size-1,S(n,o).text.length,!0,1);t<0&&(t=0);for(var a=S(n,i);;){var l=pr(e,a,i,t,r),s=oe(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=_(a=c.to.line)}}function pr(e,t,r,n,i){function o(n){var i=ur(e,W(r,n),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-he(t),l=!1,s=2*e.display.wrapper.clientWidth,c=Xt(e,t),u=Le(t),d=t.text.length,f=be(t),h=we(t),p=o(f),g=l,m=o(h),v=l;if(n>m)return fr(r,h,v,1);for(;;){if(u?h==f||h==Se(t,f,1):h-f<=1){var y=n<p||n-p<=m-n?f:h,b=y==f?g:v,w=n-(y==f?p:m);if(v&&!u&&!/\s/.test(t.text.charAt(y))&&w>0&&y<t.text.length&&c.view.measure.heights.length>1){var x=Zt(e,c,y,"right");a<=x.bottom&&a>=x.top&&Math.abs(n-x.right)<w&&(b=!1,y++,w=n-x.right)}for(;k(t.text.charAt(y));)++y;var C=fr(r,y,b,w<-1?-1:w>1?1:0);return C}var S=Math.ceil(d/2),T=f+S;if(u){T=f;for(var L=0;L<S;++L)T=Se(t,T,1)}var M=o(T);M>n?(h=T,m=M,(v=l)&&(m+=1e3),d=S):(f=T,p=M,g=l,d-=S)}}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Qa){Qa=n("pre");for(var i=0;i<49;++i)Qa.appendChild(document.createTextNode("x")),Qa.appendChild(n("br"));Qa.appendChild(document.createTextNode("x"))}r(e.measure,Qa);var o=Qa.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function vr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:yr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function yr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function br(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/mr(e.display)-3);return function(i){if(de(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function wr(e){var t=e.doc,r=br(e);t.iter(function(e){var t=r(e);t!=e.height&&M(e,t)})}function xr(e,t,r,n){var i=e.display;if(!r&&"true"==Ie(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,u=hr(e,o,a);if(n&&1==u.xRel&&(s=S(e.doc,u.line).text).length==u.ch){var d=c(s,s.length,e.options.tabSize)-s.length;u=W(u.line,Math.max(0,Math.round((o-Rt(e.display).left)/mr(e.display))-d))}return u}function kr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Cr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Sr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t!==!1||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Tr(e,l.head,i),s||Lr(e,l,o)}}return n}function Tr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Lr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return cr(e,W(t,r),"div",c,n)}var a,s,c=S(l,t),f=c.text.length;return me(Le(c),r||0,null==n?f:n,function(e,t,l){var c,h,p,g=o(e,"left");if(e==t)c=g,h=p=g.left;else{if(c=o(t-1,"right"),"rtl"==l){var m=g;g=c,c=m}h=g.left,p=c.right}null==r&&0==e&&(h=u),c.top-g.top>3&&(i(h,g.top,null,g.bottom),h=u,g.bottom<c.top&&i(h,g.bottom,null,c.top)),null==n&&t==f&&(p=d),(!a||g.top<a.top||g.top==a.top&&g.left<a.left)&&(a=g),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),h<u+1&&(h=u),i(h,c.top,p-h,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Rt(e.display),u=c.left,d=Math.max(a.sizerWidth,qt(e)-a.sizer.offsetLeft)-c.right,f=t.from(),h=t.to();if(f.line==h.line)o(f.line,f.ch,h.ch);else{var p=S(l,f.line),g=S(l,h.line),m=le(p)==le(g),v=o(f.line,f.ch,m?p.text.length+1:null).end,y=o(h.line,m?0:null,h.ch).start;m&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Mr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?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 _r(e){e.state.focused||(e.display.input.focus(),Nr(e))}function Ar(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))},100)}function Nr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ae(e,"focus",e,t),e.state.focused=!0,o(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),sa&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mr(e))}function Or(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ae(e,"blur",e,t),e.state.focused=!1,Sa(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Wr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=yr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Er(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=O(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",_n(e),!0}return!1}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(aa&&la<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=gr(t)),(s>.001||s<-.001)&&(M(i.line,o),Pr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Pr(i.rest[c])}}}function Pr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Dr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ft(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=A(t,n),a=A(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=A(t,he(S(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=A(t,he(S(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,na||Ln(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),na&&Ln(e),wn(e,100))}function Ir(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(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 jr(e){var t=Fr(e);return t.x*=ol,t.y*=ol,t}function Rr(e,t){var r=Fr(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&va&&sa)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!na&&!da&&null!=ol)return i&&s&&Hr(e,Math.max(0,Math.min(a.scrollTop+i*ol,a.scrollHeight-a.clientHeight))),Ir(e,Math.max(0,Math.min(a.scrollLeft+n*ol,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&ze(t),void(o.wheelStartX=null);if(i&&null!=ol){var f=i*ol,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):p=Math.min(e.doc.height,p+f+50),Ln(e,{top:h,bottom:p})}il<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(ol=(ol*il+r)/(il+1),++il)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Br(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+jt(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+Bt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function qr(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Ra(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ra(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,aa&&la<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Kr(){}function Ur(e,t){t||(t=Br(e));var r=e.display.barWidth,n=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Vr(e,Br(e)),r=e.display.barWidth,n=e.display.barHeight}function Vr(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=""}function Gr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Sa(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ra(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Ir(e,t):Hr(e,t)},e),e.display.scrollbars.addClass&&o(e.display.wrapper,e.display.scrollbars.addClass)}function $r(e,t){if(!Ne(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!pa){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ft(e.display))+"px;\n height: "+(t.bottom-t.top+Bt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Yr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1;i=ur(e,t);var l=r&&r!=t?ur(e,r):i,s=Zr(e,Math.min(i.left,l.left),Math.min(i.top,l.top)-n,Math.max(i.left,l.left),Math.max(i.bottom,l.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Hr(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=s.scrollLeft&&(Ir(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function Xr(e,t,r,n,i){var o=Zr(e,t,r,n,i);null!=o.scrollTop&&Hr(e,o.scrollTop),null!=o.scrollLeft&&Ir(e,o.scrollLeft)}function Zr(e,t,r,n,i){var o=e.display,a=gr(e.display);r<0&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Kt(e),c={};i-r>s&&(i=r+s);var u=e.doc.height+jt(o),d=r<a,f=i>u-a;if(r<l)c.scrollTop=d?0:r;else if(i>l+s){var h=Math.min(r,(f?u:i)-s);h!=l&&(c.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=qt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=n-t>g;return m&&(n=t+g),t<10?c.scrollLeft=0:t<p?c.scrollLeft=Math.max(0,t-(m?0:10)):n>g+p-3&&(c.scrollLeft=n+(m?0:10)-g),c}function Qr(e,t,r){null==t&&null==r||en(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Jr(e){en(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?W(t.line,t.ch-1):t,n=W(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function en(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=dr(e,t.from),n=dr(e,t.to),i=Zr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function tn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ll},wt(e.curOp)}function rn(e){var t=e.curOp;kt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;nn(e)})}function nn(e){for(var t=e.ops,r=0;r<t.length;r++)on(t[r]);for(var n=0;n<t.length;n++)an(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var a=0;a<t.length;a++)cn(t[a])}function on(e){var t=e.cm,r=t.display;Cn(t),e.updateMaxLine&&ge(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new kn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function an(e){e.updatedDisplay=e.mustUpdate&&Sn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=Br(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(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+Bt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==Ta()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&An(t,e.barMeasure),e.selectionChanged&&Mr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&_r(e.cm)}function cn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Tn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,Wr(t)),e.scrollToPos){var i=Yr(t,I(n,e.scrollToPos.from),I(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&$r(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Ae(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Ae(a[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ae(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();tn(e);try{return t()}finally{rn(e)}}function dn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tn(e);try{return t.apply(e,arguments)}finally{rn(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);tn(this);try{return e.apply(this,arguments)}finally{rn(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tn(t);try{return e.apply(this,arguments)}finally{rn(t)}}}function pn(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)Ia&&ce(e.doc,t)<i.viewTo&&mn(e);else if(r<=i.viewFrom)Ia&&ue(e.doc,r+n)>i.viewFrom?mn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)mn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):mn(e)}else if(r>=i.viewTo){var a=vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mn(e)}else{var l=vn(e,t,t,-1),s=vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(bt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):mn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function gn(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[kr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);d(a,r)==-1&&a.push(r)}}}function mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=kr(e,t),a=e.display.view;if(!Ia||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;ce(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function yn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=bt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(kr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,kr(e,r)))),n.viewTo=r}function bn(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 wn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,l(xn,e))}function xn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=$e(t.mode,Je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,l?$e(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(t.frontier),o.stateAfter=l?n:$e(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&et(e,o.text,n),o.stateAfter=t.frontier%5==0?$e(t.mode,n):null;if(++t.frontier,+new Date>r)return wn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)gn(e,i[t],"text")})}}function kn(e,t,r){var n=e.display;this.viewport=t,this.visible=Dr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=qt(e),this.force=r,this.dims=vr(e),this.events=[]}function Cn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Bt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Bt(e)+"px",t.scrollbarsClipped=!0)}function Sn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return mn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==bn(e))return!1;Er(e)&&(mn(e),r.dims=vr(e));var o=i.first+i.size,a=Math.max(r.visible.from-e.options.viewportMargin,i.first),l=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(i.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),Ia&&(a=ce(e.doc,a),l=ue(e.doc,l));var s=a!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;yn(e,a,l),n.viewOffset=he(S(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=bn(e);if(!s&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ta();return c>4&&(n.lineDiv.style.display="none"),Mn(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,u&&Ta()!=u&&u.offsetHeight&&u.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function Tn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=qt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+jt(e.display)-Kt(e),r.top)}),t.visible=Dr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Sn(e,t);n=!1){zr(e);var i=Br(e);Cr(e),Ur(e,i),An(e,i)}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 Ln(e,t){var r=new kn(e,t);if(Sn(e,r)){zr(e),Tn(e,r);var n=Br(e);Cr(e),Ur(e,n),An(e,n),r.finish()}}function Mn(e,r,n){function i(t){var r=t.nextSibling;return sa&&va&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,f=0;f<c.length;f++){
4
+ var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=i(s);var p=a&&null!=r&&r<=u&&h.lineNumber;h.changes&&(d(h.changes,"gutter")>-1&&(p=!1),Tt(e,h,u,n)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(O(e.options,u)))),s=h.node.nextSibling}else{var g=Et(e,h,u,n);l.insertBefore(g,s)}u+=h.size}for(;s;)s=i(s)}function _n(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function An(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+Bt(e)+"px"}function Nn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",_n(e)}function On(e){var t=d(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Wn(e,t){this.ranges=e,this.primIndex=t}function En(e,t){this.anchor=e,this.head=t}function zn(e,t){var r=e[t];e.sort(function(e,t){return E(e.from(),t.from())}),t=d(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(E(o.to(),i.from())>=0){var a=D(o.from(),i.from()),l=P(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new En(s?l:a,s?a:l))}}return new Wn(e,t)}function Pn(e,t){return new Wn([new En(e,t||e)],0)}function Dn(e){return e.text?W(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Hn(e,t){if(E(e,t.from)<0)return e;if(E(e,t.to)<=0)return Dn(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+=Dn(t).ch-t.to.ch),W(r,n)}function In(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new En(Hn(i.anchor,t),Hn(i.head,t)))}return zn(r,e.sel.primIndex)}function Fn(e,t,r){return e.line==t.line?W(r.line,e.ch-t.ch+r.ch):W(r.line+(e.line-t.line),e.ch)}function jn(e,t,r){for(var n=[],i=W(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Fn(l.from,i,o),c=Fn(Dn(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=E(u.head,u.anchor)<0;n[a]=new En(d?c:s,d?s:c)}else n[a]=new En(s,s)}return new Wn(n,e.sel.primIndex)}function Rn(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Bn(e)}function Bn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,wn(e,100),e.state.modeGen++,e.curOp&&pn(e)}function qn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==p(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Kn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),Ct(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new lt(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=S(e,l.line),d=S(e,s.line),f=p(c),h=i(c.length-1),g=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(qn(e,t)){var m=a(0,c.length-1);o(d,d.text,h),g&&e.remove(l.line,g),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var v=a(1,c.length-1);v.push(new lt(f+u.text.slice(s.ch),h,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,g);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),h);var y=a(1,c.length-1);g>1&&e.remove(l.line+1,g-1),e.insert(l.line+1,y)}Ct(e,"change",e,t)}function Un(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function Vn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wr(e),Rn(e),e.options.lineWrapping||ge(e),e.options.mode=t.modeOption,pn(e)}function Gn(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 $n(e,t){var r={from:z(t.from),to:Dn(t),text:T(e,t.from,t.to)};return ti(e,r,t.from.line,t.to.line+1),Un(e,function(e){return ti(e,r,t.from.line,t.to.line+1)},!0),r}function Yn(e){for(;e.length;){var t=p(e);if(!t.ranges)break;e.pop()}}function Xn(e,t){return t?(Yn(e.done),p(e.done)):e.done.length&&!p(e.done).ranges?p(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),p(e.done)):void 0}function Zn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))a=p(o.changes),0==E(t.from,t.to)&&0==E(t.from,a.to)?a.to=Dn(t):o.changes.push($n(e,t));else{var s=p(i.done);for(s&&s.ranges||ei(e.sel,i.done),o={changes:[$n(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=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ae(e,"historyAdded")}function Qn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Jn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Qn(e,o,p(i.done),t))?i.done[i.done.length-1]=t:ei(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&Yn(i.undone)}function ei(e,t){var r=p(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ti(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ri(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 ni(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ri(r[i]));return n}function ii(e,t){var r=ni(e,t),n=Y(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function oi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Wn.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&d(t,Number(u[1]))>-1&&(p(l)[f]=c[f],delete c[f])}}}return n}function ai(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=E(r,i)<0;o!=E(n,i)<0?(i=r,r=n):o!=E(r,n)<0&&(r=n)}return new En(i,r)}return new En(n||r,r)}function li(e,t,r,n){hi(e,new Wn([ai(e,e.sel.primary(),t,r)],0),n)}function si(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=ai(e,e.sel.ranges[i],t[i],null);var o=zn(n,e.sel.primIndex);hi(e,o,r)}function ci(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,hi(e,zn(i,e.sel.primIndex),n)}function ui(e,t,r,n){hi(e,Pn(t,r),n)}function di(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new En(I(e,t[n].anchor),I(e,t[n].head))},origin:r&&r.origin};return Ae(e,"beforeSelectionChange",e,n),e.cm&&Ae(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?zn(n.ranges,n.ranges.length-1):t}function fi(e,t,r){var n=e.history.done,i=p(n);i&&i.ranges?(n[n.length-1]=t,pi(e,t,r)):hi(e,t,r)}function hi(e,t,r){pi(e,t,r),Jn(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function pi(e,t,r){(We(e,"beforeSelectionChange")||e.cm&&We(e.cm,"beforeSelectionChange"))&&(t=di(e,t,r));var n=r&&r.bias||(E(t.primary().head,e.sel.primary().head)<0?-1:1);gi(e,vi(e,t,n,!0)),r&&r.scroll===!1||!e.cm||Jr(e.cm)}function gi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Oe(e.cm)),Ct(e,"cursorActivity",e))}function mi(e){gi(e,vi(e,e.sel,null,!1),Oa)}function vi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=bi(e,a.anchor,l&&l.anchor,r,n),c=bi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new En(s,c))}return i?zn(i,t.primIndex):t}function yi(e,t,r,n,i){var o=S(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Ae(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=wi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=E(c,r))&&(n<0?u<0:u>0))return yi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=wi(e,d,n,d.line==t.line?o:null)),d?yi(e,d,t,n,i):null}}return t}function bi(e,t,r,n,i){var o=n||1,a=yi(e,t,r,o,i)||!i&&yi(e,t,r,o,!0)||yi(e,t,r,-o,i)||!i&&yi(e,t,r,-o,!0);return a?a:(e.cantEdit=!0,W(e.first,0))}function wi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?I(e,W(t.line-1)):null:r>0&&t.ch==(n||S(e,t.line)).text.length?t.line<e.first+e.size-1?W(t.line+1,0):null:new W(t.line,t.ch+r)}function xi(e){e.setSelection(W(e.firstLine(),0),W(e.lastLine()),Oa)}function ki(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=I(e,t)),r&&(n.to=I(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Ae(e,"beforeChange",e,n),e.cm&&Ae(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Ci(e,t,r){if(e.cm){if(!e.cm.curOp)return dn(e.cm,Ci)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"))||(t=ki(e,t,!0))){var n=Ha&&!r&&Z(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Si(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Si(e,t)}}function Si(e,t){if(1!=t.text.length||""!=t.text[0]||0!=E(t.from,t.to)){var r=In(e,t);Zn(e,t,r,e.cm?e.cm.curOp.id:NaN),Mi(e,t,r,Y(e,t));var n=[];Un(e,function(e,r){r||d(n,e.history)!=-1||(Wi(e.history,t),n.push(e.history)),Mi(e,t,null,Y(e,t))})}}function Ti(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(ei(n,l),r&&!n.equals(e.sel))return void hi(e,n,{clearRedo:!1});o=n}var c=[];ei(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"),f=function(r){var i=n.changes[r];if(i.origin=t,u&&!ki(e,i,!1))return a.length=0,{};c.push($n(e,i));var o=r?In(e,i):p(a);Mi(e,i,o,ii(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Dn(i)});var l=[];Un(e,function(e,t){t||d(l,e.history)!=-1||(Wi(e.history,i),l.push(e.history)),Mi(e,i,null,ii(e,i))})},h=n.changes.length-1;h>=0;--h){var g=f(h);if(g)return g.v}}}}function Li(e,t){if(0!=t&&(e.first+=t,e.sel=new Wn(g(e.sel.ranges,function(e){return new En(W(e.anchor.line+t,e.anchor.ch),W(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)gn(e.cm,n,"gutter")}}function Mi(e,t,r,n){if(e.cm&&!e.cm.curOp)return dn(e.cm,Mi)(e,t,r,n);if(t.to.line<e.first)return void Li(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Li(e,i),t={from:W(e.first,0),to:W(t.to.line+i,t.to.ch),text:[p(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:W(o,S(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=In(e,t)),e.cm?_i(e.cm,t,n):Kn(e,t,n),pi(e,r,Oa)}}function _i(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=_(le(S(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Oe(e),Kn(n,t,r,br(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=pe(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),wn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||qn(e.doc,t)?pn(e,o.line,a.line+1,c):gn(e,o.line,"text");var u=We(e,"changes"),d=We(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ct(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ai(e,t,r,n,i){if(n||(n=r),E(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Ci(e,{from:r,to:n,text:t,origin:i})}function Ni(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Oi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Ni(o.ranges[l].anchor,t,r,n),Ni(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=W(c.from.line+n,c.from.ch),c.to=W(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Wi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Oi(e.done,r,n,i),Oi(e.undone,r,n,i)}function Ei(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=S(e,H(e,t)):i=_(t),null==i?null:(n(o,i)&&e.cm&&gn(e.cm,i,r),o)}function zi(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r}function Pi(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null}function Di(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t}function Hi(e,t,r){he(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Qr(e,null,r)}function Ii(e,t,r,n){var i=new Di(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ei(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!de(e,t)){var n=he(t)<e.scrollTop;M(t,t.height+Ht(i)),n&&Qr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Fi(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++sl}function ji(e,t,r,i,o){if(i&&i.shared)return Bi(e,t,r,i,o);if(e.cm&&!e.cm.curOp)return dn(e.cm,ji)(e,t,r,i,o);var a=new Fi(e,o),l=E(t,r);if(i&&s(i,a,!1),l>0||0==l&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=n("span",[a.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ae(e,t.line,t,r,a)||t.line!=r.line&&ae(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");B()}a.addToHistory&&Zn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var c,u=t.line,d=e.cm;if(e.iter(u,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&le(e)==d.display.maxLine&&(c=!0),a.collapsed&&u!=t.line&&M(e,0),V(e,new q(a,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),a.collapsed&&e.iter(t.line,r.line+1,function(t){de(e,t)&&M(t,0)}),a.clearOnEnter&&Ra(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(R(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++sl,a.atomic=!0),d){if(c&&(d.curOp.updateMaxLine=!0),a.collapsed)pn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)gn(d,f,"text");a.atomic&&mi(d.doc),Ct(d,"markerAdded",d,a)}return a}function Ri(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r}function Bi(e,t,r,n,i){n=s(n),n.shared=!1;var o=[ji(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Un(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(ji(e,I(e,t),I(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=p(o)}),new Ri(o,a)}function qi(e){return e.findMarks(W(e.first,0),e.clipPos(W(e.lastLine())),function(e){return e.parent})}function Ki(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(E(o,a)){var l=ji(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function Ui(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Un(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];d(n,o.doc)==-1&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}function Vi(e){var t=this;if(Yi(t),!Ne(t,e)&&!It(t.display,e)){ze(e),aa&&(dl=+new Date);var r=xr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(e,n){if(!t.options.allowDropFileTypes||d(t.options.allowDropFileTypes,e.type)!=-1){var l=new FileReader;l.onload=dn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=I(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ci(t.doc,s),fi(t.doc,Pn(r,Dn(s)))}}),l.readAsText(e)}},s=0;s<i;++s)l(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),pi(t.doc,Pn(r,r)),u)for(var f=0;f<u.length;++f)Ai(t.doc,"",u[f].anchor,u[f].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Gi(e,t){if(aa&&(!e.state.draggingText||+new Date-dl<100))return void He(t);if(!Ne(e,t)&&!It(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!fa)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",da&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),da&&r.parentNode.removeChild(r)}}function $i(e,t){var i=xr(e,t);if(i){var o=document.createDocumentFragment();Tr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Yi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Xi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Zi(){fl||(Qi(),fl=!0)}function Qi(){var e;Ra(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Xi(Ji)},100))}),Ra(window,"blur",function(){return Xi(Or)})}function Ji(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function eo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function to(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=g(r.split(" "),eo),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function ro(e,t,r,n){t=oo(t);var i=t.call?t.call(e,n):t[e];if(i===!1)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 ro(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=ro(e,t.fallthrough[o],r,n);if(a)return a}}}function no(e){var t="string"==typeof e?e:hl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function io(e,t){if(da&&34==e.keyCode&&e["char"])return!1;var r=hl[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(ka?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(ka?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function oo(e){return"string"==typeof e?vl[e]:e}function ao(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&E(o.from,p(n).to)<=0;){var a=n.pop();if(E(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ai(e.doc,"",n[t].from,n[t].to,"+delete");Jr(e)})}function lo(e,t){var r=S(e.doc,t),n=le(r);n!=r&&(t=_(n));var i=Le(n),o=i?i[0].level%2?we(n):be(n):0;return W(t,o)}function so(e,t){for(var r,n=S(e.doc,t);r=oe(n);)n=r.find(1,!0).line,t=null;var i=Le(n),o=i?i[0].level%2?be(n):we(n):n.text.length;return W(null==t?_(n):t,o)}function co(e,t){var r=lo(e,t.line),n=S(e.doc,r.line),i=Le(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return W(r.line,a?0:o)}return r}function uo(e,t,r){if("string"==typeof t&&(t=wl[t],!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)!=Na}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function fo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=ro(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&ro(t,e.options.extraKeys,r,e)||ro(t,e.options.keyMap,r,e)}function ho(e,t,r,n){var i=e.state.keySeq;if(i){if(no(t))return"handled";xl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=fo(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ct(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(ze(r),Mr(e)),i&&!o&&/\'$/.test(t)?(ze(r),!0):!!o}function po(e,t){var r=io(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+r,t,function(t){return uo(e,t,!0)})||ho(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return uo(e,t)}):ho(e,r,t,function(t){return uo(e,t)}))}function go(e,t,r){return ho(e,"'"+r+"'",t,function(t){return uo(e,t,!0)})}function mo(e){var t=this;if(t.curOp.focus=Ta(),!Ne(t,e)){aa&&la<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=po(t,e);da&&(kl=n?r:null,!n&&88==r&&!Va&&(va?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||vo(t)}}function vo(e){function t(e){18!=e.keyCode&&e.altKey||(Sa(r,"CodeMirror-crosshair"),_e(document,"keyup",t),_e(document,"mouseover",t))}var r=e.display.lineDiv;o(r,"CodeMirror-crosshair"),Ra(document,"keyup",t),Ra(document,"mouseover",t)}function yo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ne(this,e)}function bo(e){var t=this;if(!(It(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||va&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(da&&r==kl)return kl=null,void ze(e);if(!da||e.which&&!(e.which<10)||!po(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(go(t,e,i)||t.display.input.onKeyPress(e))}}}function wo(e){var t=this,r=t.display;if(!(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,It(r,e))return void(sa||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!To(t,e)){var n=xr(t,e);switch(window.focus(),Fe(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?xo(t,e,n):Ie(e)==r.scroller&&ze(e);break;case 2:sa&&(t.state.lastMiddleDown=+new Date),n&&li(t.doc,n),setTimeout(function(){return r.input.focus()},20),ze(e);break;case 3:Ca?Lo(t,e):Ar(t)}}}}function xo(e,t,r){aa?setTimeout(l(_r,e),0):e.curOp.focus=Ta();var n,i=+new Date;bl&&bl.time>i-400&&0==E(bl.pos,r)?n="triple":yl&&yl.time>i-400&&0==E(yl.pos,r)?(n="double",bl={time:i,pos:r}):(n="single",yl={time:i,pos:r});var o,a=e.doc.sel,s=va?t.metaKey:t.ctrlKey;e.options.dragDrop&&qa&&!e.isReadOnly()&&"single"==n&&(o=a.contains(r))>-1&&(E((o=a.ranges[o]).from(),r)<0||r.xRel>0)&&(E(o.to(),r)>0||r.xRel<0)?ko(e,t,r,s):Co(e,t,r,n,s)}function ko(e,t,r,n){var i=e.display,o=+new Date,a=dn(e,function(l){sa&&(i.scroller.draggable=!1),e.state.draggingText=!1,_e(document,"mouseup",a),_e(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ze(l),!n&&+new Date-200<o&&li(e.doc,r),sa||aa&&9==la?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});sa&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=va?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Ra(document,"mouseup",a),Ra(i.scroller,"drop",a)}function Co(e,t,r,n,i){function o(t){if(0!=E(y,t))if(y=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=c(S(u,r.line).text,r.ch,o),l=c(S(u,t.line).text,t.ch,o),s=Math.min(a,l),g=Math.max(a,l),m=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=v;m++){var b=S(u,m).text,w=f(b,s,o);s==g?i.push(new En(W(m,w),W(m,w))):b.length>w&&i.push(new En(W(m,w),W(m,f(b,g,o))))}i.length||i.push(new En(r,r)),hi(u,zn(p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=d,k=x.anchor,C=t;if("single"!=n){var T;T="double"==n?e.findWordAt(t):new En(W(t.line,0),I(u,W(t.line+1,0))),E(T.anchor,k)>0?(C=T.head,k=D(x.from(),T.anchor)):(C=T.anchor,k=P(x.to(),T.head))}var L=p.ranges.slice(0);L[h]=new En(I(u,k),C),hi(u,zn(L,h),Wa)}}function a(t){var r=++w,i=xr(e,t,!0,"rect"==n);if(i)if(0!=E(i,y)){e.curOp.focus=Ta(),o(i);var l=Dr(s,u);(i.line>=l.to||i.line<l.from)&&setTimeout(dn(e,function(){w==r&&a(t)}),150)}else{var c=t.clientY<b.top?-20:t.clientY>b.bottom?20:0;c&&setTimeout(dn(e,function(){w==r&&(s.scroller.scrollTop+=c,a(t))}),50)}}function l(t){e.state.selectingText=!1,w=1/0,ze(t),s.input.focus(),_e(document,"mousemove",x),_e(document,"mouseup",k),u.history.lastSelOrigin=null}var s=e.display,u=e.doc;ze(t);var d,h,p=u.sel,g=p.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),d=h>-1?g[h]:new En(r,r)):(d=u.sel.primary(),h=u.sel.primIndex),ya?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(d=new En(r,r)),r=xr(e,t,!0,!0),h=-1;else if("double"==n){var m=e.findWordAt(r);d=e.display.shift||u.extend?ai(u,d,m.anchor,m.head):m}else if("triple"==n){var v=new En(W(r.line,0),I(u,W(r.line+1,0)));d=e.display.shift||u.extend?ai(u,d,v.anchor,v.head):v}else d=ai(u,d,r);i?h==-1?(h=g.length,hi(u,zn(g.concat([d]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"single"==n&&!t.shiftKey?(hi(u,zn(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):ci(u,h,d,Wa):(h=0,hi(u,new Wn([d],0),Wa),p=u.sel);var y=r,b=s.wrapper.getBoundingClientRect(),w=0,x=dn(e,function(e){Fe(e)?a(e):l(e)}),k=dn(e,l);e.state.selectingText=k,Ra(document,"mousemove",x),Ra(document,"mouseup",k)}function So(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!We(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=A(e.doc,o),d=e.options.gutters[s];return Ae(e,r,e,u,d,t),De(t)}}}function To(e,t){return So(e,t,"gutterClick",!0)}function Lo(e,t){It(e.display,t)||Mo(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Mo(e,t){return!!We(e,"gutterContextMenu")&&So(e,t,"gutterContextMenu",!1)}function _o(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ir(e)}function Ao(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Cl&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Cl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Rn(e)},!0),t("indentUnit",2,Rn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Bn(e),ir(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(W(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ai(e.doc,t,r[i],W(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Cl&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ma?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ba),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){_o(e),No(e)},!0),t("keyMap","default",function(e,t,r){var n=oo(t),i=r!=Cl&&oo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,Wo,!0),t("gutters",[],function(e){On(e.options),No(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?yr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Ur(e)},!0),t("scrollbarStyle","native",function(e){Gr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){On(e.options),No(e)},!0),t("firstLineNumber",1,No,!0),t("lineNumberFormatter",function(e){return e},No,!0),t("showCursorWhenSelecting",!1,Cr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Or(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Oo),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Cr,!0),t("singleCursorHeightPerLine",!0,Cr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Bn,!0),t("addModeClass",!1,Bn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Bn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function No(e){Nn(e),pn(e),setTimeout(function(){return Wr(e)},20)}function Oo(e,t,r){var n=r&&r!=Cl;if(!t!=!n){var i=e.display.dragFunctions,o=t?Ra:_e;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Wo(e){
5
+ e.options.lineWrapping?(o(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Sa(e.display.wrapper,"CodeMirror-wrap"),ge(e)),wr(e),pn(e),ir(e),setTimeout(function(){return Ur(e)},100)}function Eo(e,t){var r=this;if(!(this instanceof Eo))return new Eo(e,t);this.options=t=t?s(t):{},s(Sl,t,!1),On(t);var n=t.value;"string"==typeof n&&(n=new ul(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new Eo.inputStyles[t.inputStyle](this),o=this.display=new C(e,n,i);o.wrapper.CodeMirror=this,Nn(this),_o(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!ma&&o.input.focus(),Gr(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 u,keySeq:null,specialChars:null},aa&&la<11&&setTimeout(function(){return r.display.input.reset(!0)},20),zo(this),Zi(),tn(this),this.curOp.forceUpdate=!0,Vn(this,n),t.autofocus&&!ma||this.hasFocus()?setTimeout(l(Nr,this),20):Or(this);for(var a in Tl)Tl.hasOwnProperty(a)&&Tl[a](r,t[a],Cl);Er(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Ll.length;++c)Ll[c](r);rn(this),sa&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function zo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Ra(i.scroller,"mousedown",dn(e,wo)),aa&&la<11?Ra(i.scroller,"dblclick",dn(e,function(t){if(!Ne(e,t)){var r=xr(e,t);if(r&&!To(e,t)&&!It(e.display,t)){ze(t);var n=e.findWordAt(r);li(e.doc,n.anchor,n.head)}}})):Ra(i.scroller,"dblclick",function(t){return Ne(e,t)||ze(t)}),Ca||Ra(i.scroller,"contextmenu",function(t){return Lo(e,t)});var o,a={end:0};Ra(i.scroller,"touchstart",function(t){if(!Ne(e,t)&&!r(t)){clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ra(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ra(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!It(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new En(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new En(W(l.line,0),I(e.doc,W(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ze(r)}t()}),Ra(i.scroller,"touchcancel",t),Ra(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Hr(e,i.scroller.scrollTop),Ir(e,i.scroller.scrollLeft,!0),Ae(e,"scroll",e))}),Ra(i.scroller,"mousewheel",function(t){return Rr(e,t)}),Ra(i.scroller,"DOMMouseScroll",function(t){return Rr(e,t)}),Ra(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ne(e,t)||He(t)},over:function(t){Ne(e,t)||($i(e,t),He(t))},start:function(t){return Gi(e,t)},drop:dn(e,Vi),leave:function(t){Ne(e,t)||Yi(e)}};var l=i.input.getField();Ra(l,"keyup",function(t){return yo.call(e,t)}),Ra(l,"keydown",dn(e,mo)),Ra(l,"keypress",dn(e,bo)),Ra(l,"focus",function(t){return Nr(e,t)}),Ra(l,"blur",function(t){return Or(e,t)})}function Po(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Je(e,t):r="prev");var a=e.options.tabSize,l=S(o,t),s=c(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,d=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(u=o.mode.indent(i,l.text.slice(d.length),l.text),u==Na||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?c(S(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/a);g;--g)p+=a,f+="\t";if(p<u&&(f+=h(u-p)),f!=d)return Ai(o,f,W(t,0),W(t,d.length),"+input"),l.stateAfter=null,!0;for(var m=0;m<o.sel.ranges.length;m++){var v=o.sel.ranges[m];if(v.head.line==t&&v.head.ch<d.length){var y=W(t,d.length);ci(o,m,new En(y,y));break}}}function Do(e){Ml=e}function Ho(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Ka(t),s=null;if(a&&n.ranges.length>1)if(Ml&&Ml.text.join("\n")==t){if(n.ranges.length%Ml.text.length==0){s=[];for(var c=0;c<Ml.text.length;c++)s.push(o.splitLines(Ml.text[c]))}}else l.length==n.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],h=f.from(),m=f.to();f.empty()&&(r&&r>0?h=W(h.line,h.ch-r):e.state.overwrite&&!a?m=W(m.line,Math.min(S(o,m.line).text.length,m.ch+p(l).length)):Ml&&Ml.lineWise&&Ml.text.join("\n")==t&&(h=m=W(h.line,0))),u=e.curOp.updateInput;var v={from:h,to:m,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Ci(e.doc,v),Ct(e,"inputRead",e,v)}t&&!a&&Fo(e,t),Jr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Io(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Ho(t,r,0,null,"paste")}),!0}function Fo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Po(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(S(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Po(e,i.head.line,"smart"));a&&Ct(e,"electricInput",e,i.head.line)}}}function jo(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:W(i,0),head:W(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ro(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Bo(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return sa?e.style.width="1000px":e.setAttribute("wrap","off"),ga&&(e.style.border="1px solid black"),Ro(e),t}function qo(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&dn(this,t[e])(this,r,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](oo(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:fn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,pn(this)}),removeOverlay:fn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void pn(t)}}),indentLine:fn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),N(this.doc,e)&&Po(this,e,t,r)}),indentSelection:fn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Po(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Jr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Po(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&ci(t.doc,i,new En(a,u[i].to()),Oa)}}}),getTokenAt:function(e,t){return nt(this,e,t)},getLineTokens:function(e,t){return nt(this,W(e),t,!0)},getTokenTypeAt:function(e){e=I(this.doc,e);var t,r=Qe(this,S(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&d(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=H(r,null==e?r.first+r.size-1:e),Je(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?I(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return cr(this,I(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),hr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,A(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=S(this.doc,e)}else r=e;return lr(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-he(r):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return mr(this.display)},setGutterMarker:fn(function(e,t,r){return Ei(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&x(n)&&(e.gutterMarkers=null),!0})}),clearGutter:fn(function(e){var t=this,r=this.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,gn(t,n,"gutter"),x(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){var t;if("number"==typeof e){if(!N(this.doc,e))return null;if(t=e,e=S(this.doc,e),!e)return null}else if(t=_(e),null==t)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}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,I(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Xr(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:fn(mo),triggerOnKeyPress:fn(bo),triggerOnKeyUp:yo,execCommand:function(e){if(wl.hasOwnProperty(e))return wl[e].call(null,this)},triggerElectric:fn(function(e){Fo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=I(this.doc,e),l=0;l<t&&(a=Ko(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:fn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ko(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Ea)}),deleteH:fn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):ao(this,function(r){var i=Ko(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=I(this.doc,e),s=0;s<t;++s){var c=ur(i,l,"div");if(null==a?a=c.left:c.left=a,l=Uo(i,c,o,r),l.hitSide)break}return l},moveV:fn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=ur(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Uo(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Qr(r,null,cr(r,s,"div").top-l.top),s},Ea),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=S(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var a=r.charAt(n),l=w(a,o)?function(e){return w(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new En(W(e.line,n),W(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?o(this.display.cursorDiv,"CodeMirror-overwrite"):Sa(this.display.cursorDiv,"CodeMirror-overwrite"),Ae(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ta()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:fn(function(e,t){null==e&&null==t||en(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Bt(this)-this.display.barHeight,width:e.scrollWidth-Bt(this)-this.display.barWidth,clientHeight:Kt(this),clientWidth:qt(this)}},scrollIntoView:fn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:W(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)en(this),this.curOp.scrollToPos=e;else{var r=Zr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:fn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&nr(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){gn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ae(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:fn(function(){var e=this.display.cachedTextHeight;pn(this),this.curOp.forceUpdate=!0,ir(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),_n(this),(null==e||Math.abs(e-gr(this.display))>.5)&&wr(this),Ae(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Vn(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),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}},Ee(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Ko(e,t,r,n,i){function o(){var t=l+r;return!(t<e.first||t>=e.first+e.size)&&(l=t,u=S(e,t))}function a(e){var t=(i?Se:Te)(u,s,r,!0);if(null==t){if(e||!o())return!1;s=i?(r<0?we:be)(u):r<0?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=r,u=S(e,l);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var d=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||a(!p);p=!1){var g=u.text.charAt(s)||"\n",m=w(g,h)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||m||(m="s"),d&&d!=m){r<0&&(r=1,a());break}if(m&&(d=m),r>0&&!a(!p))break}var v=bi(e,W(l,s),t,c,!0);return E(t,v)||(v.hitSide=!0),v}function Uo(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*gr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=hr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Vo(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new u,this.gracePeriod=!1}function Go(e,t){var r=Yt(e,t.line);if(!r||r.hidden)return null;var n=S(e.doc,t.line),i=Vt(r,n,t.line),o=Le(n),a="left";if(o){var l=ke(o,t.ch);a=l%2?"right":"left"}var s=Qt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $o(e,t){return t&&(e.bad=!0),e}function Yo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(l+=r);var u,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(W(n,0),W(i+1,0),o(+d));return void(f.length&&(u=f[0].find())&&(l+=T(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h<t.childNodes.length;h++)a(t.childNodes[h]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+=c,s=!1),l+=p}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=r;)t=t.nextSibling;return l}function Xo(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return $o(e.clipPos(W(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 Zo(o,t,r)}}function Zo(e,t,r){function n(t,r,n){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=_(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),W(s,c)}}}var o=e.text.firstChild,a=!1;if(!t||!i(o,t))return $o(W(_(e.line),0),!0);if(t==o&&(a=!0,t=o.childNodes[r],r=0,!t)){var l=e.rest?p(e.rest):e.line;return $o(W(_(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=o;)c=c.parentNode;var u=e.measure,d=u.maps,f=n(s,c,r);if(f)return $o(f,a);for(var h=c.nextSibling,g=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return $o(W(f.line,f.ch-g),a);g+=h.textContent.length}for(var m=c.previousSibling,v=r;m;m=m.previousSibling){if(f=n(m,m.firstChild,-1))return $o(W(f.line,f.ch+v),a);v+=m.textContent.length}}function Qo(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new u,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Jo(e,t){function r(){e.value=c.getValue()}if(t=t?s(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=Ta();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(Ra(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var c=Eo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return c}function ea(e){e.off=_e,e.on=Ra,e.wheelEventPixels=jr,e.Doc=ul,e.splitLines=Ka,e.countColumn=c,e.findColumn=f,e.isWordChar=b,e.Pass=Na,e.signal=Ae,e.Line=lt,e.changeEnd=Dn,e.scrollbarModel=al,e.Pos=W,e.cmpPos=E,e.modes=$a,e.mimeModes=Ya,e.resolveMode=Ue,e.getMode=Ve,e.modeExtensions=Xa,e.extendMode=Ge,e.copyState=$e,e.startState=Xe,e.innerMode=Ye,e.commands=wl,e.keyMap=vl,e.keyName=io,e.isModifierKey=no,e.lookupKey=ro,e.normalizeKeyMap=to,e.StringStream=Za,e.SharedTextMarker=Ri,e.TextMarker=Fi,e.LineWidget=Di,e.e_preventDefault=ze,e.e_stopPropagation=Pe,e.e_stop=He,e.addClass=o,e.contains=i,e.rmClass=Sa,e.keyNames=hl}var ta=navigator.userAgent,ra=navigator.platform,na=/gecko\/\d/i.test(ta),ia=/MSIE \d/.test(ta),oa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ta),aa=ia||oa,la=aa&&(ia?document.documentMode||6:oa[1]),sa=/WebKit\//.test(ta),ca=sa&&/Qt\/\d+\.\d+/.test(ta),ua=/Chrome\//.test(ta),da=/Opera\//.test(ta),fa=/Apple Computer/.test(navigator.vendor),ha=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ta),pa=/PhantomJS/.test(ta),ga=/AppleWebKit/.test(ta)&&/Mobile\/\w+/.test(ta),ma=ga||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ta),va=ga||/Mac/.test(ra),ya=/\bCrOS\b/.test(ta),ba=/win/i.test(ra),wa=da&&ta.match(/Version\/(\d*\.\d*)/);wa&&(wa=Number(wa[1])),wa&&wa>=15&&(da=!1,sa=!0);var xa,ka=va&&(ca||da&&(null==wa||wa<12.11)),Ca=na||aa&&la>=9,Sa=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};xa=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(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Ta=function(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e};aa&&la<11&&(Ta=function(){try{return document.activeElement}catch(e){return document.body}});var La=function(e){e.select()};ga?La=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:aa&&(La=function(e){try{e.select()}catch(t){}}),u.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Ma,_a,Aa=30,Na={toString:function(){return"CodeMirror.Pass"}},Oa={scroll:!1},Wa={origin:"*mouse"},Ea={origin:"+move"},za=[""],Pa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Da=/[\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]/,Ha=!1,Ia=!1,Fa=null,ja=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,u=[],d=0;d<n;++d)u.push(e(r.charCodeAt(d)));for(var f=0,h=c;f<n;++f){var g=u[f];"m"==g?u[f]=h:h=g}for(var m=0,v=c;m<n;++m){var y=u[m];"1"==y&&"r"==v?u[m]="n":a.test(y)&&(v=y,"r"==y&&(u[m]="R"))}for(var b=1,w=u[0];b<n-1;++b){var x=u[b];"+"==x&&"1"==w&&"1"==u[b+1]?u[b]="1":","!=x||w!=u[b+1]||"1"!=w&&"n"!=w||(u[b]=w),w=x}for(var k=0;k<n;++k){var C=u[k];if(","==C)u[k]="N";else if("%"==C){var S=void 0;for(S=k+1;S<n&&"%"==u[S];++S);for(var T=k&&"!"==u[k-1]||S<n&&"1"==u[S]?"1":"N",L=k;L<S;++L)u[L]=T;k=S-1}}for(var M=0,_=c;M<n;++M){var A=u[M];"L"==_&&"1"==A?u[M]="L":a.test(A)&&(_=A)}for(var N=0;N<n;++N)if(o.test(u[N])){var O=void 0;for(O=N+1;O<n&&o.test(u[O]);++O);for(var W="L"==(N?u[N-1]:c),E="L"==(O<n?u[O]:c),z=W||E?"L":"R",P=N;P<O;++P)u[P]=z;N=O-1}for(var D,H=[],I=0;I<n;)if(l.test(u[I])){var F=I;for(++I;I<n&&l.test(u[I]);++I);H.push(new t(0,F,I))}else{var j=I,R=H.length;for(++I;I<n&&"L"!=u[I];++I);for(var B=j;B<I;)if(s.test(u[B])){j<B&&H.splice(R,0,new t(1,j,B));var q=B;for(++B;B<I&&s.test(u[B]);++B);H.splice(R,0,new t(2,q,B)),j=B}else++B;j<I&&H.splice(R,0,new t(1,j,I))}return 1==H[0].level&&(D=r.match(/^\s+/))&&(H[0].from=D[0].length,H.unshift(new t(0,0,D[0].length))),1==p(H).level&&(D=r.match(/\s+$/))&&(p(H).to-=D[0].length,H.push(new t(0,n-D[0].length,n))),2==H[0].level&&H.unshift(new t(1,H[0].to,H[0].to)),H[0].level!=p(H).level&&H.push(new t(H[0].level,n,n)),H}}(),Ra=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={}),i=n[t]||(n[t]=[]);i.push(r)}},Ba=[],qa=function(){if(aa&&la<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Ka=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ua=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Va=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ga=null,$a={},Ya={},Xa={},Za=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Za.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t,r=this.string.charAt(this.pos);if(t="string"==typeof e?r==e:r&&(e.test?e.test(r):e(r)))return++this.pos,r},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=c(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return c(this.string,null,this.tabSize)-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},Ee(lt),lt.prototype.lineNo=function(){return _(this)};var Qa,Ja={},el={},tl=null,rl=null,nl={left:0,right:0,top:0,bottom:0},il=0,ol=null;aa?ol=-.53:na?ol=15:ua?ol=-.7:fa&&(ol=-1/3),qr.prototype=s({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=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=va&&!ha?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new u,this.disableVert=new u},enableZeroWidthBar:function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},qr.prototype),Kr.prototype=s({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},Kr.prototype);var al={"native":qr,"null":Kr},ll=0;kn.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)},kn.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Ae.apply(null,e.events[t]);
6
+ },Wn.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(0!=E(n.anchor,i.anchor)||0!=E(n.head,i.head))return!1}return!0},deepCopy:function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new En(z(e.ranges[r].anchor),z(e.ranges[r].head));return new Wn(t,this.primIndex)},somethingSelected:function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},contains:function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(E(t,i.from())>=0&&E(e,i.to())<=0)return n}return-1}},En.prototype={from:function(){return D(this.anchor,this.head)},to:function(){return P(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},zi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ct(o),Ct(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},iterN:function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0}},Pi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof zi))){var s=[];this.collapse(s),this.children=[new zi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new zi(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Pi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=d(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Pi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}}},Ee(Di),Di.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=_(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=Ht(this);M(n,Math.max(0,n.height-a)),t&&un(t,function(){Hi(t,n,-a),gn(t,i,"widget")})}},Di.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=Ht(this)-e;n&&(M(r,r.height+n),t&&un(t,function(){t.curOp.forceUpdate=!0,Hi(t,r,n)}))};var sl=0;Ee(Fi),Fi.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&tn(t),We(this,"clear")){var n=this.find();n&&Ct(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=K(l.markedSpans,e);t&&!e.collapsed?gn(t,_(l),"text"):t&&(null!=s.to&&(o=_(l)),null!=s.from&&(i=_(l))),l.markedSpans=U(l.markedSpans,s),null==s.from&&e.collapsed&&!de(e.doc,l)&&t&&M(l,gr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=le(e.lines[c]),d=pe(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&mi(t.doc)),t&&Ct(t,"markerCleared",t,this),r&&rn(t),this.parent&&this.parent.clear()}},Fi.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=K(a.markedSpans,r);if(null!=l.from&&(n=W(t?a:_(a),l.from),e==-1))return n;if(null!=l.to&&(i=W(t?a:_(a),l.to),1==e))return i}return n&&{from:n,to:i}},Fi.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&un(r,function(){var n=e.line,i=_(e.line),o=Yt(r,i);if(o&&(rr(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!de(t.doc,n)&&null!=t.height){var a=t.height;t.height=null;var l=Ht(t)-a;l&&M(n,n.height+l)}})},Fi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&d(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Fi.prototype.detachLine=function(e){if(this.lines.splice(d(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ee(Ri),Ri.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Ct(this,"clear")}},Ri.prototype.find=function(e,t){return this.primary.find(e,t)};var cl=0,ul=function(e,t,r,n){if(!(this instanceof ul))return new ul(e,t,r,n);null==r&&(r=0),Pi.call(this,[new zi([new lt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=W(r,0);this.sel=Pn(i),this.history=new Gn(null),this.id=++cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Kn(this,{from:i,to:i,text:e}),hi(this,Pn(i),Oa)};ul.prototype=y(Pi.prototype,{constructor:ul,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=L(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=W(this.first,0),r=this.first+this.size-1;Ci(this,{from:t,to:W(r,S(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),hi(this,Pn(t))}),replaceRange:function(e,t,r,n){t=I(this,t),r=r?I(this,r):t,Ai(this,e,t,r,n)},getRange:function(e,t,r){var n=T(this,I(this,e),I(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(N(this,e))return S(this,e)},getLineNumber:function(e){return _(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=S(this,e)),le(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return I(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,r){ui(this,I(this,"number"==typeof e?W(e,t||0):e),null,r)}),setSelection:hn(function(e,t,r){ui(this,I(this,e),I(this,t||e),r)}),extendSelection:hn(function(e,t,r){li(this,I(this,e),t&&I(this,t),r)}),extendSelections:hn(function(e,t){si(this,j(this,e),t)}),extendSelectionsBy:hn(function(e,t){var r=g(this.sel.ranges,e);si(this,j(this,r),t)}),setSelections:hn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new En(I(n,e[o].anchor),I(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),hi(this,zn(i,t),r)}}),addSelection:hn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new En(I(this,e),I(this,t||e))),hi(this,zn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=T(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=T(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},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:hn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&jn(this,i,t),c=i.length-1;c>=0;c--)Ci(n,i[c]);s?fi(this,s):this.cm&&Jr(this.cm)}),undo:hn(function(){Ti(this,"undo")}),redo:hn(function(){Ti(this,"redo")}),undoSelection:hn(function(){Ti(this,"undo",!0)}),redoSelection:hn(function(){Ti(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(){this.history=new Gn(this.history.maxGeneration)},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:oi(this.history.done),undone:oi(this.history.undone)}},setHistory:function(e){var t=this.history=new Gn(this.history.maxGeneration);t.done=oi(e.done.slice(0),null,!0),t.undone=oi(e.undone.slice(0),null,!0)},addLineClass:hn(function(t,r,n){return Ei(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:hn(function(t,r,n){return Ei(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:hn(function(e,t,r){return Ii(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ji(this,I(this,e),I(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 e=I(this,e),ji(this,e,e,r,"bookmark")},findMarksAt:function(e){e=I(this,e);var t=[],r=S(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(e,t,r){e=I(this,e),t=I(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;return o>e?(t=e,!0):(e-=o,void++r)}),I(this,W(r,t))},indexFromPos:function(e){e=I(this,e);var t=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 ul(L(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);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 ul(L(this,t,r),e.mode||this.modeOption,t,this.lineSep);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}],Ki(n,qi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Eo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Ui(qi(t));break}}if(e.history==this.history){var i=[e.id];Un(e,function(e){return i.push(e.id)},!0),e.history=new Gn(null),e.history.done=oi(this.history.done,i),e.history.undone=oi(this.history.undone,i)}},iterLinkedDocs:function(e){Un(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ka(e)},lineSeparator:function(){return this.lineSep||"\n"}}),ul.prototype.eachLine=ul.prototype.iter;for(var dl=0,fl=!1,hl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",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"},pl=0;pl<10;pl++)hl[pl+48]=hl[pl+96]=String(pl);for(var gl=65;gl<=90;gl++)hl[gl]=String.fromCharCode(gl);for(var ml=1;ml<=12;ml++)hl[ml+111]=hl[ml+63235]="F"+ml;var vl={};vl.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"},vl.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"},vl.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"},vl.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"]},vl["default"]=va?vl.macDefault:vl.pcDefault;var yl,bl,wl={selectAll:xi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oa)},killLine:function(e){return ao(e,function(t){if(t.empty()){var r=S(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:W(t.head.line+1,0)}:{from:t.head,to:W(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ao(e,function(t){return{from:W(t.from().line,0),to:I(e.doc,W(t.to().line+1,0))}})},delLineLeft:function(e){return ao(e,function(e){return{from:W(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return ao(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ao(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},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(W(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(W(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return co(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return so(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ea)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ea)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?co(e,t.head):n},Ea)},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(),a=c(e.getLine(o.line),o.ch,n);t.push(h(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=S(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new W(i.line,i.ch-1)),i.ch>0)i=new W(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),W(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=S(e.doc,i.line-1).text;a&&(i=new W(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),W(i.line-1,a.length-1),i,"+transpose"))}r.push(new En(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Jr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},xl=new u,kl=null,Cl={toString:function(){return"CodeMirror.Init"}},Sl={},Tl={};Eo.defaults=Sl,Eo.optionHandlers=Tl;var Ll=[];Eo.defineInitHook=function(e){return Ll.push(e)};var Ml=null;Vo.prototype=s({init:function(e){function t(e){if(!Ne(n,e)){if(n.somethingSelected())Do({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=jo(n);Do({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Oa),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Ml.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Bo(),l=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),l.value=Ml.text.join("\n");var s=document.activeElement;La(l),setTimeout(function(){n.display.lineSpace.removeChild(a),s.focus(),s==i&&r.showPrimarySelection()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;Ro(i,n.options.spellcheck),Ra(i,"paste",function(e){Ne(n,e)||Io(e,n)||la<=11&&setTimeout(dn(n,function(){r.pollContent()||pn(n)}),20)}),Ra(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(r.composing.sel=Pn(W(i.head.line,a),W(i.head.line,a+t.length)))}}),Ra(i,"compositionupdate",function(e){return r.composing.data=e.data}),Ra(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Ra(i,"touchstart",function(){return r.forceCompositionEnd()}),Ra(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||un(r.cm,function(){return pn(n)})}),Ra(i,"copy",t),Ra(i,"cut",t)},prepareSelection:function(){var e=Sr(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Xo(this.cm,e.anchorNode,e.anchorOffset),n=Xo(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=E(D(r,n),t.from())||0!=E(P(r,n),t.to())){var i=Go(this.cm,t.from()),o=Go(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};var u;try{u=xa(i.node,i.offset,o.offset,o.node)}catch(d){}u&&(!na&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||(e.removeAllRanges(),e.addRange(u))):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):na&&this.startGracePeriod()),this.rememberSelection()}}},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)},showMultipleSelections:function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return i(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=Xo(t,e.anchorNode,e.anchorOffset),n=Xo(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){hi(t.doc,Pn(r,n),Oa),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=kr(e,n.line))?(a=_(t.view[0].line),l=t.view[0].node):(a=_(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=kr(e,i.line);u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=_(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling);for(var d=e.doc.splitLines(Yo(e,l,c,a,s)),f=T(e.doc,W(a,0),W(s,S(e.doc,s).text.length));d.length>1&&f.length>1;)if(p(d)==p(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,g=0,m=d[0],v=f[0],y=Math.min(m.length,v.length);h<y&&m.charCodeAt(h)==v.charCodeAt(h);)++h;for(var b=p(d),w=p(f),x=Math.min(b.length-(1==d.length?h:0),w.length-(1==f.length?h:0));g<x&&b.charCodeAt(b.length-g-1)==w.charCodeAt(w.length-g-1);)++g;d[d.length-1]=b.slice(0,b.length-g),d[0]=d[0].slice(h);var k=W(a,h),C=W(s,f.length?p(f).length-g:0);return d.length>1||d[0]||E(k,C)?(Ai(e.doc,d,k,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?dn(this.cm,pn)(this.cm):e.data&&e.data!=e.startData&&dn(this.cm,Ho)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||dn(this.cm,Ho)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:v,resetPosition:v,needsContentAttribute:!0},Vo.prototype),Qo.prototype=s({init:function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())Do({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Ml.text.join("\n"),La(a));else{if(!i.options.lineWiseCopyCut)return;var t=jo(i);Do({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Oa):(n.prevInput="",a.value=t.text.join("\n"),La(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Bo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),ga&&(a.style.width="0px"),Ra(a,"input",function(){aa&&la>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Ra(a,"paste",function(e){Ne(i,e)||Io(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Ra(a,"cut",t),Ra(a,"copy",t),Ra(e.scroller,"paste",function(t){It(e,t)||Ne(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Ra(e.lineSpace,"selectstart",function(t){It(e,t)||ze(t)}),Ra(a,"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"})}}),Ra(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Sr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},showSelection:function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Va&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&La(this.textarea),aa&&la>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",aa&&la>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!ma||Ta()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ua(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(aa&&la>=9&&this.hasSelection===i||va&&/[\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 a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return un(t,function(){Ho(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?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},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){aa&&la>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=d,a.style.cssText=u,aa&&la<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!aa||aa&&la<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?dn(i,xi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset();
7
+ };o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=xr(i,e),s=o.scroller.scrollTop;if(l&&!da){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(l)==-1&&dn(i,hi)(i.doc,Pn(l),Oa);var u=a.style.cssText,d=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(aa?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(sa&&(h=window.scrollY),o.input.focus(),sa&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),aa&&la>=9&&t(),Ca){He(e);var p=function(){_e(window,"mouseup",p),setTimeout(r,20)};Ra(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:v,needsContentAttribute:!1},Qo.prototype),Ao(Eo),qo(Eo);var _l="iter insert remove copy getEditor constructor".split(" ");for(var Al in ul.prototype)ul.prototype.hasOwnProperty(Al)&&d(_l,Al)<0&&(Eo.prototype[Al]=function(e){return function(){return e.apply(this.doc,arguments)}}(ul.prototype[Al]));return Ee(ul),Eo.inputStyles={textarea:Qo,contenteditable:Vo},Eo.defineMode=function(e){Eo.defaults.mode||"null"==e||(Eo.defaults.mode=e),qe.apply(this,arguments)},Eo.defineMIME=Ke,Eo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Eo.defineMIME("text/plain","null"),Eo.defineExtension=function(e,t){Eo.prototype[e]=t},Eo.defineDocExtension=function(e,t){ul.prototype[e]=t},Eo.fromTextArea=Jo,ea(Eo),Eo.version="5.20.2",Eo})},{}],18:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return p=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(n===!1?0:m),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();g=M.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,g,m=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},T=r.counterDescriptors||{},L=r.colorKeywords||{},M=r.valueKeywords||{},_=r.allowNested,A=r.supportsAtComponent===!0,N={};return N.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(A&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(_&&"("==e)return s(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(g="property","maybeprop"):C.hasOwnProperty(n)?(g="string-2","maybeprop"):_?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":_||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(g="error","block")},N.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},N.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&_)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else g+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(g="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},N.pseudo=function(e,t,r){return"word"==e?(g="variable-3",r.context.type):u(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(g="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,_?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();g="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,_?"block":"top",!1):("word"==e&&(g="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(g="variable","restricted_atBlock_before"):u(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(g="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!T.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(g="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},N.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),g=r,t.state=N[t.state](p,e,t),g},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-m),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(g),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(h).concat(b).concat(x);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})},{"../../lib/codemirror":17}],19:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,d=c.token(n,o.htmlState),f=/\btag\b/.test(d);if(f&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),g=e.getMode(r,p),m=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(m,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=g,o.localState=e.startState(g,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);return{startState:function(){var t=e.startState(c);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},{"../../lib/codemirror":17,"../css/css":18,"../javascript/javascript":20,"../xml/xml":21}],20:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Ce=e,Se=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(We),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(We.test(n))return e.eatWhile(We),o("operator","operator",e.current());if(Ne.test(n)){e.eatWhile(Ne);var a=e.current(),u=Oe.propertyIsEnumerable(a)&&Oe[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Me&&"@"==t.peek()&&t.match(Ee))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ae){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=ze.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ne.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){
8
+ this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(De.state=e,De.stream=i,De.marked=null,De.cc=o,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():_e?C:k;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function g(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=De.state;if(De.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=He}function y(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function b(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?g():";"==e?p():g(t)}return t}function k(e,t){return"var"==e?g(b("vardef",t.length),Q,x(";"),w):"keyword a"==e?g(b("form"),T,k,w):"keyword b"==e?g(b("form"),k,w):"{"==e?g(b("}"),U,w):";"==e?g():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==w&&De.state.cc.pop()(),g(b("form"),T,k,w,ne)):"function"==e?g(ce):"for"==e?g(b("form"),ie,k,w):"variable"==e?g(b("stat"),I):"switch"==e?g(b("form"),T,b("}","switch"),x("{"),U,w,w):"case"==e?g(C,x(":")):"default"==e?g(x(":")):"catch"==e?g(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?g(b("form"),fe,w):"export"==e?g(b("stat"),me,w):"import"==e?g(b("stat"),ve,w):"module"==e?g(b("form"),J,b("}"),x("{"),U,w,w):"type"==e?g(G,x("operator"),G,x(";")):"async"==e?g(k):p(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function T(e){return"("!=e?p():g(b(")"),C,x(")"),w)}function L(e,t){if(De.state.fatArrowAt==De.stream.start){var r=t?z:E;if("("==e)return g(v,b(")"),q(J,")"),w,x("=>"),r,y);if("variable"==e)return p(v,J,x("=>"),r,y)}var n=t?N:A;return Pe.hasOwnProperty(e)?g(n):"function"==e?g(ce,n):"class"==e?g(b("form"),de,w):"keyword c"==e||"async"==e?g(t?_:M):"("==e?g(b(")"),M,x(")"),w,n):"operator"==e||"spread"==e?g(t?S:C):"["==e?g(b("]"),xe,w,n):"{"==e?K(j,"}",null,n):"quasi"==e?p(O,n):"new"==e?g(P(t)):g()}function M(e){return e.match(/[;\}\)\],]/)?p():p(C)}function _(e){return e.match(/[;\}\)\],]/)?p():p(S)}function A(e,t){return","==e?g(C):N(e,t,!1)}function N(e,t,r){var n=0==r?A:N,i=0==r?C:S;return"=>"==e?g(v,r?z:E,y):"operator"==e?/\+\+|--/.test(t)?g(n):"?"==t?g(C,x(":"),i):g(i):"quasi"==e?p(O,n):";"!=e?"("==e?K(S,")","call",n):"."==e?g(F,n):"["==e?g(b("]"),M,x("]"),w,n):void 0:void 0}function O(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?g(O):g(C,W)}function W(e){if("}"==e)return De.marked="string-2",De.state.tokenize=c,g(O)}function E(e){return u(De.stream,De.state),p("{"==e?k:C)}function z(e){return u(De.stream,De.state),p("{"==e?k:S)}function P(e){return function(t){return"."==t?g(e?H:D):p(e?S:C)}}function D(e,t){if("target"==t)return De.marked="keyword",g(A)}function H(e,t){if("target"==t)return De.marked="keyword",g(N)}function I(e){return":"==e?g(w,k):p(A,x(";"),w)}function F(e){if("variable"==e)return De.marked="property",g()}function j(e,t){return"async"==e?(De.marked="property",g(j)):"variable"==e||"keyword"==De.style?(De.marked="property",g("get"==t||"set"==t?R:B)):"number"==e||"string"==e?(De.marked=Me?"property":De.style+" property",g(B)):"jsonld-keyword"==e?g(B):"modifier"==e?g(j):"["==e?g(C,x("]"),B):"spread"==e?g(C):":"==e?p(B):void 0}function R(e){return"variable"!=e?p(B):(De.marked="property",g(ce))}function B(e){return":"==e?g(S):"("==e?p(ce):void 0}function q(e,t){function r(n,i){if(","==n){var o=De.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),g(function(r,n){return r==t||n==t?p():p(e)},r)}return n==t||i==t?g():g(x(t))}return function(n,i){return n==t||i==t?g():p(e,r)}}function K(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return g(b(t,r),q(e,t),w)}function U(e){return"}"==e?g():p(k,U)}function V(e,t){if(Ae){if(":"==e)return g(G);if("?"==t)return g(V)}}function G(e){return"variable"==e?(De.marked="variable-3",g(Z)):"{"==e?g(q(Y,"}")):"("==e?g(q(X,")"),$):void 0}function $(e){if("=>"==e)return g(G)}function Y(e){return"variable"==e||"keyword"==De.style?(De.marked="property",g(Y)):":"==e?g(G):void 0}function X(e){return"variable"==e?g(X):":"==e?g(G):void 0}function Z(e,t){return"<"==t?g(q(G,">"),Z):"["==e?g(x("]"),Z):void 0}function Q(){return p(J,V,te,re)}function J(e,t){return"modifier"==e?g(J):"variable"==e?(m(t),g()):"spread"==e?g(J):"["==e?K(J,"]"):"{"==e?K(ee,"}"):void 0}function ee(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?g(J):"}"==e?p():g(x(":"),J,te)):(m(t),g(te))}function te(e,t){if("="==t)return g(S)}function re(e){if(","==e)return g(Q)}function ne(e,t){if("keyword b"==e&&"else"==t)return g(b("form","else"),k,w)}function ie(e){if("("==e)return g(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?g(Q,x(";"),le):";"==e?g(le):"variable"==e?g(ae):p(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(De.marked="keyword",g(C)):g(A,le)}function le(e,t){return";"==e?g(se):"in"==t||"of"==t?(De.marked="keyword",g(C)):p(C,x(";"),se)}function se(e){")"!=e&&g(C)}function ce(e,t){return"*"==t?(De.marked="keyword",g(ce)):"variable"==e?(m(t),g(ce)):"("==e?g(v,b(")"),q(ue,")"),w,V,k,y):void 0}function ue(e){return"spread"==e?g(ue):p(J,V,te)}function de(e,t){return"variable"==e?fe(e,t):he(e,t)}function fe(e,t){if("variable"==e)return m(t),g(he)}function he(e,t){return"extends"==t||"implements"==t?g(Ae?G:C,he):"{"==e?g(b("}"),pe,w):void 0}function pe(e,t){return"variable"==e||"keyword"==De.style?("static"==t||"get"==t||"set"==t||Ae&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",g(pe)):(De.marked="property",g(Ae?ge:ce,pe)):"*"==t?(De.marked="keyword",g(pe)):";"==e?g(pe):"}"==e?g():void 0}function ge(e,t){return"?"==t?g(ge):":"==e?g(G,te):p(ce)}function me(e,t){return"*"==t?(De.marked="keyword",g(we,x(";"))):"default"==t?(De.marked="keyword",g(C,x(";"))):p(k)}function ve(e){return"string"==e?g():p(ye,we)}function ye(e,t){return"{"==e?K(ye,"}"):("variable"==e&&m(t),"*"==t&&(De.marked="keyword"),g(be))}function be(e,t){if("as"==t)return De.marked="keyword",g(ye)}function we(e,t){if("from"==t)return De.marked="keyword",g(C)}function xe(e){return"]"==e?g():p(q(S,"]"))}function ke(e,t){return"operator"==e.lastType||","==e.lastType||We.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Ce,Se,Te=r.indentUnit,Le=n.statementIndent,Me=n.jsonld,_e=n.json||Me,Ae=n.typescript,Ne=n.wordCharacters||/[\w$\xa1-\uffff]/,Oe=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":r,"do":r,"try":r,"finally":r,"return":n,"break":n,"continue":n,"new":e("new"),"delete":n,"throw":n,"debugger":n,"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":n,"export":e("export"),"import":e("import"),"extends":n,await:n,async:e("async")};if(Ae){var l={type:"variable",style:"variable-3"},s={"interface":e("class"),"implements":n,namespace:n,module:e("module"),"enum":e("module"),type:e("type"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:i,string:l,number:l,"boolean":l,any:l};for(var c in s)a[c]=s[c]}return a}(),We=/[+\-*&%=<>!?|~^]/,Ee=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,ze="([{}])",Pe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},He={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Te,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Ce?r:(t.lastType="operator"!=Ce||"++"!=Se&&"--"!=Se?Ce:"incdec",h(t,r,Ce,Se,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Le&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Te:"stat"==d?l.indented+(ke(t,r)?Le||Te:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Te):l.indented+(/^(?:case|default)\b/.test(r)?Te:2*Te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:_e?null:"/*",blockCommentEnd:_e?null:"*/",lineComment:_e?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:_e?"json":"javascript",jsonldMode:Me,jsonMode:_e,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":17}],21:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?g:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",p)}function g(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||C.matchClosing===!1?(M="tag",m):(M="tag error",v)}return M="error",v}function m(e,t,r){return"endTag"!=e?(M="error",m):(d(r),h)}function v(e,t,r){return M="error",m(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),h}return M="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(M="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var T in S)C[T]=S[T];for(var T in i)C[T]=i[T];var L,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(M=null,t.state=t.state(L||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return C.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":17}]},{},[11])}();
9
  //# sourceMappingURL=forms-admin.min.js.map
assets/js/forms-admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["forms-admin.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","rows","m","i18n","showType","config","fieldType","type","charAt","toUpperCase","slice","label","fieldLabel","value","onchange","withAttr","placeholder","title","isHidden","initialValue","style","optional","valueHelp","numberMinMax","min","max","isRequired","desc","inputAtts","checked","required","forceRequired","disabled","isFieldRequired","placeholderHelp","useParagraphs","wrap","wrapInParagraphTags","choiceType","options","selected","dropdown","radioButtons","acceptsMultipleValues","push","checkboxes","choices","html","map","choice","index","data-id","name","selectChoice","bind","preselect","remove","class","onclick","key","this","splice","2","forms","render","text","visibleRows","hidden","submit","number","./field-forms-rows.js","3","html_beautify","g","generate","field","htmlTemplate","generators","select","attributes","hasSelection","unshift","checkbox","radio","../third-party/beautify-html.js","../third-party/render.js","4","FieldHelper","tabs","editor","fields","events","setActiveField","fieldConfig","get","c","join","redraw","controller","createFieldHTMLAndAddToForm","insert","view","fieldCategories","getCategories","availableFields","getAll","fieldsChoice","chooseField","category","categoryFields","filter","className","inForm","inFormContent","form","overlay","help","trust","onkeydown","window","event","keyCode","addToForm","on","./field-forms.js","./field-generator.js","./overlay.js","5","FieldFactory","reset","registeredFields","forEach","deregister","register","data","sticky","getFieldType","phone","birthday","registerMergeField","mergeField","listFields","field_type","tag","streetAddress","city","state","zip","country","mc4wp_vars","countries","registerInterestCategory","interestCategory","interestCategories","id","interests","registerListFields","list","merge_fields","sort","b","interest_categories","registerListsFields","lists","registerCustomFields","formFields","subscribe","submitButton","listChoice","listChoiceDescription","unsubscribe","formAction","formActionDescription","6","createChoices","choiceLabel","FieldChoice","Object","keys","existingField","getAllWhere","shift","categories","indexOf","Field","timeout","clearTimeout","setTimeout","trigger","searchKey","searchValue","prop","7","CodeMirror","FormEditor","element","dom","domDirty","_dom","innerHTML","getValue","toLowerCase","document","createElement","fromTextArea","selectionPointer","matchTags","bothTags","mode","htmlMode","autoCloseTags","autoRefresh","dispatchEvent","Event","bubbles","addEventListener","signal","query","querySelectorAll","containsField","fieldName","elements","namedItem","replaceSelection","focus","callback","refresh","codemirror","codemirror/addon/edit/closetag.js","codemirror/addon/edit/matchtags","codemirror/addon/fold/xml-fold","codemirror/mode/css/css","codemirror/mode/htmlmixed/htmlmixed","codemirror/mode/javascript/javascript","codemirror/mode/xml/xml","8","FormWatcher","settings","helpers","updateFields","findRequiredFields","requiredFields","requiredFieldElements","Array","prototype","el","replace","requiredFieldsInput","getElementById","debounce","9","show","notices","hide","container","querySelector","heading","parentNode","insertBefore","nextSibling","init","groupingsNotice","formCode","requiredFieldsNotice","missingFields","10","close","removeEventListener","onKeyDown","position","_onCloseCallback","preventDefault","_element","windowWidth","innerWidth","documentElement","clientWidth","body","windowHeight","innerHeight","clientHeight","marginLeft","marginTop","left","top","content","onCloseCallback","11","mc4wp_forms_i18n","mc4wp","deps","mithril","FieldsFactory","textareaElement","formEditor","fieldHelper","mount","fieldsFactory","getSelectedLists","mailchimp","./admin/field-helper.js","./admin/fields-factory.js","./admin/fields.js","./admin/form-editor.js","./admin/form-watcher.js","./admin/notices","12","trim","ltrim","style_html","html_source","js_beautify","css_beautify","Parser","pos","token","current_mode","tags","parent","parentcount","parent1","tag_type","token_text","last_token","last_text","token_type","newlines","indent_content","indent_inner_html","Utils","whitespace","split","single_token","extra_liners","in_array","what","arr","traverse_whitespace","input_char","input","preserve_newlines","max_preserve_newlines","get_content","space","indent_handlebars","peek3","substr","get_tag","line_char_count","wrap_line_length","print_newline","print_indentation","get_contents_to","reg_match","RegExp","lastIndex","reg_array","exec","end_script","substring","record_tag","indent_level","retrieve_tag","temp_parent","indent_to_tag","peek","tag_start","tag_end","tag_start_char","comment","orig_pos","orig_line_char_count","get_unformatted","get_comment","tag_index","tag_offset","tag_complete","tag_check","is_unformatted","unformatted","output","start_pos","delimiter","matched","orig_tag","min_index","get_token","tag_name_type","get_full_indent","level","indent_string","next_tag","match","printer","js_source","indent_character","indent_size","brace_style","force","print_token","print_token_raw","indent","unindent","multi_parser","parseInt","max_char","indent_char","tag_name","tag_extracted_from_last_output","_beautifier","script_indent_level","indent_scripts","indentation","white","_level","reindent","13","isArray","thing","toString","camelToDash","str","removeEmpties","escapeHtml","replaceDoubleQuote","createAttrString","attrs","styles","property","createChildrenContent","children","scope","result","onunload","$trusted","VOID_TAGS","14","mod","amd","autoCloseGT","cm","getOption","Pass","ranges","listSelections","replacements","empty","head","tok","getTokenAt","inner","innerMode","getMode","tagName","opt","configuration","dontCloseTags","htmlDontClose","indentTags","htmlIndent","end","ch","lowerTagName","test","string","closingTagExists","newPos","Pos","line","info","replaceRange","anchor","sel","setSelections","indentLine","autoCloseCurrent","typingSlash","start","replacement","context","getLine","replaceSelections","autoCloseSlash","collection","elt","newTag","scanForClosingTag","Math","lastLine","nextClose","cx","onCx","prev","to","next","defineOption","val","old","Init","removeKeyMap","whenClosing","whenOpening","addKeyMap","commands","closeTag","../../lib/codemirror","../fold/xml-fold","15","clear","tagHit","tagOther","doMatchTags","failedTagMatch","operation","somethingSelected","cur","getCursor","range","getViewport","from","findMatchingTag","matchBothTags","hit","at","open","markText","other","maybeUpdateMatch","off","toMatchingTag","found","extendSelection","16","cmp","Iter","firstLine","tagAt","iter","getTokenTypeAt","nextLine","prevLine","toTagEnd","gt","lastSlash","lastIndexOf","selfClose","toTagStart","lt","xmlTagStart","toNextTag","toPrevTag","findMatchingClose","stack","startLine","startCh","findMatchingOpen","endLine","endCh","nameStartChar","nameChar","registerHelper","openTag","startPos","endPos","here","findEnclosingTag","forward","17","global","factory","classTest","cls","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","appendChild","cssText","createTextNode","contains","child","nodeType","host","addClass","node","current","joinClasses","as","args","arguments","apply","copyObj","obj","target","overwrite","hasOwnProperty","countColumn","tabSize","startIndex","startValue","search","nextTab","Delayed","array","findColumn","goal","col","skipped","spaceStr","spaceStrs","lst","out","insertSorted","score","priority","nothing","createObj","base","props","inst","create","isWordCharBasic","nonASCIISingleCaseWordChar","isWordChar","helper","source","isEmpty","isExtendingChar","charCodeAt","extendingChars","Display","place","doc","d","scrollbarFiller","setAttribute","gutterFiller","lineDiv","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","mover","sizer","sizerWidth","heightForcer","scrollerGap","gutters","lineGutter","scroller","wrapper","ie","ie_version","zIndex","paddingRight","webkit","gecko","mobile","draggable","viewFrom","viewTo","first","reportedViewFrom","reportedViewTo","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","selForContextMenu","activeTouch","size","chunk","lines","sz","chunkSize","getBetween","getLines","updateLineHeight","height","diff","lineNo","no","lineAtHeight","h","outer","i$1","lh","isLine","lineNumberFor","String","lineNumberFormatter","firstLineNumber","copyPos","x","maxPos","minPos","clipLine","clipPos","last","clipToLen","linelen","clipPosArray","seeReadOnlySpans","sawReadOnlySpans","seeCollapsedSpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","markedSpans","concat","attachLine","markedSpansBefore","isInsert","nw","startsBefore","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","span$1","found$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","find","j","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","conflictingCollapsedRange","visualLine","merged","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","findMaxLine","display","iterateBidiSections","order","part","bidiLeft","bidiRight","lineLeft","getOrder","lineRight","compareBidiLevel","linedir","getBidiPartAt","bidiOther","moveInLine","dir","byUnit","moveVisually","bidi","moveLogically","bidiOrdering","getHandlers","emitter","copy","_handlers","noHandlers","detachEvent","handlers","signalDOMEvent","override","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","set","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","mac","ctrlKey","zeroWidthElement","zwspSupported","offsetHeight","offsetWidth","hasBadBidiRects","badBidiRects","txt","r0","getBoundingClientRect","r1","right","hasBadZoomedRects","badZoomedRects","normal","fromRange","abs","defineMode","dependencies","modes","defineMIME","mime","spec","mimeModes","resolveMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","nstate","startState","a1","a2","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","loop","overlays","i_end","opaque","classes","bgClass","textClass","getLineStyles","updateFrontier","getStateBefore","maxHighlightLength","stateAfter","styleClasses","frontier","precise","findStartLine","processLine","save","startAt","stream","StringStream","callBlankLine","eol","readToken","blankLine","takeToken","asArray","getObj","tokens","extractLineClasses","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","Line","estimateHeight","updateLine","estHeight","cleanUpLine","interpretTokenStyle","cache","styleToClassCacheWithMode","styleToClassCache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","rest","addToken","buildToken","buildTokenBadBidi","allowFrontierUpdate","insertLineContent","maps","caches","lastChild","defaultSpecialCharPlaceholder","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","j$1","j$2","upto","tokenText","LineView","buildViewArray","nextPos","pushOperation","op","operationGroup","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","signalLater","orphanDelayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","updateLineBackground","background","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterWidth","alignable","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","widgetHeight","parentStyle","eventInWidget","getAttribute","paddingTop","offsetTop","paddingVert","paddingH","getComputedStyle","currentStyle","isNaN","scrollGap","displayWidth","displayHeight","ensureLineHeights","rect","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","bottom","mapFromLineView","before","updateExternalMeasurement","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","measureCharInner","bogus","rtop","rbottom","nodeAndOffsetInLineMap","collapse","mStart","mEnd","coverStart","coverEnd","getUsefulRect","nullRect","maybeUpdateRectForZooming","rSpan","charWidth","rbot","mid","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","pageScrollX","pageXOffset","scrollLeft","pageScrollY","pageYOffset","scrollTop","intoCoordSystem","yOff","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","partPos","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","mergedPos","getX","wrongLine","innerOff","adjust","dist","fromX","fromOutside","toX","toOutside","xDiff","charSize","step","ceil","middle","middleX","textHeight","measureText","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","posFromMouse","liberal","forRect","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","selection","primIndex","showCursorWhenSelecting","drawSelectionCursor","drawSelectionRange","cursor","cursorHeight","otherCursor","add","fragment","rightSide","drawForLine","fromArg","toArg","lineLen","rightPos","leftPos","tmp","leftSide","padding","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","ensureFocus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","receivedFocus","rmClass","alignHorizontally","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","updateGutterSpace","updateHeightsInViewport","prevBottom","box","updateWidgetHeight","visibleLines","viewport","floor","ensure","ensureFrom","ensureTo","setScrollTop","updateDisplaySimple","scrollbars","startWorker","setScrollLeft","isScroller","scrollWidth","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","axis","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","wheelPixelsPerUnit","onScrollWheel","scroll","canScrollX","canScrollY","scrollHeight","currentWheelTarget","presto","pixels","wheelSamples","movedX","movedY","sample","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","update","paddingBottom","borderBottom","coverGutterNextToScrollbar","initScrollbars","scrollbarModel","scrollbarStyle","maybeScrollWindow","doScroll","phantom","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","changed","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","x1","y1","x2","y2","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollPos","resolveScrollToPos","ensureCursorVisible","scrollToPos","cursorScrollMargin","isCursor","sPos","scrollTo","startOperation","viewChanged","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","nextOpId","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","i$4","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","activeElt","hasFocus","setDocumentHeight","postUpdateDisplay","forceScroll","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","methodOp","docMethodOp","regChange","lendiff","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","tooLong","highlighted","oldCls","newCls","ischange","workDelay","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","marginBottom","borderRightWidth","viewportMargin","different","toUpdate","patchDisplay","updateNumbersFrom","rm","updateNumber","updateGutters","specs","gElt","setGuttersForLineNumbers","Selection","Range","normalizeSelection","prim","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","linesFor","lastText","lastSpans","nlines","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","history","origin","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","equals","existing","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","deepCopy","newChanges","Number","extendRange","extend","posBefore","setSelection","extendSelections","heads","newSel","replaceOneSelection","setSimpleSelection","filterSelectionChange","this$1","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","sel_dontScroll","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","antiChanges","after","returned","v","shiftDoc","distance","removed","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","LineWidget","adjustScrollWhenAboveVisible","addLineWidget","insertAt","aboveVisible","TextMarker","nextMarkerId","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","SharedTextMarker","cloneNode","isParent","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","onDrop","clearDragCursor","lastDrop","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","file","allowDropFileTypes","reader","onload","lineSeparator","readAsText","draggingText","text$1","getData","onDragStart","setData","getSelection","effectAllowed","setDragImage","safari","img","src","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","ensureGlobalHandlers","globalsRegistered","registerGlobalHandlers","resizeTimer","onResize","setSize","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","keyNames","keyName","noShift","altGraphKey","altKey","flipCtrlCmd","metaKey","shiftKey","keyMap","deleteNearSelection","compute","kill","toKill","replaced","lineStart","visual","lineEnd","lineStartSmart","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","dispatchKey","seq","keySeq","stopSeq","handleKeyBinding","motion","handleCharBinding","handled","lastStoppedKey","hasCopyEvent","showCrossHair","up","onKeyUp","onKeyPress","charCode","fromCharCode","onMouseDown","supportsTouch","clickInGutter","selectingText","leftButtonDown","lastMiddleDown","captureRightClick","onContextMenu","now","lastDoubleClick","lastClick","contained","modifier","dragDrop","dragAndDrop","leftButtonStartDrag","leftButtonSelect","startTime","dragEnd","e2","addNew","extendTo","lastPos","startCol","posCol","startSel","ourIndex","oldRange","ourRange","findWordAt","ranges$1","sel_mouse","curCount","counter","editorSize","move","chromeOS","word","gutterEvent","prevent","mX","mY","lineBox","contextMenuInGutter","themeChanged","theme","defineOptions","option","deflt","notOnInit","defaults","optionHandlers","setValue","lineSep","newBreaks","getInputField","spellcheck","windows","guttersChanged","detach","attach","wrappingChanged","integer","blur","readOnlyChanged","dragDropChanged","resetPosition","getField","tabIndex","wasOn","funcs","dragFunctions","toggle","enter","over","leave","drop","Doc","inputStyles","inputStyle","autofocus","pasteIncoming","cutIncoming","registerEventHandlers","finishInit","initHooks","textRendering","finishTouch","touchFinished","prevTouch","isMouseLikeTouchEvent","touches","touch","radiusX","radiusY","farAway","moved","pageX","pageY","inp","how","aggressive","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","setLastCopied","newLastCopied","lastCopied","applyTextInput","inserted","deleted","paste","textLines","splitLinesAuto","multiPaste","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","getRange","disableBrowserMagic","hiddenTextarea","te","div","ios","border","addEditorMethods","constructor","setOption","getDoc","addOverlay","modeSpec","removeOverlay","indentSelection","newRanges","getLineTokens","getHelper","getHelpers","_global","pred","getStateAfter","defaultTextHeight","defaultCharWidth","setGutterMarker","gutterID","clearGutter","lineInfo","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","execCommand","findPosH","amount","unit","visually","hitSide","moveH","extendSelectionsBy","rtlMoveVisually","sel_move","deleteH","findPosV","goalColumn","moveV","goals","headPos","startChar","check","toggleOverwrite","getScrollInfo","interpret","oldHeight","swapDoc","getWrapperElement","getScrollerElement","getGutterElement","registerGlobalHelper","predicate","findNextLine","moveOnce","boundToLine","origDir","sawType","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","gracePeriod","posToDOM","side","badPos","bad","domTextBetween","recognizeMarker","walk","cmText","textContent","markerID","nodeName","closing","nodeValue","domToPos","lineNode","locateNodeInLineView","textNode","topNode","curNode","previousSibling","dist$1","TextareaInput","prevInput","pollingFast","inaccurateSelection","composing","textarea","tabindex","realSubmit","leaveSubmitMethodAlone","wrappedSubmit","getTextArea","toTextArea","addLegacyProps","cmpPos","userAgent","navigator","platform","ie_upto10","ie_11up","documentMode","qtwebkit","chrome","vendor","mac_geMountainLion","presto_version","createRange","endNode","setEnd","setStart","createTextRange","moveToElementText","moveEnd","moveStart","activeElement","root","selectInput","selectionStart","selectionEnd","_e","ms","charType","lowTypes","arabicTypes","BidiSpan","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","outerType","types","type$1","prev$1","type$2","type$3","i$5","cur$1","type$4","i$6","end$1","replace$1","i$7","nstart","attachEvent","nl","rt","ownerDocument","parentElement","compareEndPoints","oncopy","lastColumnPos","lastColumnValue","sol","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","pattern","consume","caseInsensitive","cased","hideFirstChars","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","w","pointerEvents","bar","delay","maybeDisable","elementFromPoint","native","null","there","removeInner","insertInner","iterN","remaining","leaf","maybeSpill","me","spilled","sibling","myIndex","used","oldH","withOp","dHeight","nextDocId","cleanGeneration","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","setCursor","addSelection","getSelections","dup","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","addLineClass","where","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","link","splitIds","iterLinkedDocs","getEditor","eachLine","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","goDocStart","goDocEnd","goLineStart","goLineStartSmart","goLineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","goLineDown","goPageUp","goPageDown","goCharLeft","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","transposeChars","newlineAndIndent","sels","openLine","defineInitHook","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","pollContent","startData","ours","applyComposition","forceCompositionEnd","showMultipleSelections","curAnchor","anchorNode","anchorOffset","curFocus","focusNode","focusOffset","rangeCount","getRangeAt","rng","removeAllRanges","addRange","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","poll","pollSelection","pollInterval","fromIndex","fromNode","toNode","toIndex","newText","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","prepareCopyCut","fastPoll","moveInputWithCursor","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","minimal","slowPoll","missed","same","prepareSelectAllHack","extval","rehide","oldWrapperCSS","oldCSS","detectingSelectAll","resetSelectionOnContextMenu","wrapperBox","oldScrollY","scrollY","mouseup","dontDelegate","method","contenteditable","defineExtension","func","defineDocExtension","version","keySet","tokenCComment","maybeEnd","tokenize","parserConfig","ret","tp","tokenBase","tokenHooks","tokenString","tokenParenthesized","quote","escaped","Context","pushContext","popContext","pass","states","popAndPass","wordAsValue","valueKeywords","colorKeywords","inline","propertyKeywords","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","allowNested","supportsAtComponent","stateArg","block","maybeprop","propBlock","_stream","parens","pseudo","atBlock","atComponentBlock","atBlock_parens","restricted_atBlock_before","restricted_atBlock","keyframes","interpolation","textAfter","blockCommentStart","blockCommentEnd","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","fontProperties_","counterDescriptors_","colorKeywords_","valueKeywords_","allWords","/",":","$","#","@","&","maybeBackup","pat","getAttrRegexp","attr","regexp","attrRegexpCache","getAttrValue","getTagRegexp","anchored","addTags","findMatchingMode","tagInfo","tagText","defaultTags","script","htmlState","inTag","endTagA","endTag","localState","localMode","multilineTagIndentFactor","multilineTagIndentPastTag","configTags","configScript","scriptTypes","matches","local","../css/css","../javascript/javascript","../xml/xml","expressionAllowed","lastType","readRegexp","inSet","cont","tokenComment","isOperatorChar","tokenQuasi","wordRE","known","keywords","propertyIsEnumerable","jsonldMode","isJsonldKeyword","findFatArrow","fatArrowAt","arrow","isTS","depth","sawSomething","bracket","brackets","JSLexical","inScope","varname","localVars","vars","parseJS","cc","marked","lexical","combinator","jsonMode","expression","statement","lex","inList","globalVars","pushcontext","defaultVars","popcontext","pushlex","poplex","expect","wanted","exp","vardef","parenExpr","maybeelse","functiondef","forspec","maybelabel","funarg","afterExport","afterImport","typeexpr","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","atomicTypes","classExpression","maybeexpressionNoComma","maybeexpression","arrayLiteral","contCommasep","objprop","quasi","maybeTarget","expr","continueQuasi","targetNoComma","_","getterSetter","afterprop","proceed","maybetype","afterType","typeprop","typearg","maybeReturnType","maybeAssign","vardefCont","proppattern","_type","forspec1","forspec2","formaybeinof","forspec3","classNameAfter","classBody","classfield","maybeFrom","importSpec","maybeAs","isContinuedStatement","statementIndent","jsonld","json","typescript","wordCharacters","kw","A","B","C","operator","atom","jsKeywords","if","while","with","else","do","try","finally","return","break","continue","new","delete","throw","debugger","var","const","let","function","catch","for","switch","case","default","in","typeof","instanceof","true","false","super","yield","export","import","extends","await","async","tsKeywords","interface","implements","namespace","enum","public","private","protected","abstract","boolean","any","variable","jsonld-keyword","basecolumn","firstChar","doubleIndentSwitch","lineComment","closeBrackets","skipExpression","21","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","menu","nav","ol","section","table","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","inText","chain","parser","inBlock","doctype","baseState","tagStart","inAttribute","stringStartCol","closure","isInAttribute","terminator","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","setStyle","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","skipAttribute"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OAAeC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAA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,KAAOtqE,GAAS,CACd,GAAIA,EAAQ1B,SAAWgsE,EAAS,GAAI,CAClCtqE,EAAUA,EAAQa,IAClB,OACK,IAAIve,EAAOyjF,iBAAiBz+D,eAAetH,EAAQ1B,SAGxD,KAFA0B,GAAUA,EAAQa,SAKjB,IAAIypE,EACT,KAAOtqE,GAAS,CACd,GAAIuqE,GAAWjoF,EAAOkkF,gBAAgBxmE,EAAQ1B,QAC9C,KAAIisE,IAAYA,EAASjjE,eAAegjE,EAAS,IAG/C,KAFAtqE,GAAUA,EAAQa,KAKxB,KAAOb,GAAWA,EAAQa,OAASb,EAAQmpE,aACzCnpE,EAAUA,EAAQa,IACpB,OAAIb,GAAgBA,EAAQ9E,OAASw3C,EACzBvnD,EAAMg/E,YAAc,GAGlCj2B,cAAe,gBACfojB,kBAAmB,OACnBC,gBAAiB,MAEjB/4D,cAAelc,EAAO4M,SAAW,OAAS,MAC1CyqB,WAAYr3B,EAAO4M,SAAW,OAAS,MAEvCs7E,cAAe,SAASr/E,GAClBA,EAAMA,OAAS6+E,IACjB7+E,EAAMA,MAAQw+E,OAKtBz7E,EAAWgrB,WAAW,WAAY,OAClChrB,EAAWgrB,WAAW,kBAAmB,OACpChrB,EAAWmrB,UAAU/R,eAAe,cACvCpZ,EAAWgrB,WAAW,aAAc7zB,KAAM,MAAO6J,UAAU,QAI1DwS,uBAAuB,UAAU","file":"forms-admin.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\nvar rows = function(m, i18n) {\n\n\tvar r = {};\n\n\tr.showType = function(config) {\n\t\t// ucfirst\n\t\tvar fieldType = config.type();\n\t\tfieldType = fieldType.charAt(0).toUpperCase() + fieldType.slice(1);\n\n\t\treturn m('div', [\n\t\t\tm(\"label\", i18n.fieldType),\n\t\t\tm('span', fieldType ),\n\t\t]);\n\t};\n\n\tr.label = function (config) {\n\t\t// label row\n\t\treturn m(\"div\", [\n\t\t\tm(\"label\", i18n.fieldLabel),\n\t\t\tm(\"input.widefat\", {\n\t\t\t\ttype : \"text\",\n\t\t\t\tvalue : config.label(),\n\t\t\t\tonchange : m.withAttr('value', config.label),\n\t\t\t\tplaceholder: config.title()\n\t\t\t})\n\t\t]);\n\t};\n\n\tr.value = function (config) {\n\t\tvar isHidden = config.type() === 'hidden';\n\t\treturn m(\"div\", [\n\t\t\tm(\"label\", [\n\t\t\t\tisHidden ? i18n.value : i18n.initialValue,\n\t\t\t\t\" \",\n\t\t\t\tisHidden ? '' : m('small', { \"style\": \"float: right; font-weight: normal;\" }, i18n.optional )\n\t\t\t]),\n\t\t\tm(\"input.widefat\", {\n\t\t\t\ttype : \"text\",\n\t\t\t\tvalue : config.value(),\n\t\t\t\tonchange: m.withAttr('value', config.value)\n\t\t\t}),\n\t\t\tisHidden ? '' : m('p.help', i18n.valueHelp)\n\t\t]);\n\t};\n\n\tr.numberMinMax = function (config) {\n\t\treturn m('div', [\n\t\t\tm('div.row', [\n\t\t\t\tm('div.col.col-3', [\n\t\t\t\t\tm('label', i18n.min),\n\t\t\t\t\tm('input', {type: 'number', onchange: m.withAttr('value', config.min)})\n\t\t\t\t]),\n\t\t\t\tm('div.col.col-3', [\n\t\t\t\t\tm('label', i18n.max),\n\t\t\t\t\tm('input', {type: 'number', onchange: m.withAttr('value', config.max)})\n\t\t\t\t])\n\t\t\t])\n\t\t])\n\t};\n\n\n\tr.isRequired = function (config) {\n\t\tvar inputAtts = {\n\t\t\ttype : 'checkbox',\n\t\t\tchecked : config.required(),\n\t\t\tonchange: m.withAttr('checked', config.required)\n\t\t};\n\t\tvar desc;\n\n\t\tif( config.forceRequired() ) {\n\t\t\tinputAtts.required = true;\n\t\t\tinputAtts.disabled = true;\n\t\t\tdesc = m('p.help', i18n.forceRequired );\n\t\t}\n\n\t\treturn m('div', [\n\t\t\tm('label.cb-wrap', [\n\t\t\t\tm('input', inputAtts),\n\t\t\t\ti18n.isFieldRequired\n\t\t\t]),\n\t\t\tdesc\n\t\t]);\n\t};\n\n\tr.placeholder = function (config) {\n\n\t\treturn m(\"div\", [\n\t\t\tm(\"label\", [\n\t\t\t\ti18n.placeholder,\n\t\t\t\t\" \",\n\t\t\t\tm('small', { \"style\": \"float: right; font-weight: normal;\" }, i18n.optional )\n\t\t\t]),\n\t\t\tm(\"input.widefat\", {\n\t\t\t\ttype : \"text\",\n\t\t\t\tvalue : config.placeholder(),\n\t\t\t\tonchange: m.withAttr('value', config.placeholder),\n\t\t\t\tplaceholder: \"\"\n\t\t\t}),\n\t\t\tm(\"p.help\", i18n.placeholderHelp)\n\t\t]);\n\t};\n\n\tr.useParagraphs = function (config) {\n\t\treturn m('div', [\n\t\t\tm('label.cb-wrap', [\n\t\t\t\tm('input', {\n\t\t\t\t\ttype : 'checkbox',\n\t\t\t\t\tchecked : config.wrap(),\n\t\t\t\t\tonchange: m.withAttr('checked', config.wrap)\n\t\t\t\t}),\n\t\t\t\ti18n.wrapInParagraphTags\n\t\t\t])\n\t\t]);\n\t};\n\n\tr.choiceType = function (config) {\n\n\n\t\tvar options = [\n\t\t\tm('option', {\n\t\t\t\tvalue : 'select',\n\t\t\t\tselected: config.type() === 'select' ? 'selected' : false\n\t\t\t}, i18n.dropdown ),\n\t\t\tm('option', {\n\t\t\t\tvalue : 'radio',\n\t\t\t\tselected: config.type() === 'radio' ? 'selected' : false\n\t\t\t}, i18n.radioButtons )\n\t\t];\n\n\t\t// only add checkbox choice if field accepts multiple values\n\t\tif( config.acceptsMultipleValues ) {\n\t\t\toptions.push(\n\t\t\t\tm('option', {\n\t\t\t\t\tvalue : 'checkbox',\n\t\t\t\t\tselected: config.type() === 'checkbox' ? 'selected' : false\n\t\t\t\t}, i18n.checkboxes )\n\t\t\t);\n\t\t}\n\n\t\treturn m('div', [\n\t\t\tm('label', i18n.choiceType ),\n\t\t\tm('select', {\n\t\t\t\tvalue : config.type(),\n\t\t\t\tonchange: m.withAttr('value', config.type)\n\t\t\t}, options)\n\t\t]);\n\t};\n\n\tr.choices = function (config) {\n\n\t\tvar html = [];\n\t\thtml.push(m('div', [\n\t\t\tm('label', i18n.choices),\n\t\t\tm('div.limit-height', [\n\t\t\t\tm(\"table\", [\n\n\t\t\t\t\t// table body\n\t\t\t\t\tconfig.choices().map(function (choice, index) {\n\t\t\t\t\t\treturn m('tr', {\n\t\t\t\t\t\t\t'data-id': index\n\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\tm('td.cb', m('input', {\n\t\t\t\t\t\t\t\t\tname: 'selected',\n\t\t\t\t\t\t\t\t\ttype: (config.type() === 'checkbox' ) ? 'checkbox' : 'radio',\n\t\t\t\t\t\t\t\t\tonchange: m.withAttr('value', config.selectChoice.bind(config)),\n\t\t\t\t\t\t\t\t\tchecked: choice.selected(),\n\t\t\t\t\t\t\t\t\tvalue: choice.value(),\n\t\t\t\t\t\t\t\t\ttitle: i18n.preselect\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tm('td.stretch', m('input.widefat', {\n\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\tvalue: choice.label(),\n\t\t\t\t\t\t\t\tplaceholder: choice.title(),\n\t\t\t\t\t\t\t\tonchange: m.withAttr('value', choice.label)\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\tm('td', m('span', {\n\t\t\t\t\t\t\t\t\"title\": i18n.remove,\n\t\t\t\t\t\t\t\t\"class\": 'dashicons dashicons-no-alt hover-activated',\n\t\t\t\t\t\t\t\t\"onclick\": function (key) {\n\t\t\t\t\t\t\t\t\tthis.choices().splice(key, 1);\n\t\t\t\t\t\t\t\t}.bind(config, index)\n\t\t\t\t\t\t\t}, ''))\n\t\t\t\t\t\t])\n\t\t\t\t\t})\n\t\t\t\t]) // end of table\n\t\t\t]) // end of limit-height div\n\t\t]));\n\t\t\n\t\treturn html;\n\n\t};\n\n\treturn r;\n};\n\nmodule.exports = rows;\n},{}],2:[function(require,module,exports){\nvar forms = function(m, i18n) {\n\tvar forms = {};\n\tvar rows = require('./field-forms-rows.js')(m, i18n);\n\n\t// route to one of the other form configs, default to \"text\"\n\tforms.render = function(config) {\n\n\t\tvar type = config.type();\n\n\t\tif( typeof( forms[type] ) === \"function\" ) {\n\t\t\treturn forms[ type ](config);\n\t\t}\n\n\t\tswitch( type ) {\n\t\t\tcase 'select':\n\t\t\tcase 'radio':\n\t\t\tcase 'checkbox':\n\t\t\t\treturn forms.choice(config);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// fallback to good old text field\n\t\treturn forms.text(config);\n\t};\n\n\n\tforms.text = function(config) {\n\t\treturn [\n\t\t\trows.label(config),\n\t\t\trows.placeholder(config),\n\t\t\trows.value(config),\n\t\t\trows.isRequired(config),\n\t\t\trows.useParagraphs(config)\n\t\t]\n\t};\n\n\tforms.choice = function(config) {\n\t\tvar visibleRows = [\n\t\t\trows.label(config),\n\t\t\trows.choiceType(config),\n\t\t\trows.choices(config),\n\t\t];\n\n\t\tif( config.type() === 'select' ) {\n\t\t\tvisibleRows.push(rows.placeholder(config));\n\t\t}\n\n\t\tvisibleRows.push(rows.useParagraphs(config));\n\n\t\tif( config.type() === 'select' || config.type() === 'radio' ) {\n\t\t\tvisibleRows.push(rows.isRequired(config));\n\t\t}\n\n\t\treturn visibleRows;\n\t};\n\n\tforms.hidden = function( config ) {\n\t\tconfig.placeholder('');\n\t\tconfig.label('');\n\t\tconfig.wrap(false);\n\n\t\treturn [\n\t\t\trows.showType(config),\n\t\t\trows.value(config)\n\t\t]\n\t};\n\n\tforms.submit = function(config) {\n\t\tconfig.label('');\n\t\tconfig.placeholder('');\n\n\t\treturn [\n\t\t\trows.value(config),\n\t\t\trows.useParagraphs(config)\n\t\t]\n\t};\n\n\tforms.number = function(config) {\n\t\treturn [\n\t\t\tforms.text(config),\n\t\t\trows.numberMinMax(config)\n\t\t];\n\t};\n\n\treturn forms;\n};\n\n\n\nmodule.exports = forms;\n},{\"./field-forms-rows.js\":1}],3:[function(require,module,exports){\n'use strict';\n\nvar render = require('../third-party/render.js');\nvar html_beautify = require('../third-party/beautify-html.js');\n\nvar g = function(m) {\n\tvar generators = {};\n\n\t/**\n\t * Generates a <select> field\n\t * @param config\n\t * @returns {*}\n\t */\n\tgenerators.select = function (config) {\n\t\tvar attributes = {\n\t\t\tname: config.name(),\n\t\t\trequired: config.required()\n\t\t};\n\t\tvar hasSelection = false;\n\n\t\tvar options = config.choices().map(function (choice) {\n\n\t\t\tif( choice.selected() ) {\n\t\t\t\thasSelection = true;\n\t\t\t}\n\n\t\t\treturn m('option', {\n\t\t\t\tvalue : ( choice.value() !== choice.label() ) ? choice.value() : undefined,\n\t\t\t\t\"selected\": choice.selected()\n\t\t\t}, choice.label())\n\t\t});\n\n\t\tvar placeholder = config.placeholder();\n\t\tif(placeholder.length > 0 ) {\n\t\t\toptions.unshift(\n\t\t\t\tm('option', {\n\t\t\t\t\t'disabled': true,\n\t\t\t\t\t'value': '',\n\t\t\t\t\t'selected': ! hasSelection\n\t\t\t\t}, placeholder)\n\t\t\t);\n\t\t}\n\n\t\treturn m('select', attributes, options );\n\t};\n\n\t/**\n\t * Generates a checkbox or radio type input field.\n\t *\n\t * @param config\n\t * @returns {*}\n\t */\n\tgenerators.checkbox = function (config) {\n\t\tvar field = config.choices().map(function (choice) {\n\t\t\tvar name = config.name() + ( config.type() === 'checkbox' ? '[]' : '' );\n\t\t\tvar required = config.required() && config.type() === 'radio';\n\n\t\t\treturn m('label', [\n\t\t\t\t\tm('input', {\n\t\t\t\t\t\tname : name,\n\t\t\t\t\t\ttype : config.type(),\n\t\t\t\t\t\tvalue : choice.value(),\n\t\t\t\t\t\tchecked : choice.selected(),\n\t\t\t\t\t\trequired: required\n\t\t\t\t\t}),\n\t\t\t\t\t' ',\n\t\t\t\t\tm('span', choice.label())\n\t\t\t\t]\n\t\t\t)\n\t\t});\n\t\t\n\t\treturn field;\n\t};\n\tgenerators.radio = generators.checkbox;\n\n\t/**\n\t * Generates a default field\n\t *\n\t * - text, url, number, email, date\n\t *\n\t * @param config\n\t * @returns {*}\n\t */\n\tgenerators['default'] = function (config) {\n\n\t\tvar attributes = {\n\t\t\ttype: config.type()\n\t\t};\n\t\tvar field;\n\n\t\tif (config.name()) {\n\t\t\tattributes.name = config.name();\n\t\t}\n\n\t\tif (config.min()) {\n\t\t\tattributes.min = config.min();\n\t\t}\n\n\t\tif (config.max()) {\n\t\t\tattributes.max = config.max();\n\t\t}\n\n\t\tif (config.value().length > 0) {\n\t\t\tattributes.value = config.value();\n\t\t}\n\n\t\tif( config.placeholder().length > 0 ) {\n\t\t\tattributes.placeholder = config.placeholder();\n\t\t}\n\n\t\tattributes.required = config.required();\n\n\t\tfield = m('input', attributes);\n\t\treturn field;\n\t};\n\n\t/**\n\t * Generates an HTML string based on a field (config) object\n\t *\n\t * @param config\n\t * @returns {*}\n\t */\n\tfunction generate(config) {\n\t\tvar label, field, htmlTemplate, html;\n\n\t\tlabel = config.label().length ? m(\"label\", config.label()) : '';\n\t\tfield = typeof(generators[config.type()]) === \"function\" ? generators[config.type()](config) : generators['default'](config);\n\n\t\thtmlTemplate = config.wrap() ? m('p', [label, field]) : [label, field];\n\n\t\t// render HTML on memory node\n\t\thtml = render(htmlTemplate);\n\n\t\t// prettify html\n\t\thtml = html_beautify(html);\n\n\t\treturn html + \"\\n\";\n\t}\n\n\treturn generate;\n};\n\nmodule.exports = g;\n},{\"../third-party/beautify-html.js\":12,\"../third-party/render.js\":13}],4:[function(require,module,exports){\nvar FieldHelper = function(m, tabs, editor, fields, events, i18n) {\n\t'use strict';\n\n\tvar generate = require('./field-generator.js')(m);\n\tvar overlay = require('./overlay.js')(m,i18n);\n\tvar forms = require('./field-forms.js')(m, i18n);\n\tvar fieldConfig;\n\n\teditor.on('blur', m.redraw);\n\n\t/**\n\t * Choose a field to open the helper form for\n\t *\n\t * @param index\n\t * @returns {*}\n\t */\n\tfunction setActiveField(index) {\n\n\t\tfieldConfig = fields.get(index);\n\n\t\t// if this hidden field has choices (hidden groups), glue them together by their label.\n\t\tif( fieldConfig && fieldConfig.choices().length > 0 ) {\n\t\t\tfieldConfig.value( fieldConfig.choices().map(function(c) {\n\t\t\t\treturn c.label();\n\t\t\t}).join('|'));\n\t\t}\n\n\t\tm.redraw();\n\t}\n\n\n\t/**\n\t * Controller\n\t */\n\tfunction controller() {\n\n\t}\n\n\t/**\n\t * Create HTML based on current config object\n\t */\n\tfunction createFieldHTMLAndAddToForm() {\n\n\t\t// generate html\n\t\tvar html = generate(fieldConfig);\n\n\t\t// add to editor\n\t\teditor.insert( html );\n\n\t\t// reset field form\n\t\tsetActiveField('');\n\n\t\t// redraw\n\t\tm.redraw();\n\t}\n\n\t/**\n\t * View\n\t * @returns {*}\n\t */\n\tfunction view() {\n\n\t\t// build DOM for fields choice\n\t\tvar fieldCategories = fields.getCategories();\n\t\tvar availableFields = fields.getAll();\n\n\t\tvar fieldsChoice = m( \"div.available-fields.small-margin\", [\n\t\t\tm(\"h4\", i18n.chooseField),\n\n\t\t\tfieldCategories.map(function(category) {\n\t\t\t\tvar categoryFields = availableFields.filter(function(f) {\n\t\t\t\t\treturn f.category === category;\n\t\t\t\t});\n\n\t\t\t\tif( ! categoryFields.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn m(\"div.tiny-margin\",[\n\t\t\t\t\tm(\"strong\", category),\n\n\t\t\t\t\t// render fields\n\t\t\t\t\tcategoryFields.map(function(field) {\n\t\t\t\t\t\tvar className = \"button\";\n\t\t\t\t\t\tif( field.forceRequired() ) {\n\t\t\t\t\t\t\tclassName += \" is-required\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar inForm = field.inFormContent();\n\t\t\t\t\t\tif( inForm !== null ) {\n\t\t\t\t\t\t\tclassName += \" \" + ( inForm ? 'in-form' : 'not-in-form' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn m(\"button\", {\n\t\t\t\t\t\t\tclassName: className,\n\t\t\t\t\t\t\ttype : 'button',\n\t\t\t\t\t\t\tonclick: m.withAttr(\"value\", setActiveField),\n\t\t\t\t\t\t\tvalue : field.index\n\t\t\t\t\t\t}, field.title() );\n\t\t\t\t\t})\n\t\t\t\t]);\n\t\t\t})\n\t\t]);\n\n\t\t// build DOM for overlay\n\t\tvar form = null;\n\t\tif( fieldConfig ) {\n\t\t\tform = overlay(\n\t\t\t\t// field wizard\n\t\t\t\tm(\"div.field-wizard\", [\n\n\t\t\t\t\t//heading\n\t\t\t\t\tm(\"h3\", [\n\t\t\t\t\t\tfieldConfig.title(),\n\t\t\t\t\t\tfieldConfig.forceRequired() ? m('span.red', '*' ) : '',\n\t\t\t\t\t\tfieldConfig.name().length ? m(\"code\", fieldConfig.name()) : ''\n\t\t\t\t\t]),\n\n\t\t\t\t\t// help text\n\t\t\t\t\t( fieldConfig.help().length ) ? m('p', m.trust( fieldConfig.help() ) ) : '',\n\n\t\t\t\t\t// actual form\n\t\t\t\t\tforms.render(fieldConfig),\n\n\t\t\t\t\t// add to form button\n\t\t\t\t\tm(\"p\", [\n\t\t\t\t\t\tm(\"button\", {\n\t\t\t\t\t\t\t\"class\": \"button-primary\",\n\t\t\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\t\tonkeydown: function(e) {\n\t\t\t\t\t\t\t\te = e || window.event;\n\t\t\t\t\t\t\t\tif(e.keyCode == 13) {\n\t\t\t\t\t\t\t\t\tcreateFieldHTMLAndAddToForm();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonclick: createFieldHTMLAndAddToForm\n\t\t\t\t\t\t}, i18n.addToForm )\n\t\t\t\t\t])\n\t\t\t\t]), setActiveField);\n\t\t}\n\n\t\treturn [\n\t\t\tfieldsChoice,\n\t\t\tform\n\t\t];\n\t}\n\n\t// expose some variables\n\treturn {\n\t\tview: view,\n\t\tcontroller: controller\n\t}\n};\n\nmodule.exports = FieldHelper;\n},{\"./field-forms.js\":2,\"./field-generator.js\":3,\"./overlay.js\":10}],5:[function(require,module,exports){\nvar FieldFactory = function(fields, i18n) {\n\t'use strict';\n\n\t/**\n\t * Array of registered fields\n\t *\n\t * @type {Array}\n\t */\n\tvar registeredFields = [];\n\n\t/**\n\t * Reset all previously registered fields\n\t */\n\tfunction reset() {\n\t\t// clear all of our fields\n\t\tregisteredFields.forEach(fields.deregister);\n\t}\n\n\t/**\n\t * Helper function to quickly register a field and store it in local scope\n\t *\n\t * @param {object} data\n\t * @param {boolean} sticky\n\t */\n\tfunction register(category, data, sticky) {\n\t\tvar field = fields.register(category, data);\n\n\t\tif( ! sticky ) {\n\t\t\tregisteredFields.push(field);\n\t\t}\n\t}\n\n\t/**\n\t * Normalizes the field type which is passed by MailChimp\n\t *\n\t * @param type\n\t * @returns {*}\n\t */\n\tfunction getFieldType(type) {\n\n\t\tvar map = {\n\t\t\t'phone' : 'tel',\n\t\t\t'dropdown': 'select',\n\t\t\t'checkboxes': 'checkbox',\n\t\t\t'birthday': 'text'\n\t\t};\n\n\t\treturn typeof map[ type ] !== \"undefined\" ? map[type] : type;\n\t}\n\n\t/**\n\t * Register the various fields for a merge var\n\t *\n\t * @param mergeField\n\t * @returns {boolean}\n\t */\n\tfunction registerMergeField(mergeField) {\n\n\t\tvar category = i18n.listFields;\n\t\tvar fieldType = getFieldType(mergeField.field_type);\n\n\t\t// name, type, title, value, required, label, placeholder, choices, wrap\n\t\tvar data = {\n\t\t\tname: mergeField.tag,\n\t\t\ttitle: mergeField.name,\n\t\t\trequired: mergeField.required,\n\t\t\tforceRequired: mergeField.required,\n\t\t\ttype: fieldType,\n\t\t\tchoices: mergeField.choices,\n\t\t\tacceptsMultipleValues: false // merge fields never accept multiple values.\n\t\t};\n\n\t\tif( data.type !== 'address' ) {\n\t\t\tregister(category, data, false);\n\t\t} else {\n\t\t\tregister(category, { name: data.name + '[addr1]', type: 'text', title: i18n.streetAddress });\n\t\t\tregister(category, { name: data.name + '[city]', type: 'text', title: i18n.city });\n\t\t\tregister(category, { name: data.name + '[state]', type: 'text', title: i18n.state });\n\t\t\tregister(category, { name: data.name + '[zip]', type: 'text', title: i18n.zip });\n\t\t\tregister(category, { name: data.name + '[country]', type: 'select', title: i18n.country, choices: mc4wp_vars.countries });\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Register a field for a MailChimp grouping\n\t *\n\t * @param interestCategory\n\t */\n\tfunction registerInterestCategory(interestCategory){\n\t\tvar category = i18n.interestCategories;\n\t\tvar fieldType = getFieldType(interestCategory.field_type);\n\n\t\tvar data = {\n\t\t\ttitle: interestCategory.name,\n\t\t\tname: 'INTERESTS[' + interestCategory.id + ']',\n\t\t\ttype: fieldType,\n\t\t\tchoices: interestCategory.interests,\n\t\t\tacceptsMultipleValues: fieldType === 'checkbox'\n\t\t};\n\t\tregister(category, data, false);\n\t}\n\n\t/**\n\t * Register all fields belonging to a list\n\t *\n\t * @param list\n\t */\n\tfunction registerListFields(list) {\n\n\t\t// make sure EMAIL && public fields come first\n\t\tlist.merge_fields = list.merge_fields.sort(function(a, b) {\n\t\t\tif( a.tag === 'EMAIL' || ( a.public && ! b.public ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif( ! a.public && b.public ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t});\n\n\t\t// loop through merge vars\n\t\tlist.merge_fields.forEach(registerMergeField);\n\n\t\t// loop through groupings\n\t\tlist.interest_categories.forEach(registerInterestCategory);\n\t}\n\n\t/**\n\t * Register all lists fields\n\t *\n\t * @param lists\n\t */\n\tfunction registerListsFields(lists) {\n\t\treset();\n\t\tlists.forEach(registerListFields);\n\t}\n\n\tfunction registerCustomFields(lists) {\n\n\t\tvar choices,\n\t\t\tcategory = i18n.formFields;\n\n\t\t// register submit button\n\t\tregister(category, {\n\t\t\tname: '',\n\t\t\tvalue: i18n.subscribe,\n\t\t\ttype: \"submit\",\n\t\t\ttitle: i18n.submitButton\n\t\t}, true);\n\n\t\t// register lists choice field\n\t\tchoices = {};\n\t\tfor(var key in lists) {\n\t\t\tchoices[lists[key].id] = lists[key].name;\n\t\t}\n\n\t\tregister(category, {\n\t\t\tname: '_mc4wp_lists',\n\t\t\ttype: 'checkbox',\n\t\t\ttitle: i18n.listChoice,\n\t\t\tchoices: choices,\n\t\t\thelp: i18n.listChoiceDescription,\n\t\t\tacceptsMultipleValues: true\n\t\t}, true);\n\n\t\tchoices = {\n\t\t\t'subscribe': \"Subscribe\",\n\t\t\t'unsubscribe': \"Unsubscribe\"\n\t\t};\n\t\tregister(category, {\n\t\t\tname: '_mc4wp_action',\n\t\t\ttype: 'radio',\n\t\t\ttitle: i18n.formAction,\n\t\t\tchoices: choices,\n\t\t\tvalue: 'subscribe',\n\t\t\thelp: i18n.formActionDescription\n\t\t}, true);\n\t}\n\n\t/**\n\t * Expose some methods\n\t */\n\treturn {\n\t\t'registerCustomFields': registerCustomFields,\n\t\t'registerListFields': registerListFields,\n\t\t'registerListsFields': registerListsFields\n\t}\n\n};\n\nmodule.exports = FieldFactory;\n},{}],6:[function(require,module,exports){\n'use strict';\n\nmodule.exports = function(m, events) {\n var timeout;\n\tvar fields = [];\n\tvar categories = [];\n\n\n\t/**\n\t * @internal\n\t *\n\t *\n\t * @param data\n\t * @constructor\n\t */\n\tvar Field = function (data) {\n\t\tthis.name = m.prop(data.name);\n\t\tthis.title = m.prop(data.title || data.name);\n\t\tthis.type = m.prop(data.type);\n\t\tthis.label = m.prop(data.title || '');\n\t\tthis.value = m.prop(data.value || '');\n\t\tthis.placeholder = m.prop(data.placeholder || '');\n\t\tthis.required = m.prop(data.required || false);\n\t\tthis.forceRequired = m.prop( data.forceRequired || false );\n\t\tthis.wrap = m.prop(data.wrap || true);\n\t\tthis.min = m.prop(data.min || null);\n\t\tthis.max = m.prop(data.max || null);\n\t\tthis.help = m.prop(data.help || '');\n\t\tthis.choices = m.prop(data.choices || []);\n\t\tthis.inFormContent = m.prop(null);\n\t\tthis.acceptsMultipleValues = data.acceptsMultipleValues;\n\n\t\tthis.selectChoice = function(value) {\n\t\t\tvar field = this;\n\n\t\t\tthis.choices(this.choices().map(function(choice) {\n\n\t\t\t\tif( choice.value() === value ) {\n\t\t\t\t\tchoice.selected(true);\n\t\t\t\t} else {\n\t\t\t\t\t// only checkboxes allow for multiple selections\n\t\t\t\t\tif( field.type() !== 'checkbox' ) {\n\t\t\t\t\t\tchoice.selected(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn choice;\n\n\t\t\t}));\n\t\t};\n\t};\n\n\t/**\n\t * @internal\n\t *\n\t * @param data\n\t * @constructor\n\t */\n\tvar FieldChoice = function (data) {\n\t\tthis.label = m.prop(data.label);\n\t\tthis.title = m.prop(data.title || data.label);\n\t\tthis.selected = m.prop(data.selected || false);\n\t\tthis.value = m.prop(data.value || data.label);\n\t};\n\n\t/**\n\t * Creates FieldChoice objects from an (associative) array of data objects\n\t *\n\t * @param data\n\t * @returns {Array}\n\t */\n\tfunction createChoices(data) {\n\t\tvar choices = [];\n\t\tif (typeof( data.map ) === \"function\") {\n\t\t\tchoices = data.map(function (choiceLabel) {\n\t\t\t\treturn new FieldChoice({label: choiceLabel});\n\t\t\t});\n\t\t} else {\n\t\t\tchoices = Object.keys(data).map(function (key) {\n\t\t\t\tvar choiceLabel = data[key];\n\t\t\t\treturn new FieldChoice({label: choiceLabel, value: key});\n\t\t\t});\n\t\t}\n\n\t\treturn choices;\n\t}\n\n\t/**\n\t * Factory method\n\t *\n\t * @api\n\t *\n\t * @param data\n\t * @returns {Field}\n\t */\n\tfunction register(category, data) {\n\n\t\tvar field;\n\t\tvar existingField = getAllWhere('name', data.name).shift();\n\n\t\t// a field with the same \"name\" already exists\n\t\tif(existingField) {\n\n\t\t\t// update \"required\" status\n\t\t\tif( ! existingField.required() && data.required ) {\n\t\t\t\texistingField.required(true);\n\t\t\t}\n\n\t\t\t// bail\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// array of choices given? convert to FieldChoice objects\n\t\tif (data.choices) {\n\t\t\tdata.choices = createChoices(data.choices);\n\n\t\t\tif( data.value) {\n\t\t\t\tdata.choices = data.choices.map(function(choice) {\n\t\t\t\t\tif(choice.value() === data.value) {\n\t\t\t\t\t\tchoice.selected(true);\n\t\t\t\t\t}\n\t\t\t\t\treturn choice;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// register category\n\t\tif( categories.indexOf(category) < 0 ) {\n\t\t\tcategories.push(category);\n\t\t}\n\n\t\t// create Field object\n\t\tfield = new Field(data);\n\t\tfield.category = category;\n\n\t\t// add to array\n\t\tfields.push(field);\n\n\t\t// redraw view\n timeout && window.clearTimeout(timeout);\n timeout = window.setTimeout(m.redraw, 100);\n\n\t\t// trigger event\n\t\tevents.trigger('fields.change');\n\n\t\treturn field;\n\t}\n\n\t/**\n\t * @api\n\t *\n\t * @param field\n\t */\n\tfunction deregister(field) {\n\t\tvar index = fields.indexOf(field);\n\t\tif (index > -1) {\n\t\t\tdelete fields[index];\n\t\t\tm.redraw();\n\t\t}\n\t}\n\n\t/**\n\t * Get a field config object\n\t *\n\t * @param name\n\t * @returns {*}\n\t */\n\tfunction get(name) {\n\t\treturn fields[name];\n\t}\n\n\t/**\n\t * Get all field config objects\n\t *\n\t * @returns {Array|*}\n\t */\n\tfunction getAll() {\n\t\t// rebuild index property on all fields\n\t\tfields = fields.map(function(f, i) {\n\t\t\tf.index = i;\n\t\t\treturn f;\n\t\t});\n\n\t\treturn fields;\n\t}\n\n\tfunction getCategories() {\n\t\treturn categories;\n\t}\n\n\t/**\n\t * Get all fields where a property matches the given value\n\t *\n\t * @param searchKey\n\t * @param searchValue\n\t * @returns {Array|*}\n\t */\n\tfunction getAllWhere(searchKey, searchValue) {\n\t\treturn fields.filter(function (field) {\n\t\t\treturn field[searchKey]() === searchValue;\n\t\t});\n\t}\n\n\n\t/**\n\t * Exposed methods\n\t */\n\treturn {\n\t\t'get' : get,\n\t\t'getAll' : getAll,\n\t\t'getCategories': getCategories,\n\t\t'deregister' : deregister,\n\t\t'register' : register,\n\t\t'getAllWhere': getAllWhere\n\t};\n};\n},{}],7:[function(require,module,exports){\n'use strict';\n\n// load CodeMirror & plugins\nvar CodeMirror = require('codemirror');\nrequire('codemirror/mode/xml/xml');\nrequire('codemirror/mode/javascript/javascript');\nrequire('codemirror/mode/css/css');\nrequire('codemirror/mode/htmlmixed/htmlmixed');\nrequire('codemirror/addon/fold/xml-fold');\nrequire('codemirror/addon/edit/matchtags');\nrequire('codemirror/addon/edit/closetag.js');\n\nvar FormEditor = function(element) {\n\n\t// create dom representation of form\n\tvar _dom = document.createElement('form'),\n\t\tdomDirty = false,\n\t\tr = {},\n\t\teditor;\n\n\t_dom.innerHTML = element.value.toLowerCase();\n\n\tif( CodeMirror ) {\n\t\teditor = CodeMirror.fromTextArea(element, {\n\t\t\tselectionPointer: true,\n\t\t\tmatchTags: { bothTags: true },\n\t\t\tmode: \"htmlmixed\",\n\t\t\thtmlMode: true,\n\t\t\tautoCloseTags: true,\n\t\t\tautoRefresh: true\n\t\t});\n\n\t\t// dispatch regular \"change\" on element event every time editor changes (IE9+ only)\n\t\twindow.dispatchEvent && editor.on('change',function() {\n\t\t\tif(typeof(Event) === \"function\") {\n\t\t\t\t// Create a new 'change' event\n\t\t\t\tvar event = new Event('change', { bubbles: true });\n\t\t\t\telement.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n\n\twindow.addEventListener('load', function() {\n\t\tCodeMirror.signal(editor, \"change\");\n\t});\n\n\t// set domDirty to true everytime the \"change\" event fires (a lot..)\n\telement.addEventListener('change',function() {\n\t\tdomDirty = true;\n\t});\n\n\tfunction dom() {\n\t\tif( domDirty ) {\n\t\t\t_dom.innerHTML = r.getValue().toLowerCase();\n\t\t\tdomDirty = false;\n\t\t}\n\n\t\treturn _dom;\n\t}\n\n\tr.getValue = function() {\n\t\treturn editor ? editor.getValue() : element.value;\n\t};\n\n\tr.query = function(query) {\n\t\treturn dom().querySelectorAll(query);\n\t};\n\n\tr.containsField = function(fieldName){\n\t\treturn dom().elements.namedItem(fieldName.toLowerCase()) !== null;\n\t};\n\n\tr.insert = function( html ) {\n\t\tif( editor ) {\n\t\t\teditor.replaceSelection( html );\n\t\t\teditor.focus();\n\t\t} else {\n\t\t\telement.value += html;\n\t\t}\n\t};\n\n\tr.on = function(event,callback) {\n\t\tif( editor ) {\n\t\t\t// translate \"input\" event for CodeMirror\n\t\t\tevent = ( event === 'input' ) ? 'changes' : event;\n\t\t\treturn editor.on(event,callback);\n\t\t}\n\n\t\treturn element.addEventListener(event,callback);\n\t};\n\n\tr.refresh = function() {\n\t\teditor && editor.refresh();\n\t};\n\n\treturn r;\n};\n\nmodule.exports = FormEditor;\n},{\"codemirror\":17,\"codemirror/addon/edit/closetag.js\":14,\"codemirror/addon/edit/matchtags\":15,\"codemirror/addon/fold/xml-fold\":16,\"codemirror/mode/css/css\":18,\"codemirror/mode/htmlmixed/htmlmixed\":19,\"codemirror/mode/javascript/javascript\":20,\"codemirror/mode/xml/xml\":21}],8:[function(require,module,exports){\nvar FormWatcher = function(m, editor, settings, fields, events, helpers) {\n\t'use strict';\n\n\tvar requiredFieldsInput = document.getElementById('required-fields');\n\n\tfunction updateFields() {\n\t\tfields.getAll().forEach(function(field) {\n\t\t\t// don't run for empty field names\n\t\t\tif(field.name().length <= 0) return;\n\n\t\t\tvar fieldName = field.name();\n\t\t\tif( field.type() === 'checkbox' ) {\n\t\t\t\tfieldName += '[]';\n\t\t\t}\n\n\t\t\tvar inForm = editor.containsField( fieldName );\n\t\t\tfield.inFormContent( inForm );\n\t\t});\n\n\t\tfindRequiredFields();\n\t\tm.redraw();\n\t}\n\n\tfunction findRequiredFields() {\n\n\t\t// query fields required by MailChimp\n\t\tvar requiredFields = fields.getAllWhere('forceRequired', true).map(function(f) { return f.name().toUpperCase(); });\n\n\t\t// query fields in form with [required] attribute\n\t\tvar requiredFieldElements = editor.query('[required]');\n\t\tArray.prototype.forEach.call(requiredFieldElements, function(el) {\n\t\t\tvar name = el.name.toUpperCase();\n\n\t\t\t// bail if name attr starts with underscore\n\t\t\tif( name[0] === '_' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// replace array brackets with dot style notation\n\t\t\tname = name.replace(/\\[(\\w+)\\]/g, '.$1' );\n\n\t\t\t// only add field if it's not already in it\n\t\t\tif( requiredFields.indexOf(name) === -1 ) {\n\t\t\t\trequiredFields.push(name);\n\t\t\t}\n\t\t});\n\n\t\t// update meta\n\t\trequiredFieldsInput.value = requiredFields.join(',');\n\t}\n\n\t// events\n\teditor.on('change', helpers.debounce(updateFields, 500));\n\tevents.on('fields.change', helpers.debounce(updateFields, 500));\n\n};\n\nmodule.exports = FormWatcher;\n},{}],9:[function(require,module,exports){\n'use strict';\n\nvar notices = {};\n\nfunction show(id, text) {\n notices[id] = text;\n render();\n}\n\nfunction hide(id) {\n delete notices[id];\n render();\n}\n\nfunction render() {\n var html = '';\n for(var key in notices) {\n html += '<div class=\"notice notice-warning inline\"><p>' + notices[key] + '</p></div>';\n }\n\n var container = document.querySelector('.mc4wp-notices');\n if( ! container ) {\n container = document.createElement('div');\n container.className = 'mc4wp-notices';\n var heading = document.querySelector('h1, h2');\n heading.parentNode.insertBefore(container, heading.nextSibling);\n }\n \n container.innerHTML = html;\n}\n\nfunction init( editor, fields ) {\n\n var groupingsNotice = function() {\n var text = \"Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly.\";\n var formCode = editor.getValue().toLowerCase();\n ( formCode.indexOf('name=\"groupings') > -1 ) ? show('deprecated_groupings', text) : hide('deprecated_groupings');\n };\n\n var requiredFieldsNotice = function() {\n var requiredFields = fields.getAllWhere('forceRequired', true);\n var missingFields = requiredFields.filter(function(f) {\n return ! editor.containsField(f.name().toUpperCase());\n });\n\n var text = '<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.';\n text += \"<br /><ul class=\\\"ul-square\\\" style=\\\"margin-bottom: 0;\\\"><li>\" + missingFields.map(function(f) { return f.title(); }).join('</li><li>') + '</li></ul>';\n\n ( missingFields.length > 0 ) ? show('required_fields_missing', text) : hide('required_fields_missing');\n };\n\n // old groupings\n groupingsNotice();\n editor.on('focus', groupingsNotice);\n editor.on('blur', groupingsNotice);\n\n // missing required fields\n requiredFieldsNotice();\n editor.on('blur', requiredFieldsNotice);\n editor.on('focus', requiredFieldsNotice);\n}\n\n\n\nmodule.exports = {\n \"init\": init\n};\n},{}],10:[function(require,module,exports){\nvar overlay = function(m, i18n) {\n\t'use strict';\n\n\tvar _element,\n\t\t_onCloseCallback;\n\n\tfunction close() {\n\t\tdocument.removeEventListener('keydown', onKeyDown);\n\t\twindow.removeEventListener('resize', position);\n\t\t_onCloseCallback();\n\t}\n\n\tfunction onKeyDown(e) {\n\t\te = e || window.event;\n\n\t\t// close overlay when pressing ESC\n\t\tif(e.keyCode == 27) {\n\t\t\tclose();\n\t\t}\n\n\t\t// prevent ENTER\n\t\tif(e.keyCode == 13 ) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tfunction position() {\n\t\tif( ! _element ) return;\n\n\t\t// fix for window width in IE8\n\t\tvar windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\t\tvar windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n\n\t\tvar marginLeft = ( windowWidth - _element.clientWidth - 40 ) / 2;\n\t\tvar marginTop = ( windowHeight - _element.clientHeight - 40 ) / 2;\n\n\t\t_element.style.left = ( marginLeft > 0 ? marginLeft : 0 ) + \"px\";\n\t\t_element.style.top = ( marginTop > 0 ? marginTop : 0 ) + \"px\";\n\t}\n\n\treturn function (content, onCloseCallback) {\n\t\t_onCloseCallback = onCloseCallback;\n\n\t\tdocument.addEventListener('keydown', onKeyDown);\n\t\twindow.addEventListener('resize', position);\n\n\t\treturn [\n\t\t\tm('div.overlay-wrap',\n\t\t\t\tm(\"div.overlay\", {\n\t\t\t\t\tconfig: function (el) {\n\t\t\t\t\t\t_element = el;\n\t\t\t\t\t\tposition();\n\t\t\t\t\t}\n\t\t\t\t},[\n\n\t\t\t\t\t// close icon\n\t\t\t\t\tm('span', {\n\t\t\t\t\t\t\"class\": 'close dashicons dashicons-no',\n\t\t\t\t\t\ttitle : i18n.close,\n\t\t\t\t\t\tonclick: close\n\t\t\t\t\t}),\n\n\t\t\t\t\tcontent\n\t\t\t\t])\n\t\t\t)\n\t\t\t,\n\t\t\tm('div.overlay-background', {\n\t\t\t\ttitle: i18n.close,\n\t\t\t\tonclick: close\n\t\t\t})\n\t\t];\n\t};\n};\n\nmodule.exports = overlay;\n},{}],11:[function(require,module,exports){\n'use strict';\n\n// deps\nvar i18n = window.mc4wp_forms_i18n;\nvar m = window.mc4wp.deps.mithril;\nvar events = mc4wp.events;\nvar settings = mc4wp.settings;\nvar helpers = mc4wp.helpers;\n\nvar tabs = mc4wp.tabs;\nvar FormWatcher = require('./admin/form-watcher.js');\nvar FormEditor = require('./admin/form-editor.js');\nvar FieldHelper = require('./admin/field-helper.js');\nvar FieldsFactory = require('./admin/fields-factory.js');\nvar fields = require('./admin/fields.js')(m, events);\n\n// vars\nvar textareaElement = document.getElementById('mc4wp-form-content');\nvar editor = window.formEditor = new FormEditor( textareaElement );\nvar watcher = new FormWatcher( m, formEditor, settings, fields, events, helpers );\nvar fieldHelper = new FieldHelper( m, tabs, formEditor, fields, events, i18n );\nvar notices = require('./admin/notices');\n\n// mount field helper on element\nm.mount( document.getElementById( 'mc4wp-field-wizard'), fieldHelper );\n\n// register fields and redraw screen in 2 seconds (fixes IE8 bug)\nvar fieldsFactory = new FieldsFactory(fields, i18n);\nevents.on('selectedLists.change', fieldsFactory.registerListsFields);\nfieldsFactory.registerListsFields(settings.getSelectedLists());\nfieldsFactory.registerCustomFields(mc4wp_vars.mailchimp.lists);\n\nwindow.setTimeout( function() { m.redraw();}, 2000 );\n\n// init notices\nnotices.init(editor, fields);\n\n// expose some methods\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.forms = window.mc4wp.forms || {};\nwindow.mc4wp.forms.editor = editor;\nwindow.mc4wp.forms.fields = fields;\n\n},{\"./admin/field-helper.js\":4,\"./admin/fields-factory.js\":5,\"./admin/fields.js\":6,\"./admin/form-editor.js\":7,\"./admin/form-watcher.js\":8,\"./admin/notices\":9}],12:[function(require,module,exports){\n/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2013 Einar Lielmanis and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n\n Style HTML\n---------------\n\n Written by Nochum Sossonko, (nsossonko@hotmail.com)\n\n Based on code initially developed by: Einar Lielmanis, <elfz@laacz.lv>\n http://jsbeautifier.org/\n\n Usage:\n style_html(html_source);\n\n style_html(html_source, options);\n\n The options are:\n indent_inner_html (default false) — indent <head> and <body> sections,\n indent_size (default 4) — indentation size,\n indent_char (default space) — character to indent with,\n wrap_line_length (default 250) - maximum amount of characters per line (0 = disable)\n brace_style (default \"collapse\") - \"collapse\" | \"expand\" | \"end-expand\"\n put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.\n unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted\n indent_scripts (default normal) - \"keep\"|\"separate\"|\"normal\"\n preserve_newlines (default true) - whether existing line breaks before elements should be preserved\n Only works before elements, not inside tags or for text.\n max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk\n indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}}\n\n e.g.\n\n style_html(html_source, {\n 'indent_inner_html': false,\n 'indent_size': 2,\n 'indent_char': ' ',\n 'wrap_line_length': 78,\n 'brace_style': 'expand',\n 'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u'],\n 'preserve_newlines': true,\n 'max_preserve_newlines': 5,\n 'indent_handlebars': false\n });\n*/\n\n(function() {\n\n function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n }\n\n function ltrim(s) {\n return s.replace(/^\\s+/g, '');\n }\n\n function style_html(html_source, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n\n var multi_parser,\n indent_inner_html,\n indent_size,\n indent_character,\n wrap_line_length,\n brace_style,\n unformatted,\n preserve_newlines,\n max_preserve_newlines;\n\n options = options || {};\n\n // backwards compatibility to 1.3.4\n if ((options.wrap_line_length === undefined || parseInt(options.wrap_line_length, 10) === 0) &&\n (options.max_char === undefined || parseInt(options.max_char, 10) === 0)) {\n options.wrap_line_length = options.max_char;\n }\n\n indent_inner_html = options.indent_inner_html || false;\n indent_size = parseInt(options.indent_size || 4, 10);\n indent_character = options.indent_char || ' ';\n brace_style = options.brace_style || 'collapse';\n wrap_line_length = parseInt(options.wrap_line_length, 10) === 0 ? 32786 : parseInt(options.wrap_line_length || 250, 10);\n unformatted = options.unformatted || ['a', 'span', 'bdo', 'em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'q', 'sub', 'sup', 'tt', 'i', 'b', 'big', 'small', 'u', 's', 'strike', 'font', 'ins', 'del', 'pre', 'address', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n preserve_newlines = options.preserve_newlines || true;\n max_preserve_newlines = preserve_newlines ? parseInt(options.max_preserve_newlines || 32786, 10) : 0;\n indent_handlebars = options.indent_handlebars || false;\n\n function Parser() {\n\n this.pos = 0; //Parser position\n this.token = '';\n this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT\n this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values\n parent: 'parent1',\n parentcount: 1,\n parent1: ''\n };\n this.tag_type = '';\n this.token_text = this.last_token = this.last_text = this.token_type = '';\n this.newlines = 0;\n this.indent_content = indent_inner_html;\n\n this.Utils = { //Uilities made available to the various functions\n whitespace: \"\\n\\r\\t \".split(''),\n single_token: 'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?='.split(','), //all the single tags for HTML\n extra_liners: 'head,body,/html'.split(','), //for tags that need a line of whitespace before them\n in_array: function(what, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (what === arr[i]) {\n return true;\n }\n }\n return false;\n }\n };\n\n this.traverse_whitespace = function() {\n var input_char = '';\n\n input_char = this.input.charAt(this.pos);\n if (this.Utils.in_array(input_char, this.Utils.whitespace)) {\n this.newlines = 0;\n while (this.Utils.in_array(input_char, this.Utils.whitespace)) {\n if (preserve_newlines && input_char === '\\n' && this.newlines <= max_preserve_newlines) {\n this.newlines += 1;\n }\n\n this.pos++;\n input_char = this.input.charAt(this.pos);\n }\n return true;\n }\n return false;\n };\n\n this.get_content = function() { //function to capture regular content between tags\n\n var input_char = '',\n content = [],\n space = false; //if a space is needed\n\n while (this.input.charAt(this.pos) !== '<') {\n if (this.pos >= this.input.length) {\n return content.length ? content.join('') : ['', 'TK_EOF'];\n }\n\n if (this.traverse_whitespace()) {\n if (content.length) {\n space = true;\n }\n continue; //don't want to insert unnecessary space\n }\n\n if (indent_handlebars) {\n // Handlebars parsing is complicated.\n // {{#foo}} and {{/foo}} are formatted tags.\n // {{something}} should get treated as content, except:\n // {{else}} specifically behaves like {{#if}} and {{/if}}\n var peek3 = this.input.substr(this.pos, 3);\n if (peek3 === '{{#' || peek3 === '{{/') {\n // These are tags and not content.\n break;\n } else if (this.input.substr(this.pos, 2) === '{{') {\n if (this.get_tag(true) === '{{else}}') {\n break;\n }\n }\n }\n\n input_char = this.input.charAt(this.pos);\n this.pos++;\n\n if (space) {\n if (this.line_char_count >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached\n this.print_newline(false, content);\n this.print_indentation(content);\n } else {\n this.line_char_count++;\n content.push(' ');\n }\n space = false;\n }\n this.line_char_count++;\n content.push(input_char); //letter at-a-time (or string) inserted to an array\n }\n return content.length ? content.join('') : '';\n };\n\n this.get_contents_to = function(name) { //get the full content of a script or style to pass to js_beautify\n if (this.pos === this.input.length) {\n return ['', 'TK_EOF'];\n }\n var input_char = '';\n var content = '';\n var reg_match = new RegExp('</' + name + '\\\\s*>', 'igm');\n reg_match.lastIndex = this.pos;\n var reg_array = reg_match.exec(this.input);\n var end_script = reg_array ? reg_array.index : this.input.length; //absolute end of script\n if (this.pos < end_script) { //get everything in between the script tags\n content = this.input.substring(this.pos, end_script);\n this.pos = end_script;\n }\n return content;\n };\n\n this.record_tag = function(tag) { //function to record a tag and its parent in this.tags Object\n if (this.tags[tag + 'count']) { //check for the existence of this tag type\n this.tags[tag + 'count']++;\n this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level\n } else { //otherwise initialize this tag type\n this.tags[tag + 'count'] = 1;\n this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level\n }\n this.tags[tag + this.tags[tag + 'count'] + 'parent'] = this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent)\n this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1')\n };\n\n this.retrieve_tag = function(tag) { //function to retrieve the opening tag to the corresponding closer\n if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it\n var temp_parent = this.tags.parent; //check to see if it's a closable tag.\n while (temp_parent) { //till we reach '' (the initial value);\n if (tag + this.tags[tag + 'count'] === temp_parent) { //if this is it use it\n break;\n }\n temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree\n }\n if (temp_parent) { //if we caught something\n this.indent_level = this.tags[tag + this.tags[tag + 'count']]; //set the indent_level accordingly\n this.tags.parent = this.tags[temp_parent + 'parent']; //and set the current parent\n }\n delete this.tags[tag + this.tags[tag + 'count'] + 'parent']; //delete the closed tags parent reference...\n delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself\n if (this.tags[tag + 'count'] === 1) {\n delete this.tags[tag + 'count'];\n } else {\n this.tags[tag + 'count']--;\n }\n }\n };\n\n this.indent_to_tag = function(tag) {\n // Match the indentation level to the last use of this tag, but don't remove it.\n if (!this.tags[tag + 'count']) {\n return;\n }\n var temp_parent = this.tags.parent;\n while (temp_parent) {\n if (tag + this.tags[tag + 'count'] === temp_parent) {\n break;\n }\n temp_parent = this.tags[temp_parent + 'parent'];\n }\n if (temp_parent) {\n this.indent_level = this.tags[tag + this.tags[tag + 'count']];\n }\n };\n\n this.get_tag = function(peek) { //function to get a full tag and parse its type\n var input_char = '',\n content = [],\n comment = '',\n space = false,\n tag_start, tag_end,\n tag_start_char,\n orig_pos = this.pos,\n orig_line_char_count = this.line_char_count;\n\n peek = peek !== undefined ? peek : false;\n\n do {\n if (this.pos >= this.input.length) {\n if (peek) {\n this.pos = orig_pos;\n this.line_char_count = orig_line_char_count;\n }\n return content.length ? content.join('') : ['', 'TK_EOF'];\n }\n\n input_char = this.input.charAt(this.pos);\n this.pos++;\n\n if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space\n space = true;\n continue;\n }\n\n if (input_char === \"'\" || input_char === '\"') {\n input_char += this.get_unformatted(input_char);\n space = true;\n\n }\n\n if (input_char === '=') { //no space before =\n space = false;\n }\n\n if (content.length && content[content.length - 1] !== '=' && input_char !== '>' && space) {\n //no space after = or before >\n if (this.line_char_count >= this.wrap_line_length) {\n this.print_newline(false, content);\n this.print_indentation(content);\n } else {\n content.push(' ');\n this.line_char_count++;\n }\n space = false;\n }\n\n if (indent_handlebars && tag_start_char === '<') {\n // When inside an angle-bracket tag, put spaces around\n // handlebars not inside of strings.\n if ((input_char + this.input.charAt(this.pos)) === '{{') {\n input_char += this.get_unformatted('}}');\n if (content.length && content[content.length - 1] !== ' ' && content[content.length - 1] !== '<') {\n input_char = ' ' + input_char;\n }\n space = true;\n }\n }\n\n if (input_char === '<' && !tag_start_char) {\n tag_start = this.pos - 1;\n tag_start_char = '<';\n }\n\n if (indent_handlebars && !tag_start_char) {\n if (content.length >= 2 && content[content.length - 1] === '{' && content[content.length - 2] == '{') {\n if (input_char === '#' || input_char === '/') {\n tag_start = this.pos - 3;\n } else {\n tag_start = this.pos - 2;\n }\n tag_start_char = '{';\n }\n }\n\n this.line_char_count++;\n content.push(input_char); //inserts character at-a-time (or string)\n\n if (content[1] && content[1] === '!') { //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n content = [this.get_comment(tag_start)];\n break;\n }\n\n if (indent_handlebars && tag_start_char === '{' && content.length > 2 && content[content.length - 2] === '}' && content[content.length - 1] === '}') {\n break;\n }\n } while (input_char !== '>');\n\n var tag_complete = content.join('');\n var tag_index;\n var tag_offset;\n\n if (tag_complete.indexOf(' ') !== -1) { //if there's whitespace, thats where the tag name ends\n tag_index = tag_complete.indexOf(' ');\n } else if (tag_complete[0] === '{') {\n tag_index = tag_complete.indexOf('}');\n } else { //otherwise go with the tag ending\n tag_index = tag_complete.indexOf('>');\n }\n if (tag_complete[0] === '<' || !indent_handlebars) {\n tag_offset = 1;\n } else {\n tag_offset = tag_complete[2] === '#' ? 3 : 2;\n }\n var tag_check = tag_complete.substring(tag_offset, tag_index).toLowerCase();\n if (tag_complete.charAt(tag_complete.length - 2) === '/' ||\n this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /)\n if (!peek) {\n this.tag_type = 'SINGLE';\n }\n } else if (indent_handlebars && tag_complete[0] === '{' && tag_check === 'else') {\n if (!peek) {\n this.indent_to_tag('if');\n this.tag_type = 'HANDLEBARS_ELSE';\n this.indent_content = true;\n this.traverse_whitespace();\n }\n } else if (tag_check === 'script') { //for later script handling\n if (!peek) {\n this.record_tag(tag_check);\n this.tag_type = 'SCRIPT';\n }\n } else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content)\n if (!peek) {\n this.record_tag(tag_check);\n this.tag_type = 'STYLE';\n }\n } else if (this.is_unformatted(tag_check, unformatted)) { // do not reformat the \"unformatted\" tags\n comment = this.get_unformatted('</' + tag_check + '>', tag_complete); //...delegate to get_unformatted function\n content.push(comment);\n // Preserve collapsed whitespace either before or after this tag.\n if (tag_start > 0 && this.Utils.in_array(this.input.charAt(tag_start - 1), this.Utils.whitespace)) {\n content.splice(0, 0, this.input.charAt(tag_start - 1));\n }\n tag_end = this.pos - 1;\n if (this.Utils.in_array(this.input.charAt(tag_end + 1), this.Utils.whitespace)) {\n content.push(this.input.charAt(tag_end + 1));\n }\n this.tag_type = 'SINGLE';\n } else if (tag_check.charAt(0) === '!') { //peek for <! comment\n // for comments content is already correct.\n if (!peek) {\n this.tag_type = 'SINGLE';\n this.traverse_whitespace();\n }\n } else if (!peek) {\n if (tag_check.charAt(0) === '/') { //this tag is a double tag so check for tag-ending\n this.retrieve_tag(tag_check.substring(1)); //remove it and all ancestors\n this.tag_type = 'END';\n this.traverse_whitespace();\n } else { //otherwise it's a start-tag\n this.record_tag(tag_check); //push it on the tag stack\n if (tag_check.toLowerCase() !== 'html') {\n this.indent_content = true;\n }\n this.tag_type = 'START';\n\n // Allow preserving of newlines after a start tag\n this.traverse_whitespace();\n }\n if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line\n this.print_newline(false, this.output);\n if (this.output.length && this.output[this.output.length - 2] !== '\\n') {\n this.print_newline(true, this.output);\n }\n }\n }\n\n if (peek) {\n this.pos = orig_pos;\n this.line_char_count = orig_line_char_count;\n }\n\n return content.join(''); //returns fully formatted tag\n };\n\n this.get_comment = function(start_pos) { //function to return comment content in its entirety\n // this is will have very poor perf, but will work for now.\n var comment = '',\n delimiter = '>',\n matched = false;\n\n this.pos = start_pos;\n input_char = this.input.charAt(this.pos);\n this.pos++;\n\n while (this.pos <= this.input.length) {\n comment += input_char;\n\n // only need to check for the delimiter if the last chars match\n if (comment[comment.length - 1] === delimiter[delimiter.length - 1] &&\n comment.indexOf(delimiter) !== -1) {\n break;\n }\n\n // only need to search for custom delimiter for the first few characters\n if (!matched && comment.length < 10) {\n if (comment.indexOf('<![if') === 0) { //peek for <![if conditional comment\n delimiter = '<![endif]>';\n matched = true;\n } else if (comment.indexOf('<![cdata[') === 0) { //if it's a <[cdata[ comment...\n delimiter = ']]>';\n matched = true;\n } else if (comment.indexOf('<![') === 0) { // some other ![ comment? ...\n delimiter = ']>';\n matched = true;\n } else if (comment.indexOf('<!--') === 0) { // <!-- comment ...\n delimiter = '-->';\n matched = true;\n }\n }\n\n input_char = this.input.charAt(this.pos);\n this.pos++;\n }\n\n return comment;\n };\n\n this.get_unformatted = function(delimiter, orig_tag) { //function to return unformatted content in its entirety\n\n if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) {\n return '';\n }\n var input_char = '';\n var content = '';\n var min_index = 0;\n var space = true;\n do {\n\n if (this.pos >= this.input.length) {\n return content;\n }\n\n input_char = this.input.charAt(this.pos);\n this.pos++;\n\n if (this.Utils.in_array(input_char, this.Utils.whitespace)) {\n if (!space) {\n this.line_char_count--;\n continue;\n }\n if (input_char === '\\n' || input_char === '\\r') {\n content += '\\n';\n /* Don't change tab indention for unformatted blocks. If using code for html editing, this will greatly affect <pre> tags if they are specified in the 'unformatted array'\n for (var i=0; i<this.indent_level; i++) {\n content += this.indent_string;\n }\n space = false; //...and make sure other indentation is erased\n */\n this.line_char_count = 0;\n continue;\n }\n }\n content += input_char;\n this.line_char_count++;\n space = true;\n\n if (indent_handlebars && input_char === '{' && content.length && content[content.length - 2] === '{') {\n // Handlebars expressions in strings should also be unformatted.\n content += this.get_unformatted('}}');\n // These expressions are opaque. Ignore delimiters found in them.\n min_index = content.length;\n }\n } while (content.toLowerCase().indexOf(delimiter, min_index) === -1);\n return content;\n };\n\n this.get_token = function() { //initial handler for token-retrieval\n var token;\n\n if (this.last_token === 'TK_TAG_SCRIPT' || this.last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n var type = this.last_token.substr(7);\n token = this.get_contents_to(type);\n if (typeof token !== 'string') {\n return token;\n }\n return [token, 'TK_' + type];\n }\n if (this.current_mode === 'CONTENT') {\n token = this.get_content();\n if (typeof token !== 'string') {\n return token;\n } else {\n return [token, 'TK_CONTENT'];\n }\n }\n\n if (this.current_mode === 'TAG') {\n token = this.get_tag();\n if (typeof token !== 'string') {\n return token;\n } else {\n var tag_name_type = 'TK_TAG_' + this.tag_type;\n return [token, tag_name_type];\n }\n }\n };\n\n this.get_full_indent = function(level) {\n level = this.indent_level + level || 0;\n if (level < 1) {\n return '';\n }\n\n return Array(level + 1).join(this.indent_string);\n };\n\n this.is_unformatted = function(tag_check, unformatted) {\n //is this an HTML5 block-level link?\n if (!this.Utils.in_array(tag_check, unformatted)) {\n return false;\n }\n\n if (tag_check.toLowerCase() !== 'a' || !this.Utils.in_array('a', unformatted)) {\n return true;\n }\n\n //at this point we have an tag; is its first child something we want to remain\n //unformatted?\n var next_tag = this.get_tag(true /* peek. */ );\n\n // test next_tag to see if it is just html tag (no external content)\n var tag = (next_tag || \"\").match(/^\\s*<\\s*\\/?([a-z]*)\\s*[^>]*>\\s*$/);\n\n // if next_tag comes back but is not an isolated tag, then\n // let's treat the 'a' tag as having content\n // and respect the unformatted option\n if (!tag || this.Utils.in_array(tag, unformatted)) {\n return true;\n } else {\n return false;\n }\n };\n\n this.printer = function(js_source, indent_character, indent_size, wrap_line_length, brace_style) { //handles input/output and some other printing functions\n\n this.input = js_source || ''; //gets the input for the Parser\n this.output = [];\n this.indent_character = indent_character;\n this.indent_string = '';\n this.indent_size = indent_size;\n this.brace_style = brace_style;\n this.indent_level = 0;\n this.wrap_line_length = wrap_line_length;\n this.line_char_count = 0; //count to see if wrap_line_length was exceeded\n\n for (var i = 0; i < this.indent_size; i++) {\n this.indent_string += this.indent_character;\n }\n\n this.print_newline = function(force, arr) {\n this.line_char_count = 0;\n if (!arr || !arr.length) {\n return;\n }\n if (force || (arr[arr.length - 1] !== '\\n')) { //we might want the extra line\n arr.push('\\n');\n }\n };\n\n this.print_indentation = function(arr) {\n for (var i = 0; i < this.indent_level; i++) {\n arr.push(this.indent_string);\n this.line_char_count += this.indent_string.length;\n }\n };\n\n this.print_token = function(text) {\n if (text || text !== '') {\n if (this.output.length && this.output[this.output.length - 1] === '\\n') {\n this.print_indentation(this.output);\n text = ltrim(text);\n }\n }\n this.print_token_raw(text);\n };\n\n this.print_token_raw = function(text) {\n if (text && text !== '') {\n if (text.length > 1 && text[text.length - 1] === '\\n') {\n // unformatted tags can grab newlines as their last character\n this.output.push(text.slice(0, -1));\n this.print_newline(false, this.output);\n } else {\n this.output.push(text);\n }\n }\n\n for (var n = 0; n < this.newlines; n++) {\n this.print_newline(n > 0, this.output);\n }\n this.newlines = 0;\n };\n\n this.indent = function() {\n this.indent_level++;\n };\n\n this.unindent = function() {\n if (this.indent_level > 0) {\n this.indent_level--;\n }\n };\n };\n return this;\n }\n\n /*_____________________--------------------_____________________*/\n\n multi_parser = new Parser(); //wrapping functions Parser\n multi_parser.printer(html_source, indent_character, indent_size, wrap_line_length, brace_style); //initialize starting values\n\n while (true) {\n var t = multi_parser.get_token();\n multi_parser.token_text = t[0];\n multi_parser.token_type = t[1];\n\n if (multi_parser.token_type === 'TK_EOF') {\n break;\n }\n\n switch (multi_parser.token_type) {\n case 'TK_TAG_START':\n multi_parser.print_newline(false, multi_parser.output);\n multi_parser.print_token(multi_parser.token_text);\n if (multi_parser.indent_content) {\n multi_parser.indent();\n multi_parser.indent_content = false;\n }\n multi_parser.current_mode = 'CONTENT';\n break;\n case 'TK_TAG_STYLE':\n case 'TK_TAG_SCRIPT':\n multi_parser.print_newline(false, multi_parser.output);\n multi_parser.print_token(multi_parser.token_text);\n multi_parser.current_mode = 'CONTENT';\n break;\n case 'TK_TAG_END':\n //Print new line only if the tag has no content and has child\n if (multi_parser.last_token === 'TK_CONTENT' && multi_parser.last_text === '') {\n var tag_name = multi_parser.token_text.match(/\\w+/)[0];\n var tag_extracted_from_last_output = null;\n if (multi_parser.output.length) {\n tag_extracted_from_last_output = multi_parser.output[multi_parser.output.length - 1].match(/(?:<|{{#)\\s*(\\w+)/);\n }\n if (tag_extracted_from_last_output === null ||\n tag_extracted_from_last_output[1] !== tag_name) {\n multi_parser.print_newline(false, multi_parser.output);\n }\n }\n multi_parser.print_token(multi_parser.token_text);\n multi_parser.current_mode = 'CONTENT';\n break;\n case 'TK_TAG_SINGLE':\n // Don't add a newline before elements that should remain unformatted.\n var tag_check = multi_parser.token_text.match(/^\\s*<([a-z]+)/i);\n if (!tag_check || !multi_parser.Utils.in_array(tag_check[1], unformatted)) {\n multi_parser.print_newline(false, multi_parser.output);\n }\n multi_parser.print_token(multi_parser.token_text);\n multi_parser.current_mode = 'CONTENT';\n break;\n case 'TK_TAG_HANDLEBARS_ELSE':\n multi_parser.print_token(multi_parser.token_text);\n if (multi_parser.indent_content) {\n multi_parser.indent();\n multi_parser.indent_content = false;\n }\n multi_parser.current_mode = 'CONTENT';\n break;\n case 'TK_CONTENT':\n multi_parser.print_token(multi_parser.token_text);\n multi_parser.current_mode = 'TAG';\n break;\n case 'TK_STYLE':\n case 'TK_SCRIPT':\n if (multi_parser.token_text !== '') {\n multi_parser.print_newline(false, multi_parser.output);\n var text = multi_parser.token_text,\n _beautifier,\n script_indent_level = 1;\n if (multi_parser.token_type === 'TK_SCRIPT') {\n _beautifier = typeof js_beautify === 'function' && js_beautify;\n } else if (multi_parser.token_type === 'TK_STYLE') {\n _beautifier = typeof css_beautify === 'function' && css_beautify;\n }\n\n if (options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (options.indent_scripts === \"separate\") {\n script_indent_level = -multi_parser.indent_level;\n }\n\n var indentation = multi_parser.get_full_indent(script_indent_level);\n if (_beautifier) {\n // call the Beautifier if avaliable\n text = _beautifier(text.replace(/^\\s*/, indentation), options);\n } else {\n // simply indent the string otherwise\n var white = text.match(/^\\s*/)[0];\n var _level = white.match(/[^\\n\\r]*$/)[0].split(multi_parser.indent_string).length - 1;\n var reindent = multi_parser.get_full_indent(script_indent_level - _level);\n text = text.replace(/^\\s*/, indentation)\n .replace(/\\r\\n|\\r|\\n/g, '\\n' + reindent)\n .replace(/\\s+$/, '');\n }\n if (text) {\n multi_parser.print_token_raw(indentation + trim(text));\n multi_parser.print_newline(false, multi_parser.output);\n }\n }\n multi_parser.current_mode = 'TAG';\n break;\n }\n multi_parser.last_token = multi_parser.token_type;\n multi_parser.last_text = multi_parser.token_text;\n }\n return multi_parser.output.join('');\n }\n\n if (typeof module !== \"undefined\" && typeof( module.exports ) !== \"undefined\" ) {\n\t\tmodule.exports = style_html;\n } else if (typeof window !== \"undefined\") {\n\t\t// If we're running a web page and don't have either of the above, add our one global\n\t\twindow.html_beautify = style_html;\n\t}\n\n}());\n},{}],13:[function(require,module,exports){\n'use strict';\n\nvar VOID_TAGS = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr',\n\t'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track',\n\t'wbr', '!doctype'];\n\nfunction isArray(thing) {\n\treturn Object.prototype.toString.call(thing) === '[object Array]';\n}\n\nfunction camelToDash(str) {\n\treturn str.replace(/\\W+/g, '-')\n\t\t.replace(/([a-z\\d])([A-Z])/g, '$1-$2');\n}\n\nfunction removeEmpties(n) {\n\treturn n != '';\n}\n\n// shameless stolen from https://github.com/punkave/sanitize-html\nfunction escapeHtml(s, replaceDoubleQuote) {\n\tif (s === 'undefined') {\n\t\ts = '';\n\t}\n\tif (typeof(s) !== 'string') {\n\t\ts = s + '';\n\t}\n\ts = s.replace(/\\&/g, '&amp;').replace(/</g, '&lt;').replace(/\\>/g, '&gt;');\n\tif (replaceDoubleQuote) {\n\t\treturn s.replace(/\\\"/g, '&quot;');\n\t}\n\treturn s;\n}\n\nfunction createAttrString(attrs) {\n\tif (!attrs || !Object.keys(attrs).length) {\n\t\treturn '';\n\t}\n\n\treturn Object.keys(attrs).map(function(name) {\n\t\tvar value = attrs[name];\n\t\tif (typeof value === 'undefined' || value === null || typeof value === 'function') {\n\t\t\treturn;\n\t\t}\n\t\tif (typeof value === 'boolean') {\n\t\t\treturn value ? ' ' + name : '';\n\t\t}\n\t\tif (name === 'style') {\n\t\t\tif (!value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar styles = attrs.style;\n\t\t\tif (typeof styles === 'object') {\n\t\t\t\tstyles = Object.keys(styles).map(function(property) {\n\t\t\t\t\treturn styles[property] != '' ? [camelToDash(property).toLowerCase(), styles[property]].join(':') : '';\n\t\t\t\t}).filter(removeEmpties).join(';');\n\t\t\t}\n\t\t\treturn styles != '' ? ' style=\"' + escapeHtml(styles, true) + '\"' : '';\n\t\t}\n\t\treturn ' ' + escapeHtml(name === 'className' ? 'class' : name) + '=\"' + escapeHtml(value, true) + '\"';\n\t}).join('');\n}\n\nfunction createChildrenContent(view) {\n\tif(isArray(view.children) && !view.children.length) {\n\t\treturn '';\n\t}\n\n\treturn render(view.children);\n}\n\nfunction render(view) {\n\tvar type = typeof view;\n\n\tif (type === 'string') {\n\t\treturn escapeHtml(view);\n\t}\n\n\tif(type === 'number' || type === 'boolean') {\n\t\treturn view;\n\t}\n\n\tif (!view) {\n\t\treturn '';\n\t}\n\n\tif (isArray(view)) {\n\t\treturn view.map(render).join('');\n\t}\n\n\t//compontent\n\tif (view.view) {\n\t\tvar scope = view.controller ? new view.controller : {};\n\t\tvar result = render(view.view(scope));\n\t\tif (scope.onunload) {\n\t\t\tscope.onunload();\n\t\t}\n\t\treturn result;\n\t}\n\n\tif (view.$trusted) {\n\t\treturn '' + view;\n\t}\n\tvar children = createChildrenContent(view);\n\tif (!children && VOID_TAGS.indexOf(view.tag.toLowerCase()) >= 0) {\n\t\treturn '<' + view.tag + createAttrString(view.attrs) + '>';\n\t}\n\treturn [\n\t\t'<', view.tag, createAttrString(view.attrs), '>',\n\t\tchildren,\n\t\t'</', view.tag, '>',\n\t].join('');\n}\n\nmodule.exports = render;\n},{}],14:[function(require,module,exports){\n// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n/**\n * Tag-closer extension for CodeMirror.\n *\n * This extension adds an \"autoCloseTags\" option that can be set to\n * either true to get the default behavior, or an object to further\n * configure its behavior.\n *\n * These are supported options:\n *\n * `whenClosing` (default true)\n * Whether to autoclose when the '/' of a closing tag is typed.\n * `whenOpening` (default true)\n * Whether to autoclose the tag when the final '>' of an opening\n * tag is typed.\n * `dontCloseTags` (default is empty tags for HTML, none for XML)\n * An array of tag names that should not be autoclosed.\n * `indentTags` (default is block tags for HTML, none for XML)\n * An array of tag names that should, when opened, cause a\n * blank line to be added inside the tag, and the blank line and\n * closing line to be indented.\n *\n * See demos/closetag.html for a usage example.\n */\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../fold/xml-fold\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../fold/xml-fold\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"autoCloseTags\", false, function(cm, val, old) {\n if (old != CodeMirror.Init && old)\n cm.removeKeyMap(\"autoCloseTags\");\n if (!val) return;\n var map = {name: \"autoCloseTags\"};\n if (typeof val != \"object\" || val.whenClosing)\n map[\"'/'\"] = function(cm) { return autoCloseSlash(cm); };\n if (typeof val != \"object\" || val.whenOpening)\n map[\"'>'\"] = function(cm) { return autoCloseGT(cm); };\n cm.addKeyMap(map);\n });\n\n var htmlDontClose = [\"area\", \"base\", \"br\", \"col\", \"command\", \"embed\", \"hr\", \"img\", \"input\", \"keygen\", \"link\", \"meta\", \"param\",\n \"source\", \"track\", \"wbr\"];\n var htmlIndent = [\"applet\", \"blockquote\", \"body\", \"button\", \"div\", \"dl\", \"fieldset\", \"form\", \"frameset\", \"h1\", \"h2\", \"h3\", \"h4\",\n \"h5\", \"h6\", \"head\", \"html\", \"iframe\", \"layer\", \"legend\", \"object\", \"ol\", \"p\", \"select\", \"table\", \"ul\"];\n\n function autoCloseGT(cm) {\n if (cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n var ranges = cm.listSelections(), replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var pos = ranges[i].head, tok = cm.getTokenAt(pos);\n var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;\n if (inner.mode.name != \"xml\" || !state.tagName) return CodeMirror.Pass;\n\n var opt = cm.getOption(\"autoCloseTags\"), html = inner.mode.configuration == \"html\";\n var dontCloseTags = (typeof opt == \"object\" && opt.dontCloseTags) || (html && htmlDontClose);\n var indentTags = (typeof opt == \"object\" && opt.indentTags) || (html && htmlIndent);\n\n var tagName = state.tagName;\n if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);\n var lowerTagName = tagName.toLowerCase();\n // Don't process the '>' at the end of an end-tag or self-closing tag\n if (!tagName ||\n tok.type == \"string\" && (tok.end != pos.ch || !/[\\\"\\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||\n tok.type == \"tag\" && state.type == \"closeTag\" ||\n tok.string.indexOf(\"/\") == (tok.string.length - 1) || // match something like <someTagName />\n dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||\n closingTagExists(cm, tagName, pos, state, true))\n return CodeMirror.Pass;\n\n var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;\n replacements[i] = {indent: indent,\n text: \">\" + (indent ? \"\\n\\n\" : \"\") + \"</\" + tagName + \">\",\n newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};\n }\n\n for (var i = ranges.length - 1; i >= 0; i--) {\n var info = replacements[i];\n cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, \"+insert\");\n var sel = cm.listSelections().slice(0);\n sel[i] = {head: info.newPos, anchor: info.newPos};\n cm.setSelections(sel);\n if (info.indent) {\n cm.indentLine(info.newPos.line, null, true);\n cm.indentLine(info.newPos.line + 1, null, true);\n }\n }\n }\n\n function autoCloseCurrent(cm, typingSlash) {\n var ranges = cm.listSelections(), replacements = [];\n var head = typingSlash ? \"/\" : \"</\";\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var pos = ranges[i].head, tok = cm.getTokenAt(pos);\n var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;\n if (typingSlash && (tok.type == \"string\" || tok.string.charAt(0) != \"<\" ||\n tok.start != pos.ch - 1))\n return CodeMirror.Pass;\n // Kludge to get around the fact that we are not in XML mode\n // when completing in JS/CSS snippet in htmlmixed mode. Does not\n // work for other XML embedded languages (there is no general\n // way to go from a mixed mode to its current XML state).\n var replacement;\n if (inner.mode.name != \"xml\") {\n if (cm.getMode().name == \"htmlmixed\" && inner.mode.name == \"javascript\")\n replacement = head + \"script\";\n else if (cm.getMode().name == \"htmlmixed\" && inner.mode.name == \"css\")\n replacement = head + \"style\";\n else\n return CodeMirror.Pass;\n } else {\n if (!state.context || !state.context.tagName ||\n closingTagExists(cm, state.context.tagName, pos, state))\n return CodeMirror.Pass;\n replacement = head + state.context.tagName;\n }\n if (cm.getLine(pos.line).charAt(tok.end) != \">\") replacement += \">\";\n replacements[i] = replacement;\n }\n cm.replaceSelections(replacements);\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++)\n if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)\n cm.indentLine(ranges[i].head.line);\n }\n\n function autoCloseSlash(cm) {\n if (cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n return autoCloseCurrent(cm, true);\n }\n\n CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };\n\n function indexOf(collection, elt) {\n if (collection.indexOf) return collection.indexOf(elt);\n for (var i = 0, e = collection.length; i < e; ++i)\n if (collection[i] == elt) return i;\n return -1;\n }\n\n // If xml-fold is loaded, we use its functionality to try and verify\n // whether a given tag is actually unclosed.\n function closingTagExists(cm, tagName, pos, state, newTag) {\n if (!CodeMirror.scanForClosingTag) return false;\n var end = Math.min(cm.lastLine() + 1, pos.line + 500);\n var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);\n if (!nextClose || nextClose.tag != tagName) return false;\n var cx = state.context;\n // If the immediate wrapping context contains onCx instances of\n // the same tag, a closing tag only exists if there are at least\n // that many closing tags of that type following.\n for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;\n pos = nextClose.to;\n for (var i = 1; i < onCx; i++) {\n var next = CodeMirror.scanForClosingTag(cm, pos, null, end);\n if (!next || next.tag != tagName) return false;\n pos = next.to;\n }\n return true;\n }\n});\n\n},{\"../../lib/codemirror\":17,\"../fold/xml-fold\":16}],15:[function(require,module,exports){\n// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../fold/xml-fold\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../fold/xml-fold\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n CodeMirror.defineOption(\"matchTags\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchTags);\n cm.off(\"viewportChange\", maybeUpdateMatch);\n clear(cm);\n }\n if (val) {\n cm.state.matchBothTags = typeof val == \"object\" && val.bothTags;\n cm.on(\"cursorActivity\", doMatchTags);\n cm.on(\"viewportChange\", maybeUpdateMatch);\n doMatchTags(cm);\n }\n });\n\n function clear(cm) {\n if (cm.state.tagHit) cm.state.tagHit.clear();\n if (cm.state.tagOther) cm.state.tagOther.clear();\n cm.state.tagHit = cm.state.tagOther = null;\n }\n\n function doMatchTags(cm) {\n cm.state.failedTagMatch = false;\n cm.operation(function() {\n clear(cm);\n if (cm.somethingSelected()) return;\n var cur = cm.getCursor(), range = cm.getViewport();\n range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to);\n var match = CodeMirror.findMatchingTag(cm, cur, range);\n if (!match) return;\n if (cm.state.matchBothTags) {\n var hit = match.at == \"open\" ? match.open : match.close;\n if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: \"CodeMirror-matchingtag\"});\n }\n var other = match.at == \"close\" ? match.open : match.close;\n if (other)\n cm.state.tagOther = cm.markText(other.from, other.to, {className: \"CodeMirror-matchingtag\"});\n else\n cm.state.failedTagMatch = true;\n });\n }\n\n function maybeUpdateMatch(cm) {\n if (cm.state.failedTagMatch) doMatchTags(cm);\n }\n\n CodeMirror.commands.toMatchingTag = function(cm) {\n var found = CodeMirror.findMatchingTag(cm, cm.getCursor());\n if (found) {\n var other = found.at == \"close\" ? found.open : found.close;\n if (other) cm.extendSelection(other.to, other.from);\n }\n };\n});\n\n},{\"../../lib/codemirror\":17,\"../fold/xml-fold\":16}],16:[function(require,module,exports){\n// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }\n\n var nameStartChar = \"A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n var nameChar = nameStartChar + \"\\-\\:\\.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n var xmlTagStart = new RegExp(\"<(/?)([\" + nameStartChar + \"][\" + nameChar + \"]*)\", \"g\");\n\n function Iter(cm, line, ch, range) {\n this.line = line; this.ch = ch;\n this.cm = cm; this.text = cm.getLine(line);\n this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();\n this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();\n }\n\n function tagAt(iter, ch) {\n var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));\n return type && /\\btag\\b/.test(type);\n }\n\n function nextLine(iter) {\n if (iter.line >= iter.max) return;\n iter.ch = 0;\n iter.text = iter.cm.getLine(++iter.line);\n return true;\n }\n function prevLine(iter) {\n if (iter.line <= iter.min) return;\n iter.text = iter.cm.getLine(--iter.line);\n iter.ch = iter.text.length;\n return true;\n }\n\n function toTagEnd(iter) {\n for (;;) {\n var gt = iter.text.indexOf(\">\", iter.ch);\n if (gt == -1) { if (nextLine(iter)) continue; else return; }\n if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }\n var lastSlash = iter.text.lastIndexOf(\"/\", gt);\n var selfClose = lastSlash > -1 && !/\\S/.test(iter.text.slice(lastSlash + 1, gt));\n iter.ch = gt + 1;\n return selfClose ? \"selfClose\" : \"regular\";\n }\n }\n function toTagStart(iter) {\n for (;;) {\n var lt = iter.ch ? iter.text.lastIndexOf(\"<\", iter.ch - 1) : -1;\n if (lt == -1) { if (prevLine(iter)) continue; else return; }\n if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }\n xmlTagStart.lastIndex = lt;\n iter.ch = lt;\n var match = xmlTagStart.exec(iter.text);\n if (match && match.index == lt) return match;\n }\n }\n\n function toNextTag(iter) {\n for (;;) {\n xmlTagStart.lastIndex = iter.ch;\n var found = xmlTagStart.exec(iter.text);\n if (!found) { if (nextLine(iter)) continue; else return; }\n if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }\n iter.ch = found.index + found[0].length;\n return found;\n }\n }\n function toPrevTag(iter) {\n for (;;) {\n var gt = iter.ch ? iter.text.lastIndexOf(\">\", iter.ch - 1) : -1;\n if (gt == -1) { if (prevLine(iter)) continue; else return; }\n if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }\n var lastSlash = iter.text.lastIndexOf(\"/\", gt);\n var selfClose = lastSlash > -1 && !/\\S/.test(iter.text.slice(lastSlash + 1, gt));\n iter.ch = gt + 1;\n return selfClose ? \"selfClose\" : \"regular\";\n }\n }\n\n function findMatchingClose(iter, tag) {\n var stack = [];\n for (;;) {\n var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);\n if (!next || !(end = toTagEnd(iter))) return;\n if (end == \"selfClose\") continue;\n if (next[1]) { // closing tag\n for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {\n stack.length = i;\n break;\n }\n if (i < 0 && (!tag || tag == next[2])) return {\n tag: next[2],\n from: Pos(startLine, startCh),\n to: Pos(iter.line, iter.ch)\n };\n } else { // opening tag\n stack.push(next[2]);\n }\n }\n }\n function findMatchingOpen(iter, tag) {\n var stack = [];\n for (;;) {\n var prev = toPrevTag(iter);\n if (!prev) return;\n if (prev == \"selfClose\") { toTagStart(iter); continue; }\n var endLine = iter.line, endCh = iter.ch;\n var start = toTagStart(iter);\n if (!start) return;\n if (start[1]) { // closing tag\n stack.push(start[2]);\n } else { // opening tag\n for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {\n stack.length = i;\n break;\n }\n if (i < 0 && (!tag || tag == start[2])) return {\n tag: start[2],\n from: Pos(iter.line, iter.ch),\n to: Pos(endLine, endCh)\n };\n }\n }\n }\n\n CodeMirror.registerHelper(\"fold\", \"xml\", function(cm, start) {\n var iter = new Iter(cm, start.line, 0);\n for (;;) {\n var openTag = toNextTag(iter), end;\n if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;\n if (!openTag[1] && end != \"selfClose\") {\n var startPos = Pos(iter.line, iter.ch);\n var endPos = findMatchingClose(iter, openTag[2]);\n return endPos && {from: startPos, to: endPos.from};\n }\n }\n });\n CodeMirror.findMatchingTag = function(cm, pos, range) {\n var iter = new Iter(cm, pos.line, pos.ch, range);\n if (iter.text.indexOf(\">\") == -1 && iter.text.indexOf(\"<\") == -1) return;\n var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);\n var start = end && toTagStart(iter);\n if (!end || !start || cmp(iter, pos) > 0) return;\n var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};\n if (end == \"selfClose\") return {open: here, close: null, at: \"open\"};\n\n if (start[1]) { // closing tag\n return {open: findMatchingOpen(iter, start[2]), close: here, at: \"close\"};\n } else { // opening tag\n iter = new Iter(cm, to.line, to.ch, range);\n return {open: here, close: findMatchingClose(iter, start[2]), at: \"open\"};\n }\n };\n\n CodeMirror.findEnclosingTag = function(cm, pos, range) {\n var iter = new Iter(cm, pos.line, pos.ch, range);\n for (;;) {\n var open = findMatchingOpen(iter);\n if (!open) break;\n var forward = new Iter(cm, pos.line, pos.ch, range);\n var close = findMatchingClose(forward, open.tag);\n if (close) return {open: open, close: close};\n }\n };\n\n // Used by addon/edit/closetag.js\n CodeMirror.scanForClosingTag = function(cm, pos, name, end) {\n var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);\n return findMatchingClose(iter, name);\n };\n});\n\n},{\"../../lib/codemirror\":17}],17:[function(require,module,exports){\n// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n// Kludges for bugs and behavior differences that can't be feature\n// detected are enabled based on userAgent etc sniffing.\nvar userAgent = navigator.userAgent\nvar platform = navigator.platform\n\nvar gecko = /gecko\\/\\d/i.test(userAgent)\nvar ie_upto10 = /MSIE \\d/.test(userAgent)\nvar ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent)\nvar ie = ie_upto10 || ie_11up\nvar ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1])\nvar webkit = /WebKit\\//.test(userAgent)\nvar qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent)\nvar chrome = /Chrome\\//.test(userAgent)\nvar presto = /Opera\\//.test(userAgent)\nvar safari = /Apple Computer/.test(navigator.vendor)\nvar mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent)\nvar phantom = /PhantomJS/.test(userAgent)\n\nvar ios = /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent)\n// This is woefully incomplete. Suggestions for alternative methods welcome.\nvar mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)\nvar mac = ios || /Mac/.test(platform)\nvar chromeOS = /\\bCrOS\\b/.test(userAgent)\nvar windows = /win/i.test(platform)\n\nvar presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/)\nif (presto_version) { presto_version = Number(presto_version[1]) }\nif (presto_version && presto_version >= 15) { presto = false; webkit = true }\n// Some browsers use the wrong event properties to signal cmd/ctrl on OS X\nvar flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))\nvar captureRightClick = gecko || (ie && ie_version >= 9)\n\nfunction classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\nvar rmClass = function(node, cls) {\n var current = node.className\n var match = classTest(cls).exec(current)\n if (match) {\n var after = current.slice(match.index + match[0].length)\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\")\n }\n}\n\nfunction removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild) }\n return e\n}\n\nfunction removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n}\n\nfunction elt(tag, content, className, style) {\n var e = document.createElement(tag)\n if (className) { e.className = className }\n if (style) { e.style.cssText = style }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)) }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }\n return e\n}\n\nvar range\nif (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange()\n r.setEnd(endNode || node, end)\n r.setStart(node, start)\n return r\n} }\nelse { range = function(node, start, end) {\n var r = document.body.createTextRange()\n try { r.moveToElementText(node.parentNode) }\n catch(e) { return r }\n r.collapse(true)\n r.moveEnd(\"character\", end)\n r.moveStart(\"character\", start)\n return r\n} }\n\nfunction contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n}\n\nvar activeElt = function() {\n var activeElement = document.activeElement\n while (activeElement && activeElement.root && activeElement.root.activeElement)\n { activeElement = activeElement.root.activeElement }\n return activeElement\n}\n// Older versions of IE throws unspecified error when touching\n// document.activeElement in some cases (during loading, in iframe)\nif (ie && ie_version < 11) { activeElt = function() {\n try { return document.activeElement }\n catch(e) { return document.body }\n} }\n\nfunction addClass(node, cls) {\n var current = node.className\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls }\n}\nfunction joinClasses(a, b) {\n var as = a.split(\" \")\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i] } }\n return b\n}\n\nvar selectInput = function(node) { node.select() }\nif (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }\nelse if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select() } catch(_e) {} } }\n\nfunction bind(f) {\n var args = Array.prototype.slice.call(arguments, 1)\n return function(){return f.apply(null, args)}\n}\n\nfunction copyObj(obj, target, overwrite) {\n if (!target) { target = {} }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop] } }\n return target\n}\n\n// Counts the column offset in a string, taking tabs into account.\n// Used mostly to find indentation.\nfunction countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}\n\nfunction Delayed() {this.id = null}\nDelayed.prototype.set = function(ms, f) {\n clearTimeout(this.id)\n this.id = setTimeout(f, ms)\n}\n\nfunction indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n}\n\n// Number of pixels added to scroller and sizer to hide scrollbar\nvar scrollerGap = 30\n\n// Returned or thrown by various protocols to signal 'I'm not\n// handling this'.\nvar Pass = {toString: function(){return \"CodeMirror.Pass\"}}\n\n// Reused option objects for setSelection & friends\nvar sel_dontScroll = {scroll: false};\nvar sel_mouse = {origin: \"*mouse\"};\nvar sel_move = {origin: \"+move\"};\n// The inverse of countColumn -- find the offset that corresponds to\n// a particular column.\nfunction findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}\n\nvar spaceStrs = [\"\"]\nfunction spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \") }\n return spaceStrs[n]\n}\n\nfunction lst(arr) { return arr[arr.length-1] }\n\nfunction map(array, f) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }\n return out\n}\n\nfunction insertSorted(array, value, score) {\n var pos = 0, priority = score(value)\n while (pos < array.length && score(array[pos]) <= priority) { pos++ }\n array.splice(pos, 0, value)\n}\n\nfunction nothing() {}\n\nfunction createObj(base, props) {\n var inst\n if (Object.create) {\n inst = Object.create(base)\n } else {\n nothing.prototype = base\n inst = new nothing()\n }\n if (props) { copyObj(props, inst) }\n return inst\n}\n\nvar nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/\nfunction isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n}\nfunction isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n}\n\nfunction isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n}\n\n// Extending unicode characters. A series of a non-extending char +\n// any number of extending chars is treated as a single unit as far\n// as editing and measuring is concerned. This is not fully correct,\n// since some scripts/fonts/browsers also treat other configurations\n// of code points as a group.\nvar 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]/\nfunction isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n// The display handles the DOM integration, both for input reading\n// and content drawing. It holds references to DOM nodes and\n// display-related state.\n\nfunction Display(place, doc, input) {\n var d = this\n this.input = input\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\")\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\")\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\")\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\")\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\")\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\")\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\")\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\")\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\")\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\")\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\")\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\")\n d.sizerWidth = null\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\")\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\")\n d.lineGutter = null\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\")\n d.scroller.setAttribute(\"tabIndex\", \"-1\")\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\")\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper) }\n else { place(d.wrapper) }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first\n d.reportedViewFrom = d.reportedViewTo = doc.first\n // Information about the rendered lines.\n d.view = []\n d.renderedView = null\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null\n // Empty space (in pixels) above the view\n d.viewOffset = 0\n d.lastWrapHeight = d.lastWrapWidth = 0\n d.updateLineNumbers = null\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0\n d.scrollbarsClipped = false\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null\n d.maxLineLength = 0\n d.maxLineChanged = false\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null\n\n // True when shift is held down.\n d.shift = false\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null\n\n d.activeTouch = null\n\n input.init(d)\n}\n\n// Find the line object corresponding to the given line number.\nfunction getLine(doc, n) {\n n -= doc.first\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize()\n if (n < sz) { chunk = child; break }\n n -= sz\n }\n }\n return chunk.lines[n]\n}\n\n// Get the part of a document between two positions, as an array of\n// strings.\nfunction getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}\n// Get the lines between from and to, as array of strings.\nfunction getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}\n\n// Update the height of a line, propagating the height change\n// upwards to parent nodes.\nfunction updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}\n\n// Given a line object, find its line number by walking up through\n// its parent links.\nfunction lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}\n\n// Find the line at the given vertical position, using the height\n// information in the document tree.\nfunction lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}\n\nfunction isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\nfunction lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n}\n\n// A Pos instance represents a position within the text.\nfunction Pos (line, ch) {\n if (!(this instanceof Pos)) { return new Pos(line, ch) }\n this.line = line; this.ch = ch\n}\n\n// Compare two positions, return 0 if they are the same, a negative\n// number when a is less, and a positive number otherwise.\nfunction cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\nfunction copyPos(x) {return Pos(x.line, x.ch)}\nfunction maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\nfunction minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n// Most of the external API clips given positions to make sure they\n// actually exist within the document.\nfunction clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\nfunction clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n}\nfunction clipToLen(pos, linelen) {\n var ch = pos.ch\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n}\nfunction clipPosArray(doc, array) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }\n return out\n}\n\n// Optimize some code when these features are not used.\nvar sawReadOnlySpans = false;\nvar sawCollapsedSpans = false;\nfunction seeReadOnlySpans() {\n sawReadOnlySpans = true\n}\n\nfunction seeCollapsedSpans() {\n sawCollapsedSpans = true\n}\n\n// TEXTMARKER SPANS\n\nfunction MarkedSpan(marker, from, to) {\n this.marker = marker\n this.from = from; this.to = to\n}\n\n// Search an array of spans for a span matching the given marker.\nfunction getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}\n// Remove a span from an array, returning undefined if no spans are\n// left (we don't store arrays for lines without spans).\nfunction removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}\n// Add a span to a line.\nfunction addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}\n\n// Used for the algorithm that adjusts markers for a change in the\n// document. These functions cut an array of spans at a given\n// character position, returning an array of remaining chunks (or\n// undefined if nothing remains).\nfunction markedSpansBefore(old, startCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))\n }\n } }\n return nw\n}\nfunction markedSpansAfter(old, endCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh))\n }\n } }\n return nw\n}\n\n// Given a change object, compute the new set of marker spans that\n// cover the line in which the change took place. Removes spans\n// entirely within the change, reconnects spans belonging to the\n// same marker that appear on both sides of the change, and cuts off\n// spans partially within the change. Returns an array of span\n// arrays with one element for each line in (after) the change.\nfunction stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}\n\n// Remove spans that are empty and don't have a clearWhenEmpty\n// option of false.\nfunction clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}\n\n// Used to 'clip' out readOnly ranges when making a change.\nfunction removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 1\n }\n }\n return parts\n}\n\n// Connect or disconnect spans from a line.\nfunction detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}\nfunction attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line) }\n line.markedSpans = spans\n}\n\n// Helpers used when computing which overlapping collapsed span\n// counts as the larger one.\nfunction extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\nfunction extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n// Returns a number indicating which of two overlapping collapsed\n// spans is larger (and thus includes the other). Falls back to\n// comparing ids when the spans cover exactly the same range.\nfunction compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}\n\n// Find out whether a line ends or starts in a collapsed span. If\n// so, return the marker for that span.\nfunction collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}\nfunction collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\nfunction collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n// Test whether there exists a collapsed span that partially\n// overlaps (covers the start or end, but not both) of a new span.\n// Such overlap is not allowed.\nfunction conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}\n\n// A visual line is a line as drawn on the screen. Folding, for\n// example, can cause multiple logical lines to appear on the same\n// visual line. This finds the start of the visual line that the\n// given line is part of (usually that is the line itself).\nfunction visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}\n\n// Returns an array of logical lines that continue the visual line\n// started by the argument, or undefined if there are no such lines.\nfunction visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}\n\n// Get the line number of the start of the visual line that the\n// given line number is part of.\nfunction visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}\n\n// Get the line number of the start of the next visual line after\n// the given line.\nfunction visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}\n\n// Compute whether a line is hidden. Lines count as hidden when they\n// are part of a visual line that starts with another line, or when\n// they are entirely covered by collapsed, non-widget span.\nfunction lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}\nfunction lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true)\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = void 0, i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i]\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n}\n\n// Find the height above the given line.\nfunction heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}\n\n// Compute the character length of a line, taking into account\n// collapsed ranges (see markText) that might hide parts, and join\n// other lines onto it.\nfunction lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}\n\n// Find the longest line in the document.\nfunction findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}\n\n// BIDI HELPERS\n\nfunction iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\") }\n var found = false\n for (var i = 0; i < order.length; ++i) {\n var part = order[i]\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\")\n found = true\n }\n }\n if (!found) { f(from, to, \"ltr\") }\n}\n\nfunction bidiLeft(part) { return part.level % 2 ? part.to : part.from }\nfunction bidiRight(part) { return part.level % 2 ? part.from : part.to }\n\nfunction lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0 }\nfunction lineRight(line) {\n var order = getOrder(line)\n if (!order) { return line.text.length }\n return bidiRight(lst(order))\n}\n\nfunction compareBidiLevel(order, a, b) {\n var linedir = order[0].level\n if (a == linedir) { return true }\n if (b == linedir) { return false }\n return a < b\n}\n\nvar bidiOther = null\nfunction getBidiPartAt(order, pos) {\n var found\n bidiOther = null\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i]\n if (cur.from < pos && cur.to > pos) { return i }\n if ((cur.from == pos || cur.to == pos)) {\n if (found == null) {\n found = i\n } else if (compareBidiLevel(order, cur.level, order[found].level)) {\n if (cur.from != cur.to) { bidiOther = found }\n return i\n } else {\n if (cur.from != cur.to) { bidiOther = i }\n return found\n }\n }\n }\n return found\n}\n\nfunction moveInLine(line, pos, dir, byUnit) {\n if (!byUnit) { return pos + dir }\n do { pos += dir }\n while (pos > 0 && isExtendingChar(line.text.charAt(pos)))\n return pos\n}\n\n// This is needed in order to move 'visually' through bi-directional\n// text -- i.e., pressing left should make the cursor go left, even\n// when in RTL text. The tricky part is the 'jumps', where RTL and\n// LTR text touch each other. This often requires the cursor offset\n// to move more than one unit, in order to visually move one unit.\nfunction moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line)\n if (!bidi) { return moveLogically(line, start, dir, byUnit) }\n var pos = getBidiPartAt(bidi, start), part = bidi[pos]\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit)\n\n for (;;) {\n if (target > part.from && target < part.to) { return target }\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) { return target }\n part = bidi[pos += dir]\n return (dir > 0) == part.level % 2 ? part.to : part.from\n } else {\n part = bidi[pos += dir]\n if (!part) { return null }\n if ((dir > 0) == part.level % 2)\n { target = moveInLine(line, part.to, -1, byUnit) }\n else\n { target = moveInLine(line, part.from, 1, byUnit) }\n }\n }\n}\n\nfunction moveLogically(line, start, dir, byUnit) {\n var target = start + dir\n if (byUnit) { while (target > 0 && isExtendingChar(line.text.charAt(target))) { target += dir } }\n return target < 0 || target > line.text.length ? null : target\n}\n\n// Bidirectional ordering algorithm\n// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n// that this (partially) implements.\n\n// One-char codes used for character types:\n// L (L): Left-to-Right\n// R (R): Right-to-Left\n// r (AL): Right-to-Left Arabic\n// 1 (EN): European Number\n// + (ES): European Number Separator\n// % (ET): European Number Terminator\n// n (AN): Arabic Number\n// , (CS): Common Number Separator\n// m (NSM): Non-Spacing Mark\n// b (BN): Boundary Neutral\n// s (B): Paragraph Separator\n// t (S): Segment Separator\n// w (WS): Whitespace\n// N (ON): Other Neutrals\n\n// Returns null if characters are ordered as they appear\n// (left-to-right), or an array of sections ({from, to, level}\n// objects) in the order in which they occur visually.\nvar bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\"\n // Character types for codepoints 0x600 to 0x6ff\n var arabicTypes = \"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm\"\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6ed) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/\n // Browsers seem to always treat the boundaries of block elements as being L.\n var outerType = \"L\"\n\n function BidiSpan(level, from, to) {\n this.level = level\n this.from = from; this.to = to\n }\n\n return function(str) {\n if (!bidiRE.test(str)) { return false }\n var len = str.length, types = []\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))) }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1]\n if (type == \"m\") { types[i$1] = prev }\n else { prev = type }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2]\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\" }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\" } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3]\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\" }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1 }\n prev$1 = type$2\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4]\n if (type$3 == \",\") { types[i$4] = \"N\" }\n else if (type$3 == \"%\") {\n var end = void 0\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\"\n for (var j = i$4; j < end; ++j) { types[j] = replace }\n i$4 = end - 1\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5]\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\" }\n else if (isStrong.test(type$4)) { cur$1 = type$4 }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = void 0\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\"\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\"\n var replace$1 = before || after ? \"L\" : \"R\"\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }\n i$6 = end$1 - 1\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7))\n } else {\n var pos = i$7, at = order.length\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }\n var nstart = j$2\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2))\n pos = j$2\n } else { ++j$2 }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length\n order.unshift(new BidiSpan(0, 0, m[0].length))\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length\n order.push(new BidiSpan(0, len - m[0].length, len))\n }\n if (order[0].level == 2)\n { order.unshift(new BidiSpan(1, order[0].to, order[0].to)) }\n if (order[0].level != lst(order).level)\n { order.push(new BidiSpan(order[0].level, len, len)) }\n\n return order\n }\n})()\n\n// Get the bidi ordering for the given line (and cache it). Returns\n// false for lines that are fully left-to-right, and an array of\n// BidiSpan objects otherwise.\nfunction getOrder(line) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text) }\n return order\n}\n\n// EVENT HANDLING\n\n// Lightweight event framework. on/off also work on DOM nodes,\n// registering native DOM handlers.\n\nvar on = function(emitter, type, f) {\n if (emitter.addEventListener)\n { emitter.addEventListener(type, f, false) }\n else if (emitter.attachEvent)\n { emitter.attachEvent(\"on\" + type, f) }\n else {\n var map = emitter._handlers || (emitter._handlers = {})\n var arr = map[type] || (map[type] = [])\n arr.push(f)\n }\n}\n\nvar noHandlers = []\nfunction getHandlers(emitter, type, copy) {\n var arr = emitter._handlers && emitter._handlers[type]\n if (copy) { return arr && arr.length > 0 ? arr.slice() : noHandlers }\n else { return arr || noHandlers }\n}\n\nfunction off(emitter, type, f) {\n if (emitter.removeEventListener)\n { emitter.removeEventListener(type, f, false) }\n else if (emitter.detachEvent)\n { emitter.detachEvent(\"on\" + type, f) }\n else {\n var handlers = getHandlers(emitter, type, false)\n for (var i = 0; i < handlers.length; ++i)\n { if (handlers[i] == f) { handlers.splice(i, 1); break } }\n }\n}\n\nfunction signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type, true)\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2)\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }\n}\n\n// The DOM events that CodeMirror handles can be overridden by\n// registering a (non-DOM) handler on the editor for the event name,\n// and preventDefault-ing the event in that handler.\nfunction signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}\n\nfunction signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]) } }\n}\n\nfunction hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n}\n\n// Add on and off methods to a constructor's prototype, to make\n// registering events on such objects more convenient.\nfunction eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}\n\n// Due to the fact that we still support jurassic IE versions, some\n// compatibility wrappers are needed.\n\nfunction e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault() }\n else { e.returnValue = false }\n}\nfunction e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation() }\n else { e.cancelBubble = true }\n}\nfunction e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n}\nfunction e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}\n\nfunction e_target(e) {return e.target || e.srcElement}\nfunction e_button(e) {\n var b = e.which\n if (b == null) {\n if (e.button & 1) { b = 1 }\n else if (e.button & 2) { b = 3 }\n else if (e.button & 4) { b = 2 }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3 }\n return b\n}\n\n// Detect drag-and-drop\nvar dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div')\n return \"draggable\" in div || \"dragDrop\" in div\n}()\n\nvar zwspSupported\nfunction zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\")\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]))\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\")\n node.setAttribute(\"cm-text\", \"\")\n return node\n}\n\n// Feature-detect IE's crummy client rect reporting for bidi text\nvar badBidiRects\nfunction hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"))\n var r0 = range(txt, 0, 1).getBoundingClientRect()\n var r1 = range(txt, 1, 2).getBoundingClientRect()\n removeChildren(measure)\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n}\n\n// See if \"\".split is the broken IE version, if so, provide an\n// alternative way to split lines.\nvar splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos)\n if (nl == -1) { nl = string.length }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl)\n var rt = line.indexOf(\"\\r\")\n if (rt != -1) {\n result.push(line.slice(0, rt))\n pos += rt + 1\n } else {\n result.push(line)\n pos = nl + 1\n }\n }\n return result\n} : function (string) { return string.split(/\\r\\n?|\\n/); }\n\nvar hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n} : function (te) {\n var range\n try {range = te.ownerDocument.selection.createRange()}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n}\n\nvar hasCopyEvent = (function () {\n var e = elt(\"div\")\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\")\n return typeof e.oncopy == \"function\"\n})()\n\nvar badZoomedRects = null\nfunction hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"))\n var normal = node.getBoundingClientRect()\n var fromRange = range(node, 0, 1).getBoundingClientRect()\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n}\n\nvar modes = {};\nvar mimeModes = {};\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nfunction defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}\n\nfunction defineMIME(mime, spec) {\n mimeModes[mime] = spec\n}\n\n// Given a MIME type, a {name, ...options} config object, or a name\n// string, return a mode config object.\nfunction resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec]\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name]\n if (typeof found == \"string\") { found = {name: found} }\n spec = createObj(found, spec)\n spec.name = found.name\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n}\n\n// Given a mode spec (anything that resolveMode accepts), find and\n// initialize an actual mode object.\nfunction getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}\n\n// This can be used to attach properties to mode objects from\n// outside the actual mode definition.\nvar modeExtensions = {}\nfunction extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})\n copyObj(properties, exts)\n}\n\nfunction copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {}\n for (var n in state) {\n var val = state[n]\n if (val instanceof Array) { val = val.concat([]) }\n nstate[n] = val\n }\n return nstate\n}\n\n// Given a mode and a state (for that mode), find the inner mode and\n// state at the position that the state refers to.\nfunction innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}\n\nfunction startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n}\n\n// STRING STREAM\n\n// Fed to the mode parsers, provides helper functions to make\n// parsers more succinct.\n\nvar StringStream = function(string, tabSize) {\n this.pos = this.start = 0\n this.string = string\n this.tabSize = tabSize || 8\n this.lastColumnPos = this.lastColumnValue = 0\n this.lineStart = 0\n}\n\nStringStream.prototype = {\n eol: function() {return this.pos >= this.string.length},\n sol: function() {return this.pos == this.lineStart},\n peek: function() {return this.string.charAt(this.pos) || undefined},\n next: function() {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n },\n eat: function(match) {\n var ch = this.string.charAt(this.pos)\n var ok\n if (typeof match == \"string\") { ok = ch == match }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)) }\n if (ok) {++this.pos; return ch}\n },\n eatWhile: function(match) {\n var start = this.pos\n while (this.eat(match)){}\n return this.pos > start\n },\n eatSpace: function() {\n var this$1 = this;\n\n var start = this.pos\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }\n return this.pos > start\n },\n skipToEnd: function() {this.pos = this.string.length},\n skipTo: function(ch) {\n var found = this.string.indexOf(ch, this.pos)\n if (found > -1) {this.pos = found; return true}\n },\n backUp: function(n) {this.pos -= n},\n column: function() {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)\n this.lastColumnPos = this.start\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n },\n indentation: function() {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n },\n match: function(pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }\n var substr = this.string.substr(this.pos, pattern.length)\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern)\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length }\n return match\n }\n },\n current: function(){return this.string.slice(this.start, this.pos)},\n hideFirstChars: function(n, inner) {\n this.lineStart += n\n try { return inner() }\n finally { this.lineStart -= n }\n }\n}\n\n// Compute a style array (an array starting with a mode generation\n// -- for invalidation -- followed by pairs of end positions and\n// style strings), which is used to highlight the tokens on the\n// line.\nfunction highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}\n\nfunction getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var state = getStateBefore(cm, lineNo(line))\n var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)\n line.stateAfter = state\n line.styles = result.styles\n if (result.classes) { line.styleClasses = result.classes }\n else if (line.styleClasses) { line.styleClasses = null }\n if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }\n }\n return line.styles\n}\n\nfunction getStateBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display\n if (!doc.mode.startState) { return true }\n var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter\n if (!state) { state = startState(doc.mode) }\n else { state = copyState(doc.mode, state) }\n doc.iter(pos, n, function (line) {\n processLine(cm, line.text, state)\n var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo\n line.stateAfter = save ? copyState(doc.mode, state) : null\n ++pos\n })\n if (precise) { doc.frontier = pos }\n return state\n}\n\n// Lightweight form of highlight -- proceed over this line and\n// update state, but don't save a style array. Used for lines that\n// aren't currently visible.\nfunction processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, state) }\n while (!stream.eol()) {\n readToken(mode, stream, state)\n stream.start = stream.pos\n }\n}\n\nfunction callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state)\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n}\n\nfunction readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode }\n var style = mode.token(stream, state)\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n}\n\n// Utility for getTokenAt and getLineTokens\nfunction takeToken(cm, pos, precise, asArray) {\n var getObj = function (copy) { return ({\n start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state\n }); }\n\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, state)\n if (asArray) { tokens.push(getObj(true)) }\n }\n return asArray ? tokens : getObj()\n}\n\nfunction extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/)\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\"\n if (output[prop] == null)\n { output[prop] = lineClass[2] }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2] }\n } }\n return type\n}\n\n// Run the given mode's parser over a line, calling f for each token.\nfunction runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, state, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}\n\n// Finds the line to start with when starting a parse. Tries to\n// find a line with a stateAfter, so that it can start with a\n// valid state. If that fails, it returns the line with the\n// smallest indentation, which tends to need the least context to\n// parse correctly.\nfunction findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}\n\n// LINE DATA STRUCTURE\n\n// Line objects. These hold state related to a line, including\n// highlighting info (the styles array).\nfunction Line(text, markedSpans, estimateHeight) {\n this.text = text\n attachMarkedSpans(this, markedSpans)\n this.height = estimateHeight ? estimateHeight(this) : 1\n}\neventMixin(Line)\nLine.prototype.lineNo = function() { return lineNo(this) }\n\n// Change the content (text, markers) of a line. Automatically\n// invalidates cached information and tries to re-estimate the\n// line's height.\nfunction updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}\n\n// Detach a line from the document tree and its markers.\nfunction cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}\n\n// Convert a style as returned by a mode (either null, or a string\n// containing one or more styles) to a CSS style. This is cached,\n// and also looks for line-wide styles.\nvar styleToClassCache = {};\nvar styleToClassCacheWithMode = {};\nfunction interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n}\n\n// Render the DOM representation of the text of a line. Also builds\n// up a 'line map', which points at the DOM nodes that represent\n// specific stretches of text, and is used by the measuring code.\n// The returned object contains the DOM node, this map, and\n// information about line-wide styles that were set by the mode.\nfunction buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = void 0\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}\n\nfunction defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\")\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16)\n token.setAttribute(\"aria-label\", token.title)\n return token\n}\n\n// Build up the DOM representation for a single token, and add it to\n// the line map. Takes care to render special characters separately.\nfunction buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = void 0\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}\n\nfunction splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\"\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i)\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\" }\n result += ch\n spaceBefore = ch == \" \"\n }\n return result\n}\n\n// Work around nonsense dimensions being reported for stretches of\n// right-to-left text.\nfunction buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, title, css) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\"\n var start = builder.pos, end = start + text.length\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = void 0\n for (var i = 0; i < order.length; i++) {\n part = order[i]\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)\n startStyle = null\n text = text.slice(part.to - start)\n start = part.to\n }\n }\n}\n\nfunction buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")) }\n widget.setAttribute(\"cm-marker\", marker.id)\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget)\n builder.content.appendChild(widget)\n }\n builder.pos += size\n builder.trailingSpace = false\n}\n\n// Outputs a number of spans to make up a line, taking highlighting\n// and marked text into account.\nfunction insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = void 0\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}\n\n\n// These objects are used to represent the visible (currently drawn)\n// part of the document. A LineView may correspond to multiple\n// logical lines, if those are connected by collapsed ranges.\nfunction LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}\n\n// Create a range of LineView objects for the given lines.\nfunction buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}\n\nvar operationGroup = null\n\nfunction pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op)\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n }\n }\n}\n\nfunction fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null) }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j]\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }\n }\n } while (i < callbacks.length)\n}\n\nfunction finishOperation(op, endCb) {\n var group = op.ownsGroup\n if (!group) { return }\n\n try { fireCallbacksForOps(group) }\n finally {\n operationGroup = null\n endCb(group)\n }\n}\n\nvar orphanDelayedCallbacks = null\n\n// Often, we want to signal events at a point where we are in the\n// middle of some work, but don't want the handler to start calling\n// other methods on the editor, which might be in an inconsistent\n// state or simply not expect any other events to happen.\n// signalLater looks whether there are any handlers, and schedules\n// them to be executed when the last operation ends, or, if no\n// operation is active, when a timeout fires.\nfunction signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type, false)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}\n\nfunction fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks\n orphanDelayedCallbacks = null\n for (var i = 0; i < delayed.length; ++i) { delayed[i]() }\n}\n\n// When an aspect of a line changes, a string is added to\n// lineView.changes. This updates the relevant part of the line's\n// DOM structure.\nfunction updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}\n\n// Lines with gutter elements, widgets or a background class need to\n// be wrapped, and have the extra elements added to the wrapper div\nfunction ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\")\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }\n lineView.node.appendChild(lineView.text)\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }\n }\n return lineView.node\n}\n\nfunction updateLineBackground(lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass\n if (cls) { cls += \" CodeMirror-linebackground\" }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView)\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild)\n }\n}\n\n// Wrapper around buildLineContent which will reuse the structure\n// in display.externalMeasured when possible.\nfunction getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}\n\n// Redraw the line's text. Interacts with the background and text\n// classes because the mode may output tokens that influence these\n// classes.\nfunction updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}\n\nfunction updateLineClasses(lineView) {\n updateLineBackground(lineView)\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\" }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass\n lineView.text.className = textClass || \"\"\n}\n\nfunction updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter)\n lineView.gutter = null\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground)\n lineView.gutterBackground = null\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView)\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"))\n wrap.insertBefore(lineView.gutterBackground, lineView.text)\n }\n var markers = lineView.line.gutterMarkers\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView)\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(gutterWrap)\n wrap$1.insertBefore(gutterWrap, lineView.text)\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))) }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))) }\n } }\n }\n}\n\nfunction updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null }\n for (var node = lineView.node.firstChild, next = void 0; node; node = next) {\n next = node.nextSibling\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node) }\n }\n insertLineWidgets(cm, lineView, dims)\n}\n\n// Build a line's DOM representation from scratch\nfunction buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}\n\n// A lineView may contain multiple logical lines (when merged by\n// collapsed spans). The widgets for all of them need to be drawn.\nfunction insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}\n\nfunction insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView)\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\")\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\") }\n positionLineWidget(widget, node, lineView, dims)\n cm.display.input.setUneditable(node)\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text) }\n else\n { wrap.appendChild(node) }\n signalLater(widget, \"redraw\")\n }\n}\n\nfunction positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n ;(lineView.alignable || (lineView.alignable = [])).push(node)\n var width = dims.wrapperWidth\n node.style.left = dims.fixedPos + \"px\"\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\"\n }\n node.style.width = width + \"px\"\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5\n node.style.position = \"relative\"\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\" }\n }\n}\n\nfunction widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\"\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\" }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\" }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle))\n }\n return widget.height = widget.node.parentNode.offsetHeight\n}\n\n// Return true when the given mouse event happened in a widget\nfunction eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}\n\n// POSITION MEASUREMENT\n\nfunction paddingTop(display) {return display.lineSpace.offsetTop}\nfunction paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\nfunction paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"))\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }\n return data\n}\n\nfunction scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\nfunction displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n}\nfunction displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n}\n\n// Ensure the lineView.wrapping.heights array is populated. This is\n// an array of bottom offsets for the lines that make up a drawn\n// line. When lineWrapping is on, there might be more than one\n// height.\nfunction ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}\n\n// Find a line map (mapping character offsets to text nodes) and a\n// measurement cache for the given line number. (A line view might\n// contain multiple lines when collapsed ranges are present.)\nfunction mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}\n\n// Render a line into the hidden node display.externalMeasured. Used\n// when measurement is needed for a line that's not in the viewport.\nfunction updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}\n\n// Get a {top, bottom, left, right} box (in line-local coordinates)\n// for a given character.\nfunction measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n}\n\n// Find a line view that corresponds to the given line number.\nfunction findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}\n\n// Measurement can be split in two steps, the set-up work that\n// applies to the whole line, and the measurement of the actual\n// character. Functions like coordsChar, that need to do a lot of\n// measurements in a row, can thus ensure that the set-up work is\n// only done once.\nfunction prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}\n\n// Given a prepared measurement object, measures the position of an\n// actual character (or fetches it from the cache).\nfunction measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}\n\nvar nullRect = {left: 0, right: 0, top: 0, bottom: 0}\n\nfunction nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i]\n mEnd = map[i + 1]\n if (ch < mStart) {\n start = 0; end = 1\n collapse = \"left\"\n } else if (ch < mEnd) {\n start = ch - mStart\n end = start + 1\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart\n start = end - 1\n if (ch >= mEnd) { collapse = \"right\" }\n }\n if (start != null) {\n node = map[i + 2]\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2]\n collapse = \"left\"\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2]\n collapse = \"right\"\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n}\n\nfunction getUsefulRect(rects, bias) {\n var rect = nullRect\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n}\n\nfunction measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse\n\n var rect\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect() }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }\n if (rect.left || rect.right || start == 0) { break }\n end = start\n start = start - 1\n collapse = \"right\"\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\" }\n var rects\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0] }\n else\n { rect = node.getBoundingClientRect() }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0]\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }\n else\n { rect = nullRect }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top\n var mid = (rtop + rbot) / 2\n var heights = prepared.view.measure.heights\n var i = 0\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i]\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot}\n if (!rect.left && !rect.right) { result.bogus = true }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }\n\n return result\n}\n\n// Work around problem with bounding client rects on ranges being\n// returned incorrectly when zoomed on IE10 and below.\nfunction maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI\n var scaleY = screen.logicalYDPI / screen.deviceYDPI\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n}\n\nfunction clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {}\n lineView.measure.heights = null\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {} } }\n }\n}\n\nfunction clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null\n removeChildren(cm.display.lineMeasure)\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]) }\n}\n\nfunction clearCaches(cm) {\n clearLineMeasurementCache(cm)\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }\n cm.display.lineNumChars = null\n}\n\nfunction pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }\nfunction pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }\n\n// Converts a {top, bottom, left, right} box from line-local\n// coordinates into another coordinate system. Context may be one of\n// \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n// or \"page\".\nfunction intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i])\n rect.top += size; rect.bottom += size\n } } }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\" }\n var yOff = heightAtLine(lineObj)\n if (context == \"local\") { yOff += paddingTop(cm.display) }\n else { yOff -= cm.display.viewOffset }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect()\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY())\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX())\n rect.left += xOff; rect.right += xOff\n }\n rect.top += yOff; rect.bottom += yOff\n return rect\n}\n\n// Coverts a box from \"div\" coords to another coordinate system.\n// Context may be \"window\", \"page\", \"div\", or \"local\"./null.\nfunction fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}\n\nfunction charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n}\n\n// Returns a box for a given cursor position, which may have an\n// 'other' property containing the position of the secondary cursor\n// on a bidi boundary.\nfunction cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos]\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1)\n right = true\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos]\n ch = bidiLeft(part) - part.level % 2\n right = false\n }\n if (right && ch == part.to && ch > part.from) { return get(ch - 1) }\n return get(ch, right)\n }\n var order = getOrder(lineObj), ch = pos.ch\n if (!order) { return get(ch) }\n var partPos = getBidiPartAt(order, ch)\n var val = getBidi(ch, partPos)\n if (bidiOther != null) { val.other = getBidi(ch, bidiOther) }\n return val\n}\n\n// Used to cheaply estimate the coordinates for a position. Used for\n// intermediate scroll updates.\nfunction estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}\n\n// Positions returned by coordsChar contain some extra information.\n// xRel is the relative x position of the input coordinates compared\n// to the found position (so xRel > 0 means the coordinates are to\n// the right of the character position, for example). When outside\n// is true, that means the coordinates lie outside the line's\n// vertical range.\nfunction PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch)\n pos.xRel = xRel\n if (outside) { pos.outside = true }\n return pos\n}\n\n// Compute the character position closest to the given coordinates.\n// Input must be lineSpace-local (\"div\" coordinate system).\nfunction coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}\n\nfunction coordsCharInner(cm, lineObj, lineNo, x, y) {\n var innerOff = y - heightAtLine(lineObj)\n var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth\n var preparedMeasure = prepareMeasureForLine(cm, lineObj)\n\n function getX(ch) {\n var sp = cursorCoords(cm, Pos(lineNo, ch), \"line\", lineObj, preparedMeasure)\n wrongLine = true\n if (innerOff > sp.bottom) { return sp.left - adjust }\n else if (innerOff < sp.top) { return sp.left + adjust }\n else { wrongLine = false }\n return sp.left\n }\n\n var bidi = getOrder(lineObj), dist = lineObj.text.length\n var from = lineLeft(lineObj), to = lineRight(lineObj)\n var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine\n\n if (x > toX) { return PosWithInfo(lineNo, to, toOutside, 1) }\n // Do a binary search between these bounds.\n for (;;) {\n if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n var ch = x < fromX || x - fromX <= toX - x ? from : to\n var outside = ch == from ? fromOutside : toOutside\n var xDiff = x - (ch == from ? fromX : toX)\n // This is a kludge to handle the case where the coordinates\n // are after a line-wrapped line. We should replace it with a\n // more general handling of cursor positions around line\n // breaks. (Issue #4078)\n if (toOutside && !bidi && !/\\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&\n ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {\n var charSize = measureCharPrepared(cm, preparedMeasure, ch, \"right\")\n if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {\n outside = false\n ch++\n xDiff = x - charSize.right\n }\n }\n while (isExtendingChar(lineObj.text.charAt(ch))) { ++ch }\n var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0)\n return pos\n }\n var step = Math.ceil(dist / 2), middle = from + step\n if (bidi) {\n middle = from\n for (var i = 0; i < step; ++i) { middle = moveVisually(lineObj, middle, 1) }\n }\n var middleX = getX(middle)\n if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) { toX += 1000; } dist = step}\n else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step}\n }\n}\n\nvar measureText\n// Compute the default text height.\nfunction textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}\n\n// Compute the default character width.\nfunction charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}\n\n// Do a bulk-read of the DOM positions and sizes needed to draw the\n// view, so that we don't interleave reading and writing to the DOM.\nfunction getDimensions(cm) {\n var d = cm.display, left = {}, width = {}\n var gutterLeft = d.gutters.clientLeft\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft\n width[cm.options.gutters[i]] = n.clientWidth\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}\n\n// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n// but using getBoundingClientRect to get a sub-pixel-accurate\n// result.\nfunction compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}\n\n// Returns a function that estimates the height of a line, to use as\n// first approximation until the line becomes visible (and is thus\n// properly measurable).\nfunction estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}\n\nfunction estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm)\n doc.iter(function (line) {\n var estHeight = est(line)\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n })\n}\n\n// Given a mouse event, find the corresponding position. If liberal\n// is false, it checks whether a gutter or scrollbar was clicked,\n// and returns null if it was. forRect is used by rectangular\n// selections, and tries to estimate a character position even for\n// coordinates beyond the right of the text.\nfunction posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}\n\n// Find the view element corresponding to a given line. Return null\n// when the line isn't visible.\nfunction findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom\n if (n < 0) { return null }\n var view = cm.display.view\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size\n if (n < 0) { return i }\n }\n}\n\nfunction updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection())\n}\n\nfunction prepareSelection(cm, primary) {\n var doc = cm.doc, result = {}\n var curFragment = result.cursors = document.createDocumentFragment()\n var selFragment = result.selection = document.createDocumentFragment()\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (primary === false && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i]\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty()\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment) }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment) }\n }\n return result\n}\n\n// Draws a cursor for the given range\nfunction drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}\n\n// Draws the given range as a highlighted selection\nfunction drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n 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\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}\n\n// Cursor-blinking\nfunction restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display\n clearInterval(display.blinker)\n var on = true\n display.cursorDiv.style.visibility = \"\"\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate) }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\" }\n}\n\nfunction ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }\n}\n\nfunction delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false\n onBlur(cm)\n } }, 100)\n}\n\nfunction onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e)\n cm.state.focused = true\n addClass(cm.display.wrapper, \"CodeMirror-focused\")\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset()\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730\n }\n cm.display.input.receivedFocus()\n }\n restartBlink(cm)\n}\nfunction onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e)\n cm.state.focused = false\n rmClass(cm.display.wrapper, \"CodeMirror-focused\")\n }\n clearInterval(cm.display.blinker)\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)\n}\n\n// Re-align line numbers and gutter marks to compensate for\n// horizontal scrolling.\nfunction alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}\n\n// Used to ensure that the line number gutter is still the right\n// size for the current document size. Returns true when an update\n// is needed.\nfunction maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}\n\n// Read the actual heights of the rendered lines, and update their\n// stored heights to match.\nfunction updateHeightsInViewport(cm) {\n var display = cm.display\n var prevBottom = display.lineDiv.offsetTop\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = void 0\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight\n height = bot - prevBottom\n prevBottom = bot\n } else {\n var box = cur.node.getBoundingClientRect()\n height = box.bottom - box.top\n }\n var diff = cur.line.height - height\n if (height < 2) { height = textHeight(display) }\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height)\n updateWidgetHeight(cur.line)\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]) } }\n }\n }\n}\n\n// Read and store the height of line widgets associated with the\n// given line.\nfunction updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}\n\n// Compute the lines that are visible in a given viewport (defaults\n// the the current scroll position). viewport may contain top,\n// height, and ensure (see op.scrollToPos) properties.\nfunction visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}\n\n// Sync the scrollable area and scrollbars, ensure the viewport\n// covers the visible area.\nfunction setScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n cm.doc.scrollTop = val\n if (!gecko) { updateDisplaySimple(cm, {top: val}) }\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }\n cm.display.scrollbars.setScrollTop(val)\n if (gecko) { updateDisplaySimple(cm) }\n startWorker(cm, 100)\n}\n// Sync scroller and scrollbar, ensure the gutter elements are\n// aligned.\nfunction setScrollLeft(cm, val, isScroller) {\n if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)\n cm.doc.scrollLeft = val\n alignHorizontally(cm)\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }\n cm.display.scrollbars.setScrollLeft(val)\n}\n\n// Since the delta values reported on mouse wheel events are\n// unstandardized between browsers and even browser versions, and\n// generally horribly unpredictable, this code starts by measuring\n// the scroll effect that the first few mouse wheel events have,\n// and, from that, detects the way it can convert deltas to pixel\n// offsets afterwards.\n//\n// The reason we want to know the amount a wheel event will scroll\n// is that it gives us a chance to update the display before the\n// actual scrolling happens, reducing flickering.\n\nvar wheelSamples = 0;\nvar wheelPixelsPerUnit = null;\n// Fill in a browser-detected starting value on browsers where we\n// know one. These don't have to be accurate -- the result of them\n// being wrong would just be a slight flicker on the first wheel\n// scroll (if it is large enough).\nif (ie) { wheelPixelsPerUnit = -.53 }\nelse if (gecko) { wheelPixelsPerUnit = 15 }\nelse if (chrome) { wheelPixelsPerUnit = -.7 }\nelse if (safari) { wheelPixelsPerUnit = -1/3 }\n\nfunction wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }\n else if (dy == null) { dy = e.wheelDelta }\n return {x: dx, y: dy}\n}\nfunction wheelEventPixels(e) {\n var delta = wheelEventDelta(e)\n delta.x *= wheelPixelsPerUnit\n delta.y *= wheelPixelsPerUnit\n return delta\n}\n\nfunction onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y\n\n var display = cm.display, scroll = display.scroller\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth\n var canScrollY = scroll.scrollHeight > scroll.clientHeight\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) }\n setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)))\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e) }\n display.wheelStartX = null // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight\n if (pixels < 0) { top = Math.max(0, top + pixels - 50) }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50) }\n updateDisplaySimple(cm, {top: top, bottom: bot})\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop\n display.wheelDX = dx; display.wheelDY = dy\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX\n var movedY = scroll.scrollTop - display.wheelStartY\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX)\n display.wheelStartX = display.wheelStartY = null\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)\n ++wheelSamples\n }, 200)\n } else {\n display.wheelDX += dx; display.wheelDY += dy\n }\n }\n}\n\n// SCROLLBARS\n\n// Prepare DOM reads needed to update the scrollbars. Done in one\n// shot to minimize update/measure roundtrips.\nfunction measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth\n var docH = Math.round(cm.doc.height + paddingVert(cm.display))\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n}\n\nfunction NativeScrollbars(place, scroll, cm) {\n this.cm = cm\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\")\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\")\n place(vert); place(horiz)\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\") }\n })\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\") }\n })\n\n this.checkedZeroWidth = false\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\" }\n}\n\nNativeScrollbars.prototype = copyObj({\n update: function(measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1\n var needsV = measure.scrollHeight > measure.clientHeight + 1\n var sWidth = measure.nativeBarWidth\n\n if (needsV) {\n this.vert.style.display = \"block\"\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\"\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\"\n } else {\n this.vert.style.display = \"\"\n this.vert.firstChild.style.height = \"0\"\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\"\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\"\n this.horiz.style.left = measure.barLeft + \"px\"\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)\n this.horiz.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\"\n } else {\n this.horiz.style.display = \"\"\n this.horiz.firstChild.style.width = \"0\"\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack() }\n this.checkedZeroWidth = true\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n },\n setScrollLeft: function(pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }\n },\n setScrollTop: function(pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }\n },\n zeroWidthHack: function() {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\"\n this.horiz.style.height = this.vert.style.width = w\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\"\n this.disableHoriz = new Delayed\n this.disableVert = new Delayed\n },\n enableZeroWidthBar: function(bar, delay) {\n bar.style.pointerEvents = \"auto\"\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // left corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect()\n var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)\n if (elt != bar) { bar.style.pointerEvents = \"none\" }\n else { delay.set(1000, maybeDisable) }\n }\n delay.set(1000, maybeDisable)\n },\n clear: function() {\n var parent = this.horiz.parentNode\n parent.removeChild(this.horiz)\n parent.removeChild(this.vert)\n }\n}, NativeScrollbars.prototype)\n\nfunction NullScrollbars() {}\n\nNullScrollbars.prototype = copyObj({\n update: function() { return {bottom: 0, right: 0} },\n setScrollLeft: function() {},\n setScrollTop: function() {},\n clear: function() {}\n}, NullScrollbars.prototype)\n\nfunction updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm) }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight\n updateScrollbarsInner(cm, measure)\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm) }\n updateScrollbarsInner(cm, measureForScrollbars(cm))\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight\n }\n}\n\n// Re-synchronize the fake scrollbars with the actual size of the\n// content.\nfunction updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}\n\nvar scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars}\n\nfunction initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear()\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }\n })\n node.setAttribute(\"cm-not-content\", \"true\")\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos) }\n else { setScrollTop(cm, pos) }\n }, cm)\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n}\n\n// SCROLLING THINGS INTO VIEW\n\n// If an editor sits on the top or bottom of the window, partially\n// scrolled out of view, this ensures that the cursor is visible.\nfunction maybeScrollWindow(cm, coords) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null\n if (coords.top + box.top < 0) { doScroll = true }\n else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (coords.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (coords.left) + \"px; width: 2px;\"))\n cm.display.lineSpace.appendChild(scrollNode)\n scrollNode.scrollIntoView(doScroll)\n cm.display.lineSpace.removeChild(scrollNode)\n }\n}\n\n// Scroll a given position into view (immediately), verifying that\n// it actually became visible (as line heights are accurately\n// measured, the position of something may 'drift' during drawing).\nfunction scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var coords\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return coords\n}\n\n// Scroll a given set of coordinates into view (immediately).\nfunction scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)\n if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}\n\n// Calculate a new scroll position needed to scroll the given\n// rectangle into view. Returns an object with scrollTop and\n// scrollLeft properties. When these are undefined, the\n// vertical/horizontal position does not need to be adjusted.\nfunction calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (y1 < 0) { y1 = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (y2 - y1 > screen) { y2 = y1 + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = x2 - x1 > screenw\n if (tooWide) { x2 = x1 + screenw }\n if (x1 < 10)\n { result.scrollLeft = 0 }\n else if (x1 < screenleft)\n { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }\n else if (x2 > screenw + screenleft - 3)\n { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }\n return result\n}\n\n// Store a relative adjustment to the scroll position in the current\n// operation (to be applied when the operation finishes).\nfunction addToScrollPos(cm, left, top) {\n if (left != null || top != null) { resolveScrollToPos(cm) }\n if (left != null)\n { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }\n if (top != null)\n { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }\n}\n\n// Make sure that at the end of the operation the current cursor is\n// shown.\nfunction ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor(), from = cur, to = cur\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur\n to = Pos(cur.line, cur.ch + 1)\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}\n}\n\n// When an operation has its scrollToPos property set, and another\n// scroll action is applied before the end of the operation, this\n// 'simulates' scrolling that position into view in a cheap way, so\n// that the effect of intermediate scroll commands is not ignored.\nfunction resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin)\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n}\n\n// Operations are used to wrap a series of changes to the editor\n// state in such a way that each change won't have to update the\n// cursor and display (which would be awkward, slow, and\n// error-prone). Instead, display updates are batched and then all\n// combined and executed at once.\n\nvar nextOpId = 0\n// Start a new operation.\nfunction startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}\n\n// Finish an operation, updating the display and signalling delayed events\nfunction endOperation(cm) {\n var op = cm.curOp\n finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null }\n endOperations(group)\n })\n}\n\n// The DOM updates done when an operation finishes are batched so\n// that the minimum number of relayouts are required.\nfunction endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}\n\nfunction endOperation_R1(op) {\n var cm = op.cm, display = cm.display\n maybeClipScrollbars(cm)\n if (op.updateMaxLine) { findMaxLine(cm) }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)\n}\n\nfunction endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)\n}\n\nfunction endOperation_R2(op) {\n var cm = op.cm, display = cm.display\n if (op.updatedDisplay) { updateHeightsInViewport(cm) }\n\n op.barMeasure = measureForScrollbars(cm)\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3\n cm.display.sizerWidth = op.adjustWidthTo\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(op.focus) }\n}\n\nfunction endOperation_W2(op) {\n var cm = op.cm\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\"\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }\n cm.display.maxLineChanged = false\n }\n\n var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus) }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure) }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure) }\n\n if (op.selectionChanged) { restartBlink(cm) }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing) }\n if (takeFocus) { ensureFocus(op.cm) }\n}\n\nfunction endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {\n doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop))\n display.scrollbars.setScrollTop(doc.scrollTop)\n display.scroller.scrollTop = doc.scrollTop\n }\n if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {\n doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft))\n display.scrollbars.setScrollLeft(doc.scrollLeft)\n display.scroller.scrollLeft = doc.scrollLeft\n alignHorizontally(cm)\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)\n if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) }\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\") } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\") } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs) }\n if (op.update)\n { op.update.finish() }\n}\n\n// Run the given function in an operation\nfunction runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}\n// Wraps a function in an operation. Returns the wrapped function.\nfunction operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}\n// Used to add methods to editor and doc instances, wrapping them in\n// operations.\nfunction methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}\nfunction docMethodOp(f) {\n return function() {\n var cm = this.cm\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm)\n try { return f.apply(this, arguments) }\n finally { endOperation(cm) }\n }\n}\n\n// Updates the display.view data structure for a given change to the\n// document. From and to are in pre-change coordinates. Lendiff is\n// the amount of lines added or subtracted by the change. This is\n// used for changes that span multiple lines, or change the way\n// lines are divided into visual lines. regLineChange (below)\n// registers single-line changes.\nfunction regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint