TablePress - Version 1.8

Version Description

This update is a stability, maintenance, and compatibility release. Updating is recommended.

Download this release

Release Info

Developer TobiasBg
Plugin Icon 128x128 TablePress
Version 1.8
Comparing to
See all releases

Code changes from version 1.7 to 1.8

admin/css/codemirror.css CHANGED
@@ -53,7 +53,7 @@
53
}
54
.cm-fat-cursor .CodeMirror-cursor {
55
width: auto;
56
- border: 0;
57
background: #7e7;
58
}
59
.cm-fat-cursor div.CodeMirror-cursors {
@@ -83,8 +83,14 @@
83
84
.cm-tab { display: inline-block; text-decoration: inherit; }
85
86
.CodeMirror-ruler {
87
border-left: 1px solid #ccc;
88
position: absolute;
89
}
90
@@ -189,12 +195,14 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
189
190
.CodeMirror-gutters {
191
position: absolute; left: 0; top: 0;
192
z-index: 3;
193
}
194
.CodeMirror-gutter {
195
white-space: normal;
196
height: 100%;
197
display: inline-block;
198
margin-bottom: -30px;
199
}
200
.CodeMirror-gutter-wrapper {
@@ -241,6 +249,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
241
position: relative;
242
overflow: visible;
243
-webkit-tap-highlight-color: transparent;
244
}
245
.CodeMirror-wrap pre {
246
word-wrap: break-word;
@@ -285,7 +296,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
285
visibility: hidden;
286
}
287
288
- .CodeMirror-cursor { position: absolute; }
289
.CodeMirror-measure pre { position: static; }
290
291
div.CodeMirror-cursors {
53
}
54
.cm-fat-cursor .CodeMirror-cursor {
55
width: auto;
56
+ border: 0 !important;
57
background: #7e7;
58
}
59
.cm-fat-cursor div.CodeMirror-cursors {
83
84
.cm-tab { display: inline-block; text-decoration: inherit; }
85
86
+ .CodeMirror-rulers {
87
+ position: absolute;
88
+ left: 0; right: 0; top: -50px; bottom: -20px;
89
+ overflow: hidden;
90
+ }
91
.CodeMirror-ruler {
92
border-left: 1px solid #ccc;
93
+ top: 0; bottom: 0;
94
position: absolute;
95
}
96
195
196
.CodeMirror-gutters {
197
position: absolute; left: 0; top: 0;
198
+ min-height: 100%;
199
z-index: 3;
200
}
201
.CodeMirror-gutter {
202
white-space: normal;
203
height: 100%;
204
display: inline-block;
205
+ vertical-align: top;
206
margin-bottom: -30px;
207
}
208
.CodeMirror-gutter-wrapper {
249
position: relative;
250
overflow: visible;
251
-webkit-tap-highlight-color: transparent;
252
+ -webkit-font-variant-ligatures: contextual;
253
+ -moz-font-variant-ligatures: contextual;
254
+ font-variant-ligatures: contextual;
255
}
256
.CodeMirror-wrap pre {
257
word-wrap: break-word;
296
visibility: hidden;
297
}
298
299
+ .CodeMirror-cursor {
300
+ position: absolute;
301
+ pointer-events: none;
302
+ }
303
.CodeMirror-measure pre { position: static; }
304
305
div.CodeMirror-cursors {
admin/css/codemirror.min.css CHANGED
@@ -1 +1 @@
1
- .CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:#ff9600;background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}#option-custom-css,#tablepress-page .CodeMirror{font-family:Consolas,Monaco,monospace;font-size:14px;line-height:1.4;width:99%!important;height:100px;margin:1px 1px 7px}#option-custom-css{margin:1px;-moz-tab-size:2;-o-tab-size:2;tab-size:2}#tablepress-page .CodeMirror-scroll{background-color:#fff;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);-webkit-transition:50ms border-color ease-in-out;transition:50ms border-color ease-in-out;height:100%;height:-webkit-calc(100% - 2px);height:calc(100% - 2px);padding-bottom:0;margin-right:0}#option-custom-css,#tablepress-page .CodeMirror-lines{padding:4px 6px 1px}#tablepress-page .CodeMirror pre{padding:0}#tablepress-page .CodeMirror.disabled .CodeMirror-scroll{background-color:#eee}#tablepress-page .CodeMirror-focused{-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}#tablepress-page .CodeMirror-focused .CodeMirror-scroll{border-color:#5b9dd9;-webkit-box-shadow:none;box-shadow:none}#tablepress-page .CodeMirror.large{height:500px}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}
1
+ .CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:#ff9600;background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;-moz-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}#option-custom-css,#tablepress-page .CodeMirror{font-family:Consolas,Monaco,monospace;font-size:14px;line-height:1.4;width:99%!important;height:100px;margin:1px 1px 7px}#option-custom-css{margin:1px;-moz-tab-size:2;-o-tab-size:2;tab-size:2}#tablepress-page .CodeMirror-scroll{background-color:#fff;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);-webkit-transition:50ms border-color ease-in-out;transition:50ms border-color ease-in-out;height:100%;height:-webkit-calc(100% - 2px);height:calc(100% - 2px);padding-bottom:0;margin-right:0}#option-custom-css,#tablepress-page .CodeMirror-lines{padding:4px 6px 1px 6px}#tablepress-page .CodeMirror pre{padding:0}#tablepress-page .CodeMirror.disabled .CodeMirror-scroll{background-color:#eee}#tablepress-page .CodeMirror-focused .CodeMirror-scroll{border-color:#5b9dd9}#tablepress-page .CodeMirror-focused{-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}#tablepress-page .CodeMirror-focused .CodeMirror-scroll{-webkit-box-shadow:none;box-shadow:none}#tablepress-page .CodeMirror.large{height:500px}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}
admin/css/common.css CHANGED
@@ -145,23 +145,15 @@
145
padding-top: 6px;
146
}
147
/* Adjust positioning of labels in relation to checkboxes/radio buttons */
148
- #tablepress_edit-table-options .column-2 label,
149
- #tablepress_edit-datatables-features .column-2 label {
150
- vertical-align: top;
151
- }
152
#tablepress_import-import-form .column-2 label,
153
#tablepress_import-import-wp-table-reloaded .column-2 label {
154
- vertical-align: top;
155
margin-right: 20px; /* some margin on radio buttons */
156
}
157
- #tablepress-page input,
158
- #tablepress-page .button {
159
- vertical-align: middle;
160
- }
161
- #tablepress-page .widefat th input {
162
- vertical-align: text-top;
163
- }
164
/* Red color for the "Uninstall TablePress" button on the "Plugin Options" screen */
165
#uninstall-tablepress {
166
color: #BC0B0B;
167
}
145
padding-top: 6px;
146
}
147
/* Adjust positioning of labels in relation to checkboxes/radio buttons */
148
#tablepress_import-import-form .column-2 label,
149
#tablepress_import-import-wp-table-reloaded .column-2 label {
150
margin-right: 20px; /* some margin on radio buttons */
151
}
152
/* Red color for the "Uninstall TablePress" button on the "Plugin Options" screen */
153
#uninstall-tablepress {
154
color: #BC0B0B;
155
}
156
+ /* Select dropdown alignment on the "Plugin Options" screen */
157
+ #tablepress-page select {
158
+ vertical-align: baseline;
159
+ }
admin/css/common.min.css CHANGED
@@ -1 +1 @@
1
- #tablepress-page div.notice{margin:10px 0 0}@media screen and (max-width:1150px){#tablepress-nav{padding-top:30px}}#tablepress-nav .plugin-name{float:left;padding:5px 0}#tablepress-nav .separator{margin:6px;float:left}#tablepress_add-add-table .form-wrap{max-width:500px}#tablepress_add-add-table .form-field{margin:0}#tablepress_add-add-table .form-field-small{float:left;width:150px;margin-right:20px}.js #tablepress-page .placeholder-active{color:#bbb}.tablepress-all-tables thead .column-table_id{width:50px}.tablepress-all-tables thead .column-table_name{width:30%}.tablepress-all-tables thead .column-table_author{width:12%}.tablepress-all-tables thead .column-table_last_modified{width:15%}.tablepress-all-tables tbody .column-table_id{font-weight:700}@media screen and (max-width:782px){.tablepress-all-tables .column-table_id{display:none!important;padding:3px 8px 3px 35%}}#tablepress-page .subtitle{float:left;padding-left:0}#tablepress-page .table-shortcode-inline{background:0 0;border:none;color:#333;width:110px;margin:0;padding:0;font-weight:700;-webkit-box-shadow:none;box-shadow:none;text-align:center;vertical-align:top}#tablepress-page .table-shortcode{cursor:text}#tablepress-page #tables-export{width:100%;height:auto;line-height:normal}#tablepress-page form .invalid,#tablepress-page form :invalid{border-color:#c00!important}.tablepress-postbox-table{border-spacing:0;max-width:1000px;width:100%}.tablepress-postbox-table .column-1{width:25%}.tablepress-postbox-table .column-2{width:75%}.tablepress-postbox-table th{text-align:left;font-weight:400}.tablepress-postbox-table td,.tablepress-postbox-table th{padding:2px;word-wrap:break-word}.tablepress-postbox-table .top-border td,.tablepress-postbox-table .top-border th{padding-top:6px}.tablepress-postbox-table .bottom-border td,.tablepress-postbox-table .bottom-border th{padding-bottom:6px;border-bottom:1px solid #eee}.tablepress-postbox-table .top-align{vertical-align:top;padding-top:6px}#tablepress_edit-datatables-features .column-2 label,#tablepress_edit-table-options .column-2 label{vertical-align:top}#tablepress_import-import-form .column-2 label,#tablepress_import-import-wp-table-reloaded .column-2 label{vertical-align:top;margin-right:20px}#tablepress-page .button,#tablepress-page input{vertical-align:middle}#tablepress-page .widefat th input{vertical-align:text-top}#uninstall-tablepress{color:#BC0B0B}
1
+ #tablepress-page div.notice{margin:10px 0 0}@media screen and (max-width:1150px){#tablepress-nav{padding-top:30px}}#tablepress-nav .plugin-name{float:left;padding:5px 0}#tablepress-nav .separator{margin:6px;float:left}#tablepress_add-add-table .form-wrap{max-width:500px}#tablepress_add-add-table .form-field{margin:0}#tablepress_add-add-table .form-field-small{float:left;width:150px;margin-right:20px}.js #tablepress-page .placeholder-active{color:#bbb}.tablepress-all-tables thead .column-table_id{width:50px}.tablepress-all-tables thead .column-table_name{width:30%}.tablepress-all-tables thead .column-table_author{width:12%}.tablepress-all-tables thead .column-table_last_modified{width:15%}.tablepress-all-tables tbody .column-table_id{font-weight:700}@media screen and (max-width:782px){.tablepress-all-tables .column-table_id{display:none!important;padding:3px 8px 3px 35%}}#tablepress-page .subtitle{float:left;padding-left:0}#tablepress-page .table-shortcode-inline{background:0 0;border:none;color:#333;width:110px;margin:0;padding:0;font-weight:700;-webkit-box-shadow:none;box-shadow:none;text-align:center;vertical-align:top}#tablepress-page .table-shortcode{cursor:text}#tablepress-page #tables-export{width:100%;height:auto;line-height:normal}#tablepress-page form .invalid,#tablepress-page form :invalid{border-color:#c00!important}.tablepress-postbox-table{border-spacing:0;max-width:1000px;width:100%}.tablepress-postbox-table .column-1{width:25%}.tablepress-postbox-table .column-2{width:75%}.tablepress-postbox-table th{text-align:left;font-weight:400}.tablepress-postbox-table td,.tablepress-postbox-table th{padding:2px;word-wrap:break-word}.tablepress-postbox-table .top-border td,.tablepress-postbox-table .top-border th{padding-top:6px}.tablepress-postbox-table .bottom-border td,.tablepress-postbox-table .bottom-border th{padding-bottom:6px;border-bottom:1px solid #eee}.tablepress-postbox-table .top-align{vertical-align:top;padding-top:6px}#tablepress_import-import-form .column-2 label,#tablepress_import-import-wp-table-reloaded .column-2 label{margin-right:20px}#uninstall-tablepress{color:#bc0b0b}#tablepress-page select{vertical-align:baseline}
admin/css/edit.css CHANGED
@@ -116,6 +116,11 @@ body #wp-link-backdrop {
116
width: 120px;
117
}
118
119
/* Table cells */
120
#edit-form-body td {
121
padding: 2px 1px;
@@ -204,7 +209,6 @@ body #wp-link-backdrop {
204
margin-right: 2px;
205
}
206
#edit-form-head .sorting-indicator {
207
- display: block; /* BC for WP 4.3, can be removed later */
208
visibility: visible;
209
}
210
#edit-form-head .sort-asc .sorting-indicator:before {
116
width: 120px;
117
}
118
119
+ #table-information-shortcode,
120
+ #tablepress-page .button {
121
+ vertical-align: middle;
122
+ }
123
+
124
/* Table cells */
125
#edit-form-body td {
126
padding: 2px 1px;
209
margin-right: 2px;
210
}
211
#edit-form-head .sorting-indicator {
212
visibility: visible;
213
}
214
#edit-form-head .sort-asc .sorting-indicator:before {
admin/css/edit.min.css CHANGED
@@ -1 +1 @@
1
- #tablepress-page div.ajax-alert pre+p,.hidden-container{display:none}body.wait *{cursor:wait!important}.hidden-help-box-container p{margin:6px}#wpbody-content,#wpwrap,body{overflow:visible!important}#TB_HideSelect{z-index:301099}#TB_overlay,.media-modal{z-index:301100}#TB_window{z-index:301102}#TB_load{z-index:301103}body #wp-link-backdrop{z-index:100103}#table-preview-iframe{width:100%;height:100%}#table-preview{height:100%;margin:-2px -15px -15px}#advanced-editor{padding:5px}#advanced-editor .wp-editor-container{border:none}#advanced-editor .submitbox{padding:5px 5px 0;font-size:12px}#advanced-editor-confirm{float:right}#advanced-editor-cancel{line-height:30px}.spinner.animation-preview,.spinner.animation-saving{float:none;margin:0 0 0 6px}#tablepress-page div.ajax-alert{margin:-10px 0 15px}#tablepress-page div.ajax-alert p{font-weight:700}#tablepress-page div.ajax-alert pre{margin:-6px 0 .5em 2px}#tablepress-page #tablepress_edit-table-data{display:inline-block;min-width:99.9%}#tablepress-page #tablepress_edit-table-data.hide-if-js{display:none}#tablepress-page .small-text{width:65px;padding:3px 5px}#tablepress-page #table-new-id{width:120px}#edit-form-body td{padding:2px 1px;height:32px}#edit-form-body .focus td,.no-js #edit-form-body td{height:70px}#edit-form-body .odd{background-color:#f1f1f1}#edit-form-body textarea{display:block;min-width:150px;width:100%;width:auto\0/IE;height:100%;resize:both}#edit-form-body textarea:focus{border-color:#333}#tablepress-page input[type=text],#tablepress-page select,#tablepress-page textarea{-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 0 ease 0;transition:all 0 ease 0}#edit-form-foot input[type=checkbox]{margin:6px 0 3px}#edit-form{border-collapse:collapse}#edit-form .move-handle{display:block;margin:auto;width:16px;height:16px;text-align:center;font-weight:700}.js #edit-form .move-handle{cursor:move}#edit-form-body .move-handle{margin:auto 3px;min-width:16px;width:auto}#edit-form .move-hover{position:absolute;z-index:1000;height:26px}#edit-form .focus .move-hover{height:64px}#edit-form-body .foot-row,#edit-form-body .head-row{background-color:#d9edf7}#edit-form-head .sort-control{float:right;height:18px;cursor:pointer;margin-right:2px}#edit-form-head .sorting-indicator{display:block;visibility:visible}#edit-form-head .sort-asc .sorting-indicator:before{content:'\f142'}#edit-form-head .sort-desc .sorting-indicator:before{content:'\f140'}#edit-form .column-hidden,#edit-form .column-hidden textarea,#edit-form .row-hidden td,#edit-form .row-hidden textarea{background-color:#ffe0e0}#tablepress_edit-table-manipulation .column-1{width:45%}#tablepress_edit-table-manipulation .column-2{width:55%}
1
+ body.wait *{cursor:wait!important}.hidden-container{display:none}.hidden-help-box-container p{margin:6px}#wpbody-content,#wpwrap,body{overflow:visible!important}#TB_HideSelect{z-index:301099}#TB_overlay,.media-modal{z-index:301100}#TB_window{z-index:301102}#TB_load{z-index:301103}body #wp-link-backdrop{z-index:100103}#table-preview-iframe{width:100%;height:100%}#table-preview{height:100%;margin:-2px -15px -15px -15px}#advanced-editor{padding:5px}#advanced-editor .wp-editor-container{border:none}#advanced-editor .submitbox{padding:5px 5px 0;font-size:12px}#advanced-editor-confirm{float:right}#advanced-editor-cancel{line-height:30px}.spinner.animation-preview,.spinner.animation-saving{float:none;margin:0 0 0 6px}#tablepress-page div.ajax-alert{margin:-10px 0 15px}#tablepress-page div.ajax-alert p{font-weight:700}#tablepress-page div.ajax-alert pre{margin:-6px 0 .5em 2px}#tablepress-page div.ajax-alert pre+p{display:none}#tablepress-page #tablepress_edit-table-data{display:inline-block;min-width:99.9%}#tablepress-page #tablepress_edit-table-data.hide-if-js{display:none}#tablepress-page .small-text{width:65px;padding:3px 5px}#tablepress-page #table-new-id{width:120px}#table-information-shortcode,#tablepress-page .button{vertical-align:middle}#edit-form-body td{padding:2px 1px;height:32px}#edit-form-body .focus td,.no-js #edit-form-body td{height:70px}#edit-form-body .odd{background-color:#f1f1f1}#edit-form-body textarea{display:block;min-width:150px;width:100%;width:auto\0/IE;height:100%;resize:both}#edit-form-body textarea:focus{border-color:#333}#tablepress-page input[type=text],#tablepress-page select,#tablepress-page textarea{-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 0 ease 0;transition:all 0 ease 0}#edit-form-foot input[type=checkbox]{margin:6px 0 3px}#edit-form{border-collapse:collapse}#edit-form .move-handle{display:block;margin:auto;width:16px;height:16px;text-align:center;font-weight:700}.js #edit-form .move-handle{cursor:move}#edit-form-body .move-handle{margin:auto 3px;min-width:16px;width:auto}#edit-form .move-hover{position:absolute;z-index:1000;height:26px}#edit-form .focus .move-hover{height:64px}#edit-form-body .foot-row,#edit-form-body .head-row{background-color:#d9edf7}#edit-form-head .sort-control{float:right;height:18px;cursor:pointer;margin-right:2px}#edit-form-head .sorting-indicator{visibility:visible}#edit-form-head .sort-asc .sorting-indicator:before{content:'\f142'}#edit-form-head .sort-desc .sorting-indicator:before{content:'\f140'}#edit-form .column-hidden,#edit-form .column-hidden textarea,#edit-form .row-hidden td,#edit-form .row-hidden textarea{background-color:#ffe0e0}#tablepress_edit-table-manipulation .column-1{width:45%}#tablepress_edit-table-manipulation .column-2{width:55%}
admin/js/add.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){"use strict";a("#tablepress-page").find("form").on("submit",function(){var b=!0;return a("#tablepress-page").find(".form-required").find(".placeholder").each(function(){this.value===this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}),validateForm(a(this))||(b=!1),a("#tablepress-page").find(".form-field-numbers-only").find("input").each(function(){var c,d=a(this),e=parseInt(d.attr("maxlength"),10);isNaN(e)?e="":e+=-1,c=new RegExp("^[1-9][0-9]{0,"+e+"}quot;),c.test(d.val())||(d.one("change",function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).focus().select().closest(".form-field").addClass("form-invalid"),b=!1)}),b?void a("#tablepress-page").find(".placeholder").each(function(){this.value===this.defaultValue&&(this.value="")}):!1})});
1
+ jQuery(document).ready(function(a){"use strict";a("#tablepress-page").find("form").on("submit",function(){var b=!0;return a("#tablepress-page").find(".form-required").find(".placeholder").each(function(){this.value===this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}),validateForm(a(this))||(b=!1),a("#tablepress-page").find(".form-field-numbers-only").find("input").each(function(){var c,d=a(this),e=parseInt(d.attr("maxlength"),10);isNaN(e)?e="":e+=-1,c=new RegExp("^[1-9][0-9]{0,"+e+"}quot;),c.test(d.val())||(d.one("change",function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).focus().select().closest(".form-field").addClass("form-invalid"),b=!1)}),!!b&&void a("#tablepress-page").find(".placeholder").each(function(){this.value===this.defaultValue&&(this.value="")})})});
admin/js/codemirror.min.js CHANGED
@@ -1,317 +1,330 @@
1
- // CodeMirror version 5.9.0
2
- (function(n){this.CodeMirror=n()})(function(){function n(a,b){if(!(this instanceof n))return new n(a,b);this.options=b=b?ja(b):{};ja(vf,b,!1);Sa(b);var c=b.value;"string"==typeof c&&(c=new X(c,b.mode,null,b.lineSeparator));this.doc=c;var d=new n.inputStyles[b.inputStyle](this),d=this.display=new N(a,c,d);d.wrapper.CodeMirror=this;ic(this);jc(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");b.autofocus&&!Eb&&d.input.focus();kc(this);this.state={keyMaps:[],overlays:[],modeGen:0,
3
- overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ta,keySeq:null,specialChars:null};var e=this;G&&11>E&&setTimeout(function(){e.display.input.reset(!0)},20);wf(this);Md||(xf(),Md=!0);lb(this);this.curOp.forceUpdate=!0;Nd(this,c);b.autofocus&&!Eb||e.hasFocus()?setTimeout(Fb(Xc,this),20):Gb(this);for(var f in mb)if(mb.hasOwnProperty(f))mb[f](this,b[f],Od);Pd(this);b.finishInit&&b.finishInit(this);for(c=0;c<Yc.length;++c)Yc[c](this);
4
- nb(this);O&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(d.lineDiv).textRendering&&(d.lineDiv.style.textRendering="auto")}function N(a,b,c){this.input=c;this.scrollbarFiller=u("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=u("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=u("div",null,"CodeMirror-code");this.selectionDiv=u("div",null,null,"position: relative; z-index: 1");
5
- this.cursorDiv=u("div",null,"CodeMirror-cursors");this.measure=u("div",null,"CodeMirror-measure");this.lineMeasure=u("div",null,"CodeMirror-measure");this.lineSpace=u("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");this.mover=u("div",[u("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=u("div",[this.mover],"CodeMirror-sizer");this.sizerWidth=null;this.heightForcer=u("div",null,null,"position: absolute; height: "+
6
- Qd+"px; width: 1px;");this.gutters=u("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=u("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=u("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");G&&8>E&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);O||Ua&&Eb||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=
7
- this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=
8
- this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;c.init(this)}function Aa(a){a.doc.mode=n.getMode(a.options,a.doc.modeOption);da(a)}function da(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Hb(a,100);a.state.modeGen++;a.curOp&&U(a)}function lc(a){var b=Va(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ib(a.display)-3);return function(e){if(Wa(a.doc,
9
- e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function Ga(a){var b=a.doc,c=lc(a);b.iter(function(a){var b=c(a);b!=a.height&&qa(a,b)})}function jc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Jb(a)}function ra(a){ic(a);U(a);setTimeout(function(){Ha(a)},20)}function ic(a){var b=a.display.gutters,
10
- c=a.options.gutters;Xa(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(u("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none";Ba(a)}function Ba(a){a.display.sizer.style.marginLeft=a.display.gutters.offsetWidth+"px"}function Ia(a){if(0==a.height)return 0;for(var b=a.text.length,c,d=a;c=Ya(d,!0);)c=c.find(0,!0),d=c.from.line,b+=c.from.ch-c.to.ch;for(d=a;c=Ya(d,!1);)c=c.find(0,!0),
11
- b-=d.text.length-c.from.ch,d=c.to.line,b+=d.text.length-c.to.ch;return b}function Ja(a){var b=a.display;a=a.doc;b.maxLine=y(a,a.first);b.maxLineLength=Ia(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=Ia(a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function Sa(a){var b=Q(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):-1<b&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function ka(a){var b=a.display,
12
- c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Zc(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+sa(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function Ka(a,b,c){this.cm=c;var d=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=u("div",
13
- [u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d);a(e);z(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")});z(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;G&&8>E&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Za(){}function kc(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Kb(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=
14
- new n.scrollbarModel[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);z(b,"mousedown",function(){a.state.focused&&setTimeout(function(){a.display.input.focus()},0)});b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?ob(a,b):Lb(a,b)},a);a.display.scrollbars.addClass&&Mb(a.display.wrapper,a.display.scrollbars.addClass)}function ea(a,b){b||(b=ka(a));var c=a.display.barWidth,d=a.display.barHeight;mc(a,b);for(var e=0;4>e&&c!=a.display.barWidth||
15
- d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&V(a),mc(a,ka(a)),c=a.display.barWidth,d=a.display.barHeight}function mc(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="";d.bottom&&a.options.coverGutterNextToScrollbar&&
16
- a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function La(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop),e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,d=$a(b,d),e=$a(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;f<d?(d=f,e=$a(b,ta(y(b,f))+a.wrapper.clientHeight)):Math.min(c,b.lastLine())>=
17
- e&&(d=$a(b,ta(y(b,c))-a.wrapper.clientHeight),e=c)}return{from:d,to:Math.max(e,d+1)}}function Ha(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=H(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}
18
- function Pd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=x(a.options,b.first+b.size-1),c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(u("div",[u("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth,d=d.offsetWidth-e;c.lineGutter.style.width="";c.lineNumInnerWidth=Math.max(e,c.lineGutter.offsetWidth-d)+1;c.lineNumWidth=c.lineNumInnerWidth+d;c.lineNumChars=c.lineNumInnerWidth?b.length:-1;c.lineGutter.style.width=c.lineNumWidth+"px";Ba(a);
19
- return!0}return!1}function x(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function H(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function nc(a,b,c){var d=a.display;this.viewport=b;this.visible=La(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=d.wrapper.clientHeight;this.wrapperWidth=d.wrapper.clientWidth;this.oldDisplayWidth=Ma(a);this.force=c;this.dims=$c(a);this.events=[]}function ad(a,b){var c=a.display,d=a.doc;
20
- if(b.editorIsHidden)return Na(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Rd(a))return!1;Pd(a)&&(Na(a),b.dims=$c(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&20>f-c.viewFrom&&(f=Math.max(d.first,c.viewFrom));c.viewTo>g&&20>c.viewTo-g&&(g=Math.min(e,c.viewTo));Oa&&(f=bd(a.doc,f),g=
21
- Sd(a.doc,g));d=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=oc(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=oc(a,f,e.viewFrom).concat(e.view):e.viewFrom<f&&(e.view=e.view.slice(ab(a,f))),e.viewFrom=f,e.viewTo<g?e.view=e.view.concat(oc(a,e.viewTo,g)):e.viewTo>g&&(e.view=e.view.slice(0,ab(a,g))));e.viewTo=g;c.viewOffset=ta(y(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";g=
22
- Rd(a);if(!d&&0==g&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;f=ua();4<g&&(c.lineDiv.style.display="none");yf(a,c.updateLineNumbers,b.dims);4<g&&(c.lineDiv.style.display="");c.renderedView=c.view;f&&ua()!=f&&f.offsetHeight&&f.focus();Xa(c.cursorDiv);Xa(c.selectionDiv);c.gutters.style.height=c.sizer.style.minHeight=0;d&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Hb(a,400));c.updateLineNumbers=null;return!0}function Td(a,
23
- b){for(var c=b.viewport,d=!0;;d=!1){if(!d||!a.options.lineWrapping||b.oldDisplayWidth==Ma(a))if(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Zc(a.display)-cd(a),c.top)}),b.visible=La(a.display,a.doc,c),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!ad(a,b))break;V(a);d=ka(a);Nb(a);K(a,d);ea(a,d)}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),
24
- a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function dd(a,b){var c=new nc(a,b);if(ad(a,c)){V(a);Td(a,c);var d=ka(a);Nb(a);K(a,d);ea(a,d);c.finish()}}function K(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px";a.display.gutters.style.height=Math.max(c+sa(a),b.clientHeight)+"px"}function V(a){a=a.display;for(var b=a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d=a.view[c],
25
- e;if(!d.hidden){if(G&&8>E){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else e=d.node.getBoundingClientRect(),e=e.bottom-e.top;f=d.line.height-e;2>e&&(e=Va(a));if(.001<f||-.001>f)if(qa(d.line,e),va(d.line),d.rest)for(e=0;e<d.rest.length;e++)va(d.rest[e])}}}function va(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function $c(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=
26
- f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:H(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function yf(a,b,c){function d(b){var c=b.nextSibling;O&&la&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view,e=e.viewFrom,q=0;q<k.length;q++){var p=k[q];if(!p.hidden)if(p.node&&p.node.parentNode==
27
- g){for(;h!=p.node;)h=d(h);h=f&&null!=b&&b<=e&&p.lineNumber;p.changes&&(-1<Q(p.changes,"gutter")&&(h=!1),Ud(a,p,e,c));h&&(Xa(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(x(a.options,e))));h=p.node.nextSibling}else{var J=zf(a,p,e,c);g.insertBefore(J,h)}e+=p.size}for(;h;)h=d(h)}function Ud(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){var f=b,g=f.text.className,h=Vd(a,f);f.text==f.node&&(f.node=h.pre);f.text.parentNode.replaceChild(h.pre,f.text);f.text=
28
- h.pre;h.bgClass!=f.bgClass||h.textClass!=f.textClass?(f.bgClass=h.bgClass,f.textClass=h.textClass,ed(f)):g&&(f.text.className=g)}else if("gutter"==f)Wd(a,b,c,d);else if("class"==f)ed(b);else if("widget"==f){f=a;g=b;h=d;g.alignable&&(g.alignable=null);for(var k=g.node.firstChild,q=void 0;k;k=q)q=k.nextSibling,"CodeMirror-linewidget"==k.className&&g.node.removeChild(k);Xd(f,g,h)}}b.changes=null}function Pa(a){a.node==a.text&&(a.node=u("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,
29
- a.text),a.node.appendChild(a.text),G&&8>E&&(a.node.style.zIndex=2));return a.node}function Vd(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Yd(a,b)}function ed(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;b&&(b+=" CodeMirror-linebackground");if(a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=Pa(a);a.background=c.insertBefore(u("div",
30
- null,b),c.firstChild)}a.line.wrapClass?Pa(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass)||""}function Wd(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null);if(b.line.gutterClass){var e=Pa(b);b.gutterBackground=u("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?
31
- d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=Pa(b),g=b.gutter=u("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");a.display.input.setUneditable(g);e.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(u("div",
32
- x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(f)for(b=0;b<a.options.gutters.length;++b)c=a.options.gutters[b],(e=f.hasOwnProperty(c)&&f[c])&&g.appendChild(u("div",[e],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}function zf(a,b,c,d){var e=Vd(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);ed(b);
33
- Wd(a,b,c,d);Xd(a,b,d);return b.node}function Xd(a,b,c){Zd(a,b.line,b,c,!0);if(b.rest)for(var d=0;d<b.rest.length;d++)Zd(a,b.rest[d],b,c,!1)}function Zd(a,b,c,d,e){if(b.widgets){var f=Pa(c),g=0;for(b=b.widgets;g<b.length;++g){var h=b[g],k=u("div",[h.node],"CodeMirror-linewidget");h.handleMouseEvents||k.setAttribute("cm-ignore-events","true");var q=h,p=k,J=d;if(q.noHScroll){(c.alignable||(c.alignable=[])).push(p);var r=J.wrapperWidth;p.style.left=J.fixedPos+"px";q.coverGutter||(r-=J.gutterTotalWidth,
34
- p.style.paddingLeft=J.gutterTotalWidth+"px");p.style.width=r+"px"}q.coverGutter&&(p.style.zIndex=5,p.style.position="relative",q.noHScroll||(p.style.marginLeft=-J.gutterTotalWidth+"px"));a.display.input.setUneditable(k);e&&h.above?f.insertBefore(k,c.gutter||c.text):f.appendChild(k);Y(h,"redraw")}}}function fd(a){return t(a.line,a.ch)}function pb(a,b){return 0>B(a,b)?b:a}function bb(a,b){return 0>B(a,b)?a:b}function Ob(a){a.state.focused||(a.display.input.focus(),Xc(a))}function W(a){return a.options.readOnly||
35
- a.doc.cantEdit}function qb(a,b,c,d,e){var f=a.doc;a.display.shift=!1;d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=f.splitLines(b),k=null;if(g&&1<d.ranges.length)if(fa&&fa.join("\n")==b){if(0==d.ranges.length%fa.length)for(var k=[],q=0;q<fa.length;q++)k.push(f.splitLines(fa[q]))}else h.length==d.ranges.length&&(k=pc(h,function(a){return[a]}));for(q=d.ranges.length-1;0<=q;q--){var p=d.ranges[q],J=p.from(),r=p.to();p.empty()&&(c&&0<c?J=t(J.line,J.ch-c):a.state.overwrite&&!g&&(r=t(r.line,Math.min(y(f,
36
- r.line).text.length,r.ch+F(h).length))));p=a.curOp.updateInput;J={from:J,to:r,text:k?k[q%k.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};rb(a.doc,J);Y(a,"inputRead",a,J)}b&&!g&&C(a,b);sb(a);a.curOp.updateInput=p;a.curOp.typing=!0;a.state.pasteIncoming=a.state.cutIncoming=!1}function tb(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");if(c)return a.preventDefault(),W(b)||b.options.disableInput||Z(b,function(){qb(b,c,0,null,"paste")}),!0}function C(a,b){if(a.options.electricChars&&
37
- a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;0<=d;d--){var e=c.ranges[d];if(!(100<e.head.ch||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars)for(var h=0;h<f.electricChars.length;h++){if(-1<b.indexOf(f.electricChars.charAt(h))){g=Pb(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(y(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Pb(a,e.head.line,"smart"));g&&Y(a,"electricInput",a,e.head.line)}}}function ga(a){for(var b=
38
- [],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,e={anchor:t(e,0),head:t(e+1,0)};c.push(e);b.push(a.getRange(e.anchor,e.head))}return{text:b,ranges:c}}function l(a){a.setAttribute("autocorrect","off");a.setAttribute("autocapitalize","off");a.setAttribute("spellcheck","false")}function v(a){this.cm=a;this.prevInput="";this.pollingFast=!1;this.polling=new Ta;this.hasSelection=this.inaccurateSelection=!1;this.composing=null}function m(){var a=u("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),
39
- b=u("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");O?a.style.width="1000px":a.setAttribute("wrap","off");ub&&(a.style.border="1px solid black");l(a);return b}function gd(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Ta;this.gracePeriod=!1}function $d(a,b){var c=hd(a,b.line);if(!c||c.hidden)return null;var d=y(a.doc,b.line),c=ae(c,d,b.line),d=ma(d),e="left";d&&(e=qc(d,b.ch)%2?"right":"left");c=
40
- be(c.map,b.ch,e);c.offset="right"==c.collapse?c.end:c.start;return c}function vb(a,b){b&&(a.bad=!0);return a}function rc(a,b,c){var d;if(b==a.display.lineDiv){d=a.display.lineDiv.childNodes[c];if(!d)return vb(a.clipPos(t(a.display.viewTo-1)),!0);b=null;c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return Af(f,b,c)}}function Af(a,b,c){function d(b,
41
- c,d){for(var e=-1;e<(q?q.length:0);e++)for(var f=0>e?k.map:q[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){c=I(0>e?a.line:a.rest[e]);e=f[g]+d;if(0>d||h!=b)e=f[g+(d?1:0)];return t(c,e)}}}var e=a.text.firstChild,f=!1;if(!b||!id(e,b))return vb(t(I(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b))return c=a.rest?F(a.rest):a.line,vb(t(I(c),c.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,c&&(c=g.nodeValue.length));for(;h.parentNode!=
42
- e;)h=h.parentNode;var k=a.measure,q=k.maps;if(b=d(g,h,c))return vb(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-c:0;e;e=e.nextSibling){if(b=d(e,e.firstChild,0))return vb(t(b.line,b.ch-g),f);g+=e.textContent.length}h=h.previousSibling;for(g=c;h;h=h.previousSibling){if(b=d(h,h.firstChild,-1))return vb(t(b.line,b.ch+g),f);g+=e.textContent.length}}function Bf(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)""==c&&
43
- (c=b.textContent.replace(/\u200b/g,"")),h+=c;else{var c=b.getAttribute("cm-marker"),r;if(c)b=a.findMarks(t(d,0),t(e+1,0),f(+c)),b.length&&(r=b[0].find())&&(h+=cb(a.doc,r.from,r.to).join(q));else if("false"!=b.getAttribute("contenteditable")){for(r=0;r<b.childNodes.length;r++)g(b.childNodes[r]);/^(pre|div|p)#x2F;i.test(b.nodeName)&&(k=!0)}}}else 3==b.nodeType&&(b=b.nodeValue)&&(k&&(h+=q,k=!1),h+=b)}for(var h="",k=!1,q=a.doc.lineSeparator();;){g(b);if(b==c)break;b=b.nextSibling}return h}function Ca(a,
44
- b){this.ranges=a;this.primIndex=b}function D(a,b){this.anchor=a;this.head=b}function na(a,b){var c=a[b];a.sort(function(a,b){return B(a.from(),b.from())});b=Q(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(0<=B(e.to(),d.from())){var f=bb(e.from(),d.from()),g=pb(e.to(),d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new D(d?g:f,d?f:g))}}return new Ca(a,b)}function wa(a,b){return new Ca([new D(a,b||a)],0)}function A(a,b){if(b.line<a.first)return t(a.first,0);var c=
45
- a.first+a.size-1;if(b.line>c)return t(c,y(a,c).text.length);var c=y(a,b.line).text.length,d=b.ch,c=null==d||d>c?t(b.line,c):0>d?t(b.line,0):b;return c}function Qb(a,b){return b>=a.first&&b<a.first+a.size}function Rb(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,d&&(b=0>B(c,a),b!=0>B(d,a)?(a=c,c=d):b!=0>B(c,d)&&(c=d)),new D(a,c)):new D(d||c,c)}function sc(a,b,c,d){P(a,new Ca([Rb(a,a.sel.primary(),b,c)],0),d)}function ce(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=Rb(a,a.sel.ranges[e],
46
- b[e],null);b=na(d,a.sel.primIndex);P(a,b,c)}function jd(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;P(a,na(e,a.sel.primIndex),d)}function Cf(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new D(A(a,b[c].anchor),A(a,b[c].head))}};M(a,"beforeSelectionChange",a,c);a.cm&&M(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?na(c.ranges,c.ranges.length-1):b}function de(a,b,c){var d=a.history.done,e=F(d);e&&e.ranges?(d[d.length-1]=b,tc(a,
47
- b,c)):P(a,b,c)}function P(a,b,c){tc(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,g;if(!(g=d==e.lastSelOp)&&(g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=F(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:uc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastSelOp=
48
- d;c&&!1!==c.clearRedo&&ee(e.undone)}function tc(a,b,c){if(ha(a,"beforeSelectionChange")||a.cm&&ha(a.cm,"beforeSelectionChange"))b=Cf(a,b);var d=c&&c.bias||(0>B(b.primary().head,a.sel.primary().head)?-1:1);fe(a,ge(a,b,d,!0));c&&!1===c.scroll||!a.cm||sb(a.cm)}function fe(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,he(a.cm)),Y(a,"cursorActivity",a))}function ie(a){fe(a,ge(a,a.sel,null,!1),xa)}function ge(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=
49
- b.ranges[f],h=vc(a,g.anchor,c,d),k=vc(a,g.head,c,d);if(e||h!=g.anchor||k!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new D(h,k)}return e?na(e,b.primIndex):b}function vc(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=y(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var q=h.markedSpans[k],p=q.marker;if((null==q.from||(p.inclusiveLeft?q.from<=f.ch:q.from<f.ch))&&(null==q.to||(p.inclusiveRight?q.to>=f.ch:q.to>f.ch))){if(d&&(M(p,"beforeCursorEnter"),p.explicitlyCleared))if(h.markedSpans){--k;
50
- continue}else break;if(p.atomic){k=p.find(0>g?-1:1);if(0==B(k,f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?A(a,t(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?t(k.line+1,0):null),!k)){if(e){if(!d)return vc(a,b,c,!0);a.cantEdit=!0;return t(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}function Nb(a){a.display.input.showSelection(a.display.input.prepareSelection())}function je(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),
51
- g=0;g<c.sel.ranges.length;g++)if(!1!==b||g!=c.sel.primIndex){var h=c.sel.ranges[g],k=h.empty();(k||a.options.showCursorWhenSelecting)&&ke(a,h.head,e);k||Df(a,h,f)}return d}function ke(a,b,c){b=Da(a,b,"div",null,null,!a.options.singleCursorHeightPerLine);var d=c.appendChild(u("div","\u00a0","CodeMirror-cursor"));d.style.left=b.left+"px";d.style.top=b.top+"px";d.style.height=Math.max(0,b.bottom-b.top)*a.options.cursorHeight+"px";b.other&&(a=c.appendChild(u("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),
52
- a.style.display="",a.style.left=b.other.left+"px",a.style.top=b.other.top+"px",a.style.height=.85*(b.other.bottom-b.other.top)+"px")}function Df(a,b,c){function d(a,b,c,d){0>b&&(b=0);b=Math.round(b);d=Math.round(d);h.appendChild(u("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?p-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){var f=y(g,b),h=f.text.length,k,J;Ef(ma(f),c||0,null==e?h:e,function(g,l,m){var n=wc(a,t(b,g),"div",f,"left"),v,u;g==
53
- l?(v=n,m=u=n.left):(v=wc(a,t(b,l-1),"div",f,"right"),"rtl"==m&&(m=n,n=v,v=m),m=n.left,u=v.right);null==c&&0==g&&(m=q);3<v.top-n.top&&(d(m,n.top,null,n.bottom),m=q,n.bottom<v.top&&d(m,n.bottom,null,v.top));null==e&&l==h&&(u=p);if(!k||n.top<k.top||n.top==k.top&&n.left<k.left)k=n;if(!J||v.bottom>J.bottom||v.bottom==J.bottom&&v.right>J.right)J=v;m<q+1&&(m=q);d(m,v.top,u-m,v.bottom)});return{start:k,end:J}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=le(a.display),q=k.left,p=Math.max(f.sizerWidth,
54
- Ma(a)-f.sizer.offsetLeft)-k.right,f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var J=y(g,f.line),k=y(g,b.line),k=ya(J)==ya(k),f=e(f.line,f.ch,k?J.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(d(f.right,f.top,null,f.bottom),d(q,b.top,b.left,b.bottom)):d(f.right,f.top,b.left-f.right,f.bottom));f.bottom<b.top&&d(q,f.bottom,null,b.top)}c.appendChild(h)}function kd(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility=
55
- "";0<a.options.cursorBlinkRate?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function Hb(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Fb(Ff,a))}function Ff(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=Qa(b.mode,Sb(a,b.frontier)),e=[];b.iter(b.frontier,
56
- Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,k=me(a,f,h?Qa(b.mode,d):d,!0);f.styles=k.styles;var q=f.styleClasses;(k=k.classes)?f.styleClasses=k:q&&(f.styleClasses=null);q=!g||g.length!=f.styles.length||q!=k&&(!q||!k||q.bgClass!=k.bgClass||q.textClass!=k.textClass);for(k=0;!q&&k<g.length;++k)q=g[k]!=f.styles[k];q&&e.push(b.frontier);f.stateAfter=h?d:Qa(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&
57
- ld(a,f.text,d),f.stateAfter=0==b.frontier%5?Qa(b.mode,d):null;++b.frontier;if(+new Date>c)return Hb(a,a.options.workDelay),!0});e.length&&Z(a,function(){for(var b=0;b<e.length;b++)Ea(a,e[b],"text")})}}function Gf(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=y(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=oa(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function Sb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;
58
- var f=Gf(a,b,c),g=f>d.first&&y(d,f-1).stateAfter,g=g?Qa(d.mode,g):Hf(d.mode);d.iter(f,b,function(c){ld(a,c.text,g);c.stateAfter=f==b-1||0==f%5||f>=e.viewFrom&&f<e.viewTo?Qa(d.mode,g):null;++f});c&&(d.frontier=f);return g}function Zc(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function le(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=aa(a.measure,u("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};
59
- isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function sa(a){return Qd-a.display.nativeBarWidth}function Ma(a){return a.display.scroller.clientWidth-sa(a)-a.display.barWidth}function cd(a){return a.display.scroller.clientHeight-sa(a)-a.display.barHeight}function ae(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(d=0;d<a.rest.length;d++)if(I(a.rest[d])>c)return{map:a.measure.maps[d],
60
- cache:a.measure.caches[d],before:!0}}function hd(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[ab(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function xc(a,b){var c=I(b),d=hd(a,c);d&&!d.text?d=null:d&&d.changes&&(Ud(a,d,c,$c(a)),a.curOp.forceUpdate=!0);if(!d){var e;e=ya(b);d=I(e);e=a.display.externalMeasured=new ne(a.doc,e,d);e.lineN=d;d=e.built=Yd(a,e);e.text=d.pre;aa(a.display.lineMeasure,d.pre);d=e}c=ae(d,b,c);return{line:b,view:d,
61
- rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function md(a,b,c,d,e){b.before&&(c=-1);var f=c+(d||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,q=k&&Ma(a);if(!g.measure.heights||k&&g.measure.width!=q){var p=g.measure.heights=[];if(k)for(g.measure.width=q,g=g.text.firstChild.getClientRects(),k=0;k<g.length-1;k++){var q=g[k],J=g[k+1];2<Math.abs(q.bottom-J.bottom)&&
62
- p.push((q.bottom+J.top)/2-h.top)}p.push(h.bottom-h.top)}b.hasHeights=!0}g=d;k=be(b.map,c,g);d=k.node;h=k.start;q=k.end;c=k.collapse;var r;if(3==d.nodeType){for(p=0;4>p;p++){for(;h&&Tb(b.line.text.charAt(k.coverStart+h));)--h;for(;k.coverStart+q<k.coverEnd&&Tb(b.line.text.charAt(k.coverStart+q));)++q;if(G&&9>E&&0==h&&q==k.coverEnd-k.coverStart)r=d.parentNode.getBoundingClientRect();else if(G&&a.options.lineWrapping){var l=db(d,h,q).getClientRects();r=l.length?l["right"==g?l.length-1:0]:nd}else r=db(d,
63
- h,q).getBoundingClientRect()||nd;if(r.left||r.right||0==h)break;q=h;--h;c="right"}G&&11>E&&((l=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=od?l=od:(p=aa(a.display.measure,u("span","x")),l=p.getBoundingClientRect(),p=db(p,0,1).getBoundingClientRect(),l=od=1<Math.abs(l.left-p.left)),l=!l),l||(l=screen.logicalXDPI/screen.deviceXDPI,p=screen.logicalYDPI/screen.deviceYDPI,r={left:r.left*l,right:r.right*l,top:r.top*p,bottom:r.bottom*p}))}else 0<h&&(c=g="right"),
64
- r=a.options.lineWrapping&&1<(l=d.getClientRects()).length?l["right"==g?l.length-1:0]:d.getBoundingClientRect();!(G&&9>E)||h||r&&(r.left||r.right)||(r=(r=d.parentNode.getClientRects()[0])?{left:r.left,right:r.left+Ib(a.display),top:r.top,bottom:r.bottom}:nd);l=r.top-b.rect.top;d=r.bottom-b.rect.top;h=(l+d)/2;g=b.view.measure.heights;for(p=0;p<g.length-1&&!(h<g[p]);p++);c={left:("right"==c?r.right:r.left)-b.rect.left,right:("left"==c?r.left:r.right)-b.rect.left,top:p?g[p-1]:0,bottom:g[p]};r.left||r.right||
65
- (c.bogus=!0);a.options.singleCursorHeightPerLine||(c.rtop=l,c.rbottom=d);a=c;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function be(a,b,c){for(var d,e,f,g,h=0;h<a.length;h+=3){var k=a[h],q=a[h+1];if(b<k)e=0,f=1,g="left";else if(b<q)e=b-k,f=e+1;else if(h==a.length-3||b==q&&a[h+3]>b)f=q-k,e=f-1,b>=q&&(g="right");if(null!=e){d=a[h+2];k==q&&c==(d.insertLeft?"left":"right")&&(g=c);if("left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=
66
- a[(h-=3)+2],g="left";if("right"==c&&e==q-k)for(;h<a.length-3&&a[h+3]==a[h+4]&&!a[h+5].insertLeft;)d=a[(h+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:k,coverEnd:q}}function oe(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function pe(a){a.display.externalMeasure=null;Xa(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)oe(a.display.view[b])}function Jb(a){pe(a);a.display.cachedCharWidth=
67
- a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function pd(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Ub(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ta(b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+("window"==d?0:window.pageYOffset||
68
- (document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function qe(a,b,c){if("div"==c)return b;var d=b.left;b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=a.display.sizer.getBoundingClientRect(),d+=c.left,b+=c.top);
69
- a=a.display.lineSpace.getBoundingClientRect();return{left:d-a.left,top:b-a.top}}function wc(a,b,c,d,e){d||(d=y(a.doc,b.line));var f=d;b=b.ch;d=md(a,xc(a,d),b,e);return pd(a,f,d,c)}function Da(a,b,c,d,e,f){function g(b,g){var h=md(a,e,b,g?"right":"left",f);g?h.left=h.right:h.right=h.left;return pd(a,d,h,c)}function h(a,b){var c=k[b],d=c.level%2;a==qd(c)&&b&&c.level<k[b-1].level?(c=k[--b],a=rd(c)-(c.level%2?0:1),d=!0):a==rd(c)&&b<k.length-1&&c.level<k[b+1].level&&(c=k[++b],a=qd(c)-c.level%2,d=!1);return d&&
70
- a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||y(a.doc,b.line);e||(e=xc(a,d));var k=ma(d);b=b.ch;if(!k)return g(b);var q=qc(k,b),q=h(b,q);null!=Vb&&(q.other=h(b,Vb));return q}function re(a,b){var c=0;b=A(a.doc,b);a.options.lineWrapping||(c=Ib(a.display)*b.ch);var d=y(a.doc,b.line),e=ta(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function yc(a,b,c,d){a=t(a,b);a.xRel=d;c&&(a.outside=!0);return a}function sd(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return yc(d.first,
71
- 0,!0,-1);var e=$a(d,c),f=d.first+d.size-1;if(e>f)return yc(d.first+d.size-1,y(d,f).text.length,!0,1);0>b&&(b=0);for(d=y(d,e);;)if(e=If(a,d,e,b,c),f=(d=Ya(d,!1))&&d.find(0,!0),d&&(e.ch>f.from.ch||e.ch==f.from.ch&&0<e.xRel))e=I(d=f.to.line);else return e}function If(a,b,c,d,e){function f(d){d=Da(a,t(c,d),"line",b,q);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+k;h=!1;return d.left}var g=e-ta(b),h=!1,k=2*a.display.wrapper.clientWidth,q=xc(a,b),p=ma(b),l=b.text.length;e=zc(b);var r=Ac(b),
72
- m=f(e),n=h,v=f(r),u=h;if(d>v)return yc(c,r,u,1);for(;;){if(p?r==e||r==td(b,e,1):1>=r-e){p=d<m||d-m<=v-d?e:r;for(d-=p==e?m:v;Tb(b.text.charAt(p));)++p;return yc(c,p,p==e?n:u,-1>d?-1:1<d?1:0)}var y=Math.ceil(l/2),z=e+y;if(p)for(var z=e,w=0;w<y;++w)z=td(b,z,1);w=f(z);if(w>d){r=z;v=w;if(u=h)v+=1E3;l=y}else e=z,m=w,n=h,l-=y}}function Va(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==eb){eb=u("pre");for(var b=0;49>b;++b)eb.appendChild(document.createTextNode("x")),eb.appendChild(u("br"));
73
- eb.appendChild(document.createTextNode("x"))}aa(a.measure,eb);b=eb.offsetHeight/50;3<b&&(a.cachedTextHeight=b);Xa(a.measure);return b||1}function Ib(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=u("span","xxxxxxxxxx"),c=u("pre",[b]);aa(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function lb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,
74
- cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jf};wb?wb.ops.push(a.curOp):a.curOp.ownsGroup=wb={ops:[a.curOp],delayedCallbacks:[]}}function nb(a){if(a=a.curOp.ownsGroup)try{var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,
75
- e.cm)}}while(c<b.length)}finally{wb=null;for(b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++){var e=a[b],c=e.cm,f=d=c.display;!f.scrollbarsClipped&&f.scroller.offsetWidth&&(f.nativeBarWidth=f.scroller.offsetWidth-f.scroller.clientWidth,f.heightForcer.style.height=sa(c)+"px",f.sizer.style.marginBottom=-f.nativeBarWidth+"px",f.sizer.style.borderRightWidth=sa(c)+"px",f.scrollbarsClipped=!0);e.updateMaxLine&&Ja(c);e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||
76
- e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&c.options.lineWrapping;e.update=e.mustUpdate&&new nc(c,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}for(b=0;b<a.length;b++)e=a[b],e.updatedDisplay=e.mustUpdate&&ad(e.cm,e.update);for(b=0;b<a.length;b++)if(e=a[b],c=e.cm,d=c.display,e.updatedDisplay&&V(c),e.barMeasure=ka(c),d.maxLineChanged&&!c.options.lineWrapping&&(f=void 0,f=d.maxLine.text.length,f=md(c,xc(c,d.maxLine),f,
77
- void 0),e.adjustWidthTo=f.left+3,c.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+sa(c)+c.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-Ma(c))),e.updatedDisplay||e.selectionChanged)e.preparedSelection=d.input.prepareSelection();for(b=0;b<a.length;b++)e=a[b],c=e.cm,null!=e.adjustWidthTo&&(c.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<c.doc.scrollLeft&&ob(c,Math.min(c.display.scroller.scrollLeft,
78
- e.maxScrollLeft),!0),c.display.maxLineChanged=!1),e.preparedSelection&&c.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&K(c,e.barMeasure),(e.updatedDisplay||e.startHeight!=c.doc.height)&&ea(c,e.barMeasure),e.selectionChanged&&kd(c),c.state.focused&&e.updateInput&&c.display.input.reset(e.typing),!e.focus||e.focus!=ua()||document.hasFocus&&!document.hasFocus()||Ob(e.cm);for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;f=c.doc;e.updatedDisplay&&Td(c,e.update);null==d.wheelStartX||
79
- null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(d.wheelStartX=d.wheelStartY=null);null==e.scrollTop||d.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(f.scrollTop=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,e.scrollTop)),d.scrollbars.setScrollTop(f.scrollTop),d.scroller.scrollTop=f.scrollTop);null==e.scrollLeft||d.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(f.scrollLeft=Math.max(0,Math.min(d.scroller.scrollWidth-Ma(c),e.scrollLeft)),d.scrollbars.setScrollLeft(f.scrollLeft),
80
- d.scroller.scrollLeft=f.scrollLeft,Ha(c));if(e.scrollToPos){var g=void 0,h=A(f,e.scrollToPos.from),g=A(f,e.scrollToPos.to),k=e.scrollToPos.margin;null==k&&(k=0);for(var q=0;5>q;q++){var p=!1,l=Da(c,h),r=g&&g!=h?Da(c,g):l,r=Bc(c,Math.min(l.left,r.left),Math.min(l.top,r.top)-k,Math.max(l.left,r.left),Math.max(l.bottom,r.bottom)+k),m=c.doc.scrollTop,n=c.doc.scrollLeft;null!=r.scrollTop&&(Lb(c,r.scrollTop),1<Math.abs(c.doc.scrollTop-m)&&(p=!0));null!=r.scrollLeft&&(ob(c,r.scrollLeft),1<Math.abs(c.doc.scrollLeft-
81
- n)&&(p=!0));if(!p)break}g=l;e.scrollToPos.isCursor&&c.state.focused&&(ia(c,"scrollCursorIntoView")||(k=c.display,q=k.sizer.getBoundingClientRect(),h=null,0>g.top+q.top?h=!0:g.bottom+q.top>(window.innerHeight||document.documentElement.clientHeight)&&(h=!1),null==h||Kf||(g=u("div","\u200b",null,"position: absolute; top: "+(g.top-k.viewOffset-c.display.lineSpace.offsetTop)+"px; height: "+(g.bottom-g.top+sa(c)+k.barHeight)+"px; left: "+g.left+"px; width: 2px;"),c.display.lineSpace.appendChild(g),g.scrollIntoView(h),
82
- c.display.lineSpace.removeChild(g))))}h=e.maybeHiddenMarkers;g=e.maybeUnhiddenMarkers;if(h)for(k=0;k<h.length;++k)h[k].lines.length||M(h[k],"hide");if(g)for(k=0;k<g.length;++k)g[k].lines.length&&M(g[k],"unhide");d.wrapper.offsetHeight&&(f.scrollTop=c.display.scroller.scrollTop);e.changeObjs&&M(c,"changes",c,e.changeObjs);e.update&&e.update.finish()}}}function Z(a,b){if(a.curOp)return b();lb(a);try{return b()}finally{nb(a)}}function L(a,b){return function(){if(a.curOp)return b.apply(a,arguments);lb(a);
83
- try{return b.apply(a,arguments)}finally{nb(a)}}}function R(a){return function(){if(this.curOp)return a.apply(this,arguments);lb(this);try{return a.apply(this,arguments)}finally{nb(this)}}}function S(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);lb(b);try{return a.apply(this,arguments)}finally{nb(b)}}}function ne(a,b,c){for(var d=this.line=b,e;d=Ya(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);this.size=(this.rest=e)?I(F(this.rest))-c+1:1;this.node=this.text=null;
84
- this.hidden=Wa(a,b)}function oc(a,b,c){var d=[],e;for(e=b;e<c;)b=new ne(a.doc,y(a.doc,e),e),e+=b.size,d.push(b);return d}function U(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);d||(d=0);var e=a.display;d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)Oa&&bd(a.doc,b)<e.viewTo&&Na(a);else if(c<=e.viewFrom)Oa&&Sd(a.doc,c+d)>e.viewFrom?Na(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Na(a);
85
- else if(b<=e.viewFrom){var f=Cc(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Na(a)}else if(c>=e.viewTo)(f=Cc(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Na(a);else{var f=Cc(a,b,b,-1),g=Cc(a,c,c+d,1);f&&g?(e.view=e.view.slice(0,f.index).concat(oc(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):Na(a)}if(a=e.externalMeasured)c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&(e.externalMeasured=null)}function Ea(a,b,c){a.curOp.viewChanged=!0;var d=a.display,
86
- e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null);b<d.viewFrom||b>=d.viewTo||(a=d.view[ab(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==Q(a,c)&&a.push(c)))}function Na(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function ab(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Cc(a,b,c,d){var e=ab(a,
87
- b),f=a.display.view;if(!Oa||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=0,h=a.display.viewFrom;g<e;g++)h+=f[g].size;if(h!=b){if(0<d){if(e==f.length-1)return null;b=h+f[e].size-b;e++}else b=h-b;c+=b}for(;bd(a.doc,c)!=c;){if(e==(0>d?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Rd(a){a=a.display.view;for(var b=0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&!d.changes||++b}return b}function wf(a){function b(){d.activeTouch&&(e=setTimeout(function(){d.activeTouch=
88
- null},1E3),f=d.activeTouch,f.end=+new Date)}function c(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return 400<c*c+d*d}var d=a.display;z(d.scroller,"mousedown",L(a,Lf));G&&11>E?z(d.scroller,"dblclick",L(a,function(b){if(!ia(a,b)){var c=fb(a,b);!c||ud(a,b,"gutterClick",!0)||Fa(a.display,b)||(T(b),b=a.findWordAt(c),sc(a.doc,b.anchor,b.head))}})):z(d.scroller,"dblclick",function(b){ia(a,b)||T(b)});vd||z(d.scroller,"contextmenu",function(b){se(a,b)});var e,f={end:0};z(d.scroller,"touchstart",
89
- function(a){var b;1!=a.touches.length?b=!1:(b=a.touches[0],b=1>=b.radiusX&&1>=b.radiusY);b||(clearTimeout(e),b=+new Date,d.activeTouch={start:b,moved:!1,prev:300>=b-f.end?f:null},1==a.touches.length&&(d.activeTouch.left=a.touches[0].pageX,d.activeTouch.top=a.touches[0].pageY))});z(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)});z(d.scroller,"touchend",function(e){var f=d.activeTouch;if(f&&!Fa(d,e)&&null!=f.left&&!f.moved&&300>new Date-f.start){var g=a.coordsChar(d.activeTouch,
90
- "page"),f=!f.prev||c(f,f.prev)?new D(g,g):!f.prev.prev||c(f,f.prev.prev)?a.findWordAt(g):new D(t(g.line,0),A(a.doc,t(g.line+1,0)));a.setSelection(f.anchor,f.head);a.focus();T(e)}b()});z(d.scroller,"touchcancel",b);z(d.scroller,"scroll",function(){d.scroller.clientHeight&&(Lb(a,d.scroller.scrollTop),ob(a,d.scroller.scrollLeft,!0),M(a,"scroll",a))});z(d.scroller,"mousewheel",function(b){te(a,b)});z(d.scroller,"DOMMouseScroll",function(b){te(a,b)});z(d.wrapper,"scroll",function(){d.wrapper.scrollTop=
91
- d.wrapper.scrollLeft=0});d.dragFunctions={enter:function(b){ia(a,b)||Dc(b)},over:function(b){if(!ia(a,b)){var c=fb(a,b);if(c){var d=document.createDocumentFragment();ke(a,c,d);a.display.dragCursor||(a.display.dragCursor=u("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));aa(a.display.dragCursor,d)}Dc(b)}},start:function(b){if(G&&(!a.state.draggingText||100>+new Date-ue))Dc(b);else if(!ia(a,b)&&!Fa(a.display,b)&&(b.dataTransfer.setData("Text",
92
- a.getSelection()),b.dataTransfer.setDragImage&&!ve)){var c=u("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";pa&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop);b.dataTransfer.setDragImage(c,0,0);pa&&c.parentNode.removeChild(c)}},drop:L(a,Mf),leave:function(){we(a)}};var g=d.input.getField();z(g,"keyup",function(b){xe.call(a,b)});z(g,"keydown",L(a,ye));z(g,"keypress",L(a,ze));z(g,"focus",
93
- Fb(Xc,a));z(g,"blur",Fb(Gb,a))}function Nf(a){var b=a.display;if(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize()}function Fa(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function fb(a,b,c,d){var e=a.display;if(!c&&"true"==(b.target||b.srcElement).getAttribute("cm-not-content"))return null;
94
- var f,g;c=e.lineSpace.getBoundingClientRect();try{f=b.clientX-c.left,g=b.clientY-c.top}catch(k){return null}b=sd(a,f,g);var h;d&&1==b.xRel&&(h=y(a.doc,b.line).text).length==b.ch&&(d=oa(h,h.length,a.options.tabSize)-h.length,b=t(b.line,Math.max(0,Math.round((f-le(a.display).left)/Ib(a.display))-d)));return b}function Lf(a){var b=this.display;if(!(b.activeTouch&&b.input.supportsTouch()||ia(this,a)))if(b.shift=a.shiftKey,Fa(b,a))O||(b.scroller.draggable=!1,setTimeout(function(){b.scroller.draggable=
95
- !0},100));else if(!ud(this,a,"gutterClick",!0)){var c=fb(this,a);window.focus();switch(Ae(a)){case 1:this.state.selectingText?this.state.selectingText(a):c?Of(this,a,c):(a.target||a.srcElement)==b.scroller&&T(a);break;case 2:O&&(this.state.lastMiddleDown=+new Date);c&&sc(this.doc,c);setTimeout(function(){b.input.focus()},20);T(a);break;case 3:vd?se(this,a):Pf(this)}}}function Of(a,b,c){G?setTimeout(Fb(Ob,a),0):a.curOp.focus=ua();var d=+new Date,e;Ec&&Ec.time>d-400&&0==B(Ec.pos,c)?e="triple":Fc&&Fc.time>
96
- d-400&&0==B(Fc.pos,c)?(e="double",Ec={time:d,pos:c}):(e="single",Fc={time:d,pos:c});var d=a.doc.sel,f=la?b.metaKey:b.ctrlKey,g;a.options.dragDrop&&Qf&&!W(a)&&"single"==e&&-1<(g=d.contains(c))&&(0>B((g=d.ranges[g]).from(),c)||0<c.xRel)&&(0<B(g.to(),c)||0>c.xRel)?Rf(a,b,c,f):Sf(a,b,c,e,f)}function Rf(a,b,c,d){var e=a.display,f=+new Date,g=L(a,function(h){O&&(e.scroller.draggable=!1);a.state.draggingText=!1;za(document,"mouseup",g);za(e.scroller,"drop",g);10>Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-
97
- h.clientY)&&(T(h),!d&&+new Date-200<f&&sc(a.doc,c),O||G&&9==E?setTimeout(function(){document.body.focus();e.input.focus()},20):e.input.focus())});O&&(e.scroller.draggable=!0);a.state.draggingText=g;e.scroller.dragDrop&&e.scroller.dragDrop();z(document,"mouseup",g);z(e.scroller,"drop",g)}function Sf(a,b,c,d,e){function f(b){if(0!=B(v,b))if(v=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=oa(y(q,c.line).text,c.ch,f),h=oa(y(q,b.line).text,b.ch,f),k=Math.min(g,h),g=Math.max(g,h),h=Math.min(c.line,b.line),
98
- m=Math.min(a.lastLine(),Math.max(c.line,b.line));h<=m;h++){var n=y(q,h).text,u=Be(n,k,f);k==g?e.push(new D(t(h,u),t(h,u))):n.length>u&&e.push(new D(t(h,u),t(h,Be(n,g,f))))}e.length||e.push(new D(c,c));P(q,na(r.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else e=p,f=e.anchor,k=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new D(t(b.line,0),A(q,t(b.line+1,0))),0<B(b.anchor,f)?(k=b.head,f=bb(e.from(),b.anchor)):(k=b.anchor,f=pb(e.to(),b.head))),e=r.ranges.slice(0),
99
- e[l]=new D(A(q,f),k),P(q,na(e,l),wd)}function g(b){var c=++w,e=fb(a,b,!0,"rect"==d);if(e)if(0!=B(e,v)){a.curOp.focus=ua();f(e);var h=La(k,q);(e.line>=h.to||e.line<h.from)&&setTimeout(L(a,function(){w==c&&g(b)}),150)}else{var p=b.clientY<u.top?-20:b.clientY>u.bottom?20:0;p&&setTimeout(L(a,function(){w==c&&(k.scroller.scrollTop+=p,g(b))}),50)}}function h(b){a.state.selectingText=!1;w=Infinity;T(b);k.input.focus();za(document,"mousemove",G);za(document,"mouseup",F);q.history.lastSelOrigin=null}var k=
100
- a.display,q=a.doc;T(b);var p,l,r=q.sel,m=r.ranges;e&&!b.shiftKey?(l=q.sel.contains(c),p=-1<l?m[l]:new D(c,c)):(p=q.sel.primary(),l=q.sel.primIndex);if(b.altKey)d="rect",e||(p=new D(c,c)),c=fb(a,b,!0,!0),l=-1;else if("double"==d){var n=a.findWordAt(c);p=a.display.shift||q.extend?Rb(q,p,n.anchor,n.head):n}else"triple"==d?(n=new D(t(c.line,0),A(q,t(c.line+1,0))),p=a.display.shift||q.extend?Rb(q,p,n.anchor,n.head):n):p=Rb(q,p,c);e?-1==l?(l=m.length,P(q,na(m.concat([p]),l),{scroll:!1,origin:"*mouse"})):
101
- 1<m.length&&m[l].empty()&&"single"==d&&!b.shiftKey?(P(q,na(m.slice(0,l).concat(m.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),r=q.sel):jd(q,l,p,wd):(l=0,P(q,new Ca([p],0),wd),r=q.sel);var v=c,u=k.wrapper.getBoundingClientRect(),w=0,G=L(a,function(a){Ae(a)?g(a):h(a)}),F=L(a,h);a.state.selectingText=F;z(document,"mousemove",G);z(document,"mouseup",F)}function ud(a,b,c,d){try{var e=b.clientX,f=b.clientY}catch(k){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&T(b);
102
- d=a.display;var g=d.lineDiv.getBoundingClientRect();if(f>g.bottom||!ha(a,c))return xd(b);f-=g.top-d.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=d.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=e)return e=$a(a.doc,f),M(a,c,a,e,a.options.gutters[g],b),xd(b)}}function Mf(a){var b=this;we(b);if(!ia(b,a)&&!Fa(b.display,a)){T(a);G&&(ue=+new Date);var c=fb(b,a,!0),d=a.dataTransfer.files;if(c&&!W(b))if(d&&d.length&&window.FileReader&&window.File){var e=d.length,f=Array(e),g=0;a=
103
- function(a,d){if(!b.options.allowDropFileTypes||-1!=Q(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=L(b,function(){var a=h.result;/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a="");f[d]=a;++g==e&&(c=A(b.doc,c),a={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"},rb(b.doc,a),de(b.doc,wa(c,gb(a))))});h.readAsText(a)}};for(var h=0;h<e;++h)a(d[h],h)}else if(b.state.draggingText&&-1<b.doc.sel.contains(c))b.state.draggingText(a),setTimeout(function(){b.display.input.focus()},
104
- 20);else try{if(f=a.dataTransfer.getData("Text")){if(b.state.draggingText&&(la?!a.altKey:!a.ctrlKey))var k=b.listSelections();tc(b.doc,wa(c,c));if(k)for(h=0;h<k.length;++h)xb(b.doc,"",k[h].anchor,k[h].head,"drag");b.replaceSelection(f,"around","paste");b.display.input.focus()}}catch(q){}}}function we(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function Lb(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,Ua||dd(a,{top:b}),a.display.scroller.scrollTop!=
105
- b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),Ua&&dd(a),Hb(a,100))}function ob(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,Ha(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function te(a,b){var c=Ce(b),d=c.x,c=c.y,e=a.display,f=e.scroller,g=f.scrollWidth>f.clientWidth,h=f.scrollHeight>f.clientHeight;
106
- if(d&&g||c&&h){if(c&&la&&O){var g=b.target,k=e.view;a:for(;g!=f;g=g.parentNode)for(var q=0;q<k.length;q++)if(k[q].node==g){a.display.currentWheelTarget=g;break a}}!d||Ua||pa||null==ba?(c&&null!=ba&&(h=c*ba,g=a.doc.scrollTop,k=g+e.wrapper.clientHeight,0>h?g=Math.max(0,g+h-50):k=Math.min(a.doc.height,k+h+50),dd(a,{top:g,bottom:k})),20>Gc&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=d,e.wheelDY=c,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-
107
- e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(ba=(ba*Gc+a)/(Gc+1),++Gc)}},200)):(e.wheelDX+=d,e.wheelDY+=c))):(c&&h&&Lb(a,Math.max(0,Math.min(f.scrollTop+c*ba,f.scrollHeight-f.clientHeight))),ob(a,Math.max(0,Math.min(f.scrollLeft+d*ba,f.scrollWidth-f.clientWidth))),(!c||c&&h)&&T(b),e.wheelStartX=null)}}function Hc(a,b,c){if("string"==typeof b&&(b=Ic[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,
108
- e=!1;try{W(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=De}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function Tf(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=Wb(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&Wb(b,a.options.extraKeys,c,a)||Wb(b,a.options.keyMap,c,a)}function Jc(a,b,c,d){var e=a.state.keySeq;if(e){if(Uf(b))return"handled";Vf.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())});b=e+" "+
109
- b}d=Tf(a,b,d);"multi"==d&&(a.state.keySeq=b);"handled"==d&&Y(a,"keyHandled",a,b,c);if("handled"==d||"multi"==d)T(c),kd(a);return e&&!d&&/\'#x2F;.test(b)?(T(c),!0):!!d}function Ee(a,b){var c=Wf(b,!0);return c?b.shiftKey&&!a.state.keySeq?Jc(a,"Shift-"+c,b,function(b){return Hc(a,b,!0)})||Jc(a,c,b,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Hc(a,b)}):Jc(a,c,b,function(b){return Hc(a,b)}):!1}function Xf(a,b,c){return Jc(a,"'"+c+"'",b,function(b){return Hc(a,b,!0)})}function ye(a){this.curOp.focus=
110
- ua();if(!ia(this,a)){G&&11>E&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=Ee(this,a);pa&&(yd=c?b:null,!c&&88==b&&!Fe&&(la?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||Yf(this)}}function Yf(a){function b(a){18!=a.keyCode&&a.altKey||(Kb(c,"CodeMirror-crosshair"),za(document,"keyup",b),za(document,"mouseover",b))}var c=a.display.lineDiv;Mb(c,"CodeMirror-crosshair");
111
- z(document,"keyup",b);z(document,"mouseover",b)}function xe(a){16==a.keyCode&&(this.doc.sel.shift=!1);ia(this,a)}function ze(a){if(!(Fa(this.display,a)||ia(this,a)||a.ctrlKey&&!a.altKey||la&&a.metaKey)){var b=a.keyCode,c=a.charCode;if(pa&&b==yd)yd=null,T(a);else if(!pa||a.which&&!(10>a.which)||!Ee(this,a))if(b=String.fromCharCode(null==c?b:c),!Xf(this,a,b))this.display.input.onKeyPress(a)}}function Pf(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=
112
- !1,Gb(a))},100)}function Xc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1);"nocursor"!=a.options.readOnly&&(a.state.focused||(M(a,"focus",a),a.state.focused=!0,Mb(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),O&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),kd(a))}function Gb(a){a.state.delayingBlurEvent||(a.state.focused&&(M(a,"blur",a),a.state.focused=!1,Kb(a.display.wrapper,
113
- "CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function se(a,b){var c;(c=Fa(a.display,b))||(c=ha(a,"gutterContextMenu")?ud(a,b,"gutterContextMenu",!1):!1);if(!c&&!ia(a,b,"contextmenu"))a.display.input.onContextMenu(b)}function Ge(a,b){if(0>B(a,b.from))return a;if(0>=B(a,b.to))return gb(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=gb(b).ch-b.to.ch);return t(c,d)}function zd(a,b){for(var c=
114
- [],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new D(Ge(e.anchor,b),Ge(e.head,b)))}return na(c,a.sel.primIndex)}function He(a,b,c){return a.line==b.line?t(c.line,a.ch-b.ch+c.ch):t(c.line+(a.line-b.line),a.ch)}function Ie(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=A(a,b));c&&(this.to=A(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});M(a,"beforeChange",a,b);a.cm&&M(a.cm,
115
- "beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function rb(a,b,c){if(a.cm){if(!a.cm.curOp)return L(a.cm,rb)(a,b,c);if(a.cm.state.suppressEdits)return}if(ha(a,"beforeChange")||a.cm&&ha(a.cm,"beforeChange"))if(b=Ie(a,b,!0),!b)return;if(c=Je&&!c&&Zf(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)Ke(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else Ke(a,b)}function Ke(a,b){if(1!=b.text.length||""!=b.text[0]||0!=B(b.from,b.to)){var c=zd(a,b);Le(a,b,c,
116
- a.cm?a.cm.curOp.id:NaN);Xb(a,b,c,Ad(a,b));var d=[];hb(a,function(a,c){c||-1!=Q(d,a.history)||(Me(a.history,b),d.push(a.history));Xb(a,b,null,Ad(a,b))})}}function Kc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d=a.history,e,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,k=0;k<g.length&&(e=g[k],c?!e.ranges||e.equals(a.sel):e.ranges);k++);if(k!=g.length){for(d.lastOrigin=d.lastSelOrigin=null;;)if(e=g.pop(),e.ranges){uc(e,h);if(c&&!e.equals(a.sel)){P(a,e,{clearRedo:!1});return}f=
117
- e}else break;c=[];uc(f,h);h.push({changes:c,generation:d.generation});d.generation=e.generation||++d.maxGeneration;d=ha(a,"beforeChange")||a.cm&&ha(a.cm,"beforeChange");for(k=e.changes.length-1;0<=k;--k){var q=e.changes[k];q.origin=b;if(d&&!Ie(a,q,!1)){g.length=0;break}c.push(Bd(a,q));f=k?zd(a,q):F(g);Xb(a,q,f,Ne(a,q));!k&&a.cm&&a.cm.scrollIntoView({from:q.from,to:gb(q)});var p=[];hb(a,function(a,b){b||-1!=Q(p,a.history)||(Me(a.history,q),p.push(a.history));Xb(a,q,null,Ne(a,q))})}}}}function Oe(a,
118
- b){if(0!=b&&(a.first+=b,a.sel=new Ca(pc(a.sel.ranges,function(a){return new D(t(a.anchor.line+b,a.anchor.ch),t(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){U(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Ea(a.cm,d,"gutter")}}function Xb(a,b,c,d){if(a.cm&&!a.cm.curOp)return L(a.cm,Xb)(a,b,c,d);if(b.to.line<a.first)Oe(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);
119
- Oe(a,e);b={from:t(a.first,0),to:t(b.to.line+e,b.to.ch),text:[F(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:t(e,y(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=cb(a,b.from,b.to);c||(c=zd(a,b));a.cm?$f(a.cm,b,d):Cd(a,b,d);tc(a,c,xa)}}function $f(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=I(ya(y(d,f.line))),d.iter(k,g.line+1,function(a){if(a==e.maxLine)return h=!0}));-1<d.sel.contains(b.from,b.to)&&he(a);Cd(d,
120
- b,c,lc(a));a.options.lineWrapping||(d.iter(k,f.line+b.text.length,function(a){var b=Ia(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,f.line);Hb(a,400);c=b.text.length-(g.line-f.line)-1;b.full?U(a):f.line!=g.line||1!=b.text.length||Pe(a.doc,b)?U(a,f.line,g.line+1,c):Ea(a,f.line,"text");c=ha(a,"changes");if((d=ha(a,"change"))||c)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},d&&Y(a,"change",
121
- a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function xb(a,b,c,d,e){d||(d=c);if(0>B(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=a.splitLines(b));rb(a,{from:c,to:d,text:b,origin:e})}function Bc(a,b,c,d,e){var f=a.display,g=Va(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,k=cd(a),q={};e-c>k&&(e=c+k);var p=a.doc.height+Zc(f),l=c<g,g=e>p-g;c<h?q.scrollTop=l?0:c:e>h+k&&(c=Math.min(c,(g?p:e)-k),c!=h&&
122
- (q.scrollTop=c));h=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft;a=Ma(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0);(f=d-b>a)&&(d=b+a);10>b?q.scrollLeft=0:b<h?q.scrollLeft=Math.max(0,b-(f?0:10)):d>a+h-3&&(q.scrollLeft=d+(f?0:10)-a);return q}function Lc(a,b,c){null==b&&null==c||Mc(a);null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+
123
- c)}function sb(a){Mc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?t(b.line,b.ch-1):b,d=t(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Mc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=re(a,b.from),d=re(a,b.to),b=Bc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function Pb(a,b,c,d){var e=a.doc,
124
- f;null==c&&(c="add");"smart"==c&&(e.mode.indent?f=Sb(a,b):c="prev");var g=a.options.tabSize,h=y(e,b),k=oa(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var q=h.text.match(/^\s*/)[0],p;if(!d&&!/\S/.test(h.text))p=0,c="not";else if("smart"==c&&(p=e.mode.indent(f,h.text.slice(q.length),h.text),p==De||150<p)){if(!d)return;c="prev"}"prev"==c?p=b>e.first?oa(y(e,b-1).text,null,g):0:"add"==c?p=k+a.options.indentUnit:"subtract"==c?p=k-a.options.indentUnit:"number"==typeof c&&(p=k+c);p=Math.max(0,p);c="";
125
- d=0;if(a.options.indentWithTabs)for(a=Math.floor(p/g);a;--a)d+=g,c+="\t";d<p&&(c+=Qe(p-d));if(c!=q)return xb(e,c,t(b,0),t(b,q.length),"+input"),h.stateAfter=null,!0;for(a=0;a<e.sel.ranges.length;a++)if(g=e.sel.ranges[a],g.head.line==b&&g.head.ch<q.length){d=t(b,q.length);jd(e,a,new D(d,d));break}}function Nc(a,b,c,d){var e=b,f=b;"number"==typeof b?f=y(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=I(b);if(null==e)return null;d(f,e)&&a.cm&&Ea(a.cm,e,c);return f}function yb(a,b){for(var c=a.doc.sel.ranges,
126
- d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&0>=B(f.from,F(d).to);){var g=d.pop();if(0>B(g.from,f.from)){f.from=g.from;break}}d.push(f)}Z(a,function(){for(var b=d.length-1;0<=b;b--)xb(a.doc,"",d[b].from,d[b].to,"+delete");sb(a)})}function Dd(a,b,c,d,e){function f(b){var d=(e?td:Re)(q,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=p=!1:(g=b,b=q=y(a,b));if(b)h=e?(0>c?Ac:zc)(q):0>c?q.text.length:0;else return p=!1}else h=d;return!0}var g=b.line,h=b.ch,k=c,q=y(a,g),p=!0;if("char"==
127
- d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var l=null;d="group"==d;b=a.cm&&a.cm.getHelper(b,"wordChars");for(var r=!0;!(0>c)||f(!r);r=!1){var m=q.text.charAt(h)||"\n",m=Oc(m,b)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";!d||r||m||(m="s");if(l&&l!=m){0>c&&(c=1,f());break}m&&(l=m);if(0<c&&!f(!r))break}}k=vc(a,t(g,h),k,!0);p||(k.hitSide=!0);return k}function Se(a,b,c,d){var e=a.doc,f=b.left,g;for("page"==d?g=b.top+c*(Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-
128
- (0>c?1.5:.5)*Va(a.display)):"line"==d&&(g=0<c?b.bottom+3:b.top-3);;){b=sd(a,f,g);if(!b.outside)break;if(0>c?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*c}return b}function w(a,b,c,d){n.defaults[a]=b;c&&(mb[a]=d?function(a,b,d){d!=Od&&c(a,b,d)}:c)}function ag(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g<b.length-1;g++){var h=b[g];if(/^(cmd|meta|m)#x2F;i.test(h))f=!0;else if(/^a(lt)?#x2F;i.test(h))c=!0;else if(/^(c|ctrl|control)#x2F;i.test(h))d=!0;else if(/^s(hift)#x2F;i.test(h))e=!0;else throw Error("Unrecognized modifier name: "+
129
- h);}c&&(a="Alt-"+a);d&&(a="Ctrl-"+a);f&&(a="Cmd-"+a);e&&(a="Shift-"+a);return a}function Pc(a){return"string"==typeof a?Ra[a]:a}function zb(a,b,c,d,e){if(d&&d.shared)return bg(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return L(a.cm,zb)(a,b,c,d,e);var f=new ib(a,e);e=B(b,c);d&&ja(d,f,!1);if(0<e||0==e&&!1!==f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=u("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&
130
- (f.widgetNode.insertLeft=!0));if(f.collapsed){if(Te(a,b.line,b,c,f)||b.line!=c.line&&Te(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");Oa=!0}f.addToHistory&&Le(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var g=b.line,h=a.cm,k;a.iter(g,c.line+1,function(a){h&&f.collapsed&&!h.options.lineWrapping&&ya(a)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&qa(a,0);var d=new Qc(f,g==b.line?b.ch:null,g==c.line?c.ch:null);a.markedSpans=a.markedSpans?a.markedSpans.concat([d]):
131
- [d];d.marker.attachLine(a);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){Wa(a,b)&&qa(b,0)});f.clearOnEnter&&z(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(Je=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());f.collapsed&&(f.id=++Ed,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)U(h,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(d=b.line;d<=c.line;d++)Ea(h,d,"text");f.atomic&&ie(h.doc);Y(h,"markerAdded",
132
- h,f)}return f}function bg(a,b,c,d,e){d=ja(d);d.shared=!1;var f=[zb(a,b,c,d,e)],g=f[0],h=d.widgetNode;hb(a,function(a){h&&(d.widgetNode=h.cloneNode(!0));f.push(zb(a,A(a,b),A(a,c),d,e));for(var q=0;q<a.linked.length;++q)if(a.linked[q].isParent)return;g=F(f)});return new Rc(f,g)}function Ue(a){return a.findMarks(t(a.first,0),a.clipPos(t(a.lastLine())),function(a){return a.parent})}function cg(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];hb(c.primary.doc,function(a){d.push(a)});for(var e=
133
- 0;e<c.markers.length;e++){var f=c.markers[e];-1==Q(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function Qc(a,b,c){this.marker=a;this.from=b;this.to=c}function Yb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Ad(a,b){if(b.full)return null;var c=Qb(a,b.from.line)&&y(a,b.from.line).markedSpans,d=Qb(a,b.to.line)&&y(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==B(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var q=c[h],p=q.marker;
134
- if(null==q.from||(p.inclusiveLeft?q.from<=e:q.from<e)||!(q.from!=e||"bookmark"!=p.type||g&&q.marker.insertLeft)){var l=null==q.to||(p.inclusiveRight?q.to>=e:q.to>e);(k||(k=[])).push(new Qc(p,q.from,l?null:q.to))}}c=k;if(d)for(var h=0,r;h<d.length;++h)if(k=d[h],q=k.marker,null==k.to||(q.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&"bookmark"==q.type&&(!g||k.marker.insertLeft))p=null==k.from||(q.inclusiveLeft?k.from<=f:k.from<f),(r||(r=[])).push(new Qc(q,p?null:k.from-f,null==k.to?null:k.to-f));d=r;g=
135
- 1==b.text.length;r=F(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=c[f],null==h.to)(k=Yb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+r):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=r),null==h.from?(k=Yb(c,h.marker),k||(h.from=r,g&&(c||(c=[])).push(h))):(h.from+=r,g&&(c||(c=[])).push(h));c&&(c=Ve(c));d&&d!=c&&(d=Ve(d));e=[c];if(!g){var g=b.text.length-2,m;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(m||(m=[])).push(new Qc(c[f].marker,null,null));for(f=0;f<g;++f)e.push(m);
136
- e.push(d)}return e}function Ve(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&!1!==c.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function Ne(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(dg(c[d]));c=e}else c=null;d=Ad(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],q=0;q<f.length;++q)if(f[q].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=
137
- g)}return c}function Zf(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=Q(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(0),f=0;f<a.length;++f){var g=a[f];if(!(0>B(g.to,e.from)||0<B(g.from,e.to))){var h=[f,1],k=B(g.from,e.from),q=B(g.to,e.to);(0>k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<q||!c.inclusiveRight&&
138
- !q)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function We(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Xe(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Ye(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=B(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=B(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?
139
- 1:0))?c:b.id-a.id}function Ya(a,b){var c=Oa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||0>Ye(d,e.marker))&&(d=e.marker);return d}function Te(a,b,c,d,e){a=y(a,b);if(a=Oa&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var g=f.marker.find(0),h=B(g.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=B(g.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&(0<
140
- B(g.to,c)||f.marker.inclusiveRight&&e.inclusiveLeft)||0<=h&&(0>B(g.from,d)||f.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function ya(a){for(var b;b=Ya(a,!0);)a=b.find(-1,!0).line;return a}function bd(a,b){var c=y(a,b),d=ya(c);return c==d?b:I(d)}function Sd(a,b){if(b>a.lastLine())return b;var c=y(a,b),d;if(!Wa(a,c))return b;for(;d=Ya(c,!1);)c=d.find(1,!0).line;return I(c)+1}function Wa(a,b){var c=Oa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||
141
- !d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&Fd(a,b,d)))return!0}function Fd(a,b,c){if(null==c.to)return b=c.marker.find(1,!0),Fd(a,b.line,Yb(b.line.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(null==d.to||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Fd(a,b,d))return!0}function Ub(a){if(null!=a.height)return a.height;
142
- var b=a.doc.cm;if(!b)return 0;if(!id(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;");a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;");aa(b.display.measure,u("div",[a.node],null,c))}return a.height=a.node.offsetHeight}function eg(a,b,c,d){var e=new Sc(a,c,d),f=a.cm;f&&e.noHScroll&&(f.display.alignWidgets=!0);Nc(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-
143
- 1,Math.max(0,e.insertAt)),0,e);e.line=b;f&&!Wa(a,b)&&(c=ta(b)<a.scrollTop,qa(b,b.height+Ub(e)),c&&Lc(f,null,e.height),f.curOp.forceUpdate=!0);return!0});return e}function Ze(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:(new RegExp("(?:^|s)"+c[2]+"(?:$|s)")).test(b[d])||(b[d]+=" "+c[2])}return a}function $e(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=
144
- n.innerMode(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}function Gd(a,b,c,d){for(var e=0;10>e;e++){d&&(d[0]=n.innerMode(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");}function af(a,b,c,d){function e(a){return{start:p.start,end:p.pos,string:p.current(),type:h||null,state:a?Qa(f.mode,q):q}}var f=a.doc,g=f.mode,h;b=A(f,b);var k=y(f,b.line),q=Sb(a,b.line,c),p=new Tc(k.text,a.options.tabSize),l;for(d&&(l=[]);(d||p.pos<b.ch)&&
145
- !p.eol();)p.start=p.pos,h=Gd(g,p,q),d&&l.push(e(!0));return d?l:e()}function bf(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,q=null,p=new Tc(b,a.options.tabSize),l,r=a.options.addModeClass&&[null];for(""==b&&Ze($e(c,d),f);!p.eol();){p.pos>a.options.maxHighlightLength?(h=!1,g&&ld(a,b,d,p.pos),p.pos=b.length,l=null):l=Ze(Gd(c,p,d,r),f);if(r){var m=r[0].name;m&&(l="m-"+(l?m+" "+l:m))}if(!h||q!=l){for(;k<p.start;)k=Math.min(p.start,k+5E4),e(k,q);q=l}p.start=p.pos}for(;k<
146
- p.pos;)a=Math.min(p.pos,k+5E4),e(a,q),k=a}function me(a,b,c,d){var e=[a.state.modeGen],f={};bf(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(c=0;c<a.state.overlays.length;++c){var g=a.state.overlays[c],h=1,k=0;bf(a,b.text,g.mode,!0,function(a,b){for(var c=h;k<a;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d);h+=2;k=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,"cm-overlay "+b),h=c+2;else for(;c<h;c+=2)d=e[c+1],e[c+1]=(d?d+" ":"")+"cm-overlay "+b},f)}return{styles:e,classes:f.bgClass||f.textClass?
147
- f:null}}function cf(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Sb(a,I(b)),e=me(a,b,b.text.length>a.options.maxHighlightLength?Qa(a.doc.mode,d):d);b.stateAfter=d;b.styles=e.styles;e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null);c===a.doc.frontier&&a.doc.frontier++}return b.styles}function ld(a,b,c,d){var e=a.doc.mode;a=new Tc(b,a.options.tabSize);a.start=a.pos=d||0;for(""==b&&$e(e,c);!a.eol();)Gd(e,a,c),a.start=a.pos}function df(a,b){if(!a||/^\s*#x2F;.test(a))return null;
148
- var c=b.addModeClass?fg:gg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-amp;"))}function Yd(a,b){var c=u("span",null,null,O?"padding-right: .1px":null),c={pre:u("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,splitSpaces:(G||O)&&a.getOption("lineWrapping")};b.measure={};for(var d=0;d<=(b.rest?b.rest.length:0);d++){var e=d?b.rest[d-1]:b.line,f;c.pos=0;c.addToken=hg;var g;if(null!=Hd)g=Hd;else{g=aa(a.display.measure,document.createTextNode("A\u062eA"));var h=db(g,0,1).getBoundingClientRect();g=h&&
149
- h.left!=h.right?Hd=3>db(g,1,2).getBoundingClientRect().right-h.right:!1}g&&(f=ma(e))&&(c.addToken=ig(c.addToken,f));c.map=[];h=b!=a.display.externalMeasured&&I(e);a:{g=c;var h=cf(a,e,h),k=e.markedSpans,q=e.text,l=0;if(k)for(var m=q.length,r=0,n=1,v="",t=void 0,y=void 0,w=0,z=void 0,A=void 0,B=void 0,F=void 0,x=void 0;;){if(w==r){for(var z=A=B=F=y="",x=null,w=Infinity,H=[],C=0;C<k.length;++C){var D=k[C],E=D.marker;"bookmark"==E.type&&D.from==r&&E.widgetNode?H.push(E):D.from<=r&&(null==D.to||D.to>r||
150
- E.collapsed&&D.to==r&&D.from==r)?(null!=D.to&&D.to!=r&&w>D.to&&(w=D.to,A=""),E.className&&(z+=" "+E.className),E.css&&(y=(y?y+";":"")+E.css),E.startStyle&&D.from==r&&(B+=" "+E.startStyle),E.endStyle&&D.to==w&&(A+=" "+E.endStyle),E.title&&!F&&(F=E.title),E.collapsed&&(!x||0>Ye(x.marker,E))&&(x=D)):D.from>r&&w>D.from&&(w=D.from)}if(x&&(x.from||0)==r){ef(g,(null==x.to?m+1:x.to)-r,x.marker,null==x.from);if(null==x.to)break a;x.to==r&&(x=!1)}if(!x&&H.length)for(C=0;C<H.length;++C)ef(g,0,H[C])}if(r>=m)break;
151
- for(H=Math.min(m,w);;){if(v){C=r+v.length;x||(D=C>H?v.slice(0,H-r):v,g.addToken(g,D,t?t+z:z,B,r+D.length==w?A:"",F,y));if(C>=H){v=v.slice(H-r);r=H;break}r=C;B=""}v=q.slice(l,l=h[n++]);t=df(h[n++],g.cm.options)}}else for(var n=1;n<h.length;n+=2)g.addToken(g,q.slice(l,l=h[n]),df(h[n+1],g.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(c.bgClass=Id(e.styleClasses.bgClass,c.bgClass||"")),e.styleClasses.textClass&&(c.textClass=Id(e.styleClasses.textClass,c.textClass||"")));0==c.map.length&&c.map.push(0,
152
- 0,c.content.appendChild(jg(a.display.measure)));0==d?(b.measure.map=c.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(c.map),(b.measure.caches||(b.measure.caches=[])).push({}))}O&&/\bcm-tab\b/.test(c.content.lastChild.className)&&(c.content.className="cm-tab-wrap-hack");M(a,"renderLine",a,b.line,c.pre);c.pre.className&&(c.textClass=Id(c.pre.className,c.textClass||""));return c}function hg(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,kg):b,k=a.cm.state.specialChars,
153
- q=!1;if(k.test(b))for(var l=document.createDocumentFragment(),m=0;;){k.lastIndex=m;var r=k.exec(b),n=r?r.index-m:b.length-m;if(n){var v=document.createTextNode(h.slice(m,m+n));G&&9>E?l.appendChild(u("span",[v])):l.appendChild(v);a.map.push(a.pos,a.pos+n,v);a.col+=n;a.pos+=n}if(!r)break;m+=n+1;"\t"==r[0]?(v=a.cm.options.tabSize,r=v-a.col%v,v=l.appendChild(u("span",Qe(r),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),a.col+=r):("\r"==r[0]||"\n"==r[0]?(v=l.appendChild(u("span",
154
- "\r"==r[0]?"\u240d":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",r[0])):(v=a.cm.options.specialCharPlaceholder(r[0]),v.setAttribute("cm-text",r[0]),G&&9>E?l.appendChild(u("span",[v])):l.appendChild(v)),a.col+=1);a.map.push(a.pos,a.pos+1,v);a.pos++}else{a.col+=b.length;var l=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,l);G&&9>E&&(q=!0);a.pos+=b.length}if(c||d||e||q||g)return b=c||"",d&&(b+=d),e&&(b+=e),d=u("span",[l],b,g),f&&(d.title=f),a.content.appendChild(d);a.content.appendChild(l)}}
155
- function kg(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":"\u00a0";return b+" "}function ig(a,b){return function(c,d,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var q=c.pos,l=q+d.length;;){for(var m=0;m<b.length;m++){var r=b[m];if(r.to>q&&r.from<=q)break}if(r.to>=l)return a(c,d,e,f,g,h,k);a(c,d.slice(0,r.to-q),e,f,null,h,k);f=null;d=d.slice(r.to-q);q=r.to}}}function ef(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!d&&a.cm.display.input.needsContentAttribute&&(e||
156
- (e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b}function Pe(a,b){return 0==b.from.ch&&0==b.to.ch&&""==F(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Cd(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);We(a);Xe(a,e);c=d?d(a):1;c!=a.height&&qa(a,c);Y(a,"change",a,b)}function f(a,b){for(var e=
157
- a,f=[];e<b;++e)f.push(new Zb(k[e],c?c[e]:null,d));return f}var g=b.from,h=b.to,k=b.text,q=y(a,g.line),l=y(a,h.line),m=F(k),r=c?c[k.length-1]:null,n=h.line-g.line;if(b.full)a.insert(0,f(0,k.length)),a.remove(k.length,a.size-k.length);else if(Pe(a,b)){var v=f(0,k.length-1);e(l,l.text,r);n&&a.remove(g.line,n);v.length&&a.insert(g.line,v)}else q==l?1==k.length?e(q,q.text.slice(0,g.ch)+m+q.text.slice(h.ch),r):(v=f(1,k.length-1),v.push(new Zb(m+q.text.slice(h.ch),r,d)),e(q,q.text.slice(0,g.ch)+k[0],c?c[0]:
158
- null),a.insert(g.line+1,v)):1==k.length?(e(q,q.text.slice(0,g.ch)+k[0]+l.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,n)):(e(q,q.text.slice(0,g.ch)+k[0],c?c[0]:null),e(l,m+l.text.slice(h.ch),r),v=f(1,k.length-1),1<n&&a.remove(g.line+1,n-1),a.insert(g.line+1,v));Y(a,"change",a,b)}function $b(a){this.lines=a;this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function ac(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d],b=b+e.chunkSize(),
159
- c=c+e.height;e.parent=this}this.size=b;this.height=c;this.parent=null}function hb(a,b,c){function d(a,f,g){if(a.linked)for(var h=0;h<a.linked.length;++h){var k=a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function Nd(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;Ga(a);Aa(a);a.options.lineWrapping||Ja(a);a.options.mode=b.modeOption;U(a)}function y(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+
160
- " in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function cb(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function Jd(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function qa(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function I(a){if(null==a.parent)return null;
161
- var b=a.parent;a=Q(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function $a(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+d}function ta(a){a=ya(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;
162
- else b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length&&(e=a.children[d],e!=c);++d)b+=e.height;return b}function ma(a){var b=a.order;null==b&&(b=a.order=lg(a.text));return b}function Uc(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a||1}function Bd(a,b){var c={from:fd(b.from),to:gb(b),text:cb(a,b.from,b.to)};ff(a,c,b.from.line,b.to.line+
163
- 1);hb(a,function(a){ff(a,c,b.from.line,b.to.line+1)},!0);return c}function ee(a){for(;a.length;)if(F(a).ranges)a.pop();else break}function Le(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g,h;if(h=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==d?(ee(e.done),g=F(e.done)):e.done.length&&!F(e.done).ranges?g=F(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),
164
- g=F(e.done)):g=void 0,h=g;if(h){var k=F(g.changes);0==B(b.from,b.to)&&0==B(b.from,k.to)?k.to=gb(b):g.changes.push(Bd(a,b))}else for((g=F(e.done))&&g.ranges||uc(a.sel,e.done),g={changes:[Bd(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;k||M(a,"historyAdded")}function uc(a,b){var c=F(b);c&&
165
- c.ranges&&c.equals(a)||b.push(a)}function ff(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function dg(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ab(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?Ca.prototype.deepCopy.call(f):f);else{var f=f.changes,
166
- g=[];e.push({changes:g});for(var h=0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var p in k)(l=p.match(/^spans_(\d+)#x2F;))&&-1<Q(b,Number(l[1]))&&(F(g)[p]=k[p],delete k[p])}}}return e}function gf(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function hf(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)gf(f.ranges[h].anchor,b,c,d),gf(f.ranges[h].head,b,c,d)}else{for(h=
167
- 0;h<f.changes.length;++h){var k=f.changes[h];if(c<k.from.line)k.from=t(k.from.line+d,k.from.ch),k.to=t(k.to.line+d,k.to.ch);else if(b<=k.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function Me(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;hf(a.done,c,d,e);hf(a.undone,c,d,e)}function xd(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Ae(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));la&&a.ctrlKey&&1==b&&(b=3);return b}function Vc(a,
168
- b,c){a=a._handlers&&a._handlers[b];return c?a&&0<a.length?a.slice():jf:a||jf}function Y(a,b){function c(a){return function(){a.apply(null,e)}}var d=Vc(a,b,!1);if(d.length){var e=Array.prototype.slice.call(arguments,2),f;wb?f=wb.delayedCallbacks:bc?f=bc:(f=bc=[],setTimeout(mg,0));for(var g=0;g<d.length;++g)f.push(c(d[g]))}}function mg(){var a=bc;bc=null;for(var b=0;b<a.length;++b)a[b]()}function ia(a,b,c){"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}});M(a,c||b.type,
169
- a,b);return xd(b)||b.codemirrorIgnore}function he(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var c=0;c<b.length;++c)-1==Q(a,b[c])&&a.push(b[c])}}function ha(a,b){return 0<Vc(a,b).length}function Bb(a){a.prototype.on=function(a,c){z(this,a,c)};a.prototype.off=function(a,c){za(this,a,c)}}function Ta(){this.id=null}function Qe(a){for(;Wc.length<=a;)Wc.push(F(Wc)+" ");return Wc[a]}function F(a){return a[a.length-1]}
170
- function Q(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function pc(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function cc(){}function kf(a,b){var c;Object.create?c=Object.create(a):(cc.prototype=a,c=new cc);b&&ja(b,c);return c}function ja(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||!1===c&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Fb(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Oc(a,b){return b?
171
- -1<b.source.indexOf("\\w")&&lf(a)?!0:b.test(a):lf(a)}function mf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Tb(a){return 768<=a.charCodeAt(0)&&ng.test(a)}function u(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Xa(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function aa(a,
172
- b){return Xa(a).appendChild(b)}function ua(){for(var a=document.activeElement;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function dc(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Id(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!dc(c[d]).test(b)&&(b+=" "+c[d]);return b}function nf(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function xf(){var a;z(window,
173
- "resize",function(){null==a&&(a=setTimeout(function(){a=null;nf(Nf)},100))});z(window,"blur",function(){nf(Gb)})}function jg(a){if(null==Kd){var b=u("span","\u200b");aa(a,u("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Kd=1>=b.offsetWidth&&2<b.offsetHeight&&!(G&&8>E))}a=Kd?u("span","\u200b"):u("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text","");return a}function Ef(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<
174
- a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function qd(a){return a.level%2?a.to:a.from}function rd(a){return a.level%2?a.from:a.to}function zc(a){return(a=ma(a))?qd(a[0]):0}function Ac(a){var b=ma(a);return b?rd(F(b)):a.text.length}function of(a,b){var c=y(a.doc,b),d=ya(c);d!=c&&(b=I(d));d=(c=ma(d))?c[0].level%2?Ac(d):zc(d):0;return t(b,d)}function pf(a,b){var c=of(a,b.line),d=y(a.doc,c.line),e=ma(d);
175
- return e&&0!=e[0].level?c:(d=Math.max(0,d.text.search(/\S/)),t(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d))}function qc(a,b){Vb=null;for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return c;if(e.from==b||e.to==b)if(null==d)d=c;else{var f;f=e.level;var g=a[d].level,h=a[0].level;f=f==h?!0:g==h?!1:f<g;if(f)return e.from!=e.to&&(Vb=d),c;e.from!=e.to&&(Vb=c);break}}return d}function Ld(a,b,c,d){if(!d)return b+c;do b+=c;while(0<b&&Tb(a.text.charAt(b)));return b}function td(a,b,c,d){var e=ma(a);
176
- if(!e)return Re(a,b,c,d);var f=qc(e,b),g=e[f];for(b=Ld(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(qc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?Ld(a,g.to,-1,d):Ld(a,g.from,1,d)}}function Re(a,b,c,d){b+=c;if(d)for(;0<b&&Tb(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var ca=navigator.userAgent,qf=navigator.platform,Ua=/gecko\/\d/i.test(ca),rf=/MSIE \d/.test(ca),sf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ca),
177
- G=rf||sf,E=G&&(rf?document.documentMode||6:sf[1]),O=/WebKit\//.test(ca),og=O&&/Qt\/\d+\.\d+/.test(ca),pg=/Chrome\//.test(ca),pa=/Opera\//.test(ca),ve=/Apple Computer/.test(navigator.vendor),qg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ca),Kf=/PhantomJS/.test(ca),ub=/AppleWebKit/.test(ca)&&/Mobile\/\w+/.test(ca),Eb=ub||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ca),la=ub||/Mac/.test(qf),rg=/win/i.test(qf),jb=pa&&ca.match(/Version\/(\d*\.\d*)/);jb&&(jb=Number(jb[1]));jb&&15<=jb&&(pa=
178
- !1,O=!0);var tf=la&&(og||pa&&(null==jb||12.11>jb)),vd=Ua||G&&9<=E,Je=!1,Oa=!1;Ka.prototype=ja({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;c?(this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=
179
- c?d+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(c?d:0))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0<a.clientHeight&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0);return{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(a){this.vert.scrollTop!=
180
- a&&(this.vert.scrollTop=a);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){this.horiz.style.height=this.vert.style.width=la&&!qg?"12px":"18px";this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new Ta;this.disableVert=new Ta},enableZeroWidthBar:function(a,b){function c(){var d=a.getBoundingClientRect();document.elementFromPoint(d.left+1,d.bottom-1)!=a?a.style.pointerEvents="none":b.set(1E3,c)}a.style.pointerEvents=
181
- "auto";b.set(1E3,c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert)}},Ka.prototype);Za.prototype=ja({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},Za.prototype);n.scrollbarModel={"native":Ka,"null":Za};nc.prototype.signal=function(a,b){ha(a,b)&&this.events.push(arguments)};nc.prototype.finish=function(){for(var a=0;a<this.events.length;a++)M.apply(null,this.events[a])};var t=n.Pos=
182
- function(a,b){if(!(this instanceof t))return new t(a,b);this.line=a;this.ch=b},B=n.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch},fa=null;v.prototype=ja({init:function(a){function b(a){if(d.somethingSelected())fa=d.getSelections(),c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,f.value=fa.join("\n"),Cb(f));else if(d.options.lineWiseCopyCut){var b=ga(d);fa=b.text;"cut"==a.type?d.setSelections(b.ranges,null,xa):(c.prevInput="",f.value=b.text.join("\n"),Cb(f))}else return;"cut"==
183
- a.type&&(d.state.cutIncoming=!0)}var c=this,d=this.cm,e=this.wrapper=m(),f=this.textarea=e.firstChild;a.wrapper.insertBefore(e,a.wrapper.firstChild);ub&&(f.style.width="0px");z(f,"input",function(){G&&9<=E&&c.hasSelection&&(c.hasSelection=null);c.poll()});z(f,"paste",function(a){if(tb(a,d))return!0;d.state.pasteIncoming=!0;c.fastPoll()});z(f,"cut",b);z(f,"copy",b);z(a.scroller,"paste",function(b){Fa(a,b)||(d.state.pasteIncoming=!0,c.focus())});z(a.lineSpace,"selectstart",function(b){Fa(a,b)||T(b)});
184
- z(f,"compositionstart",function(){var a=d.getCursor("from");c.composing&&c.composing.range.clear();c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}});z(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=je(a);if(a.options.moveInputWithCursor){var a=Da(a,c.sel.primary().head,"div"),c=b.wrapper.getBoundingClientRect(),e=b.lineDiv.getBoundingClientRect();
185
- d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-c.top));d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-c.left))}return d},showSelection:function(a){var b=this.cm.display;aa(b.cursorDiv,a.cursors);aa(b.selectionDiv,a.selection);null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;d.somethingSelected()?(this.prevInput="",b=e.sel.primary(),c=(b=Fe&&(100<
186
- b.to().line-b.from().line||1E3<(c=d.getSelection()).length))?"-":c||d.getSelection(),this.textarea.value=c,d.state.focused&&Cb(this.textarea),G&&9<=E&&(this.hasSelection=c)):a||(this.prevInput=this.textarea.value="",G&&9<=E&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Eb||ua()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},
187
- resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll();a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){c.poll()||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0;c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(this.contextMenuPending||
188
- !a.state.focused||sg(b)&&!c&&!this.composing||W(a)||a.options.disableInput||a.state.keySeq)return!1;var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(G&&9<=E&&this.hasSelection===d||la&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);8203!=e||c||(c="\u200b");if(8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,e=Math.min(c.length,d.length);f<e&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var g=this;Z(a,
189
- function(){qb(a,d.slice(f),c.length-f,null,g.composing?"*compose":null);1E3<d.length||-1<d.indexOf("\n")?b.value=g.prevInput="":g.prevInput=d;g.composing&&(g.composing.range.clear(),g.composing.range=a.markText(g.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))});return!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){G&&9<=E&&(this.hasSelection=null);this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=
190
- e.somethingSelected(),b="\u200b"+(a?g.value:"");g.value="\u21da";g.value=b;d.prevInput=a?"":"\u200b";g.selectionStart=1;g.selectionEnd=b.length;f.selForContextMenu=e.doc.sel}}function c(){d.contextMenuPending=!1;d.wrapper.style.position="relative";g.style.cssText=l;G&&9>E&&f.scrollbars.setScrollTop(f.scroller.scrollTop=k);if(null!=g.selectionStart){(!G||G&&9>E)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0<g.selectionEnd&&"\u200b"==d.prevInput?L(e,Ic.selectAll)(e):
191
- 10>a++?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=fb(e,a),k=f.scroller.scrollTop;if(h&&!pa){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(h)&&L(e,P)(e.doc,wa(h),xa);var l=g.style.cssText;d.wrapper.style.position="absolute";g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(G?"rgba(255, 255, 255, .05)":
192
- "transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(O)var p=window.scrollY;f.input.focus();O&&window.scrollTo(null,p);f.input.reset();e.somethingSelected()||(g.value=d.prevInput=" ");d.contextMenuPending=!0;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);G&&9<=E&&b();if(vd){Dc(a);var m=function(){za(window,"mouseup",m);setTimeout(c,20)};z(window,"mouseup",m)}else setTimeout(c,50)}},readOnlyChanged:function(a){a||
193
- this.reset()},setUneditable:cc,needsContentAttribute:!1},v.prototype);gd.prototype=ja({init:function(a){function b(a){if(d.somethingSelected())fa=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else if(d.options.lineWiseCopyCut){var b=ga(d);fa=b.text;"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,xa);d.replaceSelection("",null,"cut")})}else return;if(a.clipboardData&&!ub)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",fa.join("\n"));
194
- else{var c=m();a=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild);a.value=fa.join("\n");var h=document.activeElement;Cb(a);setTimeout(function(){d.display.lineSpace.removeChild(c);h.focus()},50)}}var c=this,d=c.cm;a=c.div=a.lineDiv;l(a);z(a,"paste",function(a){tb(a,d)});z(a,"compositionstart",function(a){a=a.data;c.composing={sel:d.doc.sel,data:a,startData:a};if(a){var b=d.doc.sel.primary(),g=d.getLine(b.head.line).indexOf(a,Math.max(0,b.head.ch-a.length));-1<g&&g<=
195
- b.head.ch&&(c.composing.sel=wa(t(b.head.line,g),t(b.head.line,g+a.length)))}});z(a,"compositionupdate",function(a){c.composing.data=a.data});z(a,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b);c.composing==b&&(c.composing=null)},50))});z(a,"touchstart",function(){c.forceCompositionEnd()});z(a,"input",function(){c.composing||!W(d)&&c.pollContent()||Z(c.cm,function(){U(d)})});z(a,"copy",
196
- b);z(a,"cut",b)},prepareSelection:function(){var a=je(this.cm,!1);a.focus=this.cm.state.focused;return a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=rc(this.cm,a.anchorNode,a.anchorOffset),d=rc(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=B(bb(c,d),b.from())||0!=B(pb(c,d),b.to()))if(c=$d(this.cm,b.from()),
197
- d=$d(this.cm,b.to()),c||d){var e=this.cm.display.view,b=a.rangeCount&&a.getRangeAt(0);c?d||(d=e[e.length-1].measure,d=d.maps?d.maps[d.maps.length-1]:d.map,d={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}):c={node:e[0].measure.map[2],offset:0};try{var f=db(c.node,c.offset,d.offset,d.node)}catch(g){}f&&(a.removeAllRanges(),a.addRange(f),b&&null==a.anchorNode?a.addRange(b):Ua&&this.startGracePeriod());this.rememberSelection()}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod);
198
- this.gracePeriod=setTimeout(function(){a.gracePeriod=!1;a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){aa(this.cm.display.cursorDiv,a.cursors);aa(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode;this.lastAnchorOffset=a.anchorOffset;this.lastFocusNode=a.focusNode;this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();
199
- if(!a.rangeCount)return!1;a=a.getRangeAt(0).commonAncestorContainer;return id(this.div,a)},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 a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Z(this.cm,function(){b.cm.curOp.selectionChanged=!0});
200
- this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=rc(b,a.anchorNode,a.anchorOffset),d=rc(b,a.focusNode,a.focusOffset);c&&d&&Z(b,function(){P(b.doc,
201
- wa(c,d),xa);if(c.bad||d.bad)b.curOp.selectionChanged=!0})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),c=c.to();if(d.line<b.viewFrom||c.line>b.viewTo-1)return!1;var e;d.line==b.viewFrom||0==(e=ab(a,d.line))?(d=I(b.view[0].line),e=b.view[0].node):(d=I(b.view[e].line),e=b.view[e-1].node.nextSibling);var f=ab(a,c.line);f==b.view.length-1?(c=b.viewTo-1,b=b.lineDiv.lastChild):(c=I(b.view[f+1].line)-1,b=b.view[f+1].node.previousSibling);b=a.doc.splitLines(Bf(a,e,b,
202
- d,c));for(e=cb(a.doc,t(d,0),t(c,y(a.doc,c).text.length));1<b.length&&1<e.length;)if(F(b)==F(e))b.pop(),e.pop(),c--;else if(b[0]==e[0])b.shift(),e.shift(),d++;else break;for(var g=0,f=0,h=b[0],k=e[0],l=Math.min(h.length,k.length);g<l&&h.charCodeAt(g)==k.charCodeAt(g);)++g;h=F(b);k=F(e);for(l=Math.min(h.length-(1==b.length?g:0),k.length-(1==e.length?g:0));f<l&&h.charCodeAt(h.length-f-1)==k.charCodeAt(k.length-f-1);)++f;b[b.length-1]=h.slice(0,h.length-f);b[0]=b[0].slice(g);d=t(d,g);c=t(c,e.length?F(e).length-
203
- f:0);if(1<b.length||b[0]||B(d,c))return xb(a.doc,b,d,c,"+input"),!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(a){W(this.cm)?L(this.cm,U)(this.cm):a.data&&a.data!=a.startData&&L(this.cm,qb)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.contentEditable=
204
- "false"},onKeyPress:function(a){a.preventDefault();W(this.cm)||L(this.cm,qb)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},readOnlyChanged:function(a){this.div.contentEditable=String("nocursor"!=a)},onContextMenu:cc,resetPosition:cc,needsContentAttribute:!0},gd.prototype);n.inputStyles={textarea:v,contenteditable:gd};Ca.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=
205
- this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=B(c.anchor,d.anchor)||0!=B(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new D(fd(this.ranges[b].anchor),fd(this.ranges[b].head));return new Ca(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=
206
- this.ranges[c];if(0<=B(b,d.from())&&0>=B(a,d.to()))return c}return-1}};D.prototype={from:function(){return bb(this.anchor,this.head)},to:function(){return pb(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var nd={left:0,right:0,top:0,bottom:0},eb,wb=null,Jf=0,Fc,Ec,ue=0,Gc=0,ba=null;G?ba=-.53:Ua?ba=15:pg?ba=-.7:ve&&(ba=-1/3);var Ce=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);
207
- null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta);return{x:b,y:c}};n.wheelEventPixels=function(a){a=Ce(a);a.x*=ba;a.y*=ba;return a};var Vf=new Ta,yd=null,gb=n.changeEnd=function(a){return a.text?t(a.from.line+a.text.length-1,F(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};n.prototype={constructor:n,focus:function(){window.focus();this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,mb.hasOwnProperty(a)&&L(this,
208
- mb[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Pc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:R(function(a,b){var c=a.token?a:n.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;
209
- U(this)}),removeOverlay:R(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++;U(this);break}}}),indentLine:R(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");Qb(this.doc,a)&&Pb(this,a,b,c)}),indentSelection:R(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(Pb(this,
210
- e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&sb(this));else{for(var f=e.from(),e=e.to(),g=Math.max(c,f.line),c=Math.min(this.lastLine(),e.line-(e.ch?0:1))+1,e=g;e<c;++e)Pb(this,e,a);e=this.doc.sel.ranges;0==f.ch&&b.length==e.length&&0<e[d].from().ch&&jd(this.doc,d,new D(f,e[d].to()),xa)}}}),getTokenAt:function(a,b){return af(this,a,b)},getLineTokens:function(a,b){return af(this,t(a),b,!0)},getTokenTypeAt:function(a){a=A(this.doc,a);var b=cf(this,y(this.doc,a.line)),c=0,d=(b.length-1)/
211
- 2;a=a.ch;if(0==a)b=b[2];else for(;;){var e=c+d>>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]<a)c=e+1;else{b=b[2*e+2];break}}c=b?b.indexOf("cm-overlay "):-1;return 0>c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?n.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!Db.hasOwnProperty(b))return c;var d=Db[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);
212
- else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(f=0;f<d._global.length;f++)g=d._global[f],g.pred(e,this)&&-1==Q(c,g.val)&&c.push(g.val);return c},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return Sb(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel.primary();c=null==a?c.head:"object"==typeof a?A(this.doc,
213
- a):a?c.from():c.to();return Da(this,c,b||"page")},charCoords:function(a,b){return wc(this,A(this.doc,a),b||"page")},coordsChar:function(a,b){a=qe(this,a,b||"page");return sd(this,a.left,a.top)},lineAtHeight:function(a,b){a=qe(this,{top:a,left:0},b||"page").top;return $a(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d;"number"==typeof a?(d=this.doc.first+this.doc.size-1,a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0),d=y(this.doc,a)):d=a;return pd(this,d,{top:0,left:0},
214
- b||"page").top+(c?this.doc.height-ta(d):0)},defaultTextHeight:function(){return Va(this.display)},defaultCharWidth:function(){return Ib(this.display)},setGutterMarker:R(function(a,b,c){return Nc(this.doc,a,"gutter",function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&mf(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:R(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Ea(b,d,"gutter"),mf(c.gutterMarkers)&&(c.gutterMarkers=
215
- null));++d})}),lineInfo:function(a){if("number"==typeof a){if(!Qb(this.doc,a))return null;var b=a;a=y(this.doc,a);if(!a)return null}else if(b=I(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=Da(this,A(this.doc,a));var g=a.bottom,h=a.left;b.style.position=
216
- "absolute";b.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(b);f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(h=
217
- f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&(a=Bc(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&Lb(this,a.scrollTop),null!=a.scrollLeft&&ob(this,a.scrollLeft))},triggerOnKeyDown:R(ye),triggerOnKeyPress:R(ze),triggerOnKeyUp:xe,execCommand:function(a){if(Ic.hasOwnProperty(a))return Ic[a].call(null,this)},triggerElectric:R(function(a){C(this,a)}),findPosH:function(a,b,c,d){var e=1;
218
- 0>b&&(e=-1,b=-b);var f=0;for(a=A(this.doc,a);f<b&&(a=Dd(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:R(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Dd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},ec)}),deleteH:R(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):yb(this,function(d){var e=Dd(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,
219
- b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=A(this.doc,a);f<b&&(a=Da(this,a,"div"),null==d?d=a.left:a.left=d,a=Se(this,a,e,c),!a.hitSide);++f);return a},moveV:R(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var k=Da(c,g.head,"div");null!=g.goalColumn&&(k.left=g.goalColumn);e.push(k.left);var l=Se(c,k,a,b);"page"==b&&g==d.sel.primary()&&Lc(c,null,wc(c,l,"div").top-k.top);return l},
220
- ec);if(e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=y(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var e=this.getHelper(a,"wordChars");(0>a.xRel||d==b.length)&&c?--c:++d;for(var f=b.charAt(c),f=Oc(f,e)?function(a){return Oc(a,e)}:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Oc(a)};0<c&&f(b.charAt(c-1));)--c;for(;d<b.length&&f(b.charAt(d));)++d}return new D(t(a.line,c),t(a.line,d))},toggleOverwrite:function(a){if(null==
221
- a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?Mb(this.display.cursorDiv,"CodeMirror-overwrite"):Kb(this.display.cursorDiv,"CodeMirror-overwrite"),M(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ua()},scrollTo:R(function(a,b){null==a&&null==b||Mc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,
222
- height:a.scrollHeight-sa(this)-this.display.barHeight,width:a.scrollWidth-sa(this)-this.display.barWidth,clientHeight:cd(this),clientWidth:Ma(this)}},scrollIntoView:R(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:t(a,0),to:null}:null==a.from&&(a={from:a,to:null});a.to||(a.to=a.from);a.margin=b||0;if(null!=a.from.line)Mc(this),this.curOp.scrollToPos=a;else{var c=Bc(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,
223
- a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:R(function(a,b){function c(a){return"number"==typeof a||/^\d+#x2F;.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a));null!=b&&(d.display.wrapper.style.height=c(b));d.options.lineWrapping&&pe(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Ea(d,
224
- e,"widget");break}++e});d.curOp.forceUpdate=!0;M(d,"refresh",this)}),operation:function(a){return Z(this,a)},refresh:R(function(){var a=this.display.cachedTextHeight;U(this);this.curOp.forceUpdate=!0;Jb(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);Ba(this);(null==a||.5<Math.abs(a-Va(this.display)))&&Ga(this);M(this,"refresh",this)}),swapDoc:R(function(a){var b=this.doc;b.cm=null;Nd(this,a);Jb(this);this.display.input.reset();this.scrollTo(a.scrollLeft,a.scrollTop);this.curOp.forceScroll=
225
- !0;Y(this,"swapDoc",this,b);return b}),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}};Bb(n);var vf=n.defaults={},mb=n.optionHandlers={},Od=n.Init={toString:function(){return"CodeMirror.Init"}};w("value","",function(a,b){a.setValue(b)},!0);w("mode",null,function(a,b){a.doc.modeOption=b;Aa(a)},!0);w("indentUnit",
226
- 2,Aa,!0);w("indentWithTabs",!1);w("smartIndent",!0);w("tabSize",4,function(a){da(a);Jb(a);U(a)},!0);w("lineSeparator",null,function(a,b){if(a.doc.lineSep=b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var h=a.text.indexOf(b,e);if(-1==h)break;e=h+b.length;c.push(t(d,h))}d++});for(var e=c.length-1;0<=e;e--)xb(a.doc,b,c[e],t(c[e].line,c[e].ch+b.length))}});w("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b,c){a.state.specialChars=new RegExp(b.source+
227
- (b.test("\t")?"":"|\t"),"g");c!=n.Init&&a.refresh()});w("specialCharPlaceholder",function(a){var b=u("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);b.setAttribute("aria-label",b.title);return b},function(a){a.refresh()},!0);w("electricChars",!0);w("inputStyle",Eb?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor");},!0);w("rtlMoveVisually",!rg);w("wholeLineUpdateBefore",!0);w("theme","default",function(a){jc(a);
228
- ra(a)},!0);w("keyMap","default",function(a,b,c){b=Pc(b);(c=c!=n.Init&&Pc(c))&&c.detach&&c.detach(a,b);b.attach&&b.attach(a,c||null)});w("extraKeys",null);w("lineWrapping",!1,function(a){a.options.lineWrapping?(Mb(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Kb(a.display.wrapper,"CodeMirror-wrap"),Ja(a));Ga(a);U(a);Jb(a);setTimeout(function(){ea(a)},100)},!0);w("gutters",[],function(a){Sa(a.options);ra(a)},!0);w("fixedGutter",!0,function(a,b){a.display.gutters.style.left=
229
- b?H(a.display)+"px":"0";a.refresh()},!0);w("coverGutterNextToScrollbar",!1,function(a){ea(a)},!0);w("scrollbarStyle","native",function(a){kc(a);ea(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0);w("lineNumbers",!1,function(a){Sa(a.options);ra(a)},!0);w("firstLineNumber",1,ra,!0);w("lineNumberFormatter",function(a){return a},ra,!0);w("showCursorWhenSelecting",!1,Nb,!0);w("resetSelectionOnContextMenu",!0);w("lineWiseCopyCut",!0);w("readOnly",
230
- !1,function(a,b){"nocursor"==b?(Gb(a),a.display.input.blur(),a.display.disabled=!0):a.display.disabled=!1;a.display.input.readOnlyChanged(b)});w("disableInput",!1,function(a,b){b||a.display.input.reset()},!0);w("dragDrop",!0,function(a,b,c){!b!=!(c&&c!=n.Init)&&(c=a.display.dragFunctions,b=b?z:za,b(a.display.scroller,"dragstart",c.start),b(a.display.scroller,"dragenter",c.enter),b(a.display.scroller,"dragover",c.over),b(a.display.scroller,"dragleave",c.leave),b(a.display.scroller,"drop",c.drop))});
231
- w("allowDropFileTypes",null);w("cursorBlinkRate",530);w("cursorScrollMargin",0);w("cursorHeight",1,Nb,!0);w("singleCursorHeightPerLine",!0,Nb,!0);w("workTime",100);w("workDelay",100);w("flattenSpans",!0,da,!0);w("addModeClass",!1,da,!0);w("pollInterval",100);w("undoDepth",200,function(a,b){a.doc.history.undoDepth=b});w("historyEventDelay",1250);w("viewportMargin",10,function(a){a.refresh()},!0);w("maxHighlightLength",1E4,da,!0);w("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()});
232
- w("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""});w("autofocus",null);var uf=n.modes={},fc=n.mimeModes={};n.defineMode=function(a,b){n.defaults.mode||"null"==a||(n.defaults.mode=a);2<arguments.length&&(b.dependencies=Array.prototype.slice.call(arguments,2));uf[a]=b};n.defineMIME=function(a,b){fc[a]=b};n.resolveMode=function(a){if("string"==typeof a&&fc.hasOwnProperty(a))a=fc[a];else if(a&&"string"==typeof a.name&&fc.hasOwnProperty(a.name)){var b=fc[a.name];"string"==typeof b&&
233
- (b={name:b});a=kf(b,a);a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml#x2F;.test(a))return n.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};n.getMode=function(a,b){b=n.resolveMode(b);var c=uf[b.name];if(!c)return n.getMode(a,"text/plain");c=c(a,b);if(gc.hasOwnProperty(b.name)){var d=gc[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;b.helperType&&(c.helperType=b.helperType);if(b.modeProps)for(e in b.modeProps)c[e]=
234
- b.modeProps[e];return c};n.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});n.defineMIME("text/plain","null");var gc=n.modeExtensions={};n.extendMode=function(a,b){var c=gc.hasOwnProperty(a)?gc[a]:gc[a]={};ja(b,c)};n.defineExtension=function(a,b){n.prototype[a]=b};n.defineDocExtension=function(a,b){X.prototype[a]=b};n.defineOption=w;var Yc=[];n.defineInitHook=function(a){Yc.push(a)};var Db=n.helpers={};n.registerHelper=function(a,b,c){Db.hasOwnProperty(a)||(Db[a]=n[a]={_global:[]});
235
- Db[a][b]=c};n.registerGlobalHelper=function(a,b,c,d){n.registerHelper(a,b,d);Db[a]._global.push({pred:c,val:d})};var Qa=n.copyState=function(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c},Hf=n.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};n.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var Ic=
236
- n.commands={selectAll:function(a){a.setSelection(t(a.firstLine(),0),t(a.lastLine()),xa)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),xa)},killLine:function(a){yb(a,function(b){if(b.empty()){var c=y(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:t(b.head.line+1,0)}:{from:b.head,to:t(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){yb(a,function(b){return{from:t(b.from().line,0),to:A(a.doc,
237
- t(b.to().line+1,0))}})},delLineLeft:function(a){yb(a,function(a){return{from:t(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){yb(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},delWrappedLineRight:function(a){yb(a,function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:c}})},undo:function(a){a.undo()},redo:function(a){a.redo()},
238
- undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(t(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(t(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return of(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return pf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){b=b.head.line;for(var c,
239
- d=y(a.doc,b);c=Ya(d,!1);)d=c.find(1,!0).line,b=null;c=(c=ma(d))?c[0].level%2?zc(d):Ac(d):d.text.length;return t(null==b?I(d):b,c)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div")},ec)},goLineLeft:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},ec)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=
240
- a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:0,top:c},"div");return c.ch<a.getLine(c.line).search(/\S/)?pf(a,b.head):c},ec)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,
241
- "word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},
242
- indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),f=oa(a.getLine(f.line),f.ch,d);b.push(Array(d-f%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Z(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=
243
- b[d].head,f=y(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new t(e.line,e.ch-1)),0<e.ch)e=new t(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),t(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=y(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),t(e.line-1,g.length-1),t(e.line,1),"+transpose")}c.push(new D(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Z(a,function(){for(var b=a.listSelections().length,c=0;c<b;c++){var d=
244
- a.listSelections()[c];a.replaceRange(a.doc.lineSeparator(),d.anchor,d.head,"+input");a.indentLine(d.from().line+1,null,!0)}sb(a)})},toggleOverwrite:function(a){a.toggleOverwrite()}},Ra=n.keyMap={};Ra.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",
245
- Insert:"toggleOverwrite",Esc:"singleSelection"};Ra.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",
246
- "Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Ra.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",
247
- "Ctrl-K":"killLine","Ctrl-T":"transposeChars"};Ra.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",
248
- "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"]};Ra["default"]=la?Ra.macDefault:Ra.pcDefault;n.normalizeKeyMap=function(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!/^(name|fallthrough|(de|at)tach)#x2F;.test(c)){if("..."!=d)for(var e=pc(c.split(" "),
249
- ag),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var k=b[h];if(!k)b[h]=g;else if(k!=g)throw Error("Inconsistent bindings for "+h);}delete a[c]}}for(var l in b)a[l]=b[l];return a};var Wb=n.lookupKey=function(a,b,c,d){b=Pc(b);var e=b.call?b.call(a,d):b[a];if(!1===e)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return Wb(a,b.fallthrough,
250
- c,d);for(e=0;e<b.fallthrough.length;e++){var f=Wb(a,b.fallthrough[e],c,d);if(f)return f}}},Uf=n.isModifierKey=function(a){a="string"==typeof a?a:kb[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a},Wf=n.keyName=function(a,b){if(pa&&34==a.keyCode&&a["char"])return!1;var c=kb[a.keyCode],d=c;if(null==d||a.altGraphKey)return!1;a.altKey&&"Alt"!=c&&(d="Alt-"+d);(tf?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d);(tf?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d);!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+
251
- d);return d};n.fromTextArea=function(a,b){function c(){a.value=h.getValue()}b=b?ja(b):{};b.value=a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=ua();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form&&(z(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var e=a.form,f=e.submit;try{var g=e.submit=function(){c();e.submit=f;e.submit();e.submit=g}}catch(k){}}b.finishInit=function(b){b.save=
252
- c;b.getTextArea=function(){return a};b.toTextArea=function(){b.toTextArea=isNaN;c();a.parentNode.removeChild(b.getWrapperElement());a.style.display="";a.form&&(za(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=f))}};a.style.display="none";var h=n(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return h};var Tc=n.StringStream=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};Tc.prototype={eol:function(){return this.pos>=
253
- 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(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;
254
- return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=oa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?oa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return oa(this.string,
255
- null,this.tabSize)-(this.lineStart?oa(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=
256
- a}}};var Ed=0,ib=n.TextMarker=function(a,b){this.lines=[];this.type=b;this.doc=a;this.id=++Ed};Bb(ib);ib.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&lb(a);if(ha(this,"clear")){var c=this.find();c&&Y(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=Yb(f.markedSpans,this);a&&!this.collapsed?Ea(a,I(f),"text"):a&&(null!=g.to&&(d=I(f)),null!=g.from&&(c=I(f)));for(var h=f,k=f.markedSpans,l=g,p=void 0,m=0;m<k.length;++m)k[m]!=
257
- l&&(p||(p=[])).push(k[m]);h.markedSpans=p;null==g.from&&this.collapsed&&!Wa(this.doc,f)&&a&&qa(f,Va(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=ya(this.lines[e]),g=Ia(f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&U(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&ie(a.doc));a&&Y(a,"markerCleared",a,this);
258
- b&&nb(a);this.parent&&this.parent.clear()}};ib.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=Yb(f.markedSpans,this);if(null!=g.from&&(c=t(b?f:I(f),g.from),-1==a))return c;if(null!=g.to&&(d=t(b?f:I(f),g.to),1==a))return d}return c&&{from:c,to:d}};ib.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&Z(c,function(){var d=a.line,e=I(a.line);if(e=hd(c,e))oe(e),c.curOp.selectionChanged=c.curOp.forceUpdate=
259
- !0;c.curOp.updateMaxLine=!0;Wa(b.doc,d)||null==b.height||(e=b.height,b.height=null,(e=Ub(b)-e)&&qa(d,d.height+e))})};ib.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=Q(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ib.prototype.detachLine=function(a){this.lines.splice(Q(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||
260
- (a.maybeHiddenMarkers=[])).push(this))};var Ed=0,Rc=n.SharedTextMarker=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Bb(Rc);Rc.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();Y(this,"clear")}};Rc.prototype.find=function(a,b){return this.primary.find(a,b)};var Sc=n.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a;this.node=
261
- b};Bb(Sc);Sc.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=I(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=Ub(this);qa(c,Math.max(0,c.height-f));a&&Z(a,function(){var b=-f;ta(c)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Lc(a,null,b);Ea(a,d,"widget")})}};Sc.prototype.changed=function(){var a=this.height,b=this.doc.cm,c=this.line;this.height=null;var d=Ub(this)-a;d&&(qa(c,c.height+d),b&&Z(b,function(){b.curOp.forceUpdate=
262
- !0;ta(c)<(b.curOp&&b.curOp.scrollTop||b.doc.scrollTop)&&Lc(b,null,d)}))};var Zb=n.Line=function(a,b,c){this.text=a;Xe(this,b);this.height=c?c(this):1};Bb(Zb);Zb.prototype.lineNo=function(){return I(this)};var gg={},fg={};$b.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;We(f);Y(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,
263
- b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};ac.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=
264
- null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof $b))&&(c=[],this.collapse(c),this.children=[new $b(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<=f){e.insertInner(a,b,c);if(e.lines&&50<e.lines.length){for(;50<e.lines.length;)a=
265
- e.lines.splice(e.lines.length-25,25),a=new $b(a),e.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new ac(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=Q(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new ac(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},
266
- iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return!0;if(0==(b-=f))break;a=0}else a-=f}}};var tg=0,X=n.Doc=function(a,b,c,d){if(!(this instanceof X))return new X(a,b,c,d);null==c&&(c=0);ac.call(this,[new $b([new Zb("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=t(c,0);this.sel=wa(c);this.history=new Uc(null);this.id=++tg;this.modeOption=
267
- b;this.lineSep=d;this.extend=!1;"string"==typeof a&&(a=this.splitLines(a));Cd(this,{from:c,to:c,text:a});P(this,wa(c),xa)};X.prototype=kf(ac.prototype,{constructor:X,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Jd(this,this.first,this.first+this.size);return!1===
268
- a?b:b.join(a||this.lineSeparator())},setValue:S(function(a){var b=t(this.first,0),c=this.first+this.size-1;rb(this,{from:b,to:t(c,y(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0);P(this,wa(b))}),replaceRange:function(a,b,c,d){b=A(this,b);c=c?A(this,c):b;xb(this,a,b,c,d)},getRange:function(a,b,c){a=cb(this,A(this,a),A(this,b));return!1===c?a:a.join(c||this.lineSeparator())},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(Qb(this,
269
- a))return y(this,a)},getLineNumber:function(a){return I(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=y(this,a));return ya(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return A(this,a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},
270
- somethingSelected:function(){return this.sel.somethingSelected()},setCursor:S(function(a,b,c){a=A(this,"number"==typeof a?t(a,b||0):a);P(this,wa(a,null),c)}),setSelection:S(function(a,b,c){var d=A(this,a);a=A(this,b||a);P(this,wa(d,a),c)}),extendSelection:S(function(a,b,c){sc(this,A(this,a),b&&A(this,b),c)}),extendSelections:S(function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=A(this,a[d]);ce(this,c)}),extendSelectionsBy:S(function(a,b){ce(this,pc(this.sel.ranges,a),b)}),setSelections:S(function(a,
271
- b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new D(A(this,a[d].anchor),A(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));P(this,na(e,b),c)}}),addSelection:S(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new D(A(this,a),A(this,b||a)));P(this,na(d,d.length-1),c)}),getSelection:function(a){for(var b=this.sel.ranges,c,d=0;d<b.length;d++){var e=cb(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return!1===a?c:c.join(a||this.lineSeparator())},getSelections:function(a){for(var b=
272
- [],c=this.sel.ranges,d=0;d<c.length;d++){var e=cb(this,c[d].from(),c[d].to());!1!==a&&(e=e.join(a||this.lineSeparator()));b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:S(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}if(f=b&&"end"!=b){f=[];c=a=t(this.first,0);for(e=0;e<d.length;e++){var h=
273
- d[e],g=He(h.from,a,c),k=He(gb(h),a,c);a=h.to;c=k;"around"==b?(h=this.sel.ranges[e],h=0>B(h.head,h.anchor),f[e]=new D(h?k:g,h?g:k)):f[e]=new D(g,g)}f=new Ca(f,this.sel.primIndex)}b=f;for(f=d.length-1;0<=f;f--)rb(this,d[f]);b?de(this,b):this.cm&&sb(this.cm)}),undo:S(function(){Kc(this,"undo")}),redo:S(function(){Kc(this,"redo")}),undoSelection:S(function(){Kc(this,"undo",!0)}),redoSelection:S(function(){Kc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},
274
- historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new Uc(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(a){return this.history.generation==
275
- (a||this.cleanGeneration)},getHistory:function(){return{done:Ab(this.history.done),undone:Ab(this.history.undone)}},setHistory:function(a){var b=this.history=new Uc(this.history.maxGeneration);b.done=Ab(a.done.slice(0),null,!0);b.undone=Ab(a.undone.slice(0),null,!0)},addLineClass:S(function(a,b,c){return Nc(this,a,"gutter"==b?"gutter":"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[e]){if(dc(c).test(a[e]))return!1;a[e]+=" "+c}else a[e]=
276
- c;return!0})}),removeLineClass:S(function(a,b,c){return Nc(this,a,"gutter"==b?"gutter":"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.match(dc(c));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:S(function(a,b,c){return eg(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,
277
- b,c){return zb(this,A(this,a),A(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};a=A(this,a);return zb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=A(this,a);var b=[],c=y(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},
278
- findMarks:function(a,b,c){a=A(this,a);b=A(this,b);var d=[],e=a.line;this.iter(a.line,b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g<f.length;g++){var h=f[g];e==a.line&&a.ch>h.to||null==h.from&&e!=a.line||e==b.line&&h.from>b.ch||c&&!c(h.marker)||d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=
279
- d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return A(this,t(c,b))},indexFromPos:function(a){a=A(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new X(Jd(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));
280
- return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new X(Jd(this,b,c),a.mode||this.modeOption,b,this.lineSep);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=Ue(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from),e=b.clipPos(e.to);B(f,e)&&(f=zb(b,f,e,d.primary,d.primary.type),
281
- d.markers.push(f),f.parent=d)}return b},unlinkDoc:function(a){a instanceof n&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);cg(Ue(this));break}if(a.history==this.history){var c=[a.id];hb(a,function(a){c.push(a.id)},!0);a.history=new Uc(null);a.history.done=Ab(this.history.done,c);a.history.undone=Ab(this.history.undone,c)}},iterLinkedDocs:function(a){hb(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},
282
- splitLines:function(a){return this.lineSep?a.split(this.lineSep):ug(a)},lineSeparator:function(){return this.lineSep||"\n"}});X.prototype.eachLine=X.prototype.iter;var vg="iter insert remove copy getEditor constructor".split(" "),hc;for(hc in X.prototype)X.prototype.hasOwnProperty(hc)&&0>Q(vg,hc)&&(n.prototype[hc]=function(a){return function(){return a.apply(this.doc,arguments)}}(X.prototype[hc]));Bb(X);var T=n.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},wg=
283
- n.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},Dc=n.e_stop=function(a){T(a);wg(a)},z=n.on=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))},jf=[],za=n.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else for(a=Vc(a,b,!1),b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}},M=
284
- n.signal=function(a,b){var c=Vc(a,b,!0);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},bc=null,Qd=30,De=n.Pass={toString:function(){return"CodeMirror.Pass"}},xa={scroll:!1},wd={origin:"*mouse"},ec={origin:"+move"};Ta.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var oa=n.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(0>f||f>=b)return e+
285
- (b-d);e+=f-d;e+=c-e%c;d=f+1}},Be=n.findColumn=function(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}},Wc=[""],Cb=function(a){a.select()};ub?Cb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:G&&(Cb=function(a){try{a.select()}catch(b){}});var xg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,lf=n.isWordChar=
286
- function(a){return/\w/.test(a)||"\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||xg.test(a))},ng=/[\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]/,
287
- db;db=document.createRange?function(a,b,c,d){var e=document.createRange();e.setEnd(d||a,c);e.setStart(a,b);return e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}d.collapse(!0);d.moveEnd("character",c);d.moveStart("character",b);return d};var id=n.contains=function(a,b){3==b.nodeType&&(b=b.parentNode);if(a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};G&&11>E&&(ua=function(){try{return document.activeElement}catch(a){return document.body}});
288
- var Kb=n.rmClass=function(a,b){var c=a.className,d=dc(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Mb=n.addClass=function(a,b){var c=a.className;dc(b).test(c)||(a.className+=(c?" ":"")+b)},Md=!1,Qf=function(){if(G&&9>E)return!1;var a=u("div");return"draggable"in a||"dragDrop"in a}(),Kd,Hd,ug=n.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==
289
- a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},sg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Fe=function(){var a=u("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),
290
- od=null,kb=n.keyNames={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",
291
- 63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};(function(){for(var a=0;10>a;a++)kb[a+48]=kb[a+96]=String(a);for(a=65;90>=a;a++)kb[a]=String.fromCharCode(a);for(a=1;12>=a;a++)kb[a+111]=kb[a+63235]="F"+a})();var Vb,lg=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):
292
- 1424<=a&&1524>=a?"R":1536<=a&&1773>=a?"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm".charAt(a-1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a;this.from=b;this.to=c}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,f=/[Lb1n]/,g=/[1n]/;return function(h){if(!c.test(h))return!1;
293
- for(var k=h.length,l=[],p=0,m;p<k;++p)l.push(a(h.charCodeAt(p)));for(var p=0,r="L";p<k;++p)m=l[p],"m"==m?l[p]=r:r=m;p=0;for(r="L";p<k;++p)m=l[p],"1"==m&&"r"==r?l[p]="n":e.test(m)&&(r=m,"r"==m&&(l[p]="R"));p=1;for(r=l[0];p<k-1;++p)m=l[p],"+"==m&&"1"==r&&"1"==l[p+1]?l[p]="1":","!=m||r!=l[p+1]||"1"!=r&&"n"!=r||(l[p]=r),r=m;for(p=0;p<k;++p)if(m=l[p],","==m)l[p]="N";else if("%"==m){for(r=p+1;r<k&&"%"==l[r];++r);var v=p&&"!"==l[p-1]||r<k&&"1"==l[r]?"1":"N";for(m=p;m<r;++m)l[m]=v;p=r-1}p=0;for(r="L";p<k;++p)m=
294
- l[p],"L"==r&&"1"==m?l[p]="L":e.test(m)&&(r=m);for(p=0;p<k;++p)if(d.test(l[p])){for(r=p+1;r<k&&d.test(l[r]);++r);m="L"==(r<k?l[r]:"L");v="L"==(p?l[p-1]:"L")||m?"L":"R";for(m=p;m<r;++m)l[m]=v;p=r-1}for(var r=[],n,p=0;p<k;)if(f.test(l[p])){m=p;for(++p;p<k&&f.test(l[p]);++p);r.push(new b(0,m,p))}else{var t=p,v=r.length;for(++p;p<k&&"L"!=l[p];++p);for(m=t;m<p;)if(g.test(l[m])){t<m&&r.splice(v,0,new b(1,t,m));t=m;for(++m;m<p&&g.test(l[m]);++m);r.splice(v,0,new b(2,t,m));t=m}else++m;t<p&&r.splice(v,0,new b(1,
295
- t,p))}1==r[0].level&&(n=h.match(/^\s+/))&&(r[0].from=n[0].length,r.unshift(new b(0,0,n[0].length)));1==F(r).level&&(n=h.match(/\s+#x2F;))&&(F(r).to-=n[0].length,r.push(new b(0,k-n[0].length,k)));2==r[0].level&&r.unshift(new b(1,r[0].to,r[0].to));r[0].level!=F(r).level&&r.push(new b(r[0].level,k,k));return r}}();n.version="5.9.0";return n});
296
297
- // CodeMirror CSS mode version 5.9.0
298
- (function(n){n(CodeMirror)})(function(n){function N(n){for(var x={},H=0;H<n.length;++H)x[n[H]]=!0;return x}function Aa(n,x){for(var H=!1,N;null!=(N=n.next());){if(H&&"/"==N){x.tokenize=null;break}H="*"==N}return["comment","comment"]}n.defineMode("css",function(N,x){function H(l,n){tb=n;return l}function da(l,n){var m=l.next();if(Pa[m]){var x=Pa[m](l,n);if(!1!==x)return x}if("@"==m)return l.eatWhile(/[\w\\\-]/),H("def",l.current());if("="==m||("~"==m||"|"==m)&&l.eat("="))return H(null,"compare");if('"'==
299
- m||"'"==m)return n.tokenize=ea(m),n.tokenize(l,n);if("#"==m)return l.eatWhile(/[\w\\\-]/),H("atom","hash");if("!"==m)return l.match(/^\s*\w*/),H("keyword","important");if(/\d/.test(m)||"."==m&&l.eat(/\d/))return l.eatWhile(/[\w.%]/),H("number","unit");if("-"===m){if(/[\d.]/.test(l.peek()))return l.eatWhile(/[\w.%]/),H("number","unit");if(l.match(/^-[\w\\\-]+/))return l.eatWhile(/[\w\\\-]/),l.match(/^\s*:/,!1)?H("variable-2","variable-definition"):H("variable-2","variable");if(l.match(/^\w+-/))return H("meta",
300
- "meta")}else return/[,+>*\/]/.test(m)?H(null,"select-op"):"."==m&&l.match(/^-?[_a-z][_a-z0-9-]*/i)?H("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(m)?H(null,m):"u"==m&&l.match(/rl(-prefix)?\(/)||"d"==m&&l.match("omain(")||"r"==m&&l.match("egexp(")?(l.backUp(1),n.tokenize=ra,H("property","word")):/[\w\\\-]/.test(m)?(l.eatWhile(/[\w\\\-]/),H("property","word")):H(null,null)}function ea(l){return function(n,m){for(var x=!1,C;null!=(C=n.next());){if(C==l&&!x){")"==l&&n.backUp(1);break}x=!x&&"\\"==C}if(C==
301
- l||!x&&")"!=l)m.tokenize=null;return H("string","string")}}function ra(l,n){l.next();l.match(/\s*[\"\')]/,!1)?n.tokenize=null:n.tokenize=ea(")");return H(null,"(")}function ka(l,n,m){this.type=l;this.indent=n;this.prev=m}function K(l,n,m,x){l.context=new ka(m,n.indentation()+(!1===x?0:Ba),l.context);return m}function V(l){l.context.prev&&(l.context=l.context.prev);return l.context.type}function va(l,n,m,x){for(x=x||1;0<x;x--)m.context=m.context.prev;return ga[m.context.type](l,n,m)}function Aa(l){l=
302
- l.current().toLowerCase();C=Ob.hasOwnProperty(l)?"atom":bb.hasOwnProperty(l)?"keyword":"variable"}var Ga=x;x.propertyKeywords||(x=n.resolveMode("text/css"));x.inline=Ga.inline;var Ba=N.indentUnit,Pa=x.tokenHooks,Ia=x.documentTypes||{},Ja=x.mediaTypes||{},La=x.mediaFeatures||{},Sa=x.mediaValueKeywords||{},Ha=x.propertyKeywords||{},Ka=x.nonStandardPropertyKeywords||{},Za=x.fontProperties||{},pb=x.counterDescriptors||{},bb=x.colorKeywords||{},Ob=x.valueKeywords||{},W=x.allowNested,qb=!0===x.supportsAtComponent,
303
- tb,C,ga={top:function(l,n,m){if("{"==l)return K(m,n,"block");if("}"==l&&m.context.prev)return V(m);if(qb&&/@component/.test(l))return K(m,n,"atComponentBlock");if(/^@(-moz-)?document#x2F;.test(l))return K(m,n,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)#x2F;.test(l))return K(m,n,"atBlock");if(/^@(font-face|counter-style)/.test(l))return m.stateArg=l,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes#x2F;.test(l))return"keyframes";if(l&&"@"==l.charAt(0))return K(m,n,"at");
304
- if("hash"==l)C="builtin";else if("word"==l)C="tag";else{if("variable-definition"==l)return"maybeprop";if("interpolation"==l)return K(m,n,"interpolation");if(":"==l)return"pseudo";if(W&&"("==l)return K(m,n,"parens")}return m.context.type},block:function(l,n,m){if("word"==l){l=n.current().toLowerCase();if(Ha.hasOwnProperty(l))return C="property","maybeprop";if(Ka.hasOwnProperty(l))return C="string-2","maybeprop";if(W)return C=n.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block";C+=" error";return"maybeprop"}if("meta"==
305
- l)return"block";if(W||"hash"!=l&&"qualifier"!=l)return ga.top(l,n,m);C="error";return"block"},maybeprop:function(l,n,m){return":"==l?K(m,n,"prop"):ga[m.context.type](l,n,m)},prop:function(l,n,m){if(";"==l)return V(m);if("{"==l&&W)return K(m,n,"propBlock");if("}"==l||"{"==l)return va(l,n,m);if("("==l)return K(m,n,"parens");if("hash"==l&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})#x2F;.test(n.current()))C+=" error";else if("word"==l)Aa(n);else if("interpolation"==l)return K(m,n,"interpolation");
306
- return"prop"},propBlock:function(l,n,m){return"}"==l?V(m):"word"==l?(C="property","maybeprop"):m.context.type},parens:function(l,n,m){if("{"==l||"}"==l)return va(l,n,m);if(")"==l)return V(m);if("("==l)return K(m,n,"parens");if("interpolation"==l)return K(m,n,"interpolation");"word"==l&&Aa(n);return"parens"},pseudo:function(l,n,m){return"word"==l?(C="variable-3",m.context.type):ga[m.context.type](l,n,m)},documentTypes:function(l,n,m){return"word"==l&&Ia.hasOwnProperty(n.current())?(C="tag",m.context.type):
307
- ga.atBlock(l,n,m)},atBlock:function(l,n,m){if("("==l)return K(m,n,"atBlock_parens");if("}"==l||";"==l)return va(l,n,m);if("{"==l)return V(m)&&K(m,n,W?"block":"top");if("interpolation"==l)return K(m,n,"interpolation");"word"==l&&(l=n.current().toLowerCase(),C="only"==l||"not"==l||"and"==l||"or"==l?"keyword":Ja.hasOwnProperty(l)?"attribute":La.hasOwnProperty(l)?"property":Sa.hasOwnProperty(l)?"keyword":Ha.hasOwnProperty(l)?"property":Ka.hasOwnProperty(l)?"string-2":Ob.hasOwnProperty(l)?"atom":bb.hasOwnProperty(l)?
308
- "keyword":"error");return m.context.type},atComponentBlock:function(l,n,m){if("}"==l)return va(l,n,m);if("{"==l)return V(m)&&K(m,n,W?"block":"top",!1);"word"==l&&(C="error");return m.context.type},atBlock_parens:function(l,n,m){return")"==l?V(m):"{"==l||"}"==l?va(l,n,m,2):ga.atBlock(l,n,m)},restricted_atBlock_before:function(l,n,m){return"{"==l?K(m,n,"restricted_atBlock"):"word"==l&&"@counter-style"==m.stateArg?(C="variable","restricted_atBlock_before"):ga[m.context.type](l,n,m)},restricted_atBlock:function(l,
309
- n,m){return"}"==l?(m.stateArg=null,V(m)):"word"==l?(C="@font-face"==m.stateArg&&!Za.hasOwnProperty(n.current().toLowerCase())||"@counter-style"==m.stateArg&&!pb.hasOwnProperty(n.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(l,n,m){return"word"==l?(C="variable","keyframes"):"{"==l?K(m,n,"top"):ga[m.context.type](l,n,m)},at:function(l,n,m){if(";"==l)return V(m);if("{"==l||"}"==l)return va(l,n,m);"word"==l?C="tag":"hash"==l&&(C="builtin");return"at"},
310
- interpolation:function(l,n,m){if("}"==l)return V(m);if("{"==l||";"==l)return va(l,n,m);"word"==l?C="variable":"variable"!=l&&"("!=l&&")"!=l&&(C="error");return"interpolation"}};return{startState:function(l){return{tokenize:null,state:x.inline?"block":"top",stateArg:null,context:new ka(x.inline?"block":"top",l||0,null)}},token:function(l,n){if(!n.tokenize&&l.eatSpace())return null;var m=(n.tokenize||da)(l,n);m&&"object"==typeof m&&(tb=m[1],m=m[0]);C=m;n.state=ga[n.state](tb,l,n);return C},indent:function(l,
311
- n){var m=l.context,x=n&&n.charAt(0),C=m.indent;"prop"!=m.type||"}"!=x&&")"!=x||(m=m.prev);if(m.prev)if("}"==x&&("block"==m.type||"top"==m.type||"interpolation"==m.type||"restricted_atBlock"==m.type))m=m.prev,C=m.indent;else if(")"==x&&("parens"==m.type||"atBlock_parens"==m.type)||"{"==x&&("at"==m.type||"atBlock"==m.type))C=Math.max(0,m.indent-Ba);return C},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var da=["domain","regexp","url","url-prefix"],lc=N(da),Ga="all aural braille handheld print projection screen tty tv embossed".split(" "),
312
- jc=N(Ga),ra="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".split(" "),
313
- ic=N(ra),Ba="landscape portrait none coarse fine on-demand hover interlace progressive".split(" "),Ia=N(Ba),Ja="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-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-position grid-auto-rows grid-column grid-column-end grid-column-start grid-row grid-row-end 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".split(" "),
314
- Sa=N(Ja),ka="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".split(" "),Ka=N(ka),Za=N("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),kc=N("additive-symbols fallback negative pad prefix range speak-as suffix symbols system".split(" ")),
315
- ea="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".split(" "),
316
- mc=N(ea),La="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 column column-reverse compact condensed contain content content-box context-menu continuous copy counter counters cover crop cross crosshair currentcolor cursive cyclic dashed decimal decimal-leading-zero default default-button destination-atop destination-in destination-out destination-over devanagari 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 expanded extends extra-condensed extra-expanded fantasy fast fill fixed flat flex flex-end flex-start footnotes forwards from geometricPrecision georgian graytext groove gujarati gurmukhi hand hangul hangul-consonant hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-flex 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 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 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 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 scale scale3d scaleX scaleY scaleZ 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 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".split(" "),
317
- Ha=N(La),da=da.concat(Ga).concat(ra).concat(Ba).concat(Ja).concat(ka).concat(ea).concat(La);n.registerHelper("hintWords","css",da);n.defineMIME("text/css",{documentTypes:lc,mediaTypes:jc,mediaFeatures:ic,mediaValueKeywords:Ia,propertyKeywords:Sa,nonStandardPropertyKeywords:Ka,fontProperties:Za,counterDescriptors:kc,colorKeywords:mc,valueKeywords:Ha,tokenHooks:{"/":function(n,x){if(!n.eat("*"))return!1;x.tokenize=Aa;return Aa(n,x)}},name:"css"})});
1
+ // CodeMirror version 5.24.2
2
+ (function(Ea,ha){Ea.CodeMirror=ha()})(this,function(){function Ea(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function ha(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function W(a,b){return ha(a).appendChild(b)}function v(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Yb(a,b){3==b.nodeType&&(b=
3
+ b.parentNode);if(a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function pa(){var a;try{a=document.activeElement}catch(b){a=document.body||null}for(;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function Va(a,b){var c=a.className;Ea(b).test(c)||(a.className+=(c?" ":"")+b)}function Fc(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Ea(c[d]).test(b)&&(b+=" "+c[d]);return b}function Gc(a){var b=Array.prototype.slice.call(arguments,
4
+ 1);return function(){return a.apply(null,b)}}function Fa(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||!1===c&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function aa(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(0>f||f>=b)return e+(b-d);e+=f-d;e+=c-e%c;d=f+1}}function K(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Hc(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;
5
+ if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}}function Ic(a){for(;Zb.length<=a;)Zb.push(B(Zb)+" ");return Zb[a]}function B(a){return a[a.length-1]}function $b(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Mf(a,b,c){for(var d=0,e=c(b);d<a.length&&c(a[d])<=e;)d++;a.splice(d,0,b)}function Ld(){}function Md(a,b){var c;Object.create?c=Object.create(a):(Ld.prototype=a,c=new Ld);b&&Fa(b,c);return c}function Jc(a){return/\w/.test(a)||"\u0080"<
6
+ a&&(a.toUpperCase()!=a.toLowerCase()||Nf.test(a))}function ac(a,b){return b?-1<b.source.indexOf("\\w")&&Jc(a)?!0:b.test(a):Jc(a)}function Nd(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Kc(a){return 768<=a.charCodeAt(0)&&Of.test(a)}function Od(a,b,c){for(;(0>c?0<b:b<a.length)&&Kc(a.charAt(b));)b+=c;return b}function bc(a,b,c){for(;;){if(1>=Math.abs(b-c))return a(b)?b:c;var d=Math.floor((b+c)/2);a(d)?c=d:b=d}}function Pf(a,b,c){this.input=c;this.scrollbarFiller=v("div",
7
+ null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=v("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=v("div",null,"CodeMirror-code");this.selectionDiv=v("div",null,null,"position: relative; z-index: 1");this.cursorDiv=v("div",null,"CodeMirror-cursors");this.measure=v("div",null,"CodeMirror-measure");this.lineMeasure=v("div",null,"CodeMirror-measure");this.lineSpace=v("div",[this.measure,
8
+ this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");this.mover=v("div",[v("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=v("div",[this.mover],"CodeMirror-sizer");this.sizerWidth=null;this.heightForcer=v("div",null,null,"position: absolute; height: 30px; width: 1px;");this.gutters=v("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=v("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");
9
+ this.scroller.setAttribute("tabIndex","-1");this.wrapper=v("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");C&&8>z&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);L||wa&&sb||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;
10
+ this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;c.init(this)}function r(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+
11
+ (b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function Ga(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function Lc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function ia(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function D(a){if(null==a.parent)return null;
12
+ var b=a.parent;a=K(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function Ha(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+d}function tb(a,b){return b>=a.first&&b<a.first+a.size}function Mc(a,b){return String(a.lineNumberFormatter(b+
13
+ a.firstLineNumber))}function q(a,b,c){void 0===c&&(c=null);if(!(this instanceof q))return new q(a,b,c);this.line=a;this.ch=b;this.sticky=c}function x(a,b){return a.line-b.line||a.ch-b.ch}function Nc(a,b){return a.sticky==b.sticky&&0==x(a,b)}function Oc(a){return q(a.line,a.ch)}function cc(a,b){return 0>x(a,b)?b:a}function dc(a,b){return 0>x(a,b)?a:b}function t(a,b){if(b.line<a.first)return q(a.first,0);var c=a.first+a.size-1;if(b.line>c)return q(c,r(a,c).text.length);var c=r(a,b.line).text.length,
14
+ d=b.ch,c=null==d||d>c?q(b.line,c):0>d?q(b.line,0):b;return c}function Pd(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=t(a,b[d]);return c}function ec(a,b,c){this.marker=a;this.from=b;this.to=c}function ub(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Pc(a,b){if(b.full)return null;var c=tb(a,b.from.line)&&r(a,b.from.line).markedSpans,d=tb(a,b.to.line)&&r(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==x(b.from,b.to),h;if(c)for(var k=0;k<
15
+ c.length;++k){var l=c[k],m=l.marker;if(null==l.from||(m.inclusiveLeft?l.from<=e:l.from<e)||!(l.from!=e||"bookmark"!=m.type||g&&l.marker.insertLeft)){var n=null==l.to||(m.inclusiveRight?l.to>=e:l.to>e);(h||(h=[])).push(new ec(m,l.from,n?null:l.to))}}var c=h,p;if(d)for(h=0;h<d.length;++h)if(k=d[h],l=k.marker,null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&"bookmark"==l.type&&(!g||k.marker.insertLeft))m=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(p||(p=[])).push(new ec(l,m?null:k.from-
16
+ f,null==k.to?null:k.to-f));d=p;f=1==b.text.length;g=B(b.text).length+(f?e:0);if(c)for(p=0;p<c.length;++p)if(h=c[p],null==h.to)(k=ub(d,h.marker),k)?f&&(h.to=null==k.to?null:k.to+g):h.to=e;if(d)for(e=0;e<d.length;++e)p=d[e],null!=p.to&&(p.to+=g),null==p.from?ub(c,p.marker)||(p.from=g,f&&(c||(c=[])).push(p)):(p.from+=g,f&&(c||(c=[])).push(p));c&&(c=Qd(c));d&&d!=c&&(d=Qd(d));e=[c];if(!f){var f=b.text.length-2,u;if(0<f&&c)for(g=0;g<c.length;++g)null==c[g].to&&(u||(u=[])).push(new ec(c[g].marker,null,null));
17
+ for(c=0;c<f;++c)e.push(u);e.push(d)}return e}function Qd(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&!1!==c.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function Qf(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=K(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(0),f=0;f<a.length;++f){var g=
18
+ a[f];if(!(0>x(g.to,e.from)||0<x(g.from,e.to))){var h=[f,1],k=x(g.from,e.from),l=x(g.to,e.to);(0>k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<l||!c.inclusiveRight&&!l)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-3}}}return a}function Rd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Sd(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Td(a,b){var c=a.lines.length-
19
+ b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=x(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=x(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?c:b.id-a.id}function Ia(a,b){var c=xa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||0>Td(d,e.marker))&&(d=e.marker);return d}function Ud(a,b,c,d,e){a=r(a,b);if(a=xa&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var g=
20
+ f.marker.find(0),h=x(g.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=x(g.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0<=x(g.to,c):0<x(g.to,c))||0<=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0>=x(g.from,d):0>x(g.from,d))))return!0}}}function ja(a){for(var b;b=Ia(a,!0);)a=b.find(-1,!0).line;return a}function Qc(a,b){var c=r(a,b),d=ja(c);return c==d?b:D(d)}function Vd(a,b){if(b>a.lastLine())return b;
21
+ var c=r(a,b),d;if(!Ja(a,c))return b;for(;d=Ia(c,!1);)c=d.find(1,!0).line;return D(c)+1}function Ja(a,b){var c=xa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&Rc(a,b,d)))return!0}function Rc(a,b,c){if(null==c.to)return b=c.marker.find(1,!0),Rc(a,b.line,ub(b.line.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],
22
+ d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(null==d.to||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Rc(a,b,d))return!0}function ka(a){a=ja(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;else b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length&&(e=a.children[d],e!=c);++d)b+=e.height;return b}function fc(a){if(0==a.height)return 0;for(var b=a.text.length,c,d=a;c=Ia(d,!0);)c=c.find(0,!0),d=c.from.line,b+=c.from.ch-
23
+ c.to.ch;for(d=a;c=Ia(d,!1);)a=c.find(0,!0),b-=d.text.length-a.from.ch,d=a.to.line,b+=d.text.length-a.to.ch;return b}function Sc(a){var b=a.display;a=a.doc;b.maxLine=r(a,a.first);b.maxLineLength=fc(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=fc(a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function Rf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=
24
+ !0}e||d(b,c,"ltr")}function Tc(a,b,c){var d;vb=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:vb=e);f.from==b&&(f.from!=f.to&&"before"!=c?d=e:vb=e)}return null!=d?d:vb}function ya(a){var b=a.order;null==b&&(b=a.order=Sf(a.text));return b}function Uc(a,b,c){b=Od(a.text,b+c,c);return 0>b||b>a.text.length?null:b}function Vc(a,b,c){a=Uc(a,b.ch,c);return null==a?null:new q(b.line,a,0>c?"after":"before")}function Wc(a,b,c,d,e){if(a&&(a=ya(c))){a=
25
+ 0>e?B(a):a[0];var f=0>e==(1==a.level)?"after":"before",g;if(0<a.level){var h=Wa(b,c);g=0>e?c.text.length-1:0;var k=qa(b,h,g).top;g=bc(function(a){return qa(b,h,a).top==k},0>e==(1==a.level)?a.from:a.to-1,g);"before"==f&&(g=Uc(c,g,1,!0))}else g=0>e?a.to:a.from;return new q(d,g,f)}return new q(d,0>e?c.text.length:0,0>e?"before":"after")}function Wd(a,b,c,d){var e=ya(b);if(!e)return Vc(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):0>=c.ch&&(c.ch=0,c.sticky="after");var f=Tc(e,c.ch,
26
+ c.sticky),g=e[f];if(0==g.level%2&&(0<d?g.to>c.ch:g.from<c.ch))return Vc(b,c,d);var h=function(a,d){return Uc(b,a instanceof q?a.ch:a,d)},k,l=function(d){if(!a.options.lineWrapping)return{begin:0,end:b.text.length};var c=k=k||Wa(a,b);d=Ka(a,b,qa(a,c,d),"line").top;return Xd(a,b,c,d)},m=l("before"==c.sticky?h(c,-1):c.ch);if(1==g.level%2){var n=h(c,-d);if(null!=n&&(0<d?n>=g.from&&n>=m.begin:n<=g.to&&n<=m.end))return new q(c.line,n,0>d?"before":"after")}g=function(a,b,d){for(var f=function(a,b){return b?
27
+ new q(c.line,h(a,1),"before"):new q(c.line,a,"after")};0<=a&&a<e.length;a+=b){var g=e[a],k=0<b==(1!=g.level),l=k?d.begin:h(d.end,-1);if(g.from<=l&&l<g.to)return f(l,k);l=k?g.from:h(g.to,-1);if(d.begin<=l&&l<d.end)return f(l,k)}};if(f=g(f+d,d,m))return f;m=0<d?m.end:h(m.begin,-1);return null==m||0<d&&m==b.text.length||!(f=g(0<d?0:e.length-1,d,l(m)))?null:f}function ca(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=(a=a._handlers)&&
28
+ a[b];d&&(c=K(d,c),-1<c&&(a[b]=d.slice(0,c).concat(d.slice(c+1))))}}function F(a,b){var c=a._handlers&&a._handlers[b]||gc;if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function H(a,b,c){"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}});F(a,c||b.type,a,b);return Xc(b)||b.codemirrorIgnore}function Yd(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=
29
+ []);for(var c=0;c<b.length;++c)-1==K(a,b[c])&&a.push(b[c])}}function ba(a,b){return 0<(a._handlers&&a._handlers[b]||gc).length}function Xa(a){a.prototype.on=function(a,c){w(this,a,c)};a.prototype.off=function(a,c){ca(this,a,c)}}function P(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Zd(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Xc(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function wb(a){P(a);Zd(a)}function $d(a){var b=a.which;
30
+ null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));da&&a.ctrlKey&&1==b&&(b=3);return b}function Tf(a){if(null==Yc){var b=v("span","\u200b");W(a,v("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Yc=1>=b.offsetWidth&&2<b.offsetHeight&&!(C&&8>z))}a=Yc?v("span","\u200b"):v("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text","");return a}function Uf(a,b){2<arguments.length&&(b.dependencies=Array.prototype.slice.call(arguments,
31
+ 2));Zc[a]=b}function hc(a){if("string"==typeof a&&Ya.hasOwnProperty(a))a=Ya[a];else if(a&&"string"==typeof a.name&&Ya.hasOwnProperty(a.name)){var b=Ya[a.name];"string"==typeof b&&(b={name:b});a=Md(b,a);a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml#x2F;.test(a))return hc("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json#x2F;.test(a))return hc("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function $c(a,b){b=hc(b);var c=Zc[b.name];if(!c)return $c(a,
32
+ "text/plain");c=c(a,b);if(Za.hasOwnProperty(b.name)){var d=Za[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;b.helperType&&(c.helperType=b.helperType);if(b.modeProps)for(var f in b.modeProps)c[f]=b.modeProps[f];return c}function Vf(a,b){var c=Za.hasOwnProperty(a)?Za[a]:Za[a]={};Fa(b,c)}function ra(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}
33
+ function ad(a,b){for(var c;a.innerMode;){c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}}function ae(a,b,c){return a.startState?a.startState(b,c):!0}function be(a,b,c,d){var e=[a.state.modeGen],f={};ce(a,b.text,a.doc.mode,c,function(a,b){return e.push(a,b)},f,d);c=function(d){var c=a.state.overlays[d],g=1,l=0;ce(a,b.text,c.mode,!0,function(a,b){for(var d=g;l<a;){var f=e[g];f>a&&e.splice(g,1,a,e[g+1],f);g+=2;l=Math.min(a,f)}if(b)if(c.opaque)e.splice(d,g-d,a,"overlay "+
34
+ b),g=d+2;else for(;d<g;d+=2)f=e[d+1],e[d+1]=(f?f+" ":"")+"overlay "+b},f)};for(d=0;d<a.state.overlays.length;++d)c(d);return{styles:e,classes:f.bgClass||f.textClass?f:null}}function de(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=xb(a,D(b)),e=be(a,b,b.text.length>a.options.maxHighlightLength?ra(a.doc.mode,d):d);b.stateAfter=d;b.styles=e.styles;e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null);c===a.doc.frontier&&a.doc.frontier++}return b.styles}function xb(a,b,c){var d=
35
+ a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Wf(a,b,c),g=f>d.first&&r(d,f-1).stateAfter,g=g?ra(d.mode,g):ae(d.mode);d.iter(f,b,function(c){bd(a,c.text,g);c.stateAfter=f==b-1||0==f%5||f>=e.viewFrom&&f<e.viewTo?ra(d.mode,g):null;++f});c&&(d.frontier=f);return g}function bd(a,b,c,d){var e=a.doc.mode;a=new I(b,a.options.tabSize);a.start=a.pos=d||0;for(""==b&&ee(e,c);!a.eol();)cd(e,a,c),a.start=a.pos}function ee(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=ad(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}
36
+ function cd(a,b,c,d){for(var e=0;10>e;e++){d&&(d[0]=ad(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");}function fe(a,b,c,d){var e=function(a){return{start:m.start,end:m.pos,string:m.current(),type:h||null,state:a?ra(f.mode,l):l}},f=a.doc,g=f.mode,h;b=t(f,b);var k=r(f,b.line),l=xb(a,b.line,c),m=new I(k.text,a.options.tabSize),n;for(d&&(n=[]);(d||m.pos<b.ch)&&!m.eol();)m.start=m.pos,h=cd(g,m,l),d&&n.push(e(!0));return d?n:e()}function ge(a,
37
+ b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:(new RegExp("(?:^|s)"+c[2]+"(?:$|s)")).test(b[d])||(b[d]+=" "+c[2])}return a}function ce(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,l=null,m=new I(b,a.options.tabSize),n,p=a.options.addModeClass&&[null];for(""==b&&ge(ee(c,d),f);!m.eol();){m.pos>a.options.maxHighlightLength?(h=!1,g&&
38
+ bd(a,b,d,m.pos),m.pos=b.length,n=null):n=ge(cd(c,m,d,p),f);if(p){var u=p[0].name;u&&(n="m-"+(n?u+" "+n:u))}if(!h||l!=n){for(;k<m.start;)k=Math.min(m.start,k+5E3),e(k,l);l=n}m.start=m.pos}for(;k<m.pos;)a=Math.min(m.pos,k+5E3),e(a,l),k=a}function Wf(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=r(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=aa(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function he(a,b){if(!a||
39
+ /^\s*#x2F;.test(a))return null;var c=b.addModeClass?Xf:Yf;return c[a]||(c[a]=a.replace(/\S+/g,"cm-amp;"))}function ie(a,b){var c=v("span",null,null,L?"padding-right: .1px":null),d={pre:v("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(C||L)&&a.getOption("lineWrapping")};c.setAttribute("role","presentation");d.pre.setAttribute("role","presentation");b.measure={};for(c=0;c<=(b.rest?b.rest.length:0);c++){var e=c?b.rest[c-1]:b.line,f=void 0;d.pos=0;d.addToken=Zf;var g;
40
+ g=a.display.measure;if(null!=dd)g=dd;else{var h=W(g,document.createTextNode("A\u062eA")),k=$a(h,0,1).getBoundingClientRect(),h=$a(h,1,2).getBoundingClientRect();ha(g);g=k&&k.left!=k.right?dd=3>h.right-k.right:!1}g&&(f=ya(e))&&(d.addToken=$f(d.addToken,f));d.map=[];var l=b!=a.display.externalMeasured&&D(e);a:{var m=h=k=g=void 0,n=void 0,p=void 0,u=void 0,f=d,l=de(a,e,l),q=e.markedSpans,r=e.text,w=0;if(q)for(var x=r.length,t=0,B=1,La="",la=0;;){if(la==t){n=m=h=k=p="";g=null;for(var la=Infinity,sa=[],
41
+ V=void 0,A=0;A<q.length;++A){var y=q[A],z=y.marker;"bookmark"==z.type&&y.from==t&&z.widgetNode?sa.push(z):y.from<=t&&(null==y.to||y.to>t||z.collapsed&&y.to==t&&y.from==t)?(null!=y.to&&y.to!=t&&la>y.to&&(la=y.to,m=""),z.className&&(n+=" "+z.className),z.css&&(p=(p?p+";":"")+z.css),z.startStyle&&y.from==t&&(h+=" "+z.startStyle),z.endStyle&&y.to==la&&(V||(V=[])).push(z.endStyle,y.to),z.title&&!k&&(k=z.title),z.collapsed&&(!g||0>Td(g.marker,z))&&(g=y)):y.from>t&&la>y.from&&(la=y.from)}if(V)for(A=0;A<
42
+ V.length;A+=2)V[A+1]==la&&(m+=" "+V[A]);if(!g||g.from==t)for(V=0;V<sa.length;++V)je(f,0,sa[V]);if(g&&(g.from||0)==t){je(f,(null==g.to?x+1:g.to)-t,g.marker,null==g.from);if(null==g.to)break a;g.to==t&&(g=!1)}}if(t>=x)break;for(sa=Math.min(x,la);;){if(La){V=t+La.length;g||(A=V>sa?La.slice(0,sa-t):La,f.addToken(f,A,u?u+n:n,h,t+A.length==la?m:"",k,p));if(V>=sa){La=La.slice(sa-t);t=sa;break}t=V;h=""}La=r.slice(w,w=l[B++]);u=he(l[B++],f.cm.options)}}else for(g=1;g<l.length;g+=2)f.addToken(f,r.slice(w,w=
43
+ l[g]),he(l[g+1],f.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(d.bgClass=Fc(e.styleClasses.bgClass,d.bgClass||"")),e.styleClasses.textClass&&(d.textClass=Fc(e.styleClasses.textClass,d.textClass||"")));0==d.map.length&&d.map.push(0,0,d.content.appendChild(Tf(a.display.measure)));0==c?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}L&&(c=d.content.lastChild,/\bcm-tab\b/.test(c.className)||c.querySelector&&
44
+ c.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack");F(a,"renderLine",a,b.line,d.pre);d.pre.className&&(d.textClass=Fc(d.pre.className,d.textClass||""));return d}function ag(a){var b=v("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);b.setAttribute("aria-label",b.title);return b}function Zf(a,b,c,d,e,f,g){if(b){var h;if(a.splitSpaces)if(h=a.trailingSpace,1<b.length&&!/ /.test(b))h=b;else{for(var k="",l=0;l<b.length;l++){var m=b.charAt(l);" "!=m||!h||l!=
45
+ b.length-1&&32!=b.charCodeAt(l+1)||(m="\u00a0");k+=m;h=" "==m}h=k}else h=b;k=h;l=a.cm.state.specialChars;m=!1;if(l.test(b)){h=document.createDocumentFragment();for(var n=0;;){l.lastIndex=n;var p=l.exec(b),u=p?p.index-n:b.length-n;if(u){var q=document.createTextNode(k.slice(n,n+u));C&&9>z?h.appendChild(v("span",[q])):h.appendChild(q);a.map.push(a.pos,a.pos+u,q);a.col+=u;a.pos+=u}if(!p)break;n+=u+1;"\t"==p[0]?(p=a.cm.options.tabSize,p-=a.col%p,u=h.appendChild(v("span",Ic(p),"cm-tab")),u.setAttribute("role",
46
+ "presentation"),u.setAttribute("cm-text","\t"),a.col+=p):("\r"==p[0]||"\n"==p[0]?(u=h.appendChild(v("span","\r"==p[0]?"\u240d":"\u2424","cm-invalidchar")),u.setAttribute("cm-text",p[0])):(u=a.cm.options.specialCharPlaceholder(p[0]),u.setAttribute("cm-text",p[0]),C&&9>z?h.appendChild(v("span",[u])):h.appendChild(u)),a.col+=1);a.map.push(a.pos,a.pos+1,u);a.pos++}}else a.col+=b.length,h=document.createTextNode(k),a.map.push(a.pos,a.pos+b.length,h),C&&9>z&&(m=!0),a.pos+=b.length;a.trailingSpace=32==k.charCodeAt(b.length-
47
+ 1);if(c||d||e||m||g)return b=c||"",d&&(b+=d),e&&(b+=e),d=v("span",[h],b,g),f&&(d.title=f),a.content.appendChild(d);a.content.appendChild(h)}}function $f(a,b){return function(c,d,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var l=c.pos,m=l+d.length;;){for(var n=void 0,p=0;p<b.length&&!(n=b[p],n.to>l&&n.from<=l);p++);if(n.to>=m)return a(c,d,e,f,g,h,k);a(c,d.slice(0,n.to-l),e,f,null,h,k);f=null;d=d.slice(n.to-l);l=n.to}}}function je(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+
48
+ b,e);!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function ke(a,b,c){for(var d=this.line=b,e;d=Ia(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);this.size=(this.rest=e)?D(B(this.rest))-c+1:1;this.node=this.text=null;this.hidden=Ja(a,b)}function ic(a,b,c){var d=[],e;for(e=b;e<c;)b=new ke(a.doc,r(a.doc,e),e),e+=
49
+ b.size,d.push(b);return d}function bg(a,b){var c=a.ownsGroup;if(c)try{var d=c.delayedCallbacks,e=0;do{for(;e<d.length;e++)d[e].call(null);for(var f=0;f<c.ops.length;f++){var g=c.ops[f];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(e<d.length)}finally{ab=null,b(c)}}function M(a,b){var c=a._handlers&&a._handlers[b]||gc;if(c.length){var d=Array.prototype.slice.call(arguments,2),e;ab?e=
50
+ ab.delayedCallbacks:yb?e=yb:(e=yb=[],setTimeout(cg,0));for(var f=function(a){e.push(function(){return c[a].apply(null,d)})},g=0;g<c.length;++g)f(g)}}function cg(){var a=yb;yb=null;for(var b=0;b<a.length;++b)a[b]()}function le(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){var f=b,g=f.text.className,h=me(a,f);f.text==f.node&&(f.node=h.pre);f.text.parentNode.replaceChild(h.pre,f.text);f.text=h.pre;h.bgClass!=f.bgClass||h.textClass!=f.textClass?(f.bgClass=h.bgClass,f.textClass=
51
+ h.textClass,ed(f)):g&&(f.text.className=g)}else if("gutter"==f)ne(a,b,c,d);else if("class"==f)ed(b);else if("widget"==f){f=a;g=b;h=d;g.alignable&&(g.alignable=null);for(var k=g.node.firstChild,l;k;k=l)l=k.nextSibling,"CodeMirror-linewidget"==k.className&&g.node.removeChild(k);oe(f,g,h)}}b.changes=null}function zb(a){a.node==a.text&&(a.node=v("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),C&&8>z&&(a.node.style.zIndex=
52
+ 2));return a.node}function me(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):ie(a,b)}function ed(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;b&&(b+=" CodeMirror-linebackground");if(a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=zb(a);a.background=c.insertBefore(v("div",null,b),c.firstChild)}a.line.wrapClass?zb(a).className=
53
+ a.line.wrapClass:a.node!=a.text&&(a.node.className="");a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass)||""}function ne(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null);if(b.line.gutterClass){var e=zb(b);b.gutterBackground=v("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+
54
+ d.gutterTotalWidth+"px");e.insertBefore(b.gutterBackground,b.text)}e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=zb(b),g=b.gutter=v("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");a.display.input.setUneditable(g);f.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(v("div",Mc(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt",
55
+ "left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;b<a.options.gutters.length;++b)c=a.options.gutters[b],(f=e.hasOwnProperty(c)&&e[c])&&g.appendChild(v("div",[f],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}function dg(a,b,c,d){var e=me(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);ed(b);ne(a,b,c,d);oe(a,b,d);return b.node}function oe(a,b,c){pe(a,
56
+ b.line,b,c,!0);if(b.rest)for(var d=0;d<b.rest.length;d++)pe(a,b.rest[d],b,c,!1)}function pe(a,b,c,d,e){if(b.widgets){var f=zb(c),g=0;for(b=b.widgets;g<b.length;++g){var h=b[g],k=v("div",[h.node],"CodeMirror-linewidget");h.handleMouseEvents||k.setAttribute("cm-ignore-events","true");var l=h,m=k,n=d;if(l.noHScroll){(c.alignable||(c.alignable=[])).push(m);var p=n.wrapperWidth;m.style.left=n.fixedPos+"px";l.coverGutter||(p-=n.gutterTotalWidth,m.style.paddingLeft=n.gutterTotalWidth+"px");m.style.width=
57
+ p+"px"}l.coverGutter&&(m.style.zIndex=5,m.style.position="relative",l.noHScroll||(m.style.marginLeft=-n.gutterTotalWidth+"px"));a.display.input.setUneditable(k);e&&h.above?f.insertBefore(k,c.gutter||c.text):f.appendChild(k);M(h,"redraw")}}}function Ab(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!Yb(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;");a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+
58
+ "px;");W(b.display.measure,v("div",[a.node],null,c))}return a.height=a.node.parentNode.offsetHeight}function ta(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function fd(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function qe(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=W(a.measure,v("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,
59
+ b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function ma(a){return 30-a.display.nativeBarWidth}function Ma(a){return a.display.scroller.clientWidth-ma(a)-a.display.barWidth}function gd(a){return a.display.scroller.clientHeight-ma(a)-a.display.barHeight}function re(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};
60
+ for(b=0;b<a.rest.length;b++)if(D(a.rest[b])>c)return{map:a.measure.maps[b],cache:a.measure.caches[b],before:!0}}function hd(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Na(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function Wa(a,b){var c=D(b),d=hd(a,c);d&&!d.text?d=null:d&&d.changes&&(le(a,d,c,id(a)),a.curOp.forceUpdate=!0);if(!d){var e;e=ja(b);d=D(e);e=a.display.externalMeasured=new ke(a.doc,e,d);e.lineN=d;d=e.built=ie(a,e);e.text=
61
+ d.pre;W(a.display.lineMeasure,d.pre);d=e}c=re(d,b,c);return{line:b,view:d,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function qa(a,b,c,d,e){b.before&&(c=-1);var f=c+(d||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,l=k&&Ma(a);if(!g.measure.heights||k&&g.measure.width!=l){var m=g.measure.heights=[];if(k)for(g.measure.width=l,g=g.text.firstChild.getClientRects(),
62
+ k=0;k<g.length-1;k++){var l=g[k],n=g[k+1];2<Math.abs(l.bottom-n.bottom)&&m.push((l.bottom+n.top)/2-h.top)}m.push(h.bottom-h.top)}b.hasHeights=!0}m=d;g=se(b.map,c,m);d=g.node;h=g.start;k=g.end;c=g.collapse;var p;if(3==d.nodeType){for(var u=0;4>u;u++){for(;h&&Kc(b.line.text.charAt(g.coverStart+h));)--h;for(;g.coverStart+k<g.coverEnd&&Kc(b.line.text.charAt(g.coverStart+k));)++k;if(C&&9>z&&0==h&&k==g.coverEnd-g.coverStart)p=d.parentNode.getBoundingClientRect();else{p=$a(d,h,k).getClientRects();k=te;if("left"==
63
+ m)for(l=0;l<p.length&&(k=p[l]).left==k.right;l++);else for(l=p.length-1;0<=l&&(k=p[l]).left==k.right;l--);p=k}if(p.left||p.right||0==h)break;k=h;--h;c="right"}C&&11>z&&((u=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=jd?u=jd:(m=W(a.display.measure,v("span","x")),u=m.getBoundingClientRect(),m=$a(m,0,1).getBoundingClientRect(),u=jd=1<Math.abs(u.left-m.left)),u=!u),u||(u=screen.logicalXDPI/screen.deviceXDPI,m=screen.logicalYDPI/screen.deviceYDPI,p={left:p.left*
64
+ u,right:p.right*u,top:p.top*m,bottom:p.bottom*m}))}else 0<h&&(c=m="right"),p=a.options.lineWrapping&&1<(u=d.getClientRects()).length?u["right"==m?u.length-1:0]:d.getBoundingClientRect();!(C&&9>z)||h||p&&(p.left||p.right)||(p=(p=d.parentNode.getClientRects()[0])?{left:p.left,right:p.left+Bb(a.display),top:p.top,bottom:p.bottom}:te);d=p.top-b.rect.top;h=p.bottom-b.rect.top;u=(d+h)/2;m=b.view.measure.heights;for(g=0;g<m.length-1&&!(u<m[g]);g++);c={left:("right"==c?p.right:p.left)-b.rect.left,right:("left"==
65
+ c?p.left:p.right)-b.rect.left,top:g?m[g-1]:0,bottom:m[g]};p.left||p.right||(c.bogus=!0);a.options.singleCursorHeightPerLine||(c.rtop=d,c.rbottom=h);a=c;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function se(a,b,c){for(var d,e,f,g,h,k,l=0;l<a.length;l+=3){h=a[l];k=a[l+1];if(b<h)e=0,f=1,g="left";else if(b<k)e=b-h,f=e+1;else if(l==a.length-3||b==k&&a[l+3]>b)f=k-h,e=f-1,b>=k&&(g="right");if(null!=e){d=a[l+2];h==k&&c==(d.insertLeft?"left":"right")&&
66
+ (g=c);if("left"==c&&0==e)for(;l&&a[l-2]==a[l-3]&&a[l-1].insertLeft;)d=a[(l-=3)+2],g="left";if("right"==c&&e==k-h)for(;l<a.length-3&&a[l+3]==a[l+4]&&!a[l+5].insertLeft;)d=a[(l+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:h,coverEnd:k}}function ue(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function ve(a){a.display.externalMeasure=null;ha(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)ue(a.display.view[b])}
67
+ function Cb(a){ve(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function Ka(a,b,c,d,e){if(!e&&b.widgets)for(e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Ab(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ka(b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=a.display.lineSpace.getBoundingClientRect(),
68
+ b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function we(a,b,c){if("div"==c)return b;var d=b.left;b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=a.display.sizer.getBoundingClientRect(),
69
+ d+=c.left,b+=c.top);a=a.display.lineSpace.getBoundingClientRect();return{left:d-a.left,top:b-a.top}}function jc(a,b,c,d,e){d||(d=r(a.doc,b.line));var f=d;b=b.ch;d=qa(a,Wa(a,d),b,e);return Ka(a,f,d,c)}function ea(a,b,c,d,e,f){function g(b,g){var h=qa(a,e,b,g?"right":"left",f);g?h.left=h.right:h.right=h.left;return Ka(a,d,h,c)}function h(a,b,d){return g(d?a-1:a,0!=k[b].level%2!=d)}d=d||r(a.doc,b.line);e||(e=Wa(a,d));var k=ya(d),l=b.ch;b=b.sticky;l>=d.text.length?(l=d.text.length,b="before"):0>=l&&(l=
70
+ 0,b="after");if(!k)return g("before"==b?l-1:l,"before"==b);var m=Tc(k,l,b),n=vb,m=h(l,m,"before"==b);null!=n&&(m.other=h(l,n,"before"!=b));return m}function xe(a,b){var c=0;b=t(a.doc,b);a.options.lineWrapping||(c=Bb(a.display)*b.ch);var d=r(a.doc,b.line),e=ka(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function kd(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return a=q(d.first,0,null),a.xRel=-1,a.outside=!0,a;var e=Ha(d,c),f=d.first+d.size-1;if(e>f)return a=
71
+ r(d,f).text.length,a=q(d.first+d.size-1,a,null),a.xRel=1,a.outside=!0,a;0>b&&(b=0);for(f=r(d,e);;)if(d=eg(a,f,e,b,c),f=(e=Ia(f,!1))&&e.find(0,!0),e&&(d.ch>f.from.ch||d.ch==f.from.ch&&0<d.xRel))e=D(f=f.to.line);else return d}function Xd(a,b,c,d){var e=b.text.length,f=bc(function(e){return Ka(a,b,qa(a,c,e-1),"line").bottom<=d},e,0),e=bc(function(e){return Ka(a,b,qa(a,c,e),"line").top>d},f,e);return{begin:f,end:e}}function eg(a,b,c,d,e){e-=ka(b);var f=0,g=b.text.length,h=Wa(a,b);if(ya(b)){if(a.options.lineWrapping){var k;
72
+ k=Xd(a,b,h,e);f=k.begin;g=k.end;k}c=new q(c,f);var l=ea(a,c,"line",b,h).left;k=l<d?1:-1;var m=l-d,n;do{l=m;n=c;c=Wd(a,b,c,k);if(null==c||c.ch<f||g<=("before"==c.sticky?c.ch-1:c.ch)){c=n;break}m=ea(a,c,"line",b,h).left-d}while(0>k!=0>m&&Math.abs(m)<=Math.abs(l));if(Math.abs(m)>Math.abs(l)){if(0>m==0>l)throw Error("Broke out of infinite loop in coordsCharInner");c=n}}else f=bc(function(c){var f=Ka(a,b,qa(a,h,c),"line");return f.top>e?(g=Math.min(c,g),!0):f.bottom<=e?!1:f.left>d?!0:f.right<d?!1:d-f.left<
73
+ f.right-d},f,g),f=Od(b.text,f,1),c=new q(c,f,f==g?"before":"after");f=ea(a,c,"line",b,h);if(e<f.top||f.bottom<e)c.outside=!0;c.xRel=d<f.left?-1:d>f.right?1:0;return c}function Oa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Pa){Pa=v("pre");for(var b=0;49>b;++b)Pa.appendChild(document.createTextNode("x")),Pa.appendChild(v("br"));Pa.appendChild(document.createTextNode("x"))}W(a.measure,Pa);b=Pa.offsetHeight/50;3<b&&(a.cachedTextHeight=b);ha(a.measure);return b||1}function Bb(a){if(null!=
74
+ a.cachedCharWidth)return a.cachedCharWidth;var b=v("span","xxxxxxxxxx"),c=v("pre",[b]);W(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function id(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:ld(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}
75
+ function ld(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function ye(a){var b=Oa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Bb(a.display)-3);return function(e){if(Ja(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function md(a){var b=a.doc,c=ye(a);b.iter(function(a){var b=c(a);b!=a.height&&ia(a,
76
+ b)})}function Qa(a,b,c,d){var e=a.display;if(!c&&"true"==(b.target||b.srcElement).getAttribute("cm-not-content"))return null;var f,g;c=e.lineSpace.getBoundingClientRect();try{f=b.clientX-c.left,g=b.clientY-c.top}catch(k){return null}b=kd(a,f,g);var h;d&&1==b.xRel&&(h=r(a.doc,b.line).text).length==b.ch&&(d=aa(h,h.length,a.options.tabSize)-h.length,b=q(b.line,Math.max(0,Math.round((f-qe(a.display).left)/Bb(a.display))-d)));return b}function Na(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;
77
+ if(0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Db(a){a.display.input.showSelection(a.display.input.prepareSelection())}function ze(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(!1!==b||g!=c.sel.primIndex){var h=c.sel.ranges[g];if(!(h.from().line>=a.display.viewTo||h.to().line<a.display.viewFrom)){var k=h.empty();(k||a.options.showCursorWhenSelecting)&&
78
+ Ae(a,h.head,e);k||fg(a,h,f)}}return d}function Ae(a,b,c){b=ea(a,b,"div",null,null,!a.options.singleCursorHeightPerLine);var d=c.appendChild(v("div","\u00a0","CodeMirror-cursor"));d.style.left=b.left+"px";d.style.top=b.top+"px";d.style.height=Math.max(0,b.bottom-b.top)*a.options.cursorHeight+"px";b.other&&(a=c.appendChild(v("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),a.style.display="",a.style.left=b.other.left+"px",a.style.top=b.other.top+"px",a.style.height=.85*(b.other.bottom-
79
+ b.other.top)+"px")}function fg(a,b,c){function d(a,b,d,c){0>b&&(b=0);b=Math.round(b);c=Math.round(c);h.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n top: "+b+"px; width: "+(null==d?m-a:d)+"px;\n height: "+(c-b)+"px"))}function e(b,c,e){var f=r(g,b),h=f.text.length,k,n;Rf(ya(f),c||0,null==e?h:e,function(g,p,u){var t=jc(a,q(b,g),"div",f,"left"),r,v;g==p?(r=t,u=v=t.left):(r=jc(a,q(b,p-1),"div",f,"right"),"rtl"==
80
+ u&&(u=t,t=r,r=u),u=t.left,v=r.right);null==c&&0==g&&(u=l);3<r.top-t.top&&(d(u,t.top,null,t.bottom),u=l,t.bottom<r.top&&d(u,t.bottom,null,r.top));null==e&&p==h&&(v=m);if(!k||t.top<k.top||t.top==k.top&&t.left<k.left)k=t;if(!n||r.bottom>n.bottom||r.bottom==n.bottom&&r.right>n.right)n=r;u<l+1&&(u=l);d(u,r.top,v-u,r.bottom)});return{start:k,end:n}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=qe(a.display),l=k.left,m=Math.max(f.sizerWidth,Ma(a)-f.sizer.offsetLeft)-k.right,f=b.from();b=
81
+ b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var n=r(g,f.line),k=r(g,b.line),k=ja(n)==ja(k),f=e(f.line,f.ch,k?n.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(d(f.right,f.top,null,f.bottom),d(l,b.top,b.left,b.bottom)):d(f.right,f.top,b.left-f.right,f.bottom));f.bottom<b.top&&d(l,f.bottom,null,b.top)}c.appendChild(h)}function nd(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="";0<a.options.cursorBlinkRate?b.blinker=
82
+ setInterval(function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function Be(a){a.state.focused||(a.display.input.focus(),od(a))}function gg(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Eb(a))},100)}function od(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1);"nocursor"!=a.options.readOnly&&(a.state.focused||
83
+ (F(a,"focus",a,b),a.state.focused=!0,Va(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),L&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),nd(a))}function Eb(a,b){a.state.delayingBlurEvent||(a.state.focused&&(F(a,"blur",a,b),a.state.focused=!1,bb(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function pd(a){var b=
84
+ a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=ld(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&(c[g].gutter&&(c[g].gutter.style.left=f),c[g].gutterBackground&&(c[g].gutterBackground.style.left=f));var h=c[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function Ce(a){if(!a.options.lineNumbers)return!1;
85
+ var b=a.doc,b=Mc(a.options,b.first+b.size-1),c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(v("div",[v("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth,d=d.offsetWidth-e;c.lineGutter.style.width="";c.lineNumInnerWidth=Math.max(e,c.lineGutter.offsetWidth-d)+1;c.lineNumWidth=c.lineNumInnerWidth+d;c.lineNumChars=c.lineNumInnerWidth?b.length:-1;c.lineGutter.style.width=c.lineNumWidth+"px";qd(a);return!0}return!1}function kc(a){a=a.display;for(var b=
86
+ a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d=a.view[c],e;if(!d.hidden){if(C&&8>z){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else e=d.node.getBoundingClientRect(),e=e.bottom-e.top;f=d.line.height-e;2>e&&(e=Oa(a));if(.001<f||-.001>f)if(ia(d.line,e),De(d.line),d.rest)for(e=0;e<d.rest.length;e++)De(d.rest[e])}}}function De(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function rd(a,b,c){var d=c&&null!=c.top?Math.max(0,
87
+ c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop),e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,d=Ha(b,d),e=Ha(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;f<d?(d=f,e=Ha(b,ka(r(b,f))+a.wrapper.clientHeight)):Math.min(c,b.lastLine())>=e&&(d=Ha(b,ka(r(b,c))-a.wrapper.clientHeight),e=c)}return{from:d,to:Math.max(e,d+1)}}function Fb(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,wa||sd(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=
88
+ b),a.display.scrollbars.setScrollTop(b),wa&&sd(a),Gb(a,100))}function cb(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,pd(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function Ee(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:
89
+ null==c&&(c=a.wheelDelta);return{x:b,y:c}}function hg(a){a=Ee(a);a.x*=X;a.y*=X;return a}function Fe(a,b){var c=Ee(b),d=c.x,c=c.y,e=a.display,f=e.scroller,g=f.scrollWidth>f.clientWidth,h=f.scrollHeight>f.clientHeight;if(d&&g||c&&h){if(c&&da&&L){var g=b.target,k=e.view;a:for(;g!=f;g=g.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==g){a.display.currentWheelTarget=g;break a}}!d||wa||fa||null==X?(c&&null!=X&&(h=c*X,g=a.doc.scrollTop,k=g+e.wrapper.clientHeight,0>h?g=Math.max(0,g+h-50):k=Math.min(a.doc.height,
90
+ k+h+50),sd(a,{top:g,bottom:k})),20>lc&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=d,e.wheelDY=c,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(X=(X*lc+a)/(lc+1),++lc)}},200)):(e.wheelDX+=d,e.wheelDY+=c))):(c&&h&&Fb(a,Math.max(0,Math.min(f.scrollTop+c*X,f.scrollHeight-f.clientHeight))),cb(a,Math.max(0,Math.min(f.scrollLeft+
91
+ d*X,f.scrollWidth-f.clientWidth))),(!c||c&&h)&&P(b),e.wheelStartX=null)}}function Hb(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+fd(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+ma(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function db(a,b){b||(b=Hb(a));
92
+ var c=a.display.barWidth,d=a.display.barHeight;Ge(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&kc(a),Ge(a,Hb(a)),c=a.display.barWidth,d=a.display.barHeight}function Ge(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";c.heightForcer.style.borderBottom=d.bottom+"px solid transparent";d.right&&d.bottom?(c.scrollbarFiller.style.display=
93
+ "block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="";d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function He(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&bb(a.display.wrapper,a.display.scrollbars.addClass));
94
+ a.display.scrollbars=new Ie[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);w(b,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)});b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?cb(a,b):Fb(a,b)},a);a.display.scrollbars.addClass&&Va(a.display.wrapper,a.display.scrollbars.addClass)}function mc(a,b,c,d,e){var f=a.display,g=Oa(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?
95
+ a.curOp.scrollTop:f.scroller.scrollTop,k=gd(a),l={};e-c>k&&(e=c+k);var m=a.doc.height+fd(f),n=c<g,g=e>m-g;c<h?l.scrollTop=n?0:c:e>h+k&&(c=Math.min(c,(g?m:e)-k),c!=h&&(l.scrollTop=c));h=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft;a=Ma(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0);(f=d-b>a)&&(d=b+a);10>b?l.scrollLeft=0:b<h?l.scrollLeft=Math.max(0,b-(f?0:10)):d>a+h-3&&(l.scrollLeft=d+(f?0:10)-a);return l}function nc(a,b,c){null==b&&null==c||oc(a);null!=b&&(a.curOp.scrollLeft=
96
+ (null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function eb(a){oc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?q(b.line,b.ch-1):b,d=q(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function oc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=xe(a,b.from),d=xe(a,b.to),b=mc(a,Math.min(c.left,d.left),Math.min(c.top,
97
+ d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function fb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.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:++ig};a=a.curOp;ab?ab.ops.push(a):a.ownsGroup=ab={ops:[a],delayedCallbacks:[]}}function gb(a){bg(a.curOp,function(a){for(var b=
98
+ 0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++){var d=a[b],e=d.cm,f=e.display,g=e.display;!g.scrollbarsClipped&&g.scroller.offsetWidth&&(g.nativeBarWidth=g.scroller.offsetWidth-g.scroller.clientWidth,g.heightForcer.style.height=ma(e)+"px",g.sizer.style.marginBottom=-g.nativeBarWidth+"px",g.sizer.style.borderRightWidth=ma(e)+"px",g.scrollbarsClipped=!0);d.updateMaxLine&&Sc(e);d.mustUpdate=d.viewChanged||d.forceUpdate||null!=d.scrollTop||d.scrollToPos&&(d.scrollToPos.from.line<
99
+ f.viewFrom||d.scrollToPos.to.line>=f.viewTo)||f.maxLineChanged&&e.options.lineWrapping;d.update=d.mustUpdate&&new pc(e,d.mustUpdate&&{top:d.scrollTop,ensure:d.scrollToPos},d.forceUpdate)}for(b=0;b<a.length;b++)d=a[b],d.updatedDisplay=d.mustUpdate&&td(d.cm,d.update);for(b=0;b<a.length;b++)if(d=a[b],e=d.cm,f=e.display,d.updatedDisplay&&kc(e),d.barMeasure=Hb(e),f.maxLineChanged&&!e.options.lineWrapping&&(g=f.maxLine.text.length,g=qa(e,Wa(e,f.maxLine),g,void 0),d.adjustWidthTo=g.left+3,e.display.sizerWidth=
100
+ d.adjustWidthTo,d.barMeasure.scrollWidth=Math.max(f.scroller.clientWidth,f.sizer.offsetLeft+d.adjustWidthTo+ma(e)+e.display.barWidth),d.maxScrollLeft=Math.max(0,f.sizer.offsetLeft+d.adjustWidthTo-Ma(e))),d.updatedDisplay||d.selectionChanged)d.preparedSelection=f.input.prepareSelection(d.focus);for(b=0;b<a.length;b++)d=a[b],e=d.cm,null!=d.adjustWidthTo&&(e.display.sizer.style.minWidth=d.adjustWidthTo+"px",d.maxScrollLeft<e.doc.scrollLeft&&cb(e,Math.min(e.display.scroller.scrollLeft,d.maxScrollLeft),
101
+ !0),e.display.maxLineChanged=!1),f=d.focus&&d.focus==pa()&&(!document.hasFocus||document.hasFocus()),d.preparedSelection&&e.display.input.showSelection(d.preparedSelection,f),(d.updatedDisplay||d.startHeight!=e.doc.height)&&db(e,d.barMeasure),d.updatedDisplay&&ud(e,d.barMeasure),d.selectionChanged&&nd(e),e.state.focused&&d.updateInput&&e.display.input.reset(d.typing),f&&Be(d.cm);for(b=0;b<a.length;b++){var h=void 0,k,d=a[b],e=d.cm,f=e.display,g=e.doc;d.updatedDisplay&&Je(e,d.update);null==f.wheelStartX||
102
+ null==d.scrollTop&&null==d.scrollLeft&&!d.scrollToPos||(f.wheelStartX=f.wheelStartY=null);null==d.scrollTop||f.scroller.scrollTop==d.scrollTop&&!d.forceScroll||(g.scrollTop=Math.max(0,Math.min(f.scroller.scrollHeight-f.scroller.clientHeight,d.scrollTop)),f.scrollbars.setScrollTop(g.scrollTop),f.scroller.scrollTop=g.scrollTop);null==d.scrollLeft||f.scroller.scrollLeft==d.scrollLeft&&!d.forceScroll||(g.scrollLeft=Math.max(0,Math.min(f.scroller.scrollWidth-f.scroller.clientWidth,d.scrollLeft)),f.scrollbars.setScrollLeft(g.scrollLeft),
103
+ f.scroller.scrollLeft=g.scrollLeft,pd(e));if(d.scrollToPos){k=t(g,d.scrollToPos.from);var l=t(g,d.scrollToPos.to),m=d.scrollToPos.margin;null==m&&(m=0);for(var n=0;5>n;n++){var p=!1,h=ea(e,k),u=l&&l!=k?ea(e,l):h,u=mc(e,Math.min(h.left,u.left),Math.min(h.top,u.top)-m,Math.max(h.left,u.left),Math.max(h.bottom,u.bottom)+m),q=e.doc.scrollTop,r=e.doc.scrollLeft;null!=u.scrollTop&&(Fb(e,u.scrollTop),1<Math.abs(e.doc.scrollTop-q)&&(p=!0));null!=u.scrollLeft&&(cb(e,u.scrollLeft),1<Math.abs(e.doc.scrollLeft-
104
+ r)&&(p=!0));if(!p)break}k=h;d.scrollToPos.isCursor&&e.state.focused&&(H(e,"scrollCursorIntoView")||(l=e.display,m=l.sizer.getBoundingClientRect(),h=null,0>k.top+m.top?h=!0:k.bottom+m.top>(window.innerHeight||document.documentElement.clientHeight)&&(h=!1),null==h||jg||(k=v("div","\u200b",null,"position: absolute;\n top: "+(k.top-l.viewOffset-e.display.lineSpace.offsetTop)+"px;\n height: "+(k.bottom-k.top+ma(e)+l.barHeight)+"px;\n left: "+
105
+ k.left+"px; width: 2px;"),e.display.lineSpace.appendChild(k),k.scrollIntoView(h),e.display.lineSpace.removeChild(k))))}k=d.maybeHiddenMarkers;h=d.maybeUnhiddenMarkers;if(k)for(l=0;l<k.length;++l)k[l].lines.length||F(k[l],"hide");if(h)for(k=0;k<h.length;++k)h[k].lines.length&&F(h[k],"unhide");f.wrapper.offsetHeight&&(g.scrollTop=e.display.scroller.scrollTop);d.changeObjs&&F(e,"changes",e,d.changeObjs);d.update&&d.update.finish()}})}function Y(a,b){if(a.curOp)return b();fb(a);try{return b()}finally{gb(a)}}
106
+ function J(a,b){return function(){if(a.curOp)return b.apply(a,arguments);fb(a);try{return b.apply(a,arguments)}finally{gb(a)}}}function R(a){return function(){if(this.curOp)return a.apply(this,arguments);fb(this);try{return a.apply(this,arguments)}finally{gb(this)}}}function N(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);fb(b);try{return a.apply(this,arguments)}finally{gb(b)}}}function Q(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);d||(d=
107
+ 0);var e=a.display;d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)xa&&Qc(a.doc,b)<e.viewTo&&za(a);else if(c<=e.viewFrom)xa&&Vd(a.doc,c+d)>e.viewFrom?za(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)za(a);else if(b<=e.viewFrom){var f=qc(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):za(a)}else if(c>=e.viewTo)(f=qc(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):
108
+ za(a);else{var f=qc(a,b,b,-1),g=qc(a,c,c+d,1);f&&g?(e.view=e.view.slice(0,f.index).concat(ic(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):za(a)}if(a=e.externalMeasured)c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&(e.externalMeasured=null)}function Aa(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null);b<d.viewFrom||b>=d.viewTo||(a=d.view[Na(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==K(a,c)&&a.push(c)))}
109
+ function za(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function qc(a,b,c,d){var e=Na(a,b),f=a.display.view;if(!xa||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=a.display.viewFrom,h=0;h<e;h++)g+=f[h].size;if(g!=b){if(0<d){if(e==f.length-1)return null;b=g+f[e].size-b;e++}else b=g-b;c+=b}for(;Qc(a.doc,c)!=c;){if(e==(0>d?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Ke(a){a=a.display.view;for(var b=
110
+ 0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&!d.changes||++b}return b}function Gb(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Gc(kg,a))}function kg(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ra(b.mode,xb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,
111
+ k=be(a,f,h?ra(b.mode,d):d,!0);f.styles=k.styles;var l=f.styleClasses;(k=k.classes)?f.styleClasses=k:l&&(f.styleClasses=null);l=!g||g.length!=f.styles.length||l!=k&&(!l||!k||l.bgClass!=k.bgClass||l.textClass!=k.textClass);for(k=0;!l&&k<g.length;++k)l=g[k]!=f.styles[k];l&&e.push(b.frontier);f.stateAfter=h?d:ra(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&bd(a,f.text,d),f.stateAfter=0==b.frontier%5?ra(b.mode,d):null;++b.frontier;if(+new Date>c)return Gb(a,a.options.workDelay),!0});e.length&&
112
+ Y(a,function(){for(var b=0;b<e.length;b++)Aa(a,e[b],"text")})}}function td(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return za(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Ke(a))return!1;Ce(a)&&(za(a),b.dims=id(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&20>f-c.viewFrom&&(f=
113
+ Math.max(d.first,c.viewFrom));c.viewTo>g&&20>c.viewTo-g&&(g=Math.min(e,c.viewTo));xa&&(f=Qc(a.doc,f),g=Vd(a.doc,g));d=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=ic(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=ic(a,f,e.viewFrom).concat(e.view):e.viewFrom<f&&(e.view=e.view.slice(Na(a,f))),e.viewFrom=f,e.viewTo<g?e.view=e.view.concat(ic(a,e.viewTo,g)):e.viewTo>g&&(e.view=e.view.slice(0,Na(a,
114
+ g))));e.viewTo=g;c.viewOffset=ka(r(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";g=Ke(a);if(!d&&0==g&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;f=pa();4<g&&(c.lineDiv.style.display="none");lg(a,c.updateLineNumbers,b.dims);4<g&&(c.lineDiv.style.display="");c.renderedView=c.view;f&&pa()!=f&&f.offsetHeight&&f.focus();ha(c.cursorDiv);ha(c.selectionDiv);c.gutters.style.height=c.sizer.style.minHeight=0;d&&(c.lastWrapHeight=b.wrapperHeight,
115
+ c.lastWrapWidth=b.wrapperWidth,Gb(a,400));c.updateLineNumbers=null;return!0}function Je(a,b){for(var c=b.viewport,d=!0;;d=!1){if(!d||!a.options.lineWrapping||b.oldDisplayWidth==Ma(a))if(c&&null!=c.top&&(c={top:Math.min(a.doc.height+fd(a.display)-gd(a),c.top)}),b.visible=rd(a.display,a.doc,c),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!td(a,b))break;kc(a);d=Hb(a);Db(a);db(a,d);ud(a,d)}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=
116
+ a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function sd(a,b){var c=new pc(a,b);if(td(a,c)){kc(a);Je(a,c);var d=Hb(a);Db(a);db(a,d);ud(a,d);c.finish()}}function lg(a,b,c){function d(b){var d=b.nextSibling;L&&da&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return d}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,
117
+ k=e.view,e=e.viewFrom,l=0;l<k.length;l++){var m=k[l];if(!m.hidden)if(m.node&&m.node.parentNode==g){for(;h!=m.node;)h=d(h);h=f&&null!=b&&b<=e&&m.lineNumber;m.changes&&(-1<K(m.changes,"gutter")&&(h=!1),le(a,m,e,c));h&&(ha(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(Mc(a.options,e))));h=m.node.nextSibling}else{var n=dg(a,m,e,c);g.insertBefore(n,h)}e+=m.size}for(;h;)h=d(h)}function qd(a){a.display.sizer.style.marginLeft=a.display.gutters.offsetWidth+"px"}function ud(a,b){a.display.sizer.style.minHeight=
118
+ b.docHeight+"px";a.display.heightForcer.style.top=b.docHeight+"px";a.display.gutters.style.height=b.docHeight+a.display.barHeight+ma(a)+"px"}function Le(a){var b=a.display.gutters,c=a.options.gutters;ha(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(v("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none";qd(a)}function vd(a){var b=K(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?
119
+ a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):-1<b&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function ga(a,b){var c=a[b];a.sort(function(a,b){return x(a.from(),b.from())});b=K(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(0<=x(e.to(),d.from())){var f=dc(e.from(),d.from()),g=cc(e.to(),d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new A(d?g:f,d?f:g))}}return new Z(a,b)}function ua(a,b){return new Z([new A(a,b||a)],0)}function Ba(a){return a.text?
120
+ q(a.from.line+a.text.length-1,B(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function Me(a,b){if(0>x(a,b.from))return a;if(0>=x(a,b.to))return Ba(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=Ba(b).ch-b.to.ch);return q(c,d)}function wd(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new A(Me(e.anchor,b),Me(e.head,b)))}return ga(c,a.sel.primIndex)}function Ne(a,b,c){return a.line==b.line?q(c.line,a.ch-b.ch+c.ch):q(c.line+
121
+ (a.line-b.line),a.ch)}function xd(a){a.doc.mode=$c(a.options,a.doc.modeOption);Ib(a)}function Ib(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Gb(a,100);a.state.modeGen++;a.curOp&&Q(a)}function Oe(a,b){return 0==b.from.ch&&0==b.to.ch&&""==B(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function yd(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);
122
+ Rd(a);Sd(a,e);c=d?d(a):1;c!=a.height&&ia(a,c);M(a,"change",a,b)}function f(a,b){for(var e=[],f=a;f<b;++f)e.push(new hb(k[f],c?c[f]:null,d));return e}var g=b.from,h=b.to,k=b.text,l=r(a,g.line),m=r(a,h.line),n=B(k),p=c?c[k.length-1]:null,u=h.line-g.line;b.full?(a.insert(0,f(0,k.length)),a.remove(k.length,a.size-k.length)):Oe(a,b)?(h=f(0,k.length-1),e(m,m.text,p),u&&a.remove(g.line,u),h.length&&a.insert(g.line,h)):l==m?1==k.length?e(l,l.text.slice(0,g.ch)+n+l.text.slice(h.ch),p):(u=f(1,k.length-1),u.push(new hb(n+
123
+ l.text.slice(h.ch),p,d)),e(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null),a.insert(g.line+1,u)):1==k.length?(e(l,l.text.slice(0,g.ch)+k[0]+m.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,u)):(e(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null),e(m,n+m.text.slice(h.ch),p),p=f(1,k.length-1),1<u&&a.remove(g.line+1,u-1),a.insert(g.line+1,p));M(a,"change",a,b)}function Ra(a,b,c){function d(a,f,g){if(a.linked)for(var e=0;e<a.linked.length;++e){var k=a.linked[e];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),
124
+ d(k.doc,a,l)}}}d(a,null,!0)}function Pe(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;md(a);xd(a);a.options.lineWrapping||Sc(a);a.options.mode=b.modeOption;Q(a)}function rc(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a||1}function zd(a,b){var c={from:Oc(b.from),to:Ba(b),text:Ga(a,b.from,b.to)};Qe(a,c,b.from.line,b.to.line+
125
+ 1);Ra(a,function(a){return Qe(a,c,b.from.line,b.to.line+1)},!0);return c}function Re(a){for(;a.length;)if(B(a).ranges)a.pop();else break}function Se(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g,h,k;if(k=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==d?(Re(e.done),g=B(e.done)):e.done.length&&!B(e.done).ranges?g=B(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?
126
+ (e.done.pop(),g=B(e.done)):g=void 0,k=g;if(k)h=B(g.changes),0==x(b.from,b.to)&&0==x(b.from,h.to)?h.to=Ba(b):g.changes.push(zd(a,b));else for((g=B(e.done))&&g.ranges||sc(a.sel,e.done),g={changes:[zd(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;h||F(a,"historyAdded")}function sc(a,b){var c=
127
+ B(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Qe(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(d){d.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=d.markedSpans);++f})}function mg(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function Te(a,b){var c;if(c=b["spans_"+a.id]){for(var d=[],e=0;e<b.text.length;++e)d.push(mg(c[e]));c=d}else c=null;d=Pc(a,
128
+ b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function ib(a,b,c){for(var d=[],e=0;e<a.length;++e){var f=a[e];if(f.ranges)d.push(c?Z.prototype.deepCopy.call(f):f);else{var f=f.changes,g=[];d.push({changes:g});for(var h=0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var m in k)(l=m.match(/^spans_(\d+)#x2F;))&&
129
+ -1<K(b,Number(l[1]))&&(B(g)[m]=k[m],delete k[m])}}}return d}function Jb(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,d&&(b=0>x(c,a),b!=0>x(d,a)?(a=c,c=d):b!=0>x(c,d)&&(c=d)),new A(a,c)):new A(d||c,c)}function tc(a,b,c,d){O(a,new Z([Jb(a,a.sel.primary(),b,c)],0),d)}function Ue(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=Jb(a,a.sel.ranges[e],b[e],null);b=ga(d,a.sel.primIndex);O(a,b,c)}function Ad(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;O(a,ga(e,a.sel.primIndex),d)}function ng(a,
130
+ b,c){c={ranges:b.ranges,update:function(b){this.ranges=[];for(var d=0;d<b.length;d++)this.ranges[d]=new A(t(a,b[d].anchor),t(a,b[d].head))},origin:c&&c.origin};F(a,"beforeSelectionChange",a,c);a.cm&&F(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?ga(c.ranges,c.ranges.length-1):b}function Ve(a,b,c){var d=a.history.done,e=B(d);e&&e.ranges?(d[d.length-1]=b,uc(a,b,c)):O(a,b,c)}function O(a,b,c){uc(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,g;if(!(g=d==e.lastSelOp)&&
131
+ (g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=B(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:sc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastSelOp=d;c&&!1!==c.clearRedo&&Re(e.undone)}function uc(a,b,c){if(ba(a,"beforeSelectionChange")||a.cm&&ba(a.cm,"beforeSelectionChange"))b=
132
+ ng(a,b,c);var d=c&&c.bias||(0>x(b.primary().head,a.sel.primary().head)?-1:1);We(a,Xe(a,b,d,!0));c&&!1===c.scroll||!a.cm||eb(a.cm)}function We(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Yd(a.cm)),M(a,"cursorActivity",a))}function Ye(a){We(a,Xe(a,a.sel,null,!1),na)}function Xe(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],k=Bd(a,g.anchor,h&&h.anchor,c,d),h=Bd(a,g.head,h&&h.head,
133
+ c,d);if(e||k!=g.anchor||h!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new A(k,h)}return e?ga(e,b.primIndex):b}function jb(a,b,c,d,e){var f=r(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],k=h.marker;if((null==h.from||(k.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(k.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(F(k,"beforeCursorEnter"),k.explicitlyCleared))if(f.markedSpans){--g;continue}else break;if(k.atomic){if(c){g=k.find(0>d?1:-1);h=void 0;if(0>
134
+ d?k.inclusiveRight:k.inclusiveLeft)g=Ze(a,g,-d,g&&g.line==b.line?f:null);if(g&&g.line==b.line&&(h=x(g,c))&&(0>d?0>h:0<h))return jb(a,g,b,d,e)}c=k.find(0>d?-1:1);if(0>d?k.inclusiveLeft:k.inclusiveRight)c=Ze(a,c,d,c.line==b.line?f:null);return c?jb(a,c,b,d,e):null}}}return b}function Bd(a,b,c,d,e){d=d||1;b=jb(a,b,c,d,e)||!e&&jb(a,b,c,d,!0)||jb(a,b,c,-d,e)||!e&&jb(a,b,c,-d,!0);return b?b:(a.cantEdit=!0,q(a.first,0))}function Ze(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?t(a,q(b.line-1)):null:0<c&&b.ch==
135
+ (d||r(a,b.line)).text.length?b.line<a.first+a.size-1?q(b.line+1,0):null:new q(b.line,b.ch+c)}function $e(a){a.setSelection(q(a.firstLine(),0),q(a.lastLine()),na)}function af(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){return d.canceled=!0}};c&&(d.update=function(b,c,g,h){b&&(d.from=t(a,b));c&&(d.to=t(a,c));g&&(d.text=g);void 0!==h&&(d.origin=h)});F(a,"beforeChange",a,d);a.cm&&F(a.cm,"beforeChange",a.cm,d);return d.canceled?null:{from:d.from,to:d.to,
136
+ text:d.text,origin:d.origin}}function kb(a,b,c){if(a.cm){if(!a.cm.curOp)return J(a.cm,kb)(a,b,c);if(a.cm.state.suppressEdits)return}if(ba(a,"beforeChange")||a.cm&&ba(a.cm,"beforeChange"))if(b=af(a,b,!0),!b)return;if(c=bf&&!c&&Qf(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)cf(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else cf(a,b)}function cf(a,b){if(1!=b.text.length||""!=b.text[0]||0!=x(b.from,b.to)){var c=wd(a,b);Se(a,b,c,a.cm?a.cm.curOp.id:NaN);Kb(a,b,c,Pc(a,b));var d=[];Ra(a,function(a,
137
+ c){c||-1!=K(d,a.history)||(df(a.history,b),d.push(a.history));Kb(a,b,null,Pc(a,b))})}}function vc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits||c){for(var d=a.history,e,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,k=0;k<g.length&&(e=g[k],c?!e.ranges||e.equals(a.sel):e.ranges);k++);if(k!=g.length){for(d.lastOrigin=d.lastSelOrigin=null;;)if(e=g.pop(),e.ranges){sc(e,h);if(c&&!e.equals(a.sel)){O(a,e,{clearRedo:!1});return}f=e}else break;var l=[];sc(f,h);h.push({changes:l,generation:d.generation});
138
+ d.generation=e.generation||++d.maxGeneration;var m=ba(a,"beforeChange")||a.cm&&ba(a.cm,"beforeChange");c=function(d){var c=e.changes[d];c.origin=b;if(m&&!af(a,c,!1))return g.length=0,{};l.push(zd(a,c));var f=d?wd(a,c):B(g);Kb(a,c,f,Te(a,c));!d&&a.cm&&a.cm.scrollIntoView({from:c.from,to:Ba(c)});var h=[];Ra(a,function(a,b){b||-1!=K(h,a.history)||(df(a.history,c),h.push(a.history));Kb(a,c,null,Te(a,c))})};for(d=e.changes.length-1;0<=d;--d)if(f=c(d))return f.v}}}function ef(a,b){if(0!=b&&(a.first+=b,
139
+ a.sel=new Z($b(a.sel.ranges,function(a){return new A(q(a.anchor.line+b,a.anchor.ch),q(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Q(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Aa(a.cm,d,"gutter")}}function Kb(a,b,c,d){if(a.cm&&!a.cm.curOp)return J(a.cm,Kb)(a,b,c,d);if(b.to.line<a.first)ef(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);ef(a,e);b={from:q(a.first,
140
+ 0),to:q(b.to.line+e,b.to.ch),text:[B(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:q(e,r(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ga(a,b.from,b.to);c||(c=wd(a,b));a.cm?og(a.cm,b,d):yd(a,b,d);uc(a,c,na)}}function og(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=D(ja(r(d,f.line))),d.iter(k,g.line+1,function(a){if(a==e.maxLine)return h=!0}));-1<d.sel.contains(b.from,b.to)&&Yd(a);yd(d,b,c,ye(a));a.options.lineWrapping||
141
+ (d.iter(k,f.line+b.text.length,function(a){var b=fc(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,f.line);Gb(a,400);c=b.text.length-(g.line-f.line)-1;b.full?Q(a):f.line!=g.line||1!=b.text.length||Oe(a.doc,b)?Q(a,f.line,g.line+1,c):Aa(a,f.line,"text");c=ba(a,"changes");if((d=ba(a,"change"))||c)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},d&&M(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=
142
+ [])).push(b);a.display.selForContextMenu=null}function lb(a,b,c,d,e){d||(d=c);if(0>x(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=a.splitLines(b));kb(a,{from:c,to:d,text:b,origin:e})}function ff(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function gf(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges)for(f.copied||(f=a[e]=f.deepCopy(),f.copied=!0),g=0;g<f.ranges.length;g++)ff(f.ranges[g].anchor,b,c,d),ff(f.ranges[g].head,b,c,d);else{for(var h=0;h<f.changes.length;++h){var k=
143
+ f.changes[h];if(c<k.from.line)k.from=q(k.from.line+d,k.from.ch),k.to=q(k.to.line+d,k.to.ch);else if(b<=k.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function df(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;gf(a.done,c,d,e);gf(a.undone,c,d,e)}function Lb(a,b,c,d){var e=b,f=b;"number"==typeof b?f=r(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=D(b);if(null==e)return null;d(f,e)&&a.cm&&Aa(a.cm,e,c);return f}function pg(a,b,c,d){var e=new Mb(a,c,d),f=a.cm;f&&e.noHScroll&&(f.display.alignWidgets=
144
+ !0);Lb(a,b,"widget",function(b){var d=b.widgets||(b.widgets=[]);null==e.insertAt?d.push(e):d.splice(Math.min(d.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;f&&!Ja(a,b)&&(d=ka(b)<a.scrollTop,ia(b,b.height+Ab(e)),d&&nc(f,null,e.height),f.curOp.forceUpdate=!0);return!0});M(f,"lineWidgetAdded",f,e,"number"==typeof b?b:D(b));return e}function mb(a,b,c,d,e){if(d&&d.shared)return qg(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return J(a.cm,mb)(a,b,c,d,e);var f=new Ca(a,e);e=x(b,c);d&&Fa(d,f,!1);if(0<e||0==e&&!1!==
145
+ f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=v("span",[f.replacedWith],"CodeMirror-widget"),f.widgetNode.setAttribute("role","presentation"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0));if(f.collapsed){if(Ud(a,b.line,b,c,f)||b.line!=c.line&&Ud(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");xa=!0}f.addToHistory&&Se(a,{from:b,to:c,origin:"markText"},a.sel,
146
+ NaN);var g=b.line,h=a.cm,k;a.iter(g,c.line+1,function(a){h&&f.collapsed&&!h.options.lineWrapping&&ja(a)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&ia(a,0);var d=new ec(f,g==b.line?b.ch:null,g==c.line?c.ch:null);a.markedSpans=a.markedSpans?a.markedSpans.concat([d]):[d];d.marker.attachLine(a);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){Ja(a,b)&&ia(b,0)});f.clearOnEnter&&w(f,"beforeCursorEnter",function(){return f.clear()});f.readOnly&&(bf=!0,(a.history.done.length||a.history.undone.length)&&
147
+ a.clearHistory());f.collapsed&&(f.id=++hf,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)Q(h,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(d=b.line;d<=c.line;d++)Aa(h,d,"text");f.atomic&&Ye(h.doc);M(h,"markerAdded",h,f)}return f}function qg(a,b,c,d,e){d=Fa(d);d.shared=!1;var f=[mb(a,b,c,d,e)],g=f[0],h=d.widgetNode;Ra(a,function(a){h&&(d.widgetNode=h.cloneNode(!0));f.push(mb(a,t(a,b),t(a,c),d,e));for(var k=0;k<a.linked.length;++k)if(a.linked[k].isParent)return;
148
+ g=B(f)});return new Nb(f,g)}function jf(a){return a.findMarks(q(a.first,0),a.clipPos(q(a.lastLine())),function(a){return a.parent})}function rg(a){for(var b=function(b){b=a[b];var d=[b.primary.doc];Ra(b.primary.doc,function(a){return d.push(a)});for(var c=0;c<b.markers.length;c++){var g=b.markers[c];-1==K(d,g.doc)&&(g.parent=null,b.markers.splice(c--,1))}},c=0;c<a.length;c++)b(c)}function sg(a){var b=this;kf(b);if(!H(b,a)&&!ta(b.display,a)){P(a);C&&(lf=+new Date);var c=Qa(b,a,!0),d=a.dataTransfer.files;
149
+ if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=K(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=J(b,function(){var a=h.result;/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a="");f[d]=a;++g==e&&(c=t(b.doc,c),a={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"},kb(b.doc,a),Ve(b.doc,ua(c,Ba(a))))});h.readAsText(a)}},k=0;k<e;++k)h(d[k],k);else if(b.state.draggingText&&
150
+ -1<b.doc.sel.contains(c))b.state.draggingText(a),setTimeout(function(){return b.display.input.focus()},20);else try{if(h=a.dataTransfer.getData("Text")){b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections());uc(b.doc,ua(c,c));if(k)for(d=0;d<k.length;++d)lb(b.doc,"",k[d].anchor,k[d].head,"drag");b.replaceSelection(h,"around","paste");b.display.input.focus()}}catch(l){}}}function kf(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=
151
+ null)}function mf(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function tg(){var a;w(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null;mf(ug)},100))});w(window,"blur",function(){return mf(Eb)})}function ug(a){var b=a.display;if(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=
152
+ !1,a.setSize()}function vg(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g<b.length-1;g++){var h=b[g];if(/^(cmd|meta|m)#x2F;i.test(h))f=!0;else if(/^a(lt)?#x2F;i.test(h))c=!0;else if(/^(c|ctrl|control)#x2F;i.test(h))d=!0;else if(/^s(hift)?#x2F;i.test(h))e=!0;else throw Error("Unrecognized modifier name: "+h);}c&&(a="Alt-"+a);d&&(a="Ctrl-"+a);f&&(a="Cmd-"+a);e&&(a="Shift-"+a);return a}function wg(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!/^(name|fallthrough|(de|at)tach)#x2F;.test(c)){if("..."!=
153
+ d)for(var e=$b(c.split(" "),vg),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var k=b[h];if(!k)b[h]=g;else if(k!=g)throw Error("Inconsistent bindings for "+h);}delete a[c]}}for(var l in b)a[l]=b[l];return a}function nb(a,b,c,d){b=wc(b);var e=b.call?b.call(a,d):b[a];if(!1===e)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return nb(a,
154
+ b.fallthrough,c,d);for(e=0;e<b.fallthrough.length;e++){var f=nb(a,b.fallthrough[e],c,d);if(f)return f}}}function nf(a){a="string"==typeof a?a:Da[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function of(a,b){if(fa&&34==a.keyCode&&a["char"])return!1;var c=Da[a.keyCode],d=c;if(null==d||a.altGraphKey)return!1;a.altKey&&"Alt"!=c&&(d="Alt-"+d);(pf?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d);(pf?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d);!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d);return d}
155
+ function wc(a){return"string"==typeof a?Ob[a]:a}function ob(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&0>=x(f.from,B(d).to);){var g=d.pop();if(0>x(g.from,f.from)){f.from=g.from;break}}d.push(f)}Y(a,function(){for(var b=d.length-1;0<=b;b--)lb(a.doc,"",d[b].from,d[b].to,"+delete");eb(a)})}function qf(a,b){var c=r(a.doc,b),d=ja(c);d!=c&&(b=D(d));return Wc(!0,a,d,b,1)}function rf(a,b){var c=qf(a,b.line),d=r(a.doc,c.line),e=ya(d);return e&&0!=e[0].level?c:(d=Math.max(0,
156
+ d.text.search(/\S/)),q(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d,c.sticky))}function xc(a,b,c){if("string"==typeof b&&(b=yc[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Cd}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function xg(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=nb(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&nb(b,a.options.extraKeys,
157
+ c,a)||nb(b,a.options.keyMap,c,a)}function zc(a,b,c,d){var e=a.state.keySeq;if(e){if(nf(b))return"handled";yg.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())});b=e+" "+b}d=xg(a,b,d);"multi"==d&&(a.state.keySeq=b);"handled"==d&&M(a,"keyHandled",a,b,c);if("handled"==d||"multi"==d)P(c),nd(a);return e&&!d&&/\'#x2F;.test(b)?(P(c),!0):!!d}function sf(a,b){var c=of(b,!0);return c?b.shiftKey&&!a.state.keySeq?zc(a,"Shift-"+c,b,function(b){return xc(a,b,!0)})||zc(a,c,b,function(b){if("string"==
158
+ typeof b?/^go[A-Z]/.test(b):b.motion)return xc(a,b)}):zc(a,c,b,function(b){return xc(a,b)}):!1}function zg(a,b,c){return zc(a,"'"+c+"'",b,function(b){return xc(a,b,!0)})}function tf(a){this.curOp.focus=pa();if(!H(this,a)){C&&11>z&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=sf(this,a);fa&&(Dd=c?b:null,!c&&88==b&&!uf&&(da?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||
159
+ Ag(this)}}function Ag(a){function b(a){18!=a.keyCode&&a.altKey||(bb(c,"CodeMirror-crosshair"),ca(document,"keyup",b),ca(document,"mouseover",b))}var c=a.display.lineDiv;Va(c,"CodeMirror-crosshair");w(document,"keyup",b);w(document,"mouseover",b)}function vf(a){16==a.keyCode&&(this.doc.sel.shift=!1);H(this,a)}function wf(a){if(!(ta(this.display,a)||H(this,a)||a.ctrlKey&&!a.altKey||da&&a.metaKey)){var b=a.keyCode,c=a.charCode;if(fa&&b==Dd)Dd=null,P(a);else if(!fa||a.which&&!(10>a.which)||!sf(this,a))if(b=
160
+ String.fromCharCode(null==c?b:c),"\b"!=b&&!zg(this,a,b))this.display.input.onKeyPress(a)}}function Bg(a){var b=this.display;if(!(H(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.input.ensurePolled(),b.shift=a.shiftKey,ta(b,a))L||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));else if(!Ed(this,a,"gutterClick",!0)){var c=Qa(this,a);window.focus();switch($d(a)){case 1:this.state.selectingText?this.state.selectingText(a):c?Cg(this,a,c):(a.target||a.srcElement)==
161
+ b.scroller&&P(a);break;case 2:L&&(this.state.lastMiddleDown=+new Date);c&&tc(this.doc,c);setTimeout(function(){return b.input.focus()},20);P(a);break;case 3:Fd?xf(this,a):gg(this)}}}function Cg(a,b,c){C?setTimeout(Gc(Be,a),0):a.curOp.focus=pa();var d=+new Date,e;Ac&&Ac.time>d-400&&0==x(Ac.pos,c)?e="triple":Bc&&Bc.time>d-400&&0==x(Bc.pos,c)?(e="double",Ac={time:d,pos:c}):(e="single",Bc={time:d,pos:c});var d=a.doc.sel,f=da?b.metaKey:b.ctrlKey,g;a.options.dragDrop&&Dg&&!a.isReadOnly()&&"single"==e&&
162
+ -1<(g=d.contains(c))&&(0>x((g=d.ranges[g]).from(),c)||0<c.xRel)&&(0<x(g.to(),c)||0>c.xRel)?Eg(a,b,c,f):Fg(a,b,c,e,f)}function Eg(a,b,c,d){var e=a.display,f=+new Date,g=J(a,function(h){L&&(e.scroller.draggable=!1);a.state.draggingText=!1;ca(document,"mouseup",g);ca(e.scroller,"drop",g);10>Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)&&(P(h),!d&&+new Date-200<f&&tc(a.doc,c),L||C&&9==z?setTimeout(function(){document.body.focus();e.input.focus()},20):e.input.focus())});L&&(e.scroller.draggable=
163
+ !0);a.state.draggingText=g;g.copy=da?b.altKey:b.ctrlKey;e.scroller.dragDrop&&e.scroller.dragDrop();w(document,"mouseup",g);w(e.scroller,"drop",g)}function Fg(a,b,c,d,e){function f(b){if(0!=x(y,b))if(y=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=aa(r(l,c.line).text,c.ch,f),h=aa(r(l,b.line).text,b.ch,f),k=Math.min(g,h),g=Math.max(g,h),h=Math.min(c.line,b.line),u=Math.min(a.lastLine(),Math.max(c.line,b.line));h<=u;h++){var v=r(l,h).text,w=Hc(v,k,f);k==g?e.push(new A(q(h,w),q(h,w))):v.length>w&&e.push(new A(q(h,
164
+ w),q(h,Hc(v,g,f))))}e.length||e.push(new A(c,c));O(l,ga(p.ranges.slice(0,n).concat(e),n),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else k=m,e=k.anchor,f=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new A(q(b.line,0),t(l,q(b.line+1,0))),0<x(b.anchor,e)?(f=b.head,e=dc(k.from(),b.anchor)):(f=b.anchor,e=cc(k.to(),b.head))),b=p.ranges.slice(0),b[n]=new A(t(l,e),f),O(l,ga(b,n),Gd)}function g(b){var c=++B,e=Qa(a,b,!0,"rect"==d);if(e)if(0!=x(e,y)){a.curOp.focus=pa();f(e);var h=rd(k,l);(e.line>=h.to||
165
+ e.line<h.from)&&setTimeout(J(a,function(){B==c&&g(b)}),150)}else{var m=b.clientY<z.top?-20:b.clientY>z.bottom?20:0;m&&setTimeout(J(a,function(){B==c&&(k.scroller.scrollTop+=m,g(b))}),50)}}function h(b){a.state.selectingText=!1;B=Infinity;P(b);k.input.focus();ca(document,"mousemove",C);ca(document,"mouseup",D);l.history.lastSelOrigin=null}var k=a.display,l=a.doc;P(b);var m,n,p=l.sel,u=p.ranges;e&&!b.shiftKey?(n=l.sel.contains(c),m=-1<n?u[n]:new A(c,c)):(m=l.sel.primary(),n=l.sel.primIndex);if(Gg?b.shiftKey&&
166
+ b.metaKey:b.altKey)d="rect",e||(m=new A(c,c)),c=Qa(a,b,!0,!0),n=-1;else if("double"==d){var v=a.findWordAt(c);m=a.display.shift||l.extend?Jb(l,m,v.anchor,v.head):v}else"triple"==d?(v=new A(q(c.line,0),t(l,q(c.line+1,0))),m=a.display.shift||l.extend?Jb(l,m,v.anchor,v.head):v):m=Jb(l,m,c);e?-1==n?(n=u.length,O(l,ga(u.concat([m]),n),{scroll:!1,origin:"*mouse"})):1<u.length&&u[n].empty()&&"single"==d&&!b.shiftKey?(O(l,ga(u.slice(0,n).concat(u.slice(n+1)),0),{scroll:!1,origin:"*mouse"}),p=l.sel):Ad(l,
167
+ n,m,Gd):(n=0,O(l,new Z([m],0),Gd),p=l.sel);var y=c,z=k.wrapper.getBoundingClientRect(),B=0,C=J(a,function(a){$d(a)?g(a):h(a)}),D=J(a,h);a.state.selectingText=D;w(document,"mousemove",C);w(document,"mouseup",D)}function Ed(a,b,c,d){var e,f;try{e=b.clientX,f=b.clientY}catch(k){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&P(b);d=a.display;var g=d.lineDiv.getBoundingClientRect();if(f>g.bottom||!ba(a,c))return Xc(b);f-=g.top-d.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=
168
+ d.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=e)return e=Ha(a.doc,f),F(a,c,a,e,a.options.gutters[g],b),Xc(b)}}function xf(a,b){var c;(c=ta(a.display,b))||(c=ba(a,"gutterContextMenu")?Ed(a,b,"gutterContextMenu",!1):!1);if(!c&&!H(a,b,"contextmenu"))a.display.input.onContextMenu(b)}function yf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Cb(a)}function Pb(a){Le(a);Q(a);pd(a)}function Hg(a,b,c){!b!=
169
+ !(c&&c!=pb)&&(c=a.display.dragFunctions,b=b?w:ca,b(a.display.scroller,"dragstart",c.start),b(a.display.scroller,"dragenter",c.enter),b(a.display.scroller,"dragover",c.over),b(a.display.scroller,"dragleave",c.leave),b(a.display.scroller,"drop",c.drop))}function Ig(a){a.options.lineWrapping?(Va(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(bb(a.display.wrapper,"CodeMirror-wrap"),Sc(a));md(a);Q(a);Cb(a);setTimeout(function(){return db(a)},100)}function E(a,
170
+ b){var c=this;if(!(this instanceof E))return new E(a,b);this.options=b=b?Fa(b):{};Fa(zf,b,!1);vd(b);var d=b.value;"string"==typeof d&&(d=new S(d,b.mode,null,b.lineSeparator));this.doc=d;var e=new E.inputStyles[b.inputStyle](this),e=this.display=new Pf(a,d,e);e.wrapper.CodeMirror=this;Le(this);yf(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");He(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,
171
+ cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Sa,keySeq:null,specialChars:null};b.autofocus&&!sb&&e.input.focus();C&&11>z&&setTimeout(function(){return c.display.input.reset(!0)},20);Jg(this);Af||(tg(),Af=!0);fb(this);this.curOp.forceUpdate=!0;Pe(this,d);b.autofocus&&!sb||this.hasFocus()?setTimeout(Gc(od,this),20):Eb(this);for(var f in Cc)if(Cc.hasOwnProperty(f))Cc[f](c,b[f],pb);Ce(this);b.finishInit&&b.finishInit(this);for(d=0;d<Hd.length;++d)Hd[d](c);gb(this);L&&b.lineWrapping&&
172
+ "optimizelegibility"==getComputedStyle(e.lineDiv).textRendering&&(e.lineDiv.style.textRendering="auto")}function Jg(a){function b(){d.activeTouch&&(e=setTimeout(function(){return d.activeTouch=null},1E3),f=d.activeTouch,f.end=+new Date)}function c(a,b){if(null==b.left)return!0;var d=b.left-a.left,c=b.top-a.top;return 400<d*d+c*c}var d=a.display;w(d.scroller,"mousedown",J(a,Bg));C&&11>z?w(d.scroller,"dblclick",J(a,function(b){if(!H(a,b)){var d=Qa(a,b);!d||Ed(a,b,"gutterClick",!0)||ta(a.display,b)||
173
+ (P(b),b=a.findWordAt(d),tc(a.doc,b.anchor,b.head))}})):w(d.scroller,"dblclick",function(b){return H(a,b)||P(b)});Fd||w(d.scroller,"contextmenu",function(b){return xf(a,b)});var e,f={end:0};w(d.scroller,"touchstart",function(b){var c;if(c=!H(a,b))1!=b.touches.length?c=!1:(c=b.touches[0],c=1>=c.radiusX&&1>=c.radiusY),c=!c;c&&(d.input.ensurePolled(),clearTimeout(e),c=+new Date,d.activeTouch={start:c,moved:!1,prev:300>=c-f.end?f:null},1==b.touches.length&&(d.activeTouch.left=b.touches[0].pageX,d.activeTouch.top=
174
+ b.touches[0].pageY))});w(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)});w(d.scroller,"touchend",function(e){var f=d.activeTouch;if(f&&!ta(d,e)&&null!=f.left&&!f.moved&&300>new Date-f.start){var g=a.coordsChar(d.activeTouch,"page"),f=!f.prev||c(f,f.prev)?new A(g,g):!f.prev.prev||c(f,f.prev.prev)?a.findWordAt(g):new A(q(g.line,0),t(a.doc,q(g.line+1,0)));a.setSelection(f.anchor,f.head);a.focus();P(e)}b()});w(d.scroller,"touchcancel",b);w(d.scroller,"scroll",function(){d.scroller.clientHeight&&
175
+ (Fb(a,d.scroller.scrollTop),cb(a,d.scroller.scrollLeft,!0),F(a,"scroll",a))});w(d.scroller,"mousewheel",function(b){return Fe(a,b)});w(d.scroller,"DOMMouseScroll",function(b){return Fe(a,b)});w(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0});d.dragFunctions={enter:function(b){H(a,b)||wb(b)},over:function(b){if(!H(a,b)){var d=Qa(a,b);if(d){var c=document.createDocumentFragment();Ae(a,d,c);a.display.dragCursor||(a.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),
176
+ a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));W(a.display.dragCursor,c)}wb(b)}},start:function(b){if(C&&(!a.state.draggingText||100>+new Date-lf))wb(b);else if(!H(a,b)&&!ta(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!Bf)){var d=v("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";fa&&(d.width=d.height=
177
+ 1,a.display.wrapper.appendChild(d),d._top=d.offsetTop);b.dataTransfer.setDragImage(d,0,0);fa&&d.parentNode.removeChild(d)}},drop:J(a,sg),leave:function(b){H(a,b)||kf(a)}};var g=d.input.getField();w(g,"keyup",function(b){return vf.call(a,b)});w(g,"keydown",J(a,tf));w(g,"keypress",J(a,wf));w(g,"focus",function(b){return od(a,b)});w(g,"blur",function(b){return Eb(a,b)})}function Qb(a,b,c,d){var e=a.doc,f;null==c&&(c="add");"smart"==c&&(e.mode.indent?f=xb(a,b):c="prev");var g=a.options.tabSize,h=r(e,
178
+ b),k=aa(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var l=h.text.match(/^\s*/)[0],m;if(!d&&!/\S/.test(h.text))m=0,c="not";else if("smart"==c&&(m=e.mode.indent(f,h.text.slice(l.length),h.text),m==Cd||150<m)){if(!d)return;c="prev"}"prev"==c?m=b>e.first?aa(r(e,b-1).text,null,g):0:"add"==c?m=k+a.options.indentUnit:"subtract"==c?m=k-a.options.indentUnit:"number"==typeof c&&(m=k+c);m=Math.max(0,m);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(m/g);a;--a)d+=g,c+="\t";d<m&&(c+=Ic(m-d));if(c!=
179
+ l)return lb(e,c,q(b,0),q(b,l.length),"+input"),h.stateAfter=null,!0;for(g=0;g<e.sel.ranges.length;g++)if(h=e.sel.ranges[g],h.head.line==b&&h.head.ch<l.length){b=q(b,l.length);Ad(e,g,new A(b,b));break}}function Id(a,b,c,d,e){var f=a.doc;a.display.shift=!1;d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=Jd(b),k=null;if(g&&1<d.ranges.length)if(T&&T.text.join("\n")==b){if(0==d.ranges.length%T.text.length)for(var k=[],l=0;l<T.text.length;l++)k.push(f.splitLines(T.text[l]))}else h.length==d.ranges.length&&
180
+ (k=$b(h,function(a){return[a]}));for(var m,l=d.ranges.length-1;0<=l;l--){m=d.ranges[l];var n=m.from(),p=m.to();m.empty()&&(c&&0<c?n=q(n.line,n.ch-c):a.state.overwrite&&!g?p=q(p.line,Math.min(r(f,p.line).text.length,p.ch+B(h).length)):T&&T.lineWise&&T.text.join("\n")==b&&(n=p=q(n.line,0)));m=a.curOp.updateInput;n={from:n,to:p,text:k?k[l%k.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};kb(a.doc,n);M(a,"inputRead",a,n)}b&&!g&&Cf(a,b);eb(a);a.curOp.updateInput=m;a.curOp.typing=!0;
181
+ a.state.pasteIncoming=a.state.cutIncoming=!1}function Df(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||Y(b,function(){return Id(b,c,0,null,"paste")}),!0}function Cf(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;0<=d;d--){var e=c.ranges[d];if(!(100<e.head.ch||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars)for(var h=0;h<f.electricChars.length;h++){if(-1<
182
+ b.indexOf(f.electricChars.charAt(h))){g=Qb(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(r(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Qb(a,e.head.line,"smart"));g&&M(a,"electricInput",a,e.head.line)}}}function Ef(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,e={anchor:q(e,0),head:q(e+1,0)};c.push(e);b.push(a.getRange(e.anchor,e.head))}return{text:b,ranges:c}}function Ff(a,b){a.setAttribute("autocorrect","off");a.setAttribute("autocapitalize",
183
+ "off");a.setAttribute("spellcheck",!!b)}function Gf(){var a=v("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),b=v("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");L?a.style.width="1000px":a.setAttribute("wrap","off");Rb&&(a.style.border="1px solid black");Ff(a);return b}function Kd(a,b,c,d,e){function f(d){var f;f=e?Wd(a.cm,k,b,c):Vc(k,b,c);if(null==f){if(d=!d)d=b.line+c,d<a.first||d>=a.first+a.size?d=!1:
184
+ (b=new q(d,b.ch,b.sticky),d=k=r(a,d));if(d)b=Wc(e,a.cm,k,b.line,c);else return!1}else b=f;return!0}var g=b,h=c,k=r(a,b.line);if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var l=null;d="group"==d;for(var m=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(0>c)||f(!n);n=!1){var p=k.text.charAt(b.ch)||"\n",p=ac(p,m)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";!d||n||p||(p="s");if(l&&l!=p){0>c&&(c=1,f(),b.sticky="after");break}p&&(l=p);if(0<c&&!f(!n))break}}h=Bd(a,b,g,h,!0);Nc(g,
185
+ h)&&(h.hitSide=!0);return h}function Hf(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(g=Math.max(Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*Oa(a.display),3),g=(0<c?b.bottom:b.top)+c*g):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){b=kd(a,f,g);if(!b.outside)break;if(0>c?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*c}return b}function If(a,b){var c=hd(a,b.line);if(!c||c.hidden)return null;var d=r(a.doc,b.line),c=re(c,d,b.line),d=ya(d),e="left";d&&
186
+ (e=Tc(d,b.ch)%2?"right":"left");c=se(c.map,b.ch,e);c.offset="right"==c.collapse?c.end:c.start;return c}function qb(a,b){b&&(a.bad=!0);return a}function Kg(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)h=""==c?h+b.textContent.replace(/\u200b/g,""):h+c;else{var c=b.getAttribute("cm-marker"),m;if(c)b=a.findMarks(q(d,0),q(e+1,0),f(+c)),b.length&&(m=b[0].find())&&(h+=Ga(a.doc,m.from,m.to).join(l));else if("false"!=
187
+ b.getAttribute("contenteditable")){for(m=0;m<b.childNodes.length;m++)g(b.childNodes[m]);/^(pre|div|p)#x2F;i.test(b.nodeName)&&(k=!0)}}}else 3==b.nodeType&&(b=b.nodeValue)&&(k&&(h+=l,k=!1),h+=b)}for(var h="",k=!1,l=a.doc.lineSeparator();;){g(b);if(b==c)break;b=b.nextSibling}return h}function Dc(a,b,c){var d;if(b==a.display.lineDiv){d=a.display.lineDiv.childNodes[c];if(!d)return qb(a.clipPos(q(a.display.viewTo-1)),!0);b=null;c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&
188
+ d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return Lg(f,b,c)}}function Lg(a,b,c){function d(b,d,c){for(var e=-1;e<(l?l.length:0);e++)for(var f=0>e?k.map:l[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==d){d=D(0>e?a.line:a.rest[e]);e=f[g]+c;if(0>c||h!=b)e=f[g+(c?1:0)];return q(d,e)}}}var e=a.text.firstChild,f=!1;if(!b||!Yb(e,b))return qb(q(D(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b))return c=a.rest?B(a.rest):a.line,
189
+ qb(q(D(c),c.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,c&&(c=g.nodeValue.length));for(;h.parentNode!=e;)h=h.parentNode;var k=a.measure,l=k.maps;if(b=d(g,h,c))return qb(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-c:0;e;e=e.nextSibling){if(b=d(e,e.firstChild,0))return qb(q(b.line,b.ch-g),f);g+=e.textContent.length}for(h=h.previousSibling;h;h=h.previousSibling){if(b=d(h,h.firstChild,-1))return qb(q(b.line,b.ch+c),f);c+=h.textContent.length}}
190
+ var U=navigator.userAgent,Jf=navigator.platform,wa=/gecko\/\d/i.test(U),Kf=/MSIE \d/.test(U),Lf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(U),Sb=/Edge\/(\d+)/.exec(U),C=Kf||Lf||Sb,z=C&&(Kf?document.documentMode||6:+(Sb||Lf)[1]),L=!Sb&&/WebKit\//.test(U),Mg=L&&/Qt\/\d+\.\d+/.test(U),Ng=!Sb&&/Chrome\//.test(U),fa=/Opera\//.test(U),Bf=/Apple Computer/.test(navigator.vendor),Og=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(U),jg=/PhantomJS/.test(U),Rb=!Sb&&/AppleWebKit/.test(U)&&/Mobile\/\w+/.test(U),sb=Rb||
191
+ /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(U),da=Rb||/Mac/.test(Jf),Gg=/\bCrOS\b/.test(U),Pg=/win/i.test(Jf),Ta=fa&&U.match(/Version\/(\d*\.\d*)/);Ta&&(Ta=Number(Ta[1]));Ta&&15<=Ta&&(fa=!1,L=!0);var pf=da&&(Mg||fa&&(null==Ta||12.11>Ta)),Fd=wa||C&&9<=z,bb=function(a,b){var c=a.className,d=Ea(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},$a;$a=document.createRange?function(a,b,c,d){var e=document.createRange();e.setEnd(d||a,c);
192
+ e.setStart(a,b);return e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}d.collapse(!0);d.moveEnd("character",c);d.moveStart("character",b);return d};var rb=function(a){a.select()};Rb?rb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:C&&(rb=function(a){try{a.select()}catch(b){}});var Sa=function(){this.id=null};Sa.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var Cd={toString:function(){return"CodeMirror.Pass"}},
193
+ na={scroll:!1},Gd={origin:"*mouse"},Tb={origin:"+move"},Zb=[""],Nf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Of=/[\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]/,
194
+ bf=!1,xa=!1,vb=null,Sf=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1785>=a?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(a-
195
+ 1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,d){this.level=a;this.from=b;this.to=d}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,f=/[Lb1n]/,g=/[1n]/;return function(h){if(!c.test(h))return!1;for(var k=h.length,l=[],m=0;m<k;++m)l.push(a(h.charCodeAt(m)));for(var m=0,n="L";m<k;++m){var p=l[m];"m"==p?l[m]=n:n=p}m=0;for(n="L";m<k;++m)p=l[m],"1"==p&&"r"==n?l[m]="n":e.test(p)&&(n=p,"r"==p&&(l[m]="R"));m=1;for(n=l[0];m<k-1;++m)p=l[m],"+"==p&&"1"==
196
+ n&&"1"==l[m+1]?l[m]="1":","!=p||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=p;for(m=0;m<k;++m)if(n=l[m],","==n)l[m]="N";else if("%"==n){for(n=m+1;n<k&&"%"==l[n];++n);for(p=m&&"!"==l[m-1]||n<k&&"1"==l[n]?"1":"N";m<n;++m)l[m]=p;m=n-1}m=0;for(n="L";m<k;++m)p=l[m],"L"==n&&"1"==p?l[m]="L":e.test(p)&&(n=p);for(n=0;n<k;++n)if(d.test(l[n])){for(m=n+1;m<k&&d.test(l[m]);++m);p="L"==(m<k?l[m]:"L");for(p="L"==(n?l[n-1]:"L")||p?"L":"R";n<m;++n)l[n]=p;n=m-1}for(var m=[],q,n=0;n<k;)if(f.test(l[n])){p=n;for(++n;n<k&&f.test(l[n]);++n);
197
+ m.push(new b(0,p,n))}else{var t=n,p=m.length;for(++n;n<k&&"L"!=l[n];++n);for(var r=t;r<n;)if(g.test(l[r])){t<r&&m.splice(p,0,new b(1,t,r));t=r;for(++r;r<n&&g.test(l[r]);++r);m.splice(p,0,new b(2,t,r));t=r}else++r;t<n&&m.splice(p,0,new b(1,t,n))}1==m[0].level&&(q=h.match(/^\s+/))&&(m[0].from=q[0].length,m.unshift(new b(0,0,q[0].length)));1==B(m).level&&(q=h.match(/\s+#x2F;))&&(B(m).to-=q[0].length,m.push(new b(0,k-q[0].length,k)));return m}}(),gc=[],w=function(a,b,c){a.addEventListener?a.addEventListener(b,
198
+ c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),a[b]=(a[b]||gc).concat(c))},Dg=function(){if(C&&9>z)return!1;var a=v("div");return"draggable"in a||"dragDrop"in a}(),Yc,dd,Jd=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Qg=window.getSelection?
199
+ function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){var b;try{b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},uf=function(){var a=v("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),jd=null,Zc={},Ya={},Za={},I=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};
200
+ I.prototype.eol=function(){return this.pos>=this.string.length};I.prototype.sol=function(){return this.pos==this.lineStart};I.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};I.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)};I.prototype.eat=function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b};I.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>
201
+ b};I.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a};I.prototype.skipToEnd=function(){this.pos=this.string.length};I.prototype.skipTo=function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0};I.prototype.backUp=function(a){this.pos-=a};I.prototype.column=function(){this.lastColumnPos<this.start&&(this.lastColumnValue=aa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=
202
+ this.start);return this.lastColumnValue-(this.lineStart?aa(this.string,this.lineStart,this.tabSize):0)};I.prototype.indentation=function(){return aa(this.string,null,this.tabSize)-(this.lineStart?aa(this.string,this.lineStart,this.tabSize):0)};I.prototype.match=function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;
203
+ a&&!1!==b&&(this.pos+=a[0].length);return a}};I.prototype.current=function(){return this.string.slice(this.start,this.pos)};I.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}};var hb=function(a,b,c){this.text=a;Sd(this,b);this.height=c?c(this):1};hb.prototype.lineNo=function(){return D(this)};Xa(hb);var Yf={},Xf={},ab=null,yb=null,te={left:0,right:0,top:0,bottom:0},Pa,lc=0,X=null;C?X=-.53:wa?X=15:Ng?X=-.7:Bf&&(X=-1/3);var Ua=function(a,b,c){this.cm=
204
+ c;var d=this.vert=v("div",[v("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=v("div",[v("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d);a(e);w(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")});w(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;C&&8>z&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ua.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=
205
+ a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;c?(this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(c?
206
+ d:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0<a.clientHeight&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0);return{right:c?d:0,bottom:b?d:0}};Ua.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)};Ua.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a);this.disableVert&&this.enableZeroWidthBar(this.vert,
207
+ this.disableVert)};Ua.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=da&&!Og?"12px":"18px";this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new Sa;this.disableVert=new Sa};Ua.prototype.enableZeroWidthBar=function(a,b){function c(){var d=a.getBoundingClientRect();document.elementFromPoint(d.left+1,d.bottom-1)!=a?a.style.pointerEvents="none":b.set(1E3,c)}a.style.pointerEvents="auto";b.set(1E3,c)};Ua.prototype.clear=function(){var a=
208
+ this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert)};var Ub=function(){};Ub.prototype.update=function(){return{bottom:0,right:0}};Ub.prototype.setScrollLeft=function(){};Ub.prototype.setScrollTop=function(){};Ub.prototype.clear=function(){};var Ie={"native":Ua,"null":Ub},ig=0,pc=function(a,b,c){var d=a.display;this.viewport=b;this.visible=rd(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=d.wrapper.clientHeight;this.wrapperWidth=d.wrapper.clientWidth;
209
+ this.oldDisplayWidth=Ma(a);this.force=c;this.dims=id(a);this.events=[]};pc.prototype.signal=function(a,b){ba(a,b)&&this.events.push(arguments)};pc.prototype.finish=function(){for(var a=0;a<this.events.length;a++)F.apply(null,this.events[a])};var Z=function(a,b){this.ranges=a;this.primIndex=b};Z.prototype.primary=function(){return this.ranges[this.primIndex]};Z.prototype.equals=function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<
210
+ this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(!Nc(c.anchor,d.anchor)||!Nc(c.head,d.head))return!1}return!0};Z.prototype.deepCopy=function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new A(Oc(this.ranges[b].anchor),Oc(this.ranges[b].head));return new Z(a,this.primIndex)};Z.prototype.somethingSelected=function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1};Z.prototype.contains=function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=
211
+ this.ranges[c];if(0<=x(b,d.from())&&0>=x(a,d.to()))return c}return-1};var A=function(a,b){this.anchor=a;this.head=b};A.prototype.from=function(){return dc(this.anchor,this.head)};A.prototype.to=function(){return cc(this.anchor,this.head)};A.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var va=function(a){this.lines=a;this.parent=null;for(var b=0,c=0;c<a.length;++c)a[c].parent=this,b+=a[c].height;this.height=b};va.prototype.chunkSize=function(){return this.lines.length};
212
+ va.prototype.removeInner=function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Rd(f);M(e,"delete")}this.lines.splice(a,b)};va.prototype.collapse=function(a){a.push.apply(a,this.lines)};va.prototype.insertInner=function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this};va.prototype.iterN=function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0};var oa=function(a){this.children=
213
+ a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d],b=b+e.chunkSize(),c=c+e.height;e.parent=this}this.size=b;this.height=c;this.parent=null};oa.prototype.chunkSize=function(){return this.size};oa.prototype.removeInner=function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-
214
+ b&&(1<this.children.length||!(this.children[0]instanceof va))&&(c=[],this.collapse(c),this.children=[new va(c)],this.children[0].parent=this)};oa.prototype.collapse=function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)};oa.prototype.insertInner=function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<=f){e.insertInner(a,b,c);if(e.lines&&50<e.lines.length){for(b=a=e.lines.length%25+25;b<e.lines.length;)c=
215
+ new va(e.lines.slice(b,b+=25)),e.height-=c.height,this.children.splice(++d,0,c),c.parent=this;e.lines=e.lines.slice(0,a);this.maybeSpill()}break}a-=f}};oa.prototype.maybeSpill=function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new oa(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=K(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new oa(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);
216
+ a.parent.maybeSpill()}};oa.prototype.iterN=function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return!0;if(0==(b-=f))break;a=0}else a-=f}};var Mb=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a;this.node=b};Mb.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=D(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=
217
+ null);var f=Ab(this);ia(c,Math.max(0,c.height-f));a&&(Y(a,function(){var b=-f;ka(c)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&nc(a,null,b);Aa(a,d,"widget")}),M(a,"lineWidgetCleared",a,this,d))}};Mb.prototype.changed=function(){var a=this,b=this.height,c=this.doc.cm,d=this.line;this.height=null;var e=Ab(this)-b;e&&(ia(d,d.height+e),c&&Y(c,function(){c.curOp.forceUpdate=!0;ka(d)<(c.curOp&&c.curOp.scrollTop||c.doc.scrollTop)&&nc(c,null,e);M(c,"lineWidgetChanged",c,a,D(d))}))};Xa(Mb);var hf=0,Ca=
218
+ function(a,b){this.lines=[];this.type=b;this.doc=a;this.id=++hf};Ca.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&fb(a);if(ba(this,"clear")){var c=this.find();c&&M(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=ub(f.markedSpans,this);a&&!this.collapsed?Aa(a,D(f),"text"):a&&(null!=g.to&&(d=D(f)),null!=g.from&&(c=D(f)));for(var h=f,k=void 0,l=f.markedSpans,m=g,n=0;n<l.length;++n)l[n]!=m&&(k||(k=[])).push(l[n]);
219
+ h.markedSpans=k;null==g.from&&this.collapsed&&!Ja(this.doc,f)&&a&&ia(f,Oa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=ja(this.lines[e]),g=fc(f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&Q(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ye(a.doc));a&&M(a,"markerCleared",a,this,c,d);b&&gb(a);this.parent&&
220
+ this.parent.clear()}};Ca.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=ub(f.markedSpans,this);if(null!=g.from&&(c=q(b?f:D(f),g.from),-1==a))return c;if(null!=g.to&&(d=q(b?f:D(f),g.to),1==a))return d}return c&&{from:c,to:d}};Ca.prototype.changed=function(){var a=this,b=this.find(-1,!0),c=this,d=this.doc.cm;b&&d&&Y(d,function(){var e=b.line,f=D(b.line);if(f=hd(d,f))ue(f),d.curOp.selectionChanged=d.curOp.forceUpdate=
221
+ !0;d.curOp.updateMaxLine=!0;Ja(c.doc,e)||null==c.height||(f=c.height,c.height=null,(f=Ab(c)-f)&&ia(e,e.height+f));M(d,"markerChanged",d,a)})};Ca.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=K(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Ca.prototype.detachLine=function(a){this.lines.splice(K(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,
222
+ (a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};Xa(Ca);var Nb=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Nb.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();M(this,"clear")}};Nb.prototype.find=function(a,b){return this.primary.find(a,b)};Xa(Nb);var Rg=0,S=function(a,b,c,d){if(!(this instanceof S))return new S(a,b,c,d);null==c&&(c=0);oa.call(this,
223
+ [new va([new hb("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=q(c,0);this.sel=ua(c);this.history=new rc(null);this.id=++Rg;this.modeOption=b;this.lineSep=d;this.extend=!1;"string"==typeof a&&(a=this.splitLines(a));yd(this,{from:c,to:c,text:a});O(this,ua(c),na)};S.prototype=Md(oa.prototype,{constructor:S,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=
224
+ 0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Lc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||this.lineSeparator())},setValue:N(function(a){var b=q(this.first,0),c=this.first+this.size-1;kb(this,{from:b,to:q(c,r(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0);O(this,ua(b))}),replaceRange:function(a,b,c,d){b=t(this,b);c=c?t(this,c):b;lb(this,a,b,
225
+ c,d)},getRange:function(a,b,c){a=Ga(this,t(this,a),t(this,b));return!1===c?a:a.join(c||this.lineSeparator())},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(tb(this,a))return r(this,a)},getLineNumber:function(a){return D(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=r(this,a));return ja(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return t(this,
226
+ a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:N(function(a,b,c){a=t(this,"number"==typeof a?q(a,b||0):a);O(this,ua(a,null),c)}),setSelection:N(function(a,b,c){var d=t(this,a);a=t(this,b||a);O(this,ua(d,a),c)}),extendSelection:N(function(a,b,c){tc(this,t(this,a),b&&t(this,b),
227
+ c)}),extendSelections:N(function(a,b){Ue(this,Pd(this,a),b)}),extendSelectionsBy:N(function(a,b){var c=$b(this.sel.ranges,a);Ue(this,Pd(this,c),b)}),setSelections:N(function(a,b,c){if(a.length){for(var d=[],e=0;e<a.length;e++)d[e]=new A(t(this,a[e].anchor),t(this,a[e].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));O(this,ga(d,b),c)}}),addSelection:N(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new A(t(this,a),t(this,b||a)));O(this,ga(d,d.length-1),c)}),getSelection:function(a){for(var b=
228
+ this.sel.ranges,c,d=0;d<b.length;d++){var e=Ga(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return!1===a?c:c.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Ga(this,c[d].from(),c[d].to());!1!==a&&(e=e.join(a||this.lineSeparator()));b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:N(function(a,b,c){for(var d=[],e=this.sel,
229
+ f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}if(a=b&&"end"!=b){a=[];e=c=q(this.first,0);for(f=0;f<d.length;f++){var h=d[f],g=Ne(h.from,c,e),k=Ne(Ba(h),c,e);c=h.to;e=k;"around"==b?(h=this.sel.ranges[f],h=0>x(h.head,h.anchor),a[f]=new A(h?k:g,h?g:k)):a[f]=new A(g,g)}a=new Z(a,this.sel.primIndex)}b=a;for(a=d.length-1;0<=a;a--)kb(this,d[a]);b?Ve(this,b):this.cm&&eb(this.cm)}),undo:N(function(){vc(this,"undo")}),redo:N(function(){vc(this,
230
+ "redo")}),undoSelection:N(function(){vc(this,"undo",!0)}),redoSelection:N(function(){vc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new rc(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},
231
+ changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ib(this.history.done),undone:ib(this.history.undone)}},setHistory:function(a){var b=this.history=new rc(this.history.maxGeneration);b.done=ib(a.done.slice(0),null,!0);b.undone=ib(a.undone.slice(0),null,!0)},setGutterMarker:N(function(a,b,c){return Lb(this,
232
+ a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});d[b]=c;!c&&Nd(d)&&(a.gutterMarkers=null);return!0})}),clearGutter:N(function(a){var b=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&Lb(b,c,"gutter",function(){c.gutterMarkers[a]=null;Nd(c.gutterMarkers)&&(c.gutterMarkers=null);return!0})})}),lineInfo:function(a){var b;if("number"==typeof a){if(!tb(this,a))return null;b=a;a=r(this,a);if(!a)return null}else if(b=D(a),null==b)return null;return{line:b,handle:a,text:a.text,
233
+ gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:N(function(a,b,c){return Lb(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Ea(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:N(function(a,b,c){return Lb(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==
234
+ b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",f=a[d];if(f)if(null==c)a[d]=null;else{var g=f.match(Ea(c));if(!g)return!1;var h=g.index+g[0].length;a[d]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:N(function(a,b,c){return pg(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return mb(this,t(this,a),t(this,b),c,c&&c.type||"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:
235
+ b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};a=t(this,a);return mb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=t(this,a);var b=[],c=r(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=t(this,a);b=t(this,b);var d=[],e=a.line;this.iter(a.line,b.line+1,function(f){if(f=f.markedSpans)for(var g=
236
+ 0;g<f.length;g++){var h=f[g];null!=h.to&&e==a.line&&a.ch>=h.to||null==h.from&&e!=a.line||null!=h.from&&e==b.line&&h.from>=b.ch||c&&!c(h.marker)||d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;this.iter(function(e){e=e.text.length+d;if(e>a)return b=a,!0;a-=e;++c});return t(this,
237
+ q(c,b))},indexFromPos:function(a){a=t(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;var c=this.lineSeparator().length;this.iter(this.first,a.line,function(a){b+=a.text.length+c});return b},copy:function(a){var b=new S(Lc(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||
238
+ (a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new S(Lc(this,b,c),a.mode||this.modeOption,b,this.lineSep);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=jf(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from),e=b.clipPos(e.to);x(f,e)&&(f=mb(b,f,e,d.primary,d.primary.type),d.markers.push(f),f.parent=
239
+ d)}return b},unlinkDoc:function(a){a instanceof E&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);rg(jf(this));break}if(a.history==this.history){var c=[a.id];Ra(a,function(a){return c.push(a.id)},!0);a.history=new rc(null);a.history.done=ib(this.history.done,c);a.history.undone=ib(this.history.undone,c)}},iterLinkedDocs:function(a){Ra(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},
240
+ splitLines:function(a){return this.lineSep?a.split(this.lineSep):Jd(a)},lineSeparator:function(){return this.lineSep||"\n"}});S.prototype.eachLine=S.prototype.iter;for(var lf=0,Af=!1,Da={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:".",
241
+ 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"},Vb=0;10>Vb;Vb++)Da[Vb+48]=Da[Vb+96]=String(Vb);for(var Ec=65;90>=Ec;Ec++)Da[Ec]=String.fromCharCode(Ec);for(var Wb=1;12>=Wb;Wb++)Da[Wb+111]=Da[Wb+63235]="F"+Wb;var Ob={basic:{Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",
242
+ 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"},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",
243
+ "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"},emacsy:{"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown",
244
+ "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"},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",
245
+ "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",
246
+ fallthrough:["basic","emacsy"]}};Ob["default"]=da?Ob.macDefault:Ob.pcDefault;var yc={selectAll:$e,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),na)},killLine:function(a){return ob(a,function(b){if(b.empty()){var c=r(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:q(b.head.line+1,0)}:{from:b.head,to:q(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){return ob(a,function(b){return{from:q(b.from().line,
247
+ 0),to:t(a.doc,q(b.to().line+1,0))}})},delLineLeft:function(a){return ob(a,function(a){return{from:q(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){return ob(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},delWrappedLineRight:function(a){return ob(a,function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:c}})},undo:function(a){return a.undo()},
248
+ redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(q(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(q(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy(function(b){return qf(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(b){return rf(a,b.head)},{origin:"+move",bias:1})},
249
+ goLineEnd:function(a){return a.extendSelectionsBy(function(b){b=b.head.line;var c=r(a.doc,b),d;d=c;for(var e;e=Ia(d,!1);)d=e.find(1,!0).line;d!=c&&(b=D(d));return Wc(!0,a,c,b,-1)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div")},Tb)},goLineLeft:function(a){return a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,
250
+ top:b},"div")},Tb)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:0,top:c},"div");return c.ch<a.getLine(c.line).search(/\S/)?rf(a,b.head):c},Tb)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,
251
+ "char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"char")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,
252
+ "word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),f=aa(a.getLine(f.line),f.ch,d);b.push(Ic(d-
253
+ f%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return Y(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)if(b[d].empty()){var e=b[d].head,f=r(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new q(e.line,e.ch-1)),0<e.ch)e=new q(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),q(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=r(a.doc,e.line-1).text;
254
+ g&&(e=new q(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),q(e.line-1,g.length-1),e,"+transpose"))}c.push(new A(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){return Y(a,function(){for(var b=a.listSelections(),c=b.length-1;0<=c;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.listSelections();for(c=0;c<b.length;c++)a.indentLine(b[c].from().line,null,!0);eb(a)})},openLine:function(a){return a.replaceSelection("\n","start")},toggleOverwrite:function(a){return a.toggleOverwrite()}},
255
+ yg=new Sa,Dd=null,Bc,Ac,pb={toString:function(){return"CodeMirror.Init"}},zf={},Cc={};E.defaults=zf;E.optionHandlers=Cc;var Hd=[];E.defineInitHook=function(a){return Hd.push(a)};var T=null,y=function(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new Sa;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};y.prototype.init=function(a){function b(a){if(!H(e,a)){if(e.somethingSelected())T={lineWise:!1,text:e.getSelections()},
256
+ "cut"==a.type&&e.replaceSelection("",null,"cut");else if(e.options.lineWiseCopyCut){var b=Ef(e);T={lineWise:!0,text:b.text};"cut"==a.type&&e.operation(function(){e.setSelections(b.ranges,0,na);e.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var c=T.text.join("\n");a.clipboardData.setData("Text",c);if(a.clipboardData.getData("Text")==c){a.preventDefault();return}}var g=Gf();a=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild);
257
+ a.value=T.text.join("\n");var m=document.activeElement;rb(a);setTimeout(function(){e.display.lineSpace.removeChild(g);m.focus();m==f&&d.showPrimarySelection()},50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;Ff(f,e.options.spellcheck);w(f,"paste",function(a){H(e,a)||Df(a,e)||11>=z&&setTimeout(J(e,function(){d.pollContent()||Q(e)}),20)});w(f,"compositionstart",function(a){c.composing={data:a.data,done:!1}});w(f,"compositionupdate",function(a){c.composing||(c.composing={data:a.data,done:!1})});w(f,
258
+ "compositionend",function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)});w(f,"touchstart",function(){return d.forceCompositionEnd()});w(f,"input",function(){c.composing||c.readFromDOMSoon()});w(f,"copy",b);w(f,"cut",b)};y.prototype.prepareSelection=function(){var a=ze(this.cm,!1);a.focus=this.cm.state.focused;return a};y.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))};
259
+ y.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=Dc(this.cm,a.anchorNode,a.anchorOffset),d=Dc(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=x(dc(c,d),b.from())||0!=x(cc(c,d),b.to()))if(c=If(this.cm,b.from()),d=If(this.cm,b.to()),c||d){var e=this.cm.display.view,b=a.rangeCount&&a.getRangeAt(0);c?d||(d=e[e.length-1].measure,d=d.maps?d.maps[d.maps.length-1]:d.map,d={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}):c={node:e[0].measure.map[2],
260
+ offset:0};var f;try{f=$a(c.node,c.offset,d.offset,d.node)}catch(g){}f&&(!wa&&this.cm.state.focused?(a.collapse(c.node,c.offset),f.collapsed||(a.removeAllRanges(),a.addRange(f))):(a.removeAllRanges(),a.addRange(f)),b&&null==a.anchorNode?a.addRange(b):wa&&this.startGracePeriod());this.rememberSelection()}};y.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){a.gracePeriod=!1;a.selectionChanged()&&a.cm.operation(function(){return a.cm.curOp.selectionChanged=
261
+ !0})},20)};y.prototype.showMultipleSelections=function(a){W(this.cm.display.cursorDiv,a.cursors);W(this.cm.display.selectionDiv,a.selection)};y.prototype.rememberSelection=function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode;this.lastAnchorOffset=a.anchorOffset;this.lastFocusNode=a.focusNode;this.lastFocusOffset=a.focusOffset};y.prototype.selectionInEditor=function(){var a=window.getSelection();if(!a.rangeCount)return!1;a=a.getRangeAt(0).commonAncestorContainer;return Yb(this.div,
262
+ a)};y.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())};y.prototype.blur=function(){this.div.blur()};y.prototype.getField=function(){return this.div};y.prototype.supportsTouch=function(){return!0};y.prototype.receivedFocus=function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Y(this.cm,
263
+ function(){return b.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,a)};y.prototype.selectionChanged=function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset};y.prototype.pollSelection=function(){if(!this.composing&&null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();
264
+ var c=Dc(b,a.anchorNode,a.anchorOffset),d=Dc(b,a.focusNode,a.focusOffset);c&&d&&Y(b,function(){O(b.doc,ua(c,d),na);if(c.bad||d.bad)b.curOp.selectionChanged=!0})}};y.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),c=c.to();0==d.ch&&d.line>a.firstLine()&&(d=q(d.line-1,r(a.doc,d.line-1).length));c.ch==r(a.doc,c.line).text.length&&c.line<a.lastLine()&&(c=q(c.line+1,0));if(d.line<
265
+ b.viewFrom||c.line>b.viewTo-1)return!1;var e;d.line==b.viewFrom||0==(e=Na(a,d.line))?(d=D(b.view[0].line),e=b.view[0].node):(d=D(b.view[e].line),e=b.view[e-1].node.nextSibling);var f=Na(a,c.line);f==b.view.length-1?(c=b.viewTo-1,b=b.lineDiv.lastChild):(c=D(b.view[f+1].line)-1,b=b.view[f+1].node.previousSibling);if(!e)return!1;b=a.doc.splitLines(Kg(a,e,b,d,c));for(e=Ga(a.doc,q(d,0),q(c,r(a.doc,c).text.length));1<b.length&&1<e.length;)if(B(b)==B(e))b.pop(),e.pop(),c--;else if(b[0]==e[0])b.shift(),e.shift(),
266
+ d++;else break;for(var g=0,f=0,h=b[0],k=e[0],l=Math.min(h.length,k.length);g<l&&h.charCodeAt(g)==k.charCodeAt(g);)++g;h=B(b);k=B(e);for(l=Math.min(h.length-(1==b.length?g:0),k.length-(1==e.length?g:0));f<l&&h.charCodeAt(h.length-f-1)==k.charCodeAt(k.length-f-1);)++f;b[b.length-1]=h.slice(0,h.length-f).replace(/^\u200b+/,"");b[0]=b[0].slice(g).replace(/\u200b+#x2F;,"");d=q(d,g);c=q(c,e.length?B(e).length-f:0);if(1<b.length||b[0]||x(d,c))return lb(a.doc,b,d,c,"+input"),!0};y.prototype.ensurePolled=function(){this.forceCompositionEnd()};
267
+ y.prototype.reset=function(){this.forceCompositionEnd()};y.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||Q(this.cm),this.div.blur(),this.div.focus())};y.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){a.readDOMTimeout=null;if(a.composing)if(a.composing.done)a.composing=null;else return;!a.cm.isReadOnly()&&a.pollContent()||Y(a.cm,function(){return Q(a.cm)})},
268
+ 80))};y.prototype.setUneditable=function(a){a.contentEditable="false"};y.prototype.onKeyPress=function(a){0!=a.charCode&&(a.preventDefault(),this.cm.isReadOnly()||J(this.cm,Id)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))};y.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)};y.prototype.onContextMenu=function(){};y.prototype.resetPosition=function(){};y.prototype.needsContentAttribute=!0;var G=function(a){this.cm=a;this.prevInput="";this.pollingFast=
269
+ !1;this.polling=new Sa;this.hasSelection=this.inaccurateSelection=!1;this.composing=null};G.prototype.init=function(a){function b(a){if(!H(e,a)){if(e.somethingSelected())T={lineWise:!1,text:e.getSelections()},d.inaccurateSelection&&(d.prevInput="",d.inaccurateSelection=!1,g.value=T.text.join("\n"),rb(g));else if(e.options.lineWiseCopyCut){var b=Ef(e);T={lineWise:!0,text:b.text};"cut"==a.type?e.setSelections(b.ranges,null,na):(d.prevInput="",g.value=b.text.join("\n"),rb(g))}else return;"cut"==a.type&&
270
+ (e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm,f=this.wrapper=Gf(),g=this.textarea=f.firstChild;a.wrapper.insertBefore(f,a.wrapper.firstChild);Rb&&(g.style.width="0px");w(g,"input",function(){C&&9<=z&&c.hasSelection&&(c.hasSelection=null);d.poll()});w(g,"paste",function(a){H(e,a)||Df(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())});w(g,"cut",b);w(g,"copy",b);w(a.scroller,"paste",function(b){ta(a,b)||H(e,b)||(e.state.pasteIncoming=!0,d.focus())});w(a.lineSpace,"selectstart",function(b){ta(a,
271
+ b)||P(b)});w(g,"compositionstart",function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear();d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}});w(g,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})};G.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=ze(a);if(a.options.moveInputWithCursor){var a=ea(a,c.sel.primary().head,"div"),c=b.wrapper.getBoundingClientRect(),e=
272
+ b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-c.top));d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-c.left))}return d};G.prototype.showSelection=function(a){var b=this.cm.display;W(b.cursorDiv,a.cursors);W(b.selectionDiv,a.selection);null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")};G.prototype.reset=function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;d.somethingSelected()?
273
+ (this.prevInput="",b=e.sel.primary(),c=(b=uf&&(100<b.to().line-b.from().line||1E3<(c=d.getSelection()).length))?"-":c||d.getSelection(),this.textarea.value=c,d.state.focused&&rb(this.textarea),C&&9<=z&&(this.hasSelection=c)):a||(this.prevInput=this.textarea.value="",C&&9<=z&&(this.hasSelection=null));this.inaccurateSelection=b}};G.prototype.getField=function(){return this.textarea};G.prototype.supportsTouch=function(){return!1};G.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&
274
+ (!sb||pa()!=this.textarea))try{this.textarea.focus()}catch(a){}};G.prototype.blur=function(){this.textarea.blur()};G.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};G.prototype.receivedFocus=function(){this.slowPoll()};G.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll();a.cm.state.focused&&a.slowPoll()})};G.prototype.fastPoll=function(){function a(){c.poll()||b?(c.pollingFast=!1,c.slowPoll()):
275
+ (b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0;c.polling.set(20,a)};G.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||Qg(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(C&&9<=z&&this.hasSelection===e||da&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=
276
+ e.charCodeAt(0);8203!=f||d||(d="\u200b");if(8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,f=Math.min(d.length,e.length);g<f&&d.charCodeAt(g)==e.charCodeAt(g);)++g;Y(b,function(){Id(b,e.slice(g),d.length-g,null,a.composing?"*compose":null);1E3<e.length||-1<e.indexOf("\n")?c.value=a.prevInput="":a.prevInput=e;a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))});return!0};G.prototype.ensurePolled=
277
+ function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};G.prototype.onKeyPress=function(){C&&9<=z&&(this.hasSelection=null);this.fastPoll()};G.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="\u200b"+(a?g.value:"");g.value="\u21da";g.value=b;d.prevInput=a?"":"\u200b";g.selectionStart=1;g.selectionEnd=b.length;f.selForContextMenu=e.doc.sel}}function c(){d.contextMenuPending=!1;d.wrapper.style.cssText=m;g.style.cssText=l;C&&9>z&&f.scrollbars.setScrollTop(f.scroller.scrollTop=
278
+ k);if(null!=g.selectionStart){(!C||C&&9>z)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0<g.selectionEnd&&"\u200b"==d.prevInput?J(e,$e)(e):10>a++?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Qa(e,a),k=f.scroller.scrollTop;if(h&&!fa){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(h)&&J(e,O)(e.doc,ua(h),na);var l=g.style.cssText,
279
+ m=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";h=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-h.top-5)+"px; left: "+(a.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(C?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var n;L&&(n=window.scrollY);f.input.focus();L&&window.scrollTo(null,
280
+ n);f.input.reset();e.somethingSelected()||(g.value=d.prevInput=" ");d.contextMenuPending=!0;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);C&&9<=z&&b();if(Fd){wb(a);var p=function(){ca(window,"mouseup",p);setTimeout(c,20)};w(window,"mouseup",p)}else setTimeout(c,50)}};G.prototype.readOnlyChanged=function(a){a||this.reset()};G.prototype.setUneditable=function(){};G.prototype.needsContentAttribute=!1;(function(a){function b(b,e,f,g){a.defaults[b]=e;f&&(c[b]=g?function(a,b,d){d!=pb&&
281
+ f(a,b,d)}:f)}var c=a.optionHandlers;a.defineOption=b;a.Init=pb;b("value","",function(a,b){return a.setValue(b)},!0);b("mode",null,function(a,b){a.doc.modeOption=b;xd(a)},!0);b("indentUnit",2,xd,!0);b("indentWithTabs",!1);b("smartIndent",!0);b("tabSize",4,function(a){Ib(a);Cb(a);Q(a)},!0);b("lineSeparator",null,function(a,b){if(a.doc.lineSep=b){var d=[],c=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;e=f+b.length;d.push(q(c,f))}c++});for(var e=d.length-
282
+ 1;0<=e;e--)lb(a.doc,b,d[e],q(d[e].line,d[e].ch+b.length))}});b("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g");c!=pb&&a.refresh()});b("specialCharPlaceholder",ag,function(a){return a.refresh()},!0);b("electricChars",!0);b("inputStyle",sb?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor");},!0);b("spellcheck",!1,function(a,
283
+ b){return a.getInputField().spellcheck=b},!0);b("rtlMoveVisually",!Pg);b("wholeLineUpdateBefore",!0);b("theme","default",function(a){yf(a);Pb(a)},!0);b("keyMap","default",function(a,b,c){b=wc(b);(c=c!=pb&&wc(c))&&c.detach&&c.detach(a,b);b.attach&&b.attach(a,c||null)});b("extraKeys",null);b("lineWrapping",!1,Ig,!0);b("gutters",[],function(a){vd(a.options);Pb(a)},!0);b("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?ld(a.display)+"px":"0";a.refresh()},!0);b("coverGutterNextToScrollbar",
284
+ !1,function(a){return db(a)},!0);b("scrollbarStyle","native",function(a){He(a);db(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0);b("lineNumbers",!1,function(a){vd(a.options);Pb(a)},!0);b("firstLineNumber",1,Pb,!0);b("lineNumberFormatter",function(a){return a},Pb,!0);b("showCursorWhenSelecting",!1,Db,!0);b("resetSelectionOnContextMenu",!0);b("lineWiseCopyCut",!0);b("readOnly",!1,function(a,b){"nocursor"==b?(Eb(a),a.display.input.blur(),
285
+ a.display.disabled=!0):a.display.disabled=!1;a.display.input.readOnlyChanged(b)});b("disableInput",!1,function(a,b){b||a.display.input.reset()},!0);b("dragDrop",!0,Hg);b("allowDropFileTypes",null);b("cursorBlinkRate",530);b("cursorScrollMargin",0);b("cursorHeight",1,Db,!0);b("singleCursorHeightPerLine",!0,Db,!0);b("workTime",100);b("workDelay",100);b("flattenSpans",!0,Ib,!0);b("addModeClass",!1,Ib,!0);b("pollInterval",100);b("undoDepth",200,function(a,b){return a.doc.history.undoDepth=b});b("historyEventDelay",
286
+ 1250);b("viewportMargin",10,function(a){return a.refresh()},!0);b("maxHighlightLength",1E4,Ib,!0);b("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()});b("tabindex",null,function(a,b){return a.display.input.getField().tabIndex=b||""});b("autofocus",null)})(E);(function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus();this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];if(d[a]!=c||"mode"==a)d[a]=c,
287
+ b.hasOwnProperty(a)&&J(this,b[a])(this,c,e),F(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](wc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:R(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw Error("Overlays may not be stateful.");Mf(this.state.overlays,
288
+ {mode:d,modeSpec:b,opaque:c&&c.opaque,priority:c&&c.priority||0},function(a){return a.priority});this.state.modeGen++;Q(this)}),removeOverlay:R(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++;Q(this);break}}}),indentLine:R(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");tb(this.doc,a)&&Qb(this,a,b,c)}),indentSelection:R(function(a){for(var b=
289
+ this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var h=b[d];if(h.empty())h.head.line>c&&(Qb(this,h.head.line,a,!0),c=h.head.line,d==this.doc.sel.primIndex&&eb(this));else{for(var k=h.from(),h=h.to(),l=Math.max(c,k.line),c=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1,h=l;h<c;++h)Qb(this,h,a);h=this.doc.sel.ranges;0==k.ch&&b.length==h.length&&0<h[d].from().ch&&Ad(this.doc,d,new A(k,h[d].to()),na)}}}),getTokenAt:function(a,b){return fe(this,a,b)},getLineTokens:function(a,b){return fe(this,q(a),b,!0)},getTokenTypeAt:function(a){a=
290
+ t(this.doc,a);var b=de(this,r(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)b=b[2];else for(;;){var h=c+d>>1;if((h?b[2*h-1]:0)>=a)d=h;else if(b[2*h+1]<a)c=h+1;else{b=b[2*h+2];break}}c=b?b.indexOf("overlay "):-1;return 0>c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var d=[];if(!c.hasOwnProperty(b))return d;var e=c[b],
291
+ h=this.getModeAt(a);if("string"==typeof h[b])e[h[b]]&&d.push(e[h[b]]);else if(h[b])for(var k=0;k<h[b].length;k++){var l=e[h[b][k]];l&&d.push(l)}else h.helperType&&e[h.helperType]?d.push(e[h.helperType]):e[h.name]&&d.push(e[h.name]);for(k=0;k<e._global.length;k++)l=e._global[k],l.pred(h,this)&&-1==K(d,l.val)&&d.push(l.val);return d},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return xb(this,a+1,b)},cursorCoords:function(a,b){var c;
292
+ c=this.doc.sel.primary();c=null==a?c.head:"object"==typeof a?t(this.doc,a):a?c.from():c.to();return ea(this,c,b||"page")},charCoords:function(a,b){return jc(this,t(this.doc,a),b||"page")},coordsChar:function(a,b){a=we(this,a,b||"page");return kd(this,a.left,a.top)},lineAtHeight:function(a,b){a=we(this,{top:a,left:0},b||"page").top;return Ha(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b,c){var d=!1;if("number"==typeof a){var e=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:
293
+ a>e&&(a=e,d=!0);a=r(this.doc,a)}return Ka(this,a,{top:0,left:0},b||"page",c||d).top+(d?this.doc.height-ka(a):0)},defaultTextHeight:function(){return Oa(this.display)},defaultCharWidth:function(){return Bb(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,g,h){var d=this.display;a=ea(this,t(this.doc,a));var e=a.bottom,f=a.left;b.style.position="absolute";b.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(b);
294
+ d.sizer.appendChild(b);if("over"==g)e=a.top;else if("above"==g||"near"==g){var n=Math.max(d.wrapper.clientHeight,this.doc.height),p=Math.max(d.sizer.clientWidth,d.lineSpace.clientWidth);("above"==g||a.bottom+b.offsetHeight>n)&&a.top>b.offsetHeight?e=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=n&&(e=a.bottom);f+b.offsetWidth>p&&(f=p-b.offsetWidth)}b.style.top=e+"px";b.style.left=b.style.right="";"right"==h?(f=d.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==h?f=0:"middle"==h&&(f=(d.sizer.clientWidth-
295
+ b.offsetWidth)/2),b.style.left=f+"px");c&&(a=mc(this,f,e,f+b.offsetWidth,e+b.offsetHeight),null!=a.scrollTop&&Fb(this,a.scrollTop),null!=a.scrollLeft&&cb(this,a.scrollLeft))},triggerOnKeyDown:R(tf),triggerOnKeyPress:R(wf),triggerOnKeyUp:vf,execCommand:function(a){if(yc.hasOwnProperty(a))return yc[a].call(null,this)},triggerElectric:R(function(a){Cf(this,a)}),findPosH:function(a,b,c,g){var d=1;0>b&&(d=-1,b=-b);a=t(this.doc,a);for(var e=0;e<b&&(a=Kd(this.doc,a,d,c,g),!a.hitSide);++e);return a},moveH:R(function(a,
296
+ b){var c=this;this.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Kd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Tb)}),deleteH:R(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):ob(this,function(d){var e=Kd(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,g){var d=1;0>b&&(d=-1,b=-b);var e=t(this.doc,a);for(a=0;a<b&&(e=ea(this,e,"div"),null==g?g=e.left:
297
+ e.left=g,e=Hf(this,e,d,c),!e.hitSide);++a);return e},moveV:R(function(a,b){var c=this,d=this.doc,e=[],k=!this.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(f){if(k)return 0>a?f.from():f.to();var g=ea(c,f.head,"div");null!=f.goalColumn&&(g.left=f.goalColumn);e.push(g.left);var h=Hf(c,g,a,b);"page"==b&&f==d.sel.primary()&&nc(c,null,jc(c,h,"div").top-g.top);return h},Tb);if(e.length)for(var l=0;l<d.sel.ranges.length;l++)d.sel.ranges[l].goalColumn=e[l]}),findWordAt:function(a){var b=
298
+ r(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var h=this.getHelper(a,"wordChars");"before"!=a.sticky&&d!=b.length||!c?++d:--c;for(var k=b.charAt(c),k=ac(k,h)?function(a){return ac(a,h)}:/\s/.test(k)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!ac(a)};0<c&&k(b.charAt(c-1));)--c;for(;d<b.length&&k(b.charAt(d));)++d}return new A(q(a.line,c),q(a.line,d))},toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?Va(this.display.cursorDiv,
299
+ "CodeMirror-overwrite"):bb(this.display.cursorDiv,"CodeMirror-overwrite"),F(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==pa()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:R(function(a,b){null==a&&null==b||oc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-
300
+ ma(this)-this.display.barHeight,width:a.scrollWidth-ma(this)-this.display.barWidth,clientHeight:gd(this),clientWidth:Ma(this)}},scrollIntoView:R(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:q(a,0),to:null}:null==a.from&&(a={from:a,to:null});a.to||(a.to=a.from);a.margin=b||0;if(null!=a.from.line)oc(this),this.curOp.scrollToPos=a;else{var c=mc(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-
301
+ a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:R(function(a,b){var c=this,d=function(a){return"number"==typeof a||/^\d+#x2F;.test(String(a))?a+"px":a};null!=a&&(this.display.wrapper.style.width=d(a));null!=b&&(this.display.wrapper.style.height=d(b));this.options.lineWrapping&&ve(this);var e=this.display.viewFrom;this.doc.iter(e,this.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Aa(c,
302
+ e,"widget");break}++e});this.curOp.forceUpdate=!0;F(this,"refresh",this)}),operation:function(a){return Y(this,a)},refresh:R(function(){var a=this.display.cachedTextHeight;Q(this);this.curOp.forceUpdate=!0;Cb(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);qd(this);(null==a||.5<Math.abs(a-Oa(this.display)))&&md(this);F(this,"refresh",this)}),swapDoc:R(function(a){var b=this.doc;b.cm=null;Pe(this,a);Cb(this);this.display.input.reset();this.scrollTo(a.scrollLeft,a.scrollTop);this.curOp.forceScroll=
303
+ !0;M(this,"swapDoc",this,b);return b}),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}};Xa(a);a.registerHelper=function(b,e,f){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]});c[b][e]=f};a.registerGlobalHelper=function(b,e,f,g){a.registerHelper(b,e,g);c[b]._global.push({pred:f,val:g})}})(E);var Sg="iter insert remove copy getEditor constructor".split(" "),
304
+ Xb;for(Xb in S.prototype)S.prototype.hasOwnProperty(Xb)&&0>K(Sg,Xb)&&(E.prototype[Xb]=function(a){return function(){return a.apply(this.doc,arguments)}}(S.prototype[Xb]));Xa(S);E.inputStyles={textarea:G,contenteditable:y};E.defineMode=function(a){E.defaults.mode||"null"==a||(E.defaults.mode=a);Uf.apply(this,arguments)};E.defineMIME=function(a,b){Ya[a]=b};E.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}});E.defineMIME("text/plain","null");E.defineExtension=function(a,
305
+ b){E.prototype[a]=b};E.defineDocExtension=function(a,b){S.prototype[a]=b};E.fromTextArea=function(a,b){function c(){a.value=h.getValue()}b=b?Fa(b):{};b.value=a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=pa();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}var e;if(a.form&&(w(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form;e=f.submit;try{var g=f.submit=function(){c();
306
+ f.submit=e;f.submit();f.submit=g}}catch(k){}}b.finishInit=function(b){b.save=c;b.getTextArea=function(){return a};b.toTextArea=function(){b.toTextArea=isNaN;c();a.parentNode.removeChild(b.getWrapperElement());a.style.display="";a.form&&(ca(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}};a.style.display="none";var h=E(function(b){return a.parentNode.insertBefore(b,a.nextSibling)},b);return h};(function(a){a.off=ca;a.on=w;a.wheelEventPixels=hg;a.Doc=S;a.splitLines=Jd;a.countColumn=
307
+ aa;a.findColumn=Hc;a.isWordChar=Jc;a.Pass=Cd;a.signal=F;a.Line=hb;a.changeEnd=Ba;a.scrollbarModel=Ie;a.Pos=q;a.cmpPos=x;a.modes=Zc;a.mimeModes=Ya;a.resolveMode=hc;a.getMode=$c;a.modeExtensions=Za;a.extendMode=Vf;a.copyState=ra;a.startState=ae;a.innerMode=ad;a.commands=yc;a.keyMap=Ob;a.keyName=of;a.isModifierKey=nf;a.lookupKey=nb;a.normalizeKeyMap=wg;a.StringStream=I;a.SharedTextMarker=Nb;a.TextMarker=Ca;a.LineWidget=Mb;a.e_preventDefault=P;a.e_stopPropagation=Zd;a.e_stop=wb;a.addClass=Va;a.contains=
308
+ Yb;a.rmClass=bb;a.keyNames=Da})(E);E.version="5.24.2";return E});
309
310
+ // CodeMirror CSS mode version 5.24.2
311
+ (function(k){k(CodeMirror)})(function(k){function g(g){for(var d={},f=0;f<g.length;++f)d[g[f].toLowerCase()]=!0;return d}function x(g,d){for(var f=!1,k;null!=(k=g.next());){if(f&&"/"==k){d.tokenize=null;break}f="*"==k}return["comment","comment"]}k.defineMode("css",function(g,d){function f(a,c){A=c;return a}function q(a,c){var b=a.next();if(w[b]){var d=w[b](a,c);if(!1!==d)return d}if("@"==b)return a.eatWhile(/[\w\\\-]/),f("def",a.current());if("="==b||("~"==b||"|"==b)&&a.eat("="))return f(null,"compare");
312
+ if('"'==b||"'"==b)return c.tokenize=G(b),c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),f("atom","hash");if("!"==b)return a.match(/^\s*\w*/),f("keyword","important");if(/\d/.test(b)||"."==b&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),f("number","unit");if("-"===b){if(/[\d.]/.test(a.peek()))return a.eatWhile(/[\w.%]/),f("number","unit");if(a.match(/^-[\w\\\-]+/))return a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?f("variable-2","variable-definition"):f("variable-2","variable");if(a.match(/^\w+-/))return f("meta",
313
+ "meta")}else return/[,+>*\/]/.test(b)?f(null,"select-op"):"."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?f("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?f(null,b):"u"==b&&a.match(/rl(-prefix)?\(/)||"d"==b&&a.match("omain(")||"r"==b&&a.match("egexp(")?(a.backUp(1),c.tokenize=x,f("property","word")):/[\w\\\-]/.test(b)?(a.eatWhile(/[\w\\\-]/),f("property","word")):f(null,null)}function G(a){return function(c,b){for(var d=!1,e;null!=(e=c.next());){if(e==a&&!d){")"==a&&c.backUp(1);break}d=!d&&"\\"==e}if(e==
314
+ a||!d&&")"!=a)b.tokenize=null;return f("string","string")}}function x(a,c){a.next();a.match(/\s*[\"\')]/,!1)?c.tokenize=null:c.tokenize=G(")");return f(null,"(")}function r(a,c,b){this.type=a;this.indent=c;this.prev=b}function h(a,c,b,d){a.context=new r(b,c.indentation()+(!1===d?0:v),a.context);return b}function l(a){a.context.prev&&(a.context=a.context.prev);return a.context.type}function n(a,c,b,d){for(d=d||1;0<d;d--)b.context=b.context.prev;return m[b.context.type](a,c,b)}function t(a){a=a.current().toLowerCase();
315
+ e=H.hasOwnProperty(a)?"atom":I.hasOwnProperty(a)?"keyword":"variable"}var u=d.inline;d.propertyKeywords||(d=k.resolveMode("text/css"));var v=g.indentUnit,w=d.tokenHooks,y=d.documentTypes||{},z=d.mediaTypes||{},B=d.mediaFeatures||{},C=d.mediaValueKeywords||{},J=d.propertyKeywords||{},K=d.nonStandardPropertyKeywords||{},D=d.fontProperties||{},E=d.counterDescriptors||{},I=d.colorKeywords||{},H=d.valueKeywords||{},p=d.allowNested,F=!0===d.supportsAtComponent,A,e,m={top:function(a,c,b){if("{"==a)return h(b,
316
+ c,"block");if("}"==a&&b.context.prev)return l(b);if(F&&/@component/.test(a))return h(b,c,"atComponentBlock");if(/^@(-moz-)?document#x2F;.test(a))return h(b,c,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)#x2F;.test(a))return h(b,c,"atBlock");if(/^@(font-face|counter-style)/.test(a))return b.stateArg=a,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes#x2F;.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return h(b,c,"at");if("hash"==a)e="builtin";else if("word"==a)e="tag";
317
+ else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return h(b,c,"interpolation");if(":"==a)return"pseudo";if(p&&"("==a)return h(b,c,"parens")}return b.context.type},block:function(a,c,b){if("word"==a){a=c.current().toLowerCase();if(J.hasOwnProperty(a))return e="property","maybeprop";if(K.hasOwnProperty(a))return e="string-2","maybeprop";if(p)return e=c.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block";e+=" error";return"maybeprop"}if("meta"==a)return"block";if(p||"hash"!=a&&
318
+ "qualifier"!=a)return m.top(a,c,b);e="error";return"block"},maybeprop:function(a,c,b){return":"==a?h(b,c,"prop"):m[b.context.type](a,c,b)},prop:function(a,c,b){if(";"==a)return l(b);if("{"==a&&p)return h(b,c,"propBlock");if("}"==a||"{"==a)return n(a,c,b);if("("==a)return h(b,c,"parens");if("hash"==a&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})#x2F;.test(c.current()))e+=" error";else if("word"==a)t(c);else if("interpolation"==a)return h(b,c,"interpolation");return"prop"},propBlock:function(a,
319
+ c,b){return"}"==a?l(b):"word"==a?(e="property","maybeprop"):b.context.type},parens:function(a,c,b){if("{"==a||"}"==a)return n(a,c,b);if(")"==a)return l(b);if("("==a)return h(b,c,"parens");if("interpolation"==a)return h(b,c,"interpolation");"word"==a&&t(c);return"parens"},pseudo:function(a,c,b){return"meta"==a?"pseudo":"word"==a?(e="variable-3",b.context.type):m[b.context.type](a,c,b)},documentTypes:function(a,c,b){return"word"==a&&y.hasOwnProperty(c.current())?(e="tag",b.context.type):m.atBlock(a,
320
+ c,b)},atBlock:function(a,c,b){if("("==a)return h(b,c,"atBlock_parens");if("}"==a||";"==a)return n(a,c,b);if("{"==a)return l(b)&&h(b,c,p?"block":"top");if("interpolation"==a)return h(b,c,"interpolation");"word"==a&&(a=c.current().toLowerCase(),e="only"==a||"not"==a||"and"==a||"or"==a?"keyword":z.hasOwnProperty(a)?"attribute":B.hasOwnProperty(a)?"property":C.hasOwnProperty(a)?"keyword":J.hasOwnProperty(a)?"property":K.hasOwnProperty(a)?"string-2":H.hasOwnProperty(a)?"atom":I.hasOwnProperty(a)?"keyword":
321
+ "error");return b.context.type},atComponentBlock:function(a,c,b){if("}"==a)return n(a,c,b);if("{"==a)return l(b)&&h(b,c,p?"block":"top",!1);"word"==a&&(e="error");return b.context.type},atBlock_parens:function(a,c,b){return")"==a?l(b):"{"==a||"}"==a?n(a,c,b,2):m.atBlock(a,c,b)},restricted_atBlock_before:function(a,c,b){return"{"==a?h(b,c,"restricted_atBlock"):"word"==a&&"@counter-style"==b.stateArg?(e="variable","restricted_atBlock_before"):m[b.context.type](a,c,b)},restricted_atBlock:function(a,
322
+ c,b){return"}"==a?(b.stateArg=null,l(b)):"word"==a?(e="@font-face"==b.stateArg&&!D.hasOwnProperty(c.current().toLowerCase())||"@counter-style"==b.stateArg&&!E.hasOwnProperty(c.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(a,c,b){return"word"==a?(e="variable","keyframes"):"{"==a?h(b,c,"top"):m[b.context.type](a,c,b)},at:function(a,c,b){if(";"==a)return l(b);if("{"==a||"}"==a)return n(a,c,b);"word"==a?e="tag":"hash"==a&&(e="builtin");return"at"},interpolation:function(a,
323
+ c,b){if("}"==a)return l(b);if("{"==a||";"==a)return n(a,c,b);"word"==a?e="variable":"variable"!=a&&"("!=a&&")"!=a&&(e="error");return"interpolation"}};return{startState:function(a){return{tokenize:null,state:u?"block":"top",stateArg:null,context:new r(u?"block":"top",a||0,null)}},token:function(a,c){if(!c.tokenize&&a.eatSpace())return null;var b=(c.tokenize||q)(a,c);b&&"object"==typeof b&&(A=b[1],b=b[0]);e=b;c.state=m[c.state](A,a,c);return e},indent:function(a,c){var b=a.context,d=c&&c.charAt(0),
324
+ e=b.indent;"prop"!=b.type||"}"!=d&&")"!=d||(b=b.prev);if(b.prev)if("}"==d&&("block"==b.type||"top"==b.type||"interpolation"==b.type||"restricted_atBlock"==b.type))b=b.prev,e=b.indent;else if(")"==d&&("parens"==b.type||"atBlock_parens"==b.type)||"{"==d&&("at"==b.type||"atBlock"==b.type))e=Math.max(0,b.indent-v);return e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.lineComment,fold:"brace"}});var q=["domain","regexp","url","url-prefix"],B=g(q),r="all aural braille handheld print projection screen tty tv embossed".split(" "),
325
+ C=g(r),t="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".split(" "),
326
+ D=g(t),u="landscape portrait none coarse fine on-demand hover interlace progressive".split(" "),E=g(u),v="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 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 user-select vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width will-change 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".split(" "),
327
+ F=g(v),w="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".split(" "),L=g(w),M=g("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),N=g("additive-symbols fallback negative pad prefix range speak-as suffix symbols system".split(" ")),
328
+ y="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".split(" "),
329
+ O=g(y),z="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 auto-flow 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 contents 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 opacity 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 scroll-position 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 transform translate translate3d translateX translateY translateZ transparent ultra-condensed ultra-expanded underline unset 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".split(" "),
330
+ P=g(z),q=q.concat(r).concat(t).concat(u).concat(v).concat(w).concat(y).concat(z);k.registerHelper("hintWords","css",q);k.defineMIME("text/css",{documentTypes:B,mediaTypes:C,mediaFeatures:D,mediaValueKeywords:E,propertyKeywords:F,nonStandardPropertyKeywords:L,fontProperties:M,counterDescriptors:N,colorKeywords:O,valueKeywords:P,tokenHooks:{"/":function(g,d){if(!g.eat("*"))return!1;d.tokenize=x;return x(g,d)}},name:"css"})});
admin/js/common.min.js CHANGED
@@ -1 +1 @@
1
- window.tp=window.tp||{},jQuery(document).ready(function(a){"use strict";postboxes.add_postbox_toggles(pagenow),a("#tablepress-page").on("focus",".placeholder",function(){this.value===this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}).on("blur",".placeholder",function(){""===this.value&&(this.value=this.defaultValue,a(this).addClass("placeholder-active"))}),a("#tablepress-page").on("blur",".numbers-only, .form-field-numbers-only input",function(){var b=a(this);b.val(b.val().replace(/[^0-9]/g,""))}),a("#tablepress-page").on("click",".delete-link",function(){return confirm(tablepress_common.ays_delete_single_table)?void(tp.made_changes=!1):!1}),a("#tablepress-page").on("click",".table-shortcode",function(){a(this).focus().select()})});
1
+ window.tp=window.tp||{},jQuery(document).ready(function(a){"use strict";postboxes.add_postbox_toggles(pagenow),a("#tablepress-page").on("focus",".placeholder",function(){this.value===this.defaultValue&&(this.value="",a(this).removeClass("placeholder-active"))}).on("blur",".placeholder",function(){""===this.value&&(this.value=this.defaultValue,a(this).addClass("placeholder-active"))}),a("#tablepress-page").on("blur",".numbers-only, .form-field-numbers-only input",function(){var b=a(this);b.val(b.val().replace(/[^0-9]/g,""))}),a("#tablepress-page").on("click",".delete-link",function(){return!!confirm(tablepress_common.ays_delete_single_table)&&void(tp.made_changes=!1)}),a("#tablepress-page").on("click",".table-shortcode",function(){a(this).focus().select()})});
admin/js/edit.js CHANGED
@@ -118,7 +118,7 @@ jQuery( document ).ready( function( $ ) {
118
} );
119
table_data = JSON.stringify( table_data );
120
121
- // @TODO: maybe for options saving: http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery
122
// or each()-loop through all checkboxes/textfields/selects
123
table_options = {
124
// Table Options
@@ -404,13 +404,14 @@ jQuery( document ).ready( function( $ ) {
404
$foot_rows = $table_body.find( '.foot-row' ).nextAll().addBack(),
405
rows = $table_body.children().not( $head_rows ).not( $foot_rows ).get(),
406
/*
407
- * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
408
* Author: Jim Palmer (based on chunking idea from Dave Koelle)
409
* See: https://github.com/overset/javascript-natural-sort and http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support/
410
*/
411
natural_sort = function( a, b ) {
412
- var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
413
- sre = /(^[ ]*|[ ]*$)/g,
414
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
415
hre = /^0x[0-9a-f]+#x2F;i,
416
ore = /^0/,
@@ -421,30 +422,34 @@ jQuery( document ).ready( function( $ ) {
421
xN = x.replace(re, '\0$1\0').replace(/\0#x2F;,'').replace(/^\0/,'').split('\0'),
422
yN = y.replace(re, '\0$1\0').replace(/\0#x2F;,'').replace(/^\0/,'').split('\0'),
423
// numeric, hex or date detection
424
- xD = parseInt(x.match(hre), 10) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),
425
- yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null,
426
- oFxNcL, oFyNcL, cLoc, numS;
427
// first try and sort Hex codes or Dates
428
if (yD) {
429
- if ( xD < yD ) { return -1; }
430
- else if ( xD > yD ) { return 1; }
431
}
432
// natural sorting through split numeric strings and default strings
433
- for(cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
434
- // find floats not starting with '0', string or 0 if not defined (Clint Priest)
435
- oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
436
- oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
437
// handle numeric vs string comparison - number < string - (Kyle Adams)
438
- if (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }
439
- // rely on string comparison if different types - i.e. '02' < 2 !== '02' < '2'
440
- else if (typeof oFxNcL !== typeof oFyNcL) {
441
- oFxNcL += '';
442
- oFyNcL += '';
443
}
444
if (oFxNcL < oFyNcL) { return -1; }
445
- if (oFxNcL > oFyNcL) { return 1; }
446
}
447
- return 0;
448
};
449
450
$.each( rows, function( row_idx, row ) {
118
} );
119
table_data = JSON.stringify( table_data );
120
121
+ // @TODO: maybe for options saving: https://stackoverflow.com/questions/1184624/convert-form-data-to-javascript-object-with-jquery
122
// or each()-loop through all checkboxes/textfields/selects
123
table_options = {
124
// Table Options
404
$foot_rows = $table_body.find( '.foot-row' ).nextAll().addBack(),
405
rows = $table_body.children().not( $head_rows ).not( $foot_rows ).get(),
406
/*
407
+ * Natural Sort algorithm for Javascript - Version 0.8.1 - Released under MIT license
408
* Author: Jim Palmer (based on chunking idea from Dave Koelle)
409
* See: https://github.com/overset/javascript-natural-sort and http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support/
410
*/
411
natural_sort = function( a, b ) {
412
+ var re = /(^([+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|^0x[\da-fA-F]+$|\d+)/g,
413
+ sre = /^\s+|\s+#x2F;g, // trim pre-post whitespace
414
+ snre = /\s+/g, // normalize all whitespace to single ' ' character
415
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
416
hre = /^0x[0-9a-f]+#x2F;i,
417
ore = /^0/,
422
xN = x.replace(re, '\0$1\0').replace(/\0#x2F;,'').replace(/^\0/,'').split('\0'),
423
yN = y.replace(re, '\0$1\0').replace(/\0#x2F;,'').replace(/^\0/,'').split('\0'),
424
// numeric, hex or date detection
425
+ xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && Date.parse(x)),
426
+ yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,
427
+ normChunk = function(s, l) {
428
+ // normalize spaces; find floats not starting with '0', string or 0 if not defined (Clint Priest)
429
+ return (!s.match(ore) || l === 1) && parseFloat(s) || s.replace(snre, ' ').replace(sre, '') || 0;
430
+ },
431
+ oFxNcL, oFyNcL;
432
// first try and sort Hex codes or Dates
433
if (yD) {
434
+ if (xD < yD) { return -1; }
435
+ else if (xD > yD) { return 1; }
436
}
437
// natural sorting through split numeric strings and default strings
438
+ for(var cLoc = 0, xNl = xN.length, yNl = yN.length, numS = Math.max(xNl, yNl); cLoc < numS; cLoc++) {
439
+ oFxNcL = normChunk(xN[cLoc] || '', xNl);
440
+ oFyNcL = normChunk(yN[cLoc] || '', yNl);
441
// handle numeric vs string comparison - number < string - (Kyle Adams)
442
+ if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
443
+ return isNaN(oFxNcL) ? 1 : -1;
444
+ }
445
+ // if unicode use locale comparison
446
+ if (/[^\x00-\x80]/.test(oFxNcL + oFyNcL) && oFxNcL.localeCompare) {
447
+ var comp = oFxNcL.localeCompare(oFyNcL);
448
+ return comp / Math.abs(comp);
449
}
450
if (oFxNcL < oFyNcL) { return -1; }
451
+ else if (oFxNcL > oFyNcL) { return 1; }
452
}
453
};
454
455
$.each( rows, function( row_idx, row ) {
admin/js/edit.min.js CHANGED
@@ -1 +1 @@
1
- window.tp=window.tp||{},jQuery(document).ready(function(a){"use strict";var b=function(b){return a(document.getElementById(b))};tp.made_changes=!1,tp.table={id:b("table-id").val(),new_id:b("table-new-id").val(),rows:parseInt(b("number-rows").val(),10),columns:parseInt(b("number-columns").val(),10),head:b("option-table-head").prop("checked"),foot:b("option-table-foot").prop("checked"),no_data_columns_pre:2,no_data_columns_post:1,body_cells_pre:'<tr><td><span class="move-handle"></span></td><td><input type="checkbox" /><input type="hidden" class="visibility" name="table[visibility][rows][]" value="1" /></td>',body_cells_post:'<td><span class="move-handle"></span></td></tr>',body_cell:'<td><textarea rows="1"></textarea></td>',head_cell:'<th class="head"><span class="sort-control sort-desc" title="'+tablepress_strings.sort_desc+'"><span class="sorting-indicator"></span></span><span class="sort-control sort-asc" title="'+tablepress_strings.sort_asc+'"><span class="sorting-indicator"></span></span><span class="move-handle"></span></th>',foot_cell:'<th><input type="checkbox" /><input type="hidden" class="visibility" name="table[visibility][columns][]" value="1" /></th>',set_table_changed:function(){tp.made_changes=!0},unset_table_changed:function(){tp.made_changes=!1,b("edit-form-body").one("change","textarea",tp.table.set_table_changed),a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed)},change_id:function(){return""===a.trim(b("table-new-id").val())?(alert(tablepress_strings.table_id_not_empty),void b("table-new-id").val(tp.table.new_id).focus().select()):"0"===a.trim(b("table-new-id").val())?(alert(tablepress_strings.table_id_not_zero),void b("table-new-id").val(tp.table.new_id).focus().select()):void(this.value!==tp.table.new_id&&(confirm(tablepress_strings.ays_change_table_id)?(tp.table.new_id=this.value,a(".table-shortcode").val("["+tablepress_options.shortcode+" id="+tp.table.new_id+" /]").click(),tp.table.set_table_changed()):a(this).val(tp.table.new_id)))},change_table_head:function(){tp.table.head=a(this).prop("checked"),b("option-use-datatables").prop("disabled",!tp.table.head).change(),b("notice-datatables-head-row").toggle(!tp.table.head),tp.rows.stripe()},change_table_foot:function(){tp.table.foot=a(this).prop("checked"),tp.rows.stripe()},change_print_name_description:function(){b(this.id+"-position").prop("disabled",!a(this).prop("checked"))},change_datatables:function(){var a=b("option-use-datatables"),c=!(a.prop("checked")&&!a.prop("disabled"));a.closest("tbody").find("input").not(a).prop("disabled",c),tp.table.change_datatables_pagination()},change_datatables_pagination:function(){var a=b("option-datatables-paginate"),c=a.prop("checked")&&!a.prop("disabled");b("option-datatables-lengthchange").prop("disabled",!c),b("option-datatables-paginate_entries").prop("disabled",!c)},prepare_ajax_request:function(c,d){var e,f=b("edit-form-body"),g=[],h={rows:tp.table.rows,columns:tp.table.columns,hidden_rows:0,hidden_columns:0},i={rows:[],columns:[]};return f.children().each(function(b,c){g[b]=a(c).find("textarea").map(function(){return a(this).val()}).get()}),g=JSON.stringify(g),e={table_head:tp.table.head,table_foot:tp.table.foot,alternating_row_colors:b("option-alternating-row-colors").prop("checked"),row_hover:b("option-row-hover").prop("checked"),print_name:b("option-print-name").prop("checked"),print_description:b("option-print-description").prop("checked"),print_name_position:b("option-print-name-position").val(),print_description_position:b("option-print-description-position").val(),extra_css_classes:b("option-extra-css-classes").val(),use_datatables:b("option-use-datatables").prop("checked"),datatables_sort:b("option-datatables-sort").prop("checked"),datatables_filter:b("option-datatables-filter").prop("checked"),datatables_paginate:b("option-datatables-paginate").prop("checked"),datatables_lengthchange:b("option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:b("option-datatables-paginate_entries").val(),datatables_info:b("option-datatables-info").prop("checked"),datatables_scrollx:b("option-datatables-scrollx").prop("checked"),datatables_custom_commands:b("option-datatables-custom-commands").val()},e=JSON.stringify(e),i.rows=f.find('input[type="hidden"]').map(function(){return"1"===a(this).val()?1:(h.hidden_rows+=1,0)}).get(),i.columns=b("edit-form-foot").find('input[type="hidden"]').map(function(){return"1"===a(this).val()?1:(h.hidden_columns+=1,0)}).get(),i=JSON.stringify(i),{action:c,_ajax_nonce:a(d).val(),tablepress:{id:tp.table.id,new_id:tp.table.new_id,name:b("table-name").val(),description:b("table-description").val(),number:h,data:g,options:e,visibility:i}}},preview:{trigger:function(){return tp.made_changes?b("option-datatables-paginate").prop("checked")&&!/^[1-9][0-9]{0,4}#x2F;.test(b("option-datatables-paginate_entries").val())?(alert(tablepress_strings.num_pagination_entries_invalid),void b("option-datatables-paginate_entries").focus().select()):/[^A-Za-z0-9- _]/.test(b("option-extra-css-classes").val())?(alert(tablepress_strings.extra_css_classes_invalid),void b("option-extra-css-classes").focus().select()):(a(this).closest("p").append('<span class="animation-preview spinner is-active" title="'+tablepress_strings.preparing_preview+'"/>'),a("body").addClass("wait"),b("table-preview").empty(),a.ajax({type:"POST",url:ajaxurl,data:tp.table.prepare_ajax_request("tablepress_preview_table","#nonce-preview-table"),success:tp.table.preview.ajax_success,error:tp.table.preview.ajax_error,dataType:"json"}),!1):(tp.table.preview.show(a(this).attr("href")+"&TB_iframe=true"),!1)},ajax_success:function(a,b){"undefined"==typeof b||"success"!==b?tp.table.preview.error("AJAX call successful, but unclear status."):"undefined"==typeof a||null===a||"-1"===a||"undefined"==typeof a.success||!0!==a.success?tp.table.preview.error("AJAX call successful, but unclear data."):tp.table.preview.success(a)},ajax_error:function(a,b,c){tp.table.preview.error("AJAX call failed: "+b+" - "+c)},success:function(c){b("table-preview").empty(),a('<iframe id="table-preview-iframe" />').load(function(){var b=a(this).contents();b.find("head").append(c.head_html),b.find("body").append(c.body_html)}).appendTo("#table-preview"),a(".animation-preview").remove(),a("body").removeClass("wait"),tp.table.preview.show("#TB_inline?inlineId=preview-container")},error:function(b){a(".animation-preview").closest("p").after('<div class="ajax-alert preview-error error"><p>'+tablepress_strings.preview_error+": "+b+"</p></div>"),a(".animation-preview").remove(),a(".preview-error").delay(6e3).fadeOut(2e3,function(){a(this).remove()}),a("body").removeClass("wait")},show:function(b){var c=a(window).width()-120,d=a(window).height()-120;a("#wpadminbar").length&&(d-=parseInt(a("#wpadminbar").css("height"),10)),tb_show(a(".show-preview-button").first().text(),b+"&height="+d+"&width="+c,!1)}}},tp.rows={create:function(c){var d,e,f,g="";for(d=0;c>d;d++){for(g+=tp.table.body_cells_pre,e=0;e<tp.table.columns;e++)g+=tp.table.body_cell;g+=tp.table.body_cells_post}return f=b("edit-form-foot").find(".column-hidden").map(function(){return a(this).index()}).get(),a(g).each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,f)}).addClass("column-hidden")})},append:function(){var a=b("rows-append-number").val();return/^[1-9][0-9]{0,4}#x2F;.test(a)?(b("edit-form-body").append(tp.rows.create(a)),tp.rows.stripe(),void tp.reindex()):(alert(tablepress_strings.append_num_rows_invalid),void b("rows-append-number").focus().select())},insert:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.before(tp.rows.create(1)),tp.rows.stripe(),void tp.reindex())},duplicate:function(c){var d=b("edit-form-body").find("input:checked").prop("checked",c.shiftKey).closest("tr");return 0===d.length?void alert(tablepress_strings.no_rows_selected):(d.each(function(b,c){var d=a(c),e=d.find("textarea"),f=d.clone();f.find("textarea").removeAttr("id").each(function(b,c){a(c).val(e.eq(b).val())}),d.after(f)}),tp.rows.stripe(),void tp.reindex())},hide:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.addClass("row-hidden").find(".visibility").val("0"),tp.rows.stripe(),void tp.table.set_table_changed())},unhide:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.removeClass("row-hidden").find(".visibility").val("1"),tp.rows.stripe(),void tp.table.set_table_changed())},remove:function(){var a,c=b("edit-form-body").find("input:checked").closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):tp.table.rows===c.length?void alert(tablepress_strings.no_remove_all_rows):(a=1===c.length?tablepress_strings.ays_remove_rows_singular:tablepress_strings.ays_remove_rows_plural,void(confirm(a)&&(c.remove(),tp.rows.stripe(),tp.reindex())))},move:{start:function(b,c){a(c.placeholder).removeClass("row-hidden").css("visibility","visible").html('<td colspan="'+(tp.table.columns+tp.table.no_data_columns_pre+tp.table.no_data_columns_post)+'"><div/></td>'),a(c.helper).removeClass("odd head-row foot-row")},change:function(a,b){tp.rows.stripe(b.helper)},stop:function(){tp.rows.stripe()}},sort:function(){var b=a(this).parent().index(),c=a(this).hasClass("sort-asc")?1:-1,d=a("#edit-form-body"),e=d.find(".head-row").prevAll().addBack(),f=d.find(".foot-row").nextAll().addBack(),g=d.children().not(e).not(f).get(),h=function(a,b){var c,d,e,f,g=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,h=/(^[ ]*|[ ]*$)/g,i=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,j=/^0x[0-9a-f]+#x2F;i,k=/^0/,l=a.replace(h,"")||"",m=b.replace(h,"")||"",n=l.replace(g,"\x00$1\x00").replace(/\0#x2F;,"").replace(/^\0/,"").split("\x00"),o=m.replace(g,"\x00$1\x00").replace(/\0#x2F;,"").replace(/^\0/,"").split("\x00"),p=parseInt(l.match(j),10)||1!==n.length&&l.match(i)&&Date.parse(l),q=parseInt(m.match(j),10)||p&&m.match(i)&&Date.parse(m)||null;if(q){if(q>p)return-1;if(p>q)return 1}for(e=0,f=Math.max(n.length,o.length);f>e;e++){if(c=!(n[e]||"").match(k)&&parseFloat(n[e])||n[e]||0,d=!(o[e]||"").match(k)&&parseFloat(o[e])||o[e]||0,isNaN(c)!==isNaN(d))return isNaN(c)?1:-1;if(typeof c!=typeof d&&(c+="",d+=""),d>c)return-1;if(c>d)return 1}return 0};a.each(g,function(c,d){d.sort_key=(""+a(d).children().eq(b).find("textarea").val()).toLowerCase()}),g.sort(function(a,b){return c*h(a.sort_key,b.sort_key)}),a.each(g,function(a,b){b.sort_key=null}),d.append(e),d.append(g),d.append(f),tp.rows.stripe(),tp.reindex()},stripe:function(c){"undefined"==typeof c&&(c=null),c=a(c);var d=b("edit-form-body").children().removeClass("odd head-row foot-row").not(c);d.filter(":even").addClass("odd"),d=d.not(".row-hidden"),c.hasClass("row-hidden")&&(d=d.not(".ui-sortable-placeholder")),tp.table.head&&d.first().addClass("head-row"),tp.table.foot&&d.last().addClass("foot-row")}},tp.columns={append:function(){var c,d=b("columns-append-number").val(),e="",f="",g="";if(!/^[1-9][0-9]{0,4}#x2F;.test(d))return alert(tablepress_strings.append_num_columns_invalid),void b("columns-append-number").focus().select();for(c=0;d>c;c++)f+=tp.table.body_cell,e+=tp.table.head_cell,g+=tp.table.foot_cell;b("edit-form-body").children().each(function(b,c){a(c).children().slice(-tp.table.no_data_columns_post).before(f)}),b("edit-form-head").children().slice(-tp.table.no_data_columns_post).before(e),b("edit-form-foot").children().slice(-tp.table.no_data_columns_post).before(g),tp.reindex()},insert:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,d)}).before(tp.table.body_cell)}),b("edit-form-head").children().filter(function(b){return-1!==a.inArray(b,d)}).before(tp.table.head_cell),e.before(tp.table.foot_cell),void tp.reindex())},duplicate:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form").find("tr").each(function(b,c){a(c).children().each(function(b,c){if(-1!==a.inArray(b,d)){var e=a(c),f=e.clone();f.find("textarea").removeAttr("id").val(e.find("textarea").val()),e.after(f)}})}),void tp.reindex())},hide:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().add("#edit-form-head").each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,d)}).addClass("column-hidden")}),e.addClass("column-hidden").find(".visibility").val("0"),void tp.table.set_table_changed())},unhide:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().add("#edit-form-head").each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,d)}).removeClass("column-hidden")}),e.removeClass("column-hidden").find(".visibility").val("1"),void tp.table.set_table_changed())},remove:function(){var c,d,e=b("edit-form-foot").find("input:checked").closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):tp.table.columns===e.length?void alert(tablepress_strings.no_remove_all_columns):(d=1===e.length?tablepress_strings.ays_remove_columns_singular:tablepress_strings.ays_remove_columns_plural,void(confirm(d)&&(c=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().add("#edit-form-head").each(function(b,d){a(d).children().filter(function(b){return-1!==a.inArray(b,c)}).remove()}),e.remove(),tp.reindex())))},move:{source_idx:-1,target_idx:-1,$rows:null,$row_children:null,$cell:null,$cells:null,$placeholder:null,$helper:null,start:function(c,d){var e,f=a(d.item);tp.columns.move.source_idx=f.index(),tp.columns.move.$rows=b("edit-form-body").children().add("#edit-form-foot"),tp.columns.move.$cells=tp.columns.move.$rows.find(":nth-child("+(tp.columns.move.source_idx+1)+")").each(function(){tp.columns.move.$cell=a(this),a('<td class="move-placeholder"><div/></td>').insertBefore(tp.columns.move.$cell),tp.columns.move.$cell.insertAfter(tp.columns.move.$cell.nextAll().last()).clone().addClass("move-hover").insertAfter(tp.columns.move.$cell).find("textarea").val(tp.columns.move.$cell.find("textarea").val())}).hide(),tp.columns.move.$helper=tp.columns.move.$rows.find(".move-hover"),e=tp.columns.move.$helper.eq(1).width(),tp.columns.move.$helper.eq(0).width(e),tp.columns.move.$placeholder=tp.columns.move.$rows.find(".move-placeholder"),tp.columns.move.$placeholder.find("div").width(e)},change:function(b,c){tp.columns.move.target_idx=a(c.placeholder).index(),tp.columns.move.target_idx-tp.columns.move.source_idx===1?tp.columns.move.target_idx+=1:tp.columns.move.target_idx===tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1),tp.columns.move.$placeholder.each(function(){tp.columns.move.$cell=a(this),tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().children().eq(tp.columns.move.target_idx))}),tp.columns.move.target_idx>tp.columns.move.source_idx&&(tp.columns.move.target_idx-=1),tp.columns.move.source_idx=tp.columns.move.target_idx},sort:function(a,b){tp.columns.move.$helper.css("left",b.position.left)},stop:function(){tp.columns.move.$helper.remove(),tp.columns.move.$cells.each(function(){tp.columns.move.$cell=a(this),tp.columns.move.$cell.insertBefore(tp.columns.move.$cell.parent().find(".move-placeholder"))}).show(),tp.columns.move.$placeholder.remove(),tp.columns.move.source_idx=tp.columns.move.target_idx=-1,tp.columns.move.$rows=tp.columns.move.$row_children=tp.columns.move.$cell=tp.columns.move.$cells=tp.columns.move.$placeholder=tp.columns.move.$helper=null,tp.reindex()}},number_to_letter:function(a){for(var b="";a>0;)b=String.fromCharCode(65+(a-1)%26)+b,a=Math.floor((a-1)/26);return b}},tp.cells={$focus:a(null),$textarea:null,autogrow:function(){tp.cells.$focus.removeClass("focus"),tp.cells.$focus=a(this).closest("tr").addClass("focus")},advanced_editor:{prompt_shown:!1,keyopen:function(c){if(c.shiftKey){var d=b("advanced-editor-content");tp.cells.$textarea=a(this).blur(),d.val(tp.cells.$textarea.val()),b("advanced-editor").wpdialog("open"),d.get(0).selectionStart=d.get(0).selectionEnd=d.val().length,d.focus()}},buttonopen:function(){(tp.cells.advanced_editor.prompt_shown||confirm(tablepress_strings.advanced_editor_open))&&(tp.cells.advanced_editor.prompt_shown=!0,b("edit-form-body").one("click","textarea",function(){var c=b("advanced-editor-content");tp.cells.$textarea=a(this).blur(),c.val(tp.cells.$textarea.val()),b("advanced-editor").wpdialog("open"),c.get(0).selectionStart=c.get(0).selectionEnd=c.val().length,c.focus()}))},save:function(){var a=b("advanced-editor-content").blur().val();tp.cells.$textarea.val()!==a&&(tp.cells.$textarea.val(a),tp.cells.$textarea.get(0).selectionStart=tp.cells.$textarea.get(0).selectionEnd=tp.cells.$textarea.val().length,tp.table.set_table_changed()),tp.cells.$textarea.focus(),tp.cells.advanced_editor.close()},close:function(){return b("advanced-editor").wpdialog("close"),!1}},checkboxes:{last_clicked:{"#edit-form-body":!1,"#edit-form-foot":!1},multi_select:function(b){if("undefined"===b.shiftKey)return!0;if(b.shiftKey){if(!tp.cells.checkboxes.last_clicked[b.data.parent])return!0;var c=a(b.data.parent).find(":checkbox"),d=c.index(tp.cells.checkboxes.last_clicked[b.data.parent]),e=c.index(this);d!==e&&c.slice(Math.min(d,e),Math.max(d,e)).prop("checked",a(this).prop("checked"))}return tp.cells.checkboxes.last_clicked[b.data.parent]=this,!0}}},tp.content={link:{prompt_shown:!1,add:function(){(tp.content.link.prompt_shown||confirm(tablepress_strings.link_add))&&(tp.content.link.prompt_shown=!0,b("edit-form-body").one("mousedown","textarea",function(){var b=this.id;a(document).one("mouseup",function(){"undefined"!=typeof wpLink&&(wpLink.open(b),tp.table.set_table_changed())})}))}},image:{prompt_shown:!1,add:function(){(tp.content.image.prompt_shown||confirm(tablepress_strings.image_add))&&(tp.content.image.prompt_shown=!0,b("edit-form-body").one("click","textarea",function(){var b=this.id,c={frame:"post",state:"insert",title:wp.media.view.l10n.addMedia,multiple:!0};this.selectionStart=this.selectionEnd=this.value.length,a(this).blur(),wp.media.editor.open(b,c),tp.table.set_table_changed()}))}},span:{prompt_shown:!1,add:function(c){var d="#rowspan#"===c?tablepress_strings.rowspan_add:tablepress_strings.colspan_add;if(!1===tp.content.span.prompt_shown&&(tp.content.span.prompt_shown={},tp.content.span.prompt_shown["#rowspan#"]=tp.content.span.prompt_shown["#colspan#"]=!1),b("option-use-datatables").prop("checked")){if(!confirm(tablepress_strings.span_add_datatables_warning))return;b("option-use-datatables").prop("checked",!1).change()}(tp.content.span.prompt_shown[c]||confirm(d))&&(tp.content.span.prompt_shown[c]=!0,b("edit-form-body").one("click","textarea",function(){var b=a(this),d=b.parent().index(),e=b.closest("tr").index();if("#rowspan#"===c){if(0===e)return void alert(tablepress_strings.no_rowspan_first_row);if(tp.table.head&&1===e)return void alert(tablepress_strings.no_rowspan_table_head);if(tp.table.foot&&tp.table.rows-1===e)return void alert(tablepress_strings.no_rowspan_table_foot)}else if("#colspan#"===c&&tp.table.no_data_columns_pre===d)return void alert(tablepress_strings.no_colspan_first_col);b.val(c),tp.table.set_table_changed()}))}}},tp.check={table_id:function(b){if(37!==b.which&&39!==b.which){var c=a(this);c.val(c.val().replace(/[^0-9a-zA-Z-_]/g,""))}},changes_saved:function(){return tp.made_changes?tablepress_strings.unsaved_changes_unload:void 0}},tp.reindex=function(){var c,d,e=b("edit-form-body").children(),f={};tp.table.rows=e.length,tp.table.rows>0?tp.table.columns=e.first().children().length-tp.table.no_data_columns_pre-tp.table.no_data_columns_post:tp.table.columns=0,e.each(function(e,g){c=a(g),c.find("textarea").val(function(a,c){return""===c||"="!==c.charAt(0)?c:c.replace(/([A-Z]+[0-9]+)(?::([A-Z]+[0-9]+))?/g,function(a,c,e){return f.hasOwnProperty(c)||(d=b("cell-"+c),d.length?f[c]=tp.columns.number_to_letter(d.parent().index()-tp.table.no_data_columns_pre+1)+(d.closest("tr").index()+1):f[c]=c),a=f[c],"undefined"!=typeof e&&""!==e&&(f.hasOwnProperty(e)||(d=b("cell-"+e),d.length?f[e]=tp.columns.number_to_letter(d.parent().index()-tp.table.no_data_columns_pre+1)+(d.closest("tr").index()+1):f[e]=e),a+=":"+f[e]),a})}).attr("name",function(a){return"table[data]["+e+"]["+a+"]"}),c.find(".move-handle").html(e+1)}).each(function(b,c){a(c).find("textarea").attr("id",function(a){return"cell-"+tp.columns.number_to_letter(a+1)+(b+1)})}),b("edit-form-head").find(".move-handle").html(function(a){return tp.columns.number_to_letter(a+1)}),b("number-rows").val(tp.table.rows),b("number-columns").val(tp.table.columns),tp.table.set_table_changed()},tp.save_changes={trigger:function(c){return b("option-datatables-paginate").prop("checked")&&!/^[1-9][0-9]{0,4}#x2F;.test(b("option-datatables-paginate_entries").val())?(alert(tablepress_strings.num_pagination_entries_invalid),void b("option-datatables-paginate_entries").focus().select()):/[^A-Za-z0-9- _]/.test(b("option-extra-css-classes").val())?(alert(tablepress_strings.extra_css_classes_invalid),void b("option-extra-css-classes").focus().select()):c.shiftKey?(tp.made_changes=!1,void b("tablepress-page").find("form").submit()):(a(this).closest("p").append('<span class="animation-saving spinner is-active" title="'+tablepress_strings.saving_changes+'"/>'),a(".save-changes-button").prop("disabled",!0),a("body").addClass("wait"),void a.ajax({type:"POST",url:ajaxurl,data:tp.table.prepare_ajax_request("tablepress_save_table","#nonce-edit-table"),success:tp.save_changes.ajax_success,error:tp.save_changes.ajax_error,dataType:"json"}))},ajax_success:function(a,b){if("undefined"==typeof b||"success"!==b)tp.save_changes.error("AJAX call successful, but unclear status. Try again while holding down the &#8220;Shift&#8221; key.");else if("undefined"==typeof a||null===a||"-1"===a||"undefined"==typeof a.success)tp.save_changes.error("AJAX call successful, but unclear data. Try again while holding down the &#8220;Shift&#8221; key.");else if(!0!==a.success){var c="";"undefined"!=typeof a.error_details&&tablepress_options.print_debug_output&&(c="</p><p>These errors were encountered:</p><pre>"+a.error_details+"</pre><p>"),tp.save_changes.error("AJAX call successful, internal saving process failed. Try again while holding down the &#8220;Shift&#8221; key."+c)}else tp.save_changes.success(a)},ajax_error:function(a,b,c){tp.save_changes.error("AJAX call failed: "+b+" - "+c+". Try again while holding down the &#8220;Shift&#8221; key.")},success:function(c){tp.table.id!==c.table_id&&"pushState"in window.history&&null!==window.history.pushState&&window.history.pushState("","",window.location.href.replace(/table_id=[0-9a-zA-Z-_]+/gi,"table_id="+c.table_id)),b("edit-form").removeClass("tablepress-edit-screen-id-"+tp.table.id).addClass("tablepress-edit-screen-id-"+c.table_id),tp.table.id=tp.table.new_id=c.table_id,b("table-id").val(tp.table.id),b("table-new-id").val(tp.table.new_id),a(".table-shortcode").val("["+tablepress_options.shortcode+" id="+tp.table.new_id+" /]"),b("nonce-edit-table").val(c.new_edit_nonce),b("nonce-preview-table").val(c.new_preview_nonce);var d=a(".show-preview-button");d.length&&d.attr("href",d.first().attr("href").replace(/item=[a-zA-Z0-9_-]+/g,"item="+c.table_id).replace(/&_wpnonce=[a-z0-9]+/gi,"&_wpnonce="+c.new_preview_nonce)),b("last-modified").text(c.last_modified),b("last-editor").text(c.last_editor),tp.table.unset_table_changed(),tp.save_changes.after_saving_dialog("success",tablepress_strings[c.message])},error:function(a){tp.save_changes.after_saving_dialog("error",a)},after_saving_dialog:function(b,c){c="undefined"==typeof c?"":": "+c;var d,e="save-changes-"+b;"success"===b?(e+=" notice notice-success",d=3e3):(e+=" notice notice-error",d=6e3),a(".animation-saving").closest("p").after('<div class="ajax-alert '+e+'"><p>'+tablepress_strings["save_changes_"+b]+c+"</p></div>"),a(".animation-saving").remove(),a(".save-changes-"+b).delay(d).fadeOut(2e3,function(){a(this).remove()}),a(".save-changes-button").prop("disabled",!1),a("body").removeClass("wait")}},tp.init=function(){var c={click:{"#rows-insert":tp.rows.insert,"#columns-insert":tp.columns.insert,"#rows-duplicate":tp.rows.duplicate,"#columns-duplicate":tp.columns.duplicate,"#rows-remove":tp.rows.remove,"#columns-remove":tp.columns.remove,"#rows-hide":tp.rows.hide,"#columns-hide":tp.columns.hide,"#rows-unhide":tp.rows.unhide,"#columns-unhide":tp.columns.unhide,"#rows-append":tp.rows.append,"#columns-append":tp.columns.append,"#link-add":tp.content.link.add,"#image-add":tp.content.image.add,"#span-add-rowspan":function(){tp.content.span.add("#rowspan#")},"#span-add-colspan":function(){tp.content.span.add("#colspan#")},".show-preview-button":tp.table.preview.trigger,".save-changes-button":tp.save_changes.trigger,".show-help-box":function(){a(this).next().wpdialog({title:a(this).attr("title"),height:470,width:320,modal:!0,dialogClass:"wp-dialog",resizable:!1})}},keyup:{"#table-new-id":tp.check.table_id},change:{"#option-table-head":tp.table.change_table_head,"#option-table-foot":tp.table.change_table_foot,"#option-use-datatables":tp.table.change_datatables,"#option-datatables-paginate":tp.table.change_datatables_pagination},blur:{"#table-new-id":tp.table.change_id}},d=b("edit-form-body");a.each(c,function(b,c){a.each(c,function(c,d){a(c).on(b,d)})}),a(window).on("beforeunload",tp.check.changes_saved),b("option-table-head").change(),b("option-print-name").change(tp.table.change_print_name_description).change(),b("option-print-description").change(tp.table.change_print_name_description).change(),d.one("change","textarea",tp.table.set_table_changed),a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed),tablepress_options.cells_advanced_editor?(d.on("click","textarea",tp.cells.advanced_editor.keyopen),b("advanced-editor-open").on("click",tp.cells.advanced_editor.buttonopen),b("advanced-editor-confirm").on("click",tp.cells.advanced_editor.save),b("advanced-editor-cancel").on("click",tp.cells.advanced_editor.close),b("advanced-editor").wpdialog({autoOpen:!1,title:b("advanced-editor-open").val(),width:600,modal:!0,dialogClass:"wp-dialog",resizable:!1}),b("wp-link").on("focus","input",function(a){a.stopPropagation()})):b("advanced-editor-open").hide(),a("body").on("focus",".media-modal .media-frame-content input, .media-modal .media-frame-content textarea",function(a){a.stopPropagation()}),tablepress_options.cells_auto_grow&&d.on("focus","textarea",tp.cells.autogrow),b("edit-form-body").on("click","input:checkbox",{parent:"#edit-form-body"},tp.cells.checkboxes.multi_select),b("edit-form-foot").on("click","input:checkbox",{parent:"#edit-form-foot"},tp.cells.checkboxes.multi_select),b("edit-form-head").on("click",".sort-control",tp.rows.sort),b("tablepress-page").find("form").on("submit",function(){a(this).find(".tablepress-postbox-table").find("input, select").prop("disabled",!1)}),d.sortable({axis:"y",containment:b("edit-form"),forceHelperSize:!0,handle:".move-handle",start:tp.rows.move.start,change:tp.rows.move.change,stop:tp.rows.move.stop,update:tp.reindex}),b("edit-form-head").sortable({axis:"x",items:".head",containment:"parent",forceHelperSize:!0,helper:"clone",handle:".move-handle",start:tp.columns.move.start,stop:tp.columns.move.stop,change:tp.columns.move.change,sort:tp.columns.move.sort}).disableSelection()},tp.init()});
1
+ window.tp=window.tp||{},jQuery(document).ready(function(a){"use strict";var b=function(b){return a(document.getElementById(b))};tp.made_changes=!1,tp.table={id:b("table-id").val(),new_id:b("table-new-id").val(),rows:parseInt(b("number-rows").val(),10),columns:parseInt(b("number-columns").val(),10),head:b("option-table-head").prop("checked"),foot:b("option-table-foot").prop("checked"),no_data_columns_pre:2,no_data_columns_post:1,body_cells_pre:'<tr><td><span class="move-handle"></span></td><td><input type="checkbox" /><input type="hidden" class="visibility" name="table[visibility][rows][]" value="1" /></td>',body_cells_post:'<td><span class="move-handle"></span></td></tr>',body_cell:'<td><textarea rows="1"></textarea></td>',head_cell:'<th class="head"><span class="sort-control sort-desc" title="'+tablepress_strings.sort_desc+'"><span class="sorting-indicator"></span></span><span class="sort-control sort-asc" title="'+tablepress_strings.sort_asc+'"><span class="sorting-indicator"></span></span><span class="move-handle"></span></th>',foot_cell:'<th><input type="checkbox" /><input type="hidden" class="visibility" name="table[visibility][columns][]" value="1" /></th>',set_table_changed:function(){tp.made_changes=!0},unset_table_changed:function(){tp.made_changes=!1,b("edit-form-body").one("change","textarea",tp.table.set_table_changed),a("#tablepress_edit-table-information, #tablepress_edit-table-options, #tablepress_edit-datatables-features").one("change","input, textarea, select",tp.table.set_table_changed)},change_id:function(){return""===a.trim(b("table-new-id").val())?(alert(tablepress_strings.table_id_not_empty),void b("table-new-id").val(tp.table.new_id).focus().select()):"0"===a.trim(b("table-new-id").val())?(alert(tablepress_strings.table_id_not_zero),void b("table-new-id").val(tp.table.new_id).focus().select()):void(this.value!==tp.table.new_id&&(confirm(tablepress_strings.ays_change_table_id)?(tp.table.new_id=this.value,a(".table-shortcode").val("["+tablepress_options.shortcode+" id="+tp.table.new_id+" /]").click(),tp.table.set_table_changed()):a(this).val(tp.table.new_id)))},change_table_head:function(){tp.table.head=a(this).prop("checked"),b("option-use-datatables").prop("disabled",!tp.table.head).change(),b("notice-datatables-head-row").toggle(!tp.table.head),tp.rows.stripe()},change_table_foot:function(){tp.table.foot=a(this).prop("checked"),tp.rows.stripe()},change_print_name_description:function(){b(this.id+"-position").prop("disabled",!a(this).prop("checked"))},change_datatables:function(){var a=b("option-use-datatables"),c=!(a.prop("checked")&&!a.prop("disabled"));a.closest("tbody").find("input").not(a).prop("disabled",c),tp.table.change_datatables_pagination()},change_datatables_pagination:function(){var a=b("option-datatables-paginate"),c=a.prop("checked")&&!a.prop("disabled");b("option-datatables-lengthchange").prop("disabled",!c),b("option-datatables-paginate_entries").prop("disabled",!c)},prepare_ajax_request:function(c,d){var e,f=b("edit-form-body"),g=[],h={rows:tp.table.rows,columns:tp.table.columns,hidden_rows:0,hidden_columns:0},i={rows:[],columns:[]};return f.children().each(function(b,c){g[b]=a(c).find("textarea").map(function(){return a(this).val()}).get()}),g=JSON.stringify(g),e={table_head:tp.table.head,table_foot:tp.table.foot,alternating_row_colors:b("option-alternating-row-colors").prop("checked"),row_hover:b("option-row-hover").prop("checked"),print_name:b("option-print-name").prop("checked"),print_description:b("option-print-description").prop("checked"),print_name_position:b("option-print-name-position").val(),print_description_position:b("option-print-description-position").val(),extra_css_classes:b("option-extra-css-classes").val(),use_datatables:b("option-use-datatables").prop("checked"),datatables_sort:b("option-datatables-sort").prop("checked"),datatables_filter:b("option-datatables-filter").prop("checked"),datatables_paginate:b("option-datatables-paginate").prop("checked"),datatables_lengthchange:b("option-datatables-lengthchange").prop("checked"),datatables_paginate_entries:b("option-datatables-paginate_entries").val(),datatables_info:b("option-datatables-info").prop("checked"),datatables_scrollx:b("option-datatables-scrollx").prop("checked"),datatables_custom_commands:b("option-datatables-custom-commands").val()},e=JSON.stringify(e),i.rows=f.find('input[type="hidden"]').map(function(){return"1"===a(this).val()?1:(h.hidden_rows+=1,0)}).get(),i.columns=b("edit-form-foot").find('input[type="hidden"]').map(function(){return"1"===a(this).val()?1:(h.hidden_columns+=1,0)}).get(),i=JSON.stringify(i),{action:c,_ajax_nonce:a(d).val(),tablepress:{id:tp.table.id,new_id:tp.table.new_id,name:b("table-name").val(),description:b("table-description").val(),number:h,data:g,options:e,visibility:i}}},preview:{trigger:function(){return tp.made_changes?b("option-datatables-paginate").prop("checked")&&!/^[1-9][0-9]{0,4}#x2F;.test(b("option-datatables-paginate_entries").val())?(alert(tablepress_strings.num_pagination_entries_invalid),void b("option-datatables-paginate_entries").focus().select()):/[^A-Za-z0-9- _]/.test(b("option-extra-css-classes").val())?(alert(tablepress_strings.extra_css_classes_invalid),void b("option-extra-css-classes").focus().select()):(a(this).closest("p").append('<span class="animation-preview spinner is-active" title="'+tablepress_strings.preparing_preview+'"/>'),a("body").addClass("wait"),b("table-preview").empty(),a.ajax({type:"POST",url:ajaxurl,data:tp.table.prepare_ajax_request("tablepress_preview_table","#nonce-preview-table"),success:tp.table.preview.ajax_success,error:tp.table.preview.ajax_error,dataType:"json"}),!1):(tp.table.preview.show(a(this).attr("href")+"&TB_iframe=true"),!1)},ajax_success:function(a,b){"undefined"==typeof b||"success"!==b?tp.table.preview.error("AJAX call successful, but unclear status."):"undefined"==typeof a||null===a||"-1"===a||"undefined"==typeof a.success||!0!==a.success?tp.table.preview.error("AJAX call successful, but unclear data."):tp.table.preview.success(a)},ajax_error:function(a,b,c){tp.table.preview.error("AJAX call failed: "+b+" - "+c)},success:function(c){b("table-preview").empty(),a('<iframe id="table-preview-iframe" />').load(function(){var b=a(this).contents();b.find("head").append(c.head_html),b.find("body").append(c.body_html)}).appendTo("#table-preview"),a(".animation-preview").remove(),a("body").removeClass("wait"),tp.table.preview.show("#TB_inline?inlineId=preview-container")},error:function(b){a(".animation-preview").closest("p").after('<div class="ajax-alert preview-error error"><p>'+tablepress_strings.preview_error+": "+b+"</p></div>"),a(".animation-preview").remove(),a(".preview-error").delay(6e3).fadeOut(2e3,function(){a(this).remove()}),a("body").removeClass("wait")},show:function(b){var c=a(window).width()-120,d=a(window).height()-120;a("#wpadminbar").length&&(d-=parseInt(a("#wpadminbar").css("height"),10)),tb_show(a(".show-preview-button").first().text(),b+"&height="+d+"&width="+c,!1)}}},tp.rows={create:function(c){var d,e,f,g="";for(d=0;d<c;d++){for(g+=tp.table.body_cells_pre,e=0;e<tp.table.columns;e++)g+=tp.table.body_cell;g+=tp.table.body_cells_post}return f=b("edit-form-foot").find(".column-hidden").map(function(){return a(this).index()}).get(),a(g).each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,f)}).addClass("column-hidden")})},append:function(){var a=b("rows-append-number").val();return/^[1-9][0-9]{0,4}#x2F;.test(a)?(b("edit-form-body").append(tp.rows.create(a)),tp.rows.stripe(),void tp.reindex()):(alert(tablepress_strings.append_num_rows_invalid),void b("rows-append-number").focus().select())},insert:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.before(tp.rows.create(1)),tp.rows.stripe(),void tp.reindex())},duplicate:function(c){var d=b("edit-form-body").find("input:checked").prop("checked",c.shiftKey).closest("tr");return 0===d.length?void alert(tablepress_strings.no_rows_selected):(d.each(function(b,c){var d=a(c),e=d.find("textarea"),f=d.clone();f.find("textarea").removeAttr("id").each(function(b,c){a(c).val(e.eq(b).val())}),d.after(f)}),tp.rows.stripe(),void tp.reindex())},hide:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.addClass("row-hidden").find(".visibility").val("0"),tp.rows.stripe(),void tp.table.set_table_changed())},unhide:function(a){var c=b("edit-form-body").find("input:checked").prop("checked",a.shiftKey).closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):(c.removeClass("row-hidden").find(".visibility").val("1"),tp.rows.stripe(),void tp.table.set_table_changed())},remove:function(){var a,c=b("edit-form-body").find("input:checked").closest("tr");return 0===c.length?void alert(tablepress_strings.no_rows_selected):tp.table.rows===c.length?void alert(tablepress_strings.no_remove_all_rows):(a=1===c.length?tablepress_strings.ays_remove_rows_singular:tablepress_strings.ays_remove_rows_plural,void(confirm(a)&&(c.remove(),tp.rows.stripe(),tp.reindex())))},move:{start:function(b,c){a(c.placeholder).removeClass("row-hidden").css("visibility","visible").html('<td colspan="'+(tp.table.columns+tp.table.no_data_columns_pre+tp.table.no_data_columns_post)+'"><div/></td>'),a(c.helper).removeClass("odd head-row foot-row")},change:function(a,b){tp.rows.stripe(b.helper)},stop:function(){tp.rows.stripe()}},sort:function(){var b=a(this).parent().index(),c=a(this).hasClass("sort-asc")?1:-1,d=a("#edit-form-body"),e=d.find(".head-row").prevAll().addBack(),f=d.find(".foot-row").nextAll().addBack(),g=d.children().not(e).not(f).get(),h=function(a,b){var c,d,e=/(^([+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|^0x[\da-fA-F]+$|\d+)/g,f=/^\s+|\s+#x2F;g,g=/\s+/g,h=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,i=/^0x[0-9a-f]+#x2F;i,j=/^0/,k=a.replace(f,"")||"",l=b.replace(f,"")||"",m=k.replace(e,"\0$1\0").replace(/\0#x2F;,"").replace(/^\0/,"").split("\0"),n=l.replace(e,"\0$1\0").replace(/\0#x2F;,"").replace(/^\0/,"").split("\0"),o=parseInt(k.match(i),16)||1!==m.length&&Date.parse(k),p=parseInt(l.match(i),16)||o&&l.match(h)&&Date.parse(l)||null,q=function(a,b){return(!a.match(j)||1===b)&&parseFloat(a)||a.replace(g," ").replace(f,"")||0};if(p){if(o<p)return-1;if(o>p)return 1}for(var r=0,s=m.length,t=n.length,u=Math.max(s,t);r<u;r++){if(c=q(m[r]||"",s),d=q(n[r]||"",t),isNaN(c)!==isNaN(d))return isNaN(c)?1:-1;if(/[^\x00-\x80]/.test(c+d)&&c.localeCompare){var v=c.localeCompare(d);return v/Math.abs(v)}if(c<d)return-1;if(c>d)return 1}};a.each(g,function(c,d){d.sort_key=(""+a(d).children().eq(b).find("textarea").val()).toLowerCase()}),g.sort(function(a,b){return c*h(a.sort_key,b.sort_key)}),a.each(g,function(a,b){b.sort_key=null}),d.append(e),d.append(g),d.append(f),tp.rows.stripe(),tp.reindex()},stripe:function(c){"undefined"==typeof c&&(c=null),c=a(c);var d=b("edit-form-body").children().removeClass("odd head-row foot-row").not(c);d.filter(":even").addClass("odd"),d=d.not(".row-hidden"),c.hasClass("row-hidden")&&(d=d.not(".ui-sortable-placeholder")),tp.table.head&&d.first().addClass("head-row"),tp.table.foot&&d.last().addClass("foot-row")}},tp.columns={append:function(){var c,d=b("columns-append-number").val(),e="",f="",g="";if(!/^[1-9][0-9]{0,4}#x2F;.test(d))return alert(tablepress_strings.append_num_columns_invalid),void b("columns-append-number").focus().select();for(c=0;c<d;c++)f+=tp.table.body_cell,e+=tp.table.head_cell,g+=tp.table.foot_cell;b("edit-form-body").children().each(function(b,c){a(c).children().slice(-tp.table.no_data_columns_post).before(f)}),b("edit-form-head").children().slice(-tp.table.no_data_columns_post).before(e),b("edit-form-foot").children().slice(-tp.table.no_data_columns_post).before(g),tp.reindex()},insert:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,d)}).before(tp.table.body_cell)}),b("edit-form-head").children().filter(function(b){return-1!==a.inArray(b,d)}).before(tp.table.head_cell),e.before(tp.table.foot_cell),void tp.reindex())},duplicate:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form").find("tr").each(function(b,c){a(c).children().each(function(b,c){if(-1!==a.inArray(b,d)){var e=a(c),f=e.clone();f.find("textarea").removeAttr("id").val(e.find("textarea").val()),e.after(f)}})}),void tp.reindex())},hide:function(c){var d,e=b("edit-form-foot").find("input:checked").prop("checked",c.shiftKey).closest("th");return 0===e.length?void alert(tablepress_strings.no_columns_selected):(d=e.map(function(){return a(this).index()}).get(),b("edit-form-body").children().add("#edit-form-head").each(function(b,c){a(c).children().filter(function(b){return-1!==a.inArray(b,d)}).addClass("column-hidden")}),e.addClass("column-hidden").find(".visibility").val("0"),void tp.table.set_table_changed())},unhide:function(c){var d,e=b("