Post Snippets - Version 4.0

Version Description

Download this release

Release Info

Developer wpexpertsio
Plugin Icon 128x128 Post Snippets
Version 4.0
Comparing to
See all releases

Code changes from version 3.1.7 to 4.0

Files changed (4) hide show
  1. assets/edit.css +247 -0
  2. assets/edit.js +121 -0
  3. assets/editor.css +1984 -0
  4. assets/editor.js +32718 -0
assets/edit.css ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .tagger {
2
+ border: 1px solid #909497;
3
+ }
4
+ .tagger input[type="hidden"] {
5
+ display: none;
6
+ }
7
+ .tagger > ul {
8
+ align-items: center;
9
+ box-sizing: border-box;
10
+ display: flex;
11
+ height: auto;
12
+ justify-content: space-between;
13
+ padding: 4px 0;
14
+ width: 100%;
15
+ }
16
+ .tagger ul {
17
+ list-style: none;
18
+ margin: 0;
19
+ }
20
+ .tagger > ul > li {
21
+ margin: 0.4rem 0;
22
+ padding-left: 10px;
23
+ }
24
+ .tagger-new ul a,
25
+ .tagger-new ul a:visited,
26
+ .tagger > ul > li:not(.tagger-new) a,
27
+ .tagger > ul > li:not(.tagger-new) a:visited {
28
+ color: #000;
29
+ }
30
+ .tagger .tagger-new ul,
31
+ .tagger > ul > li:not(.tagger-new) > a,
32
+ .tagger li:not(.tagger-new) > span {
33
+ background: #b1c3d7;
34
+ border: 1px solid #4181ed;
35
+ border-radius: 3px;
36
+ padding: 4px 4px 4px 8px;
37
+ }
38
+ .tagger li a.close {
39
+ filter: alpha(opacity=100);
40
+ float: none;
41
+ font-size: 16px;
42
+ line-height: 16px;
43
+ margin-left: 4px;
44
+ opacity: 1;
45
+ padding: 4px;
46
+ }
47
+ .tagger li a.close:hover {
48
+ color: #fff;
49
+ }
50
+ .tagger li:not(.tagger-new) a {
51
+ text-decoration: none;
52
+ }
53
+ .tagger .tagger-new input {
54
+ background: transparent;
55
+ border: none;
56
+ box-shadow: none;
57
+ outline: none;
58
+ padding-left: 0;
59
+ width: 100%;
60
+ }
61
+ .tagger .tagger-new {
62
+ flex-grow: 1;
63
+ position: relative;
64
+ }
65
+ .tagger .tagger-new ul {
66
+ padding: 5px;
67
+ }
68
+ .tagger .tagger-completion {
69
+ position: absolute;
70
+ z-index: 100;
71
+ }
72
+ .tagger.wrap > ul {
73
+ flex-wrap: wrap;
74
+ justify-content: start;
75
+ }
76
+ .form-table th {
77
+ width: auto;
78
+ }
79
+ h2 {
80
+ margin: 25px 0 15px;
81
+ }
82
+ h2:first-of-type {
83
+ margin-top: 20px;
84
+ }
85
+ h2 label {
86
+ cursor: auto;
87
+ }
88
+ .active-snippet #title,
89
+ .inactive-snippet #title {
90
+ border-left-width: 4px;
91
+ }
92
+ .active-snippet #title {
93
+ border-left-color: #46b450;
94
+ }
95
+ .inactive-snippet #title {
96
+ border-left-color: #bbb;
97
+ }
98
+ .erroneous-snippet #title {
99
+ border-left-color: #dc3232;
100
+ }
101
+ label[for="snippet_description"] h3 div {
102
+ position: absolute;
103
+ }
104
+ .button + .button {
105
+ margin-left: 0.5em;
106
+ }
107
+ .submit-inline {
108
+ float: right;
109
+ }
110
+ .snippet-scope {
111
+ margin-top: 15px;
112
+ }
113
+ .snippet-scope label {
114
+ display: inline-block;
115
+ margin-right: 1.5em;
116
+ }
117
+ .snippet-priority {
118
+ float: right;
119
+ }
120
+ .snippet-priority label {
121
+ cursor: help;
122
+ font-size: 1.1em;
123
+ font-weight: 700;
124
+ padding-right: 0.5em;
125
+ }
126
+ .snippet-priority input {
127
+ width: 4em;
128
+ }
129
+ .snippet-editor {
130
+ position: relative;
131
+ }
132
+ .editor-help-tooltip {
133
+ background: transparent !important;
134
+ cursor: help;
135
+ display: inline-block;
136
+ font-size: 10px;
137
+ padding: 0.3em 0.3em 0;
138
+ }
139
+ .snippet-editor-help {
140
+ position: absolute;
141
+ right: 5px;
142
+ top: 5px;
143
+ }
144
+ .snippet-editor-help:hover .editor-help-text {
145
+ opacity: 1;
146
+ visibility: visible;
147
+ }
148
+ .editor-help-text {
149
+ background-color: #555;
150
+ border-radius: 6px;
151
+ color: #fff;
152
+ font-size: small;
153
+ margin-right: -10px;
154
+ opacity: 0;
155
+ padding: 5px;
156
+ position: absolute;
157
+ right: 0;
158
+ top: 125%;
159
+ transition: opacity 0.3s;
160
+ visibility: hidden;
161
+ white-space: nowrap;
162
+ z-index: 99;
163
+ }
164
+ .editor-help-text:after {
165
+ border: 5px solid transparent;
166
+ border-bottom-color: #555;
167
+ bottom: 100%;
168
+ content: "";
169
+ margin-right: 10px;
170
+ position: absolute;
171
+ right: 0;
172
+ }
173
+ .editor-help-text td:first-child {
174
+ padding-right: 0.5em;
175
+ }
176
+ .editor-help-text .mac-key {
177
+ display: none;
178
+ }
179
+ .editor-help-text.platform-mac .mac-key {
180
+ display: inline;
181
+ }
182
+ .editor-help-text.platform-mac .pc-key {
183
+ display: none;
184
+ }
185
+ .CodeMirror {
186
+ width: 100%;
187
+ }
188
+ .CodeMirror-sizer {
189
+ min-height: 300px !important;
190
+ }
191
+ .tagger {
192
+ border: 0;
193
+ }
194
+ .tagger ul {
195
+ background-color: #fff;
196
+ border: 1px solid #dfdfdf;
197
+ border-radius: 3px;
198
+ }
199
+ .tagger-new ul,
200
+ .tagger > ul > li:not(.tagger-new) > a,
201
+ .tagger li:not(.tagger-new) > span {
202
+ background-color: #dee7f8;
203
+ border: 1px solid #cad8f3;
204
+ border-radius: 6px;
205
+ }
206
+ .tagger-new ul:hover,
207
+ .tagger > ul > li:not(.tagger-new) > a:hover,
208
+ .tagger li:not(.tagger-new) > span:hover {
209
+ background-color: #bbcef1;
210
+ border-color: #6d95e0;
211
+ }
212
+ .tagger-new ul a,
213
+ .tagger-new ul a:visited,
214
+ .tagger > ul > li:not(.tagger-new) a,
215
+ .tagger > ul > li:not(.tagger-new) a:visited {
216
+ color: #555;
217
+ font-size: 1.1em;
218
+ }
219
+
220
+ /* editor custom code save button design */
221
+
222
+ .save-button-area {
223
+ display:block;
224
+ position: relative;
225
+ background-color: #F5F5F5;
226
+ border:1px solid #C3C4C7;
227
+ margin-top:-48px;
228
+ height:60px;
229
+
230
+
231
+ }
232
+
233
+ .save-button-area > p.submit {
234
+ width:150px;
235
+ height:40px;
236
+ }
237
+
238
+ .save-button-area > p.submit > input.button {
239
+ display:block;
240
+ position: relative;
241
+ margin-top: -19px;
242
+ margin-left: 5px;
243
+ width: 150px;
244
+ height: 40px;
245
+ left: 113px;
246
+
247
+ }
assets/edit.js ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+
3
+ Using Jquery for post snippet save button design
4
+
5
+ */
6
+
7
+ jQuery(document).ready(function($){
8
+
9
+ // editor code of css and js save button design
10
+ if ($('#ps_option_meta_box').length) {
11
+ $(".save-button-area").css({"display":"block",
12
+ "margin-top":"-22px",
13
+ });
14
+ }
15
+ // editor code save button functionality
16
+ if( $('#pspro_snippet_shortcode').is(':checked') && $('.notice-error').length==0) {
17
+ $('.save-button-area').css({'margin-top':'-2px'});
18
+ }
19
+ // change margin of save button on checkbox click
20
+ $('#pspro_snippet_shortcode').on('click', function(){
21
+ if( $(this).is(':checked') && $("#pspro_edit_shotcode_text").length!=0) {
22
+ $(".save-button-area").css({"margin-top":"-2px"});
23
+ }
24
+ else if($(this).is(':checked')==false) {
25
+ $(".save-button-area").css({"margin-top":"-48px"});
26
+ }
27
+ })
28
+
29
+ });
30
+
31
+
32
+
33
+
34
+ var post_snippets_editor_atts = {
35
+ mode: "php-snippet",
36
+ matchBrackets: true,
37
+ extraKeys: { "Alt-F": "findPersistent" },
38
+ gutters: ["CodeMirror-lint-markers"],
39
+ lint: true,
40
+ direction: "ltr",
41
+ viewportMargin: 10,
42
+ scrollbarStyle: 'native',
43
+ theme: "default",
44
+ indentWithTabs: true,
45
+ tabSize: 4,
46
+ indentUnit: 4,
47
+ lineWrapping: true,
48
+ lineNumbers: true,
49
+ autoCloseBrackets: true,
50
+ highlightSelectionMatches: true,
51
+ };
52
+
53
+ !(function e(t, r, n) {
54
+ function o(c, d) {
55
+ if (!r[c]) {
56
+ if (!t[c]) {
57
+ var a = "function" == typeof require && require;
58
+ if (!d && a) return a(c, !0);
59
+ if (i) return i(c, !0);
60
+ var u = new Error("Cannot find module '" + c + "'");
61
+ throw ((u.code = "MODULE_NOT_FOUND"), u);
62
+ }
63
+ var p = (r[c] = { exports: {} });
64
+ t[c][0].call(
65
+ p.exports,
66
+ function (e) {
67
+ return o(t[c][1][e] || e);
68
+ },
69
+ p,
70
+ p.exports,
71
+ e,
72
+ t,
73
+ r,
74
+ n
75
+ );
76
+ }
77
+ return r[c].exports;
78
+ }
79
+ for (
80
+ var i = "function" == typeof require && require, c = 0;
81
+ c < n.length;
82
+ c++
83
+ )
84
+ o(n[c]);
85
+ return o;
86
+ })(
87
+ {
88
+ 1: [
89
+ function (e, t, r) {
90
+ "use strict";
91
+ var n, o, i, c;
92
+ (window.post_snippets_editor =
93
+ ((n = window.Code_Snippets_CodeMirror),
94
+ (o = post_snippets_editor_atts),
95
+ // (i = function (e) {
96
+ // return document.getElementById("save_snippet").click();
97
+ // }),
98
+ // (o.extraKeys = window.navigator.platform.match("Mac")
99
+ // ? { "Cmd-Enter": i, "Cmd-S": i }
100
+ // : { "Ctrl-Enter": i, "Ctrl-S": i }),
101
+ // window.navigator.platform.match("Mac") &&
102
+ // (document.querySelector(".editor-help-text").className +=
103
+ // " platform-mac"),
104
+ n.fromTextArea(document.getElementById("ps_code_editor"), o)))//,
105
+ // (c = document.getElementById("snippet-code-direction")) &&
106
+ // c.addEventListener("change", function () {
107
+ // window.post_snippets_editor.setOption(
108
+ // "direction",
109
+ // "rtl" === c.value ? "rtl" : "ltr"
110
+ // );
111
+ // });
112
+ },
113
+ {},
114
+ ],
115
+ },
116
+ {},
117
+ [1]
118
+ );
119
+
120
+
121
+
assets/editor.css ADDED
@@ -0,0 +1,1984 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .codemirror-colorview {
2
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
3
+ repeat;
4
+ border: 1px solid #cecece;
5
+ box-sizing: border-box;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+ height: 10px;
9
+ margin: 0 2px;
10
+ position: relative;
11
+ vertical-align: middle;
12
+ width: 10px;
13
+ }
14
+ .codemirror-colorview .codemirror-colorview-background {
15
+ bottom: 0;
16
+ content: "";
17
+ left: 0;
18
+ position: absolute;
19
+ right: 0;
20
+ top: 0;
21
+ }
22
+ .codemirror-colorview:hover {
23
+ border-color: #494949;
24
+ }
25
+ .codemirror-colorpicker {
26
+ background-color: #fff;
27
+ border: 1px solid rgba(0, 0, 0, 0.2);
28
+ border-radius: 3px;
29
+ box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.12);
30
+ display: inline-block;
31
+ position: relative;
32
+ width: 224px;
33
+ z-index: 1000;
34
+ }
35
+ .codemirror-colorpicker > .arrow {
36
+ border-bottom: 10px solid rgba(0, 0, 0, 0.2);
37
+ border-left: 10px solid transparent;
38
+ border-right: 10px solid transparent;
39
+ display: none;
40
+ height: 0;
41
+ left: 7px;
42
+ pointer-events: none;
43
+ position: absolute;
44
+ top: -10px;
45
+ width: 0;
46
+ }
47
+ .codemirror-colorpicker > .arrow:after {
48
+ border-bottom: 9px solid #fff;
49
+ border-left: 9px solid transparent;
50
+ border-right: 9px solid transparent;
51
+ content: "";
52
+ height: 0;
53
+ left: -9px;
54
+ position: absolute;
55
+ top: 1px;
56
+ width: 0;
57
+ }
58
+ .codemirror-colorpicker .colorpicker-body .arrow-button {
59
+ background-color: transparent;
60
+ height: 12px;
61
+ padding: 0;
62
+ position: relative;
63
+ width: 10px;
64
+ }
65
+ .codemirror-colorpicker .colorpicker-body .arrow-button:before {
66
+ border-bottom: 3px solid #000;
67
+ height: 50%;
68
+ top: 0;
69
+ }
70
+ .codemirror-colorpicker .colorpicker-body .arrow-button:after,
71
+ .codemirror-colorpicker .colorpicker-body .arrow-button:before {
72
+ border-left: 3px solid transparent;
73
+ border-right: 3px solid transparent;
74
+ box-sizing: border-box;
75
+ content: "";
76
+ display: inline-block;
77
+ height: 0;
78
+ left: 0;
79
+ margin: 2px;
80
+ pointer-events: none;
81
+ position: absolute;
82
+ right: 0;
83
+ width: 0;
84
+ }
85
+ .codemirror-colorpicker .colorpicker-body .arrow-button:after {
86
+ border-top: 3px solid #000;
87
+ bottom: 0;
88
+ top: 50%;
89
+ }
90
+ .codemirror-colorpicker .colorpicker-body .color {
91
+ cursor: pointer;
92
+ height: 120px;
93
+ overflow: hidden;
94
+ position: relative;
95
+ }
96
+ .codemirror-colorpicker .colorpicker-body .color > .saturation,
97
+ .codemirror-colorpicker .colorpicker-body .color > .saturation > .value {
98
+ height: 100%;
99
+ position: relative;
100
+ width: 100%;
101
+ }
102
+ .codemirror-colorpicker
103
+ .colorpicker-body
104
+ .color
105
+ > .saturation
106
+ > .value
107
+ > .drag-pointer {
108
+ border-radius: 50%;
109
+ height: 10px;
110
+ position: absolute;
111
+ transform: translateX(-50%) translateY(-50%);
112
+ width: 10px;
113
+ }
114
+ .codemirror-colorpicker .colorpicker-body .color > .saturation {
115
+ background-color: hsla(20, 42%, 65%, 0);
116
+ background-image: linear-gradient(90deg, #fff, hsla(20, 42%, 65%, 0));
117
+ background-repeat: repeat-x;
118
+ }
119
+ .codemirror-colorpicker .colorpicker-body .color > .saturation > .value {
120
+ background-image: linear-gradient(0deg, #000, hsla(20, 42%, 65%, 0));
121
+ }
122
+ .codemirror-colorpicker
123
+ .colorpicker-body
124
+ .color
125
+ > .saturation
126
+ > .value
127
+ > .drag-pointer {
128
+ border: 1px solid #fff;
129
+ box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.05);
130
+ }
131
+ .codemirror-colorpicker .colorpicker-body .control {
132
+ padding: 10px 0;
133
+ position: relative;
134
+ -webkit-user-select: none;
135
+ -moz-user-select: none;
136
+ -ms-user-select: none;
137
+ user-select: none;
138
+ }
139
+ .codemirror-colorpicker .colorpicker-body .control > .color,
140
+ .codemirror-colorpicker .colorpicker-body .control > .empty {
141
+ border-radius: 50%;
142
+ box-sizing: border-box;
143
+ height: 30px;
144
+ left: 12px;
145
+ position: absolute;
146
+ top: 14px;
147
+ width: 30px;
148
+ }
149
+ .codemirror-colorpicker .colorpicker-body .control > .color {
150
+ border: 1px solid rgba(0, 0, 0, 0.1);
151
+ }
152
+ .codemirror-colorpicker .colorpicker-body .control > .hue {
153
+ box-sizing: border-box;
154
+ cursor: pointer;
155
+ margin: 0 0 0 42px;
156
+ padding: 6px 16px;
157
+ position: relative;
158
+ }
159
+ .codemirror-colorpicker .colorpicker-body .control > .hue > .hue-container {
160
+ border-radius: 3px;
161
+ height: 10px;
162
+ position: relative;
163
+ width: 100%;
164
+ }
165
+ .codemirror-colorpicker .colorpicker-body .control > .opacity {
166
+ box-sizing: border-box;
167
+ cursor: pointer;
168
+ margin: 0 0 0 42px;
169
+ padding: 3px 16px;
170
+ position: relative;
171
+ }
172
+ .codemirror-colorpicker
173
+ .colorpicker-body
174
+ .control
175
+ > .opacity
176
+ > .opacity-container {
177
+ border-radius: 3px;
178
+ height: 10px;
179
+ position: relative;
180
+ width: 100%;
181
+ }
182
+ .codemirror-colorpicker .colorpicker-body .control .drag-bar,
183
+ .codemirror-colorpicker .colorpicker-body .control .drag-bar2 {
184
+ border-radius: 50%;
185
+ cursor: pointer;
186
+ height: 12px;
187
+ left: 0;
188
+ position: absolute;
189
+ top: 50%;
190
+ transform: translateX(-50%) translateY(-50%);
191
+ width: 12px;
192
+ }
193
+ .codemirror-colorpicker .colorpicker-body .control > .hue > .hue-container {
194
+ background: linear-gradient(
195
+ 90deg,
196
+ red 0,
197
+ #ff0 17%,
198
+ #0f0 33%,
199
+ #0ff 50%,
200
+ #00f 67%,
201
+ #f0f 83%,
202
+ red
203
+ );
204
+ }
205
+ .codemirror-colorpicker
206
+ .colorpicker-body
207
+ .control
208
+ > .opacity
209
+ > .opacity-container {
210
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
211
+ repeat;
212
+ }
213
+ .codemirror-colorpicker
214
+ .colorpicker-body
215
+ .control
216
+ > .opacity
217
+ > .opacity-container
218
+ > .color-bar {
219
+ bottom: 0;
220
+ content: "";
221
+ display: block;
222
+ left: 0;
223
+ position: absolute;
224
+ right: 0;
225
+ top: 0;
226
+ }
227
+ .codemirror-colorpicker .colorpicker-body .control > .empty {
228
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
229
+ repeat;
230
+ }
231
+ .codemirror-colorpicker .colorpicker-body .control .drag-bar,
232
+ .codemirror-colorpicker .colorpicker-body .control .drag-bar2 {
233
+ background-color: #fefefe;
234
+ border: 1px solid rgba(0, 0, 0, 0.05);
235
+ box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.2);
236
+ }
237
+ .codemirror-colorpicker .colorpicker-body .information {
238
+ box-sizing: padding-box;
239
+ position: relative;
240
+ }
241
+ .codemirror-colorpicker .colorpicker-body .information > input {
242
+ bottom: 20px;
243
+ box-sizing: border-box;
244
+ font-size: 10px;
245
+ height: 20px;
246
+ padding: 0 0 0 2px;
247
+ position: absolute;
248
+ -webkit-user-select: text;
249
+ -moz-user-select: text;
250
+ -ms-user-select: text;
251
+ user-select: text;
252
+ }
253
+ .codemirror-colorpicker .colorpicker-body .information > input[type="number"] {
254
+ -webkit-appearance: none;
255
+ -moz-appearance: none;
256
+ appearance: none;
257
+ }
258
+ .codemirror-colorpicker
259
+ .colorpicker-body
260
+ .information
261
+ > input[type="number"]::-webkit-inner-spin-button,
262
+ .codemirror-colorpicker
263
+ .colorpicker-body
264
+ .information
265
+ > input[type="number"]::-webkit-outer-spin-button {
266
+ -webkit-appearance: none;
267
+ appearance: none;
268
+ margin: 0;
269
+ }
270
+ .codemirror-colorpicker
271
+ .colorpicker-body
272
+ .information.hex
273
+ > .information-item.hex,
274
+ .codemirror-colorpicker
275
+ .colorpicker-body
276
+ .information.hsl
277
+ > .information-item.hsl,
278
+ .codemirror-colorpicker
279
+ .colorpicker-body
280
+ .information.rgb
281
+ > .information-item.rgb {
282
+ display: flex;
283
+ }
284
+ .codemirror-colorpicker .colorpicker-body .information > .information-item {
285
+ box-sizing: border-box;
286
+ display: none;
287
+ margin-right: 40px;
288
+ padding: 0 5px 0 9px;
289
+ position: relative;
290
+ }
291
+ .codemirror-colorpicker
292
+ .colorpicker-body
293
+ .information
294
+ > .information-item
295
+ > .input-field {
296
+ box-sizing: border-box;
297
+ display: block;
298
+ flex: 1;
299
+ padding: 3px;
300
+ position: relative;
301
+ }
302
+ .codemirror-colorpicker
303
+ .colorpicker-body
304
+ .information
305
+ > .information-item
306
+ > .input-field
307
+ > .title {
308
+ color: #a9a9a9;
309
+ cursor: pointer;
310
+ font-size: 12px;
311
+ padding-top: 2px;
312
+ text-align: center;
313
+ -webkit-user-select: none;
314
+ -moz-user-select: none;
315
+ -ms-user-select: none;
316
+ user-select: none;
317
+ }
318
+ .codemirror-colorpicker
319
+ .colorpicker-body
320
+ .information
321
+ > .information-item
322
+ > .input-field
323
+ input {
324
+ border: 1px solid #cbcbcb;
325
+ border-radius: 2px;
326
+ box-sizing: border-box;
327
+ color: #333;
328
+ font-size: 11px;
329
+ height: 21px;
330
+ padding: 3px;
331
+ text-align: center;
332
+ -webkit-user-select: text;
333
+ -moz-user-select: text;
334
+ -ms-user-select: text;
335
+ user-select: text;
336
+ width: 100%;
337
+ }
338
+ .codemirror-colorpicker
339
+ .colorpicker-body
340
+ .information
341
+ > .information-item
342
+ > .input-field
343
+ input[type="number"] {
344
+ -webkit-appearance: none;
345
+ -moz-appearance: none;
346
+ appearance: none;
347
+ }
348
+ .codemirror-colorpicker
349
+ .colorpicker-body
350
+ .information
351
+ > .information-item
352
+ > .input-field
353
+ input[type="number"]::-webkit-inner-spin-button,
354
+ .codemirror-colorpicker
355
+ .colorpicker-body
356
+ .information
357
+ > .information-item
358
+ > .input-field
359
+ input[type="number"]::-webkit-outer-spin-button {
360
+ -webkit-appearance: none;
361
+ appearance: none;
362
+ margin: 0;
363
+ }
364
+ .codemirror-colorpicker
365
+ .colorpicker-body
366
+ .information
367
+ > .information-item
368
+ > .input-field.hsl-l
369
+ input[type="number"],
370
+ .codemirror-colorpicker
371
+ .colorpicker-body
372
+ .information
373
+ > .information-item
374
+ > .input-field.hsl-s
375
+ input[type="number"] {
376
+ padding-left: 1px;
377
+ padding-right: 10px;
378
+ }
379
+ .codemirror-colorpicker
380
+ .colorpicker-body
381
+ .information
382
+ > .information-item
383
+ > .input-field
384
+ .postfix {
385
+ box-sizing: border-box;
386
+ display: inline-block;
387
+ font-size: 11px;
388
+ height: 21px;
389
+ line-height: 2;
390
+ padding: 2px;
391
+ position: absolute;
392
+ right: 3px;
393
+ text-align: center;
394
+ top: 2px;
395
+ }
396
+ .codemirror-colorpicker .colorpicker-body .information > .information-change {
397
+ bottom: 0;
398
+ box-sizing: border-box;
399
+ display: block;
400
+ padding-top: 5px;
401
+ position: absolute;
402
+ right: 0;
403
+ text-align: center;
404
+ top: 0;
405
+ width: 40px;
406
+ }
407
+ .codemirror-colorpicker
408
+ .colorpicker-body
409
+ .information
410
+ > .information-change
411
+ > .format-change-button {
412
+ background: transparent;
413
+ border: 0;
414
+ box-sizing: border-box;
415
+ cursor: pointer;
416
+ outline: none;
417
+ }
418
+ .codemirror-colorpicker .colorpicker-body .information > .title {
419
+ color: #a3a3a3;
420
+ }
421
+ .codemirror-colorpicker .colorpicker-body .information > .input {
422
+ color: #333;
423
+ }
424
+ .codemirror-colorpicker .colorpicker-body .colorsets {
425
+ border-top: 1px solid #e2e2e2;
426
+ }
427
+ .codemirror-colorpicker .colorpicker-body .colorsets > .menu {
428
+ float: right;
429
+ padding: 10px 15px 10px 5px;
430
+ }
431
+ .codemirror-colorpicker .colorpicker-body .colorsets > .menu button {
432
+ border: 0;
433
+ cursor: pointer;
434
+ font-family: serif, sans-serif;
435
+ font-size: 14px;
436
+ font-weight: 300;
437
+ outline: none;
438
+ }
439
+ .codemirror-colorpicker .colorpicker-body .colorsets > .color-list {
440
+ box-sizing: border-box;
441
+ display: block;
442
+ line-height: 0;
443
+ margin-right: 30px;
444
+ padding: 12px 0 0 12px;
445
+ }
446
+ .codemirror-colorpicker .colorpicker-body .colorsets > .color-list .color-item {
447
+ background-size: contain;
448
+ border-radius: 2px;
449
+ box-sizing: border-box;
450
+ cursor: pointer;
451
+ display: inline-block;
452
+ height: 13px;
453
+ margin-bottom: 12px;
454
+ margin-right: 12px;
455
+ overflow: hidden;
456
+ position: relative;
457
+ vertical-align: middle;
458
+ width: 13px;
459
+ }
460
+ .codemirror-colorpicker
461
+ .colorpicker-body
462
+ .colorsets
463
+ > .color-list
464
+ .color-item:hover {
465
+ transform: scale(1.2);
466
+ }
467
+ .codemirror-colorpicker
468
+ .colorpicker-body
469
+ .colorsets
470
+ > .color-list
471
+ .color-item
472
+ .empty {
473
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
474
+ repeat;
475
+ height: 100%;
476
+ left: 0;
477
+ margin: 0;
478
+ padding: 0;
479
+ pointer-events: none;
480
+ position: absolute;
481
+ top: 0;
482
+ width: 100%;
483
+ }
484
+ .codemirror-colorpicker
485
+ .colorpicker-body
486
+ .colorsets
487
+ > .color-list
488
+ .color-item
489
+ .color-view {
490
+ border: 1px solid rgba(0, 0, 0, 0.1);
491
+ box-sizing: border-box;
492
+ height: 100%;
493
+ left: 0;
494
+ margin: 0;
495
+ padding: 0;
496
+ pointer-events: none;
497
+ position: absolute;
498
+ top: 0;
499
+ width: 100%;
500
+ }
501
+ .codemirror-colorpicker
502
+ .colorpicker-body
503
+ .colorsets
504
+ > .color-list
505
+ .add-color-item {
506
+ color: #8e8e8e;
507
+ cursor: pointer;
508
+ display: inline-block;
509
+ font-family: serif, sans-serif;
510
+ font-size: 16px;
511
+ font-weight: 400;
512
+ height: 13px;
513
+ line-height: 1;
514
+ margin-bottom: 12px;
515
+ margin-right: 12px;
516
+ text-align: center;
517
+ vertical-align: middle;
518
+ width: 13px;
519
+ }
520
+ .codemirror-colorpicker .colorpicker-body .color-chooser {
521
+ background-color: rgba(0, 0, 0, 0.5);
522
+ bottom: 0;
523
+ left: 0;
524
+ opacity: 0;
525
+ pointer-events: none;
526
+ position: absolute;
527
+ right: 0;
528
+ top: 0;
529
+ transition: opacity 0.05s ease-out;
530
+ }
531
+ .codemirror-colorpicker .colorpicker-body .color-chooser.open {
532
+ opacity: 1;
533
+ pointer-events: all;
534
+ }
535
+ .codemirror-colorpicker
536
+ .colorpicker-body
537
+ .color-chooser
538
+ .color-chooser-container {
539
+ background-color: #fff;
540
+ bottom: 0;
541
+ left: 0;
542
+ position: absolute;
543
+ right: 0;
544
+ top: 120px;
545
+ }
546
+ .codemirror-colorpicker
547
+ .colorpicker-body
548
+ .color-chooser
549
+ .color-chooser-container
550
+ .colorsets-item-header {
551
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
552
+ box-sizing: border-box;
553
+ display: flex;
554
+ height: 34px;
555
+ left: 0;
556
+ padding: 3px 0;
557
+ position: absolute;
558
+ right: 0;
559
+ top: 0;
560
+ }
561
+ .codemirror-colorpicker
562
+ .colorpicker-body
563
+ .color-chooser
564
+ .color-chooser-container
565
+ .colorsets-item-header
566
+ .title {
567
+ box-sizing: border-box;
568
+ color: #000;
569
+ flex: 2;
570
+ font-size: 15px;
571
+ font-weight: 700;
572
+ margin: 0;
573
+ overflow: hidden;
574
+ padding: 5px 5px 5px 14px;
575
+ text-align: left;
576
+ text-overflow: ellipsis;
577
+ vertical-align: middle;
578
+ white-space: nowrap;
579
+ }
580
+ .codemirror-colorpicker
581
+ .colorpicker-body
582
+ .color-chooser
583
+ .color-chooser-container
584
+ .colorsets-item-header
585
+ .items {
586
+ cursor: pointer;
587
+ display: block;
588
+ flex: 1;
589
+ height: 100%;
590
+ line-height: 2;
591
+ padding-right: 10px;
592
+ text-align: right;
593
+ }
594
+ .codemirror-colorpicker
595
+ .colorpicker-body
596
+ .color-chooser
597
+ .color-chooser-container
598
+ .colorsets-list {
599
+ bottom: 0;
600
+ left: 0;
601
+ overflow: auto;
602
+ position: absolute;
603
+ right: 0;
604
+ top: 34px;
605
+ }
606
+ .codemirror-colorpicker
607
+ .colorpicker-body
608
+ .color-chooser
609
+ .color-chooser-container
610
+ .colorsets-list
611
+ .colorsets-item {
612
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
613
+ cursor: pointer;
614
+ display: flex;
615
+ padding: 3px 0;
616
+ }
617
+ .codemirror-colorpicker
618
+ .colorpicker-body
619
+ .color-chooser
620
+ .color-chooser-container
621
+ .colorsets-list
622
+ .colorsets-item:hover {
623
+ background-color: rgba(0, 0, 0, 0.05);
624
+ }
625
+ .codemirror-colorpicker
626
+ .colorpicker-body
627
+ .color-chooser
628
+ .color-chooser-container
629
+ .colorsets-list
630
+ .colorsets-item
631
+ .title {
632
+ box-sizing: border-box;
633
+ color: #000;
634
+ flex: 2;
635
+ font-size: 14px;
636
+ font-size: 13px;
637
+ font-weight: 400;
638
+ margin: 0;
639
+ overflow: hidden;
640
+ padding: 5px 5px 5px 14px;
641
+ pointer-events: none;
642
+ text-align: left;
643
+ text-overflow: ellipsis;
644
+ vertical-align: middle;
645
+ white-space: nowrap;
646
+ }
647
+ .codemirror-colorpicker
648
+ .colorpicker-body
649
+ .color-chooser
650
+ .color-chooser-container
651
+ .colorsets-list
652
+ .colorsets-item
653
+ .items {
654
+ cursor: pointer;
655
+ display: block;
656
+ flex: 3;
657
+ height: 100%;
658
+ line-height: 1.6;
659
+ pointer-events: none;
660
+ }
661
+ .codemirror-colorpicker
662
+ .colorpicker-body
663
+ .color-chooser
664
+ .color-chooser-container
665
+ .colorsets-list
666
+ .colorsets-item
667
+ .items
668
+ .color-item {
669
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
670
+ repeat;
671
+ background-size: contain;
672
+ border: 1px solid #ddd;
673
+ border-radius: 3px;
674
+ box-sizing: border-box;
675
+ cursor: pointer;
676
+ display: inline-block;
677
+ height: 13px;
678
+ margin-right: 10px;
679
+ overflow: hidden;
680
+ vertical-align: middle;
681
+ width: 13px;
682
+ }
683
+ .codemirror-colorpicker
684
+ .colorpicker-body
685
+ .color-chooser
686
+ .color-chooser-container
687
+ .colorsets-list
688
+ .colorsets-item
689
+ .items
690
+ .color-item
691
+ .color-view {
692
+ height: 100%;
693
+ margin: 0;
694
+ padding: 0;
695
+ pointer-events: none;
696
+ width: 100%;
697
+ }
698
+ .codemirror-colorpicker.sketch {
699
+ border-radius: 5px;
700
+ }
701
+ .codemirror-colorpicker.sketch > .colorpicker-body > .color {
702
+ box-sizing: border-box;
703
+ height: 150px;
704
+ margin: 10px 10px 2px;
705
+ }
706
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control {
707
+ padding: 0;
708
+ }
709
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control > .color,
710
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control > .empty {
711
+ border-radius: 2px;
712
+ box-sizing: border-box;
713
+ height: 26px;
714
+ left: auto;
715
+ position: absolute;
716
+ right: 10px;
717
+ top: 1px;
718
+ width: 26px;
719
+ }
720
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control > .color {
721
+ box-shadow: inset 0 0 1px 0 rgba(0, 0, 0, 0.5);
722
+ }
723
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control > .hue {
724
+ margin: 0 38px 0 0;
725
+ padding: 2px 2px 2px 10px;
726
+ position: relative;
727
+ }
728
+ .codemirror-colorpicker.sketch
729
+ > .colorpicker-body
730
+ > .control
731
+ > .hue
732
+ > .hue-container {
733
+ border-radius: 0;
734
+ }
735
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control > .opacity {
736
+ margin: 0 38px 0 0;
737
+ padding: 2px 2px 2px 10px;
738
+ position: relative;
739
+ }
740
+ .codemirror-colorpicker.sketch
741
+ > .colorpicker-body
742
+ > .control
743
+ > .opacity
744
+ > .opacity-container {
745
+ border-radius: 0;
746
+ }
747
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar,
748
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar2 {
749
+ border-radius: 0;
750
+ border-radius: 1px;
751
+ bottom: 1px !important;
752
+ height: 50%;
753
+ left: 0;
754
+ top: 50%;
755
+ transform: translateX(-50%) translateY(-50%);
756
+ width: 2px;
757
+ }
758
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar2.first,
759
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar.first {
760
+ left: 0;
761
+ transform: translateX(50%) translateY(-50%) !important;
762
+ }
763
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar2.last,
764
+ .codemirror-colorpicker.sketch > .colorpicker-body > .control .drag-bar.last {
765
+ transform: translateX(-150%) translateY(-50%) !important;
766
+ }
767
+ .codemirror-colorpicker.sketch
768
+ > .colorpicker-body
769
+ > .information
770
+ .information-change {
771
+ display: none;
772
+ }
773
+ .codemirror-colorpicker.sketch
774
+ > .colorpicker-body
775
+ > .information.rgb
776
+ .information-item.rgb {
777
+ display: inherit;
778
+ }
779
+ .codemirror-colorpicker.sketch
780
+ > .colorpicker-body
781
+ > .information.rgb
782
+ .information-item.hsl {
783
+ display: none !important;
784
+ }
785
+ .codemirror-colorpicker.sketch
786
+ > .colorpicker-body
787
+ > .information.hex
788
+ .information-item.hex {
789
+ display: inherit;
790
+ }
791
+ .codemirror-colorpicker.sketch
792
+ > .colorpicker-body
793
+ > .information.hex
794
+ .information-item.hsl,
795
+ .codemirror-colorpicker.sketch
796
+ > .colorpicker-body
797
+ > .information.hsl
798
+ .information-item.rgb {
799
+ display: none !important;
800
+ }
801
+ .codemirror-colorpicker.sketch
802
+ > .colorpicker-body
803
+ > .information.hsl
804
+ .information-item.hsl {
805
+ display: inherit;
806
+ }
807
+ .codemirror-colorpicker.sketch
808
+ > .colorpicker-body
809
+ > .information
810
+ .information-item {
811
+ display: inline-flex !important;
812
+ margin-right: 0;
813
+ }
814
+ .codemirror-colorpicker.sketch
815
+ > .colorpicker-body
816
+ > .information
817
+ .information-item
818
+ > .input-field {
819
+ padding-left: 0;
820
+ }
821
+ .codemirror-colorpicker.sketch
822
+ > .colorpicker-body
823
+ > .information
824
+ .information-item
825
+ > .input-field:last-child {
826
+ padding-right: 0;
827
+ }
828
+ .codemirror-colorpicker.sketch
829
+ > .colorpicker-body
830
+ > .information
831
+ .information-item
832
+ > .input-field
833
+ > .title {
834
+ color: #000;
835
+ cursor: pointer;
836
+ font-size: 11px;
837
+ }
838
+ .codemirror-colorpicker.sketch
839
+ > .colorpicker-body
840
+ > .information
841
+ .information-item
842
+ > .input-field:last-child:not(:first-child) {
843
+ padding-right: 0;
844
+ }
845
+ .codemirror-colorpicker.sketch
846
+ > .colorpicker-body
847
+ > .information
848
+ .information-item.hex {
849
+ padding-left: 5px;
850
+ padding-right: 0;
851
+ width: 74px;
852
+ }
853
+ .codemirror-colorpicker.sketch
854
+ > .colorpicker-body
855
+ > .information
856
+ .information-item.rgb {
857
+ padding-left: 0;
858
+ padding-right: 0;
859
+ width: 140px;
860
+ }
861
+ .codemirror-colorpicker.sketch
862
+ > .colorpicker-body
863
+ > .information
864
+ .information-item.hsl {
865
+ display: none;
866
+ padding-left: 0;
867
+ padding-right: 0;
868
+ width: 140px;
869
+ }
870
+ .codemirror-colorpicker.sketch > .colorpicker-body > .colorsets > .color-list {
871
+ margin-right: 0;
872
+ padding-right: 12px;
873
+ }
874
+ .codemirror-colorpicker.sketch
875
+ > .colorpicker-body
876
+ > .colorsets
877
+ > .color-list
878
+ .color-item {
879
+ border-radius: 3px;
880
+ height: 16px;
881
+ margin-bottom: 10px;
882
+ margin-right: 9px;
883
+ width: 16px;
884
+ }
885
+ .codemirror-colorpicker.palette {
886
+ border-radius: 3px;
887
+ box-shadow: none;
888
+ }
889
+ .codemirror-colorpicker.palette > .colorpicker-body > .color,
890
+ .codemirror-colorpicker.palette > .colorpicker-body > .control,
891
+ .codemirror-colorpicker.palette > .colorpicker-body > .information {
892
+ display: none;
893
+ }
894
+ .codemirror-colorpicker.palette > .colorpicker-body > .colorsets {
895
+ border-top: 0;
896
+ box-sizing: border-box;
897
+ }
898
+ .codemirror-colorpicker.palette
899
+ > .colorpicker-body
900
+ > .colorsets
901
+ > .color-list
902
+ .color-item {
903
+ height: 15px;
904
+ margin-bottom: 10px;
905
+ margin-right: 10px;
906
+ width: 15px;
907
+ }
908
+ .codemirror-colorpicker.palette > .colorpicker-body > .color-chooser {
909
+ box-sizing: border-box;
910
+ display: none;
911
+ }
912
+ .codemirror-colorpicker.palette > .colorpicker-body > .color-chooser.open {
913
+ border: 1px solid #d8d8d8;
914
+ border-radius: 3px;
915
+ bottom: auto;
916
+ box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.12);
917
+ display: block;
918
+ left: -1px;
919
+ right: -1px;
920
+ top: -1px;
921
+ }
922
+ .codemirror-colorpicker.palette
923
+ > .colorpicker-body
924
+ > .color-chooser.open
925
+ .color-chooser-container {
926
+ background-color: #fff;
927
+ border-radius: 2px;
928
+ bottom: auto;
929
+ box-sizing: border-box;
930
+ left: auto;
931
+ position: relative;
932
+ right: auto;
933
+ top: auto;
934
+ }
935
+ .codemirror-colorpicker.palette
936
+ > .colorpicker-body
937
+ > .color-chooser.open
938
+ .color-chooser-container
939
+ .colorsets-item-header {
940
+ border-top-left-radius: 3px;
941
+ border-top-right-radius: 3px;
942
+ bottom: auto;
943
+ left: auto;
944
+ position: relative;
945
+ right: auto;
946
+ top: auto;
947
+ }
948
+ .codemirror-colorpicker.palette
949
+ > .colorpicker-body
950
+ > .color-chooser.open
951
+ .color-chooser-container
952
+ .colorsets-list {
953
+ bottom: auto;
954
+ left: auto;
955
+ overflow: auto;
956
+ position: relative;
957
+ right: auto;
958
+ top: auto;
959
+ }
960
+ .codemirror-colorpicker.palette
961
+ > .colorpicker-body
962
+ > .color-chooser.open
963
+ .color-chooser-container
964
+ .colorsets-list
965
+ .colorsets-item:last-child {
966
+ border-bottom-left-radius: 3px;
967
+ border-bottom-right-radius: 3px;
968
+ }
969
+ .codemirror-colorpicker.macos .colorpicker-body .wheel {
970
+ box-sizing: border-box;
971
+ height: 224px;
972
+ position: relative;
973
+ width: 224px;
974
+ }
975
+ .codemirror-colorpicker.macos .colorpicker-body .wheel .wheel-canvas {
976
+ border-radius: 50%;
977
+ height: 214px;
978
+ left: 5px;
979
+ position: absolute;
980
+ top: 5px;
981
+ width: 214px;
982
+ }
983
+ .codemirror-colorpicker.macos .colorpicker-body .wheel .drag-pointer {
984
+ border: 1px solid #fff;
985
+ border-radius: 50%;
986
+ display: inline-block;
987
+ height: 10px;
988
+ left: 50%;
989
+ position: absolute;
990
+ top: 50%;
991
+ transform: translateX(-50%) translateY(-50%);
992
+ width: 10px;
993
+ z-index: 2;
994
+ }
995
+ .codemirror-colorpicker.macos .control {
996
+ padding-top: 0;
997
+ }
998
+ .codemirror-colorpicker.macos .control > .color,
999
+ .codemirror-colorpicker.macos .control > .empty {
1000
+ top: 4px;
1001
+ }
1002
+ .codemirror-colorpicker.macos .value {
1003
+ box-sizing: border-box;
1004
+ cursor: pointer;
1005
+ margin: 0 0 0 42px;
1006
+ padding: 6px 16px;
1007
+ position: relative;
1008
+ }
1009
+ .codemirror-colorpicker.macos .value > .value-container {
1010
+ background-image: linear-gradient(90deg, #000 0, hsla(0, 0%, 100%, 0));
1011
+ border-radius: 3px;
1012
+ box-sizing: border-box;
1013
+ height: 10px;
1014
+ position: relative;
1015
+ width: 100%;
1016
+ }
1017
+ .codemirror-colorpicker.macos .value > .value-container .drag-bar {
1018
+ border-radius: 50%;
1019
+ cursor: pointer;
1020
+ height: 12px;
1021
+ left: 0;
1022
+ position: absolute;
1023
+ top: 50%;
1024
+ transform: translateX(-50%) translateY(-50%);
1025
+ width: 12px;
1026
+ }
1027
+ .codemirror-colorpicker.mini {
1028
+ display: inline-block;
1029
+ width: 180px;
1030
+ }
1031
+ .codemirror-colorpicker.mini .control {
1032
+ padding: 0;
1033
+ }
1034
+ .codemirror-colorpicker.mini .control .hue,
1035
+ .codemirror-colorpicker.mini .control .opacity {
1036
+ margin: 0;
1037
+ padding: 0;
1038
+ }
1039
+ .codemirror-colorpicker.mini .control .hue > .hue-container,
1040
+ .codemirror-colorpicker.mini .control .opacity > .opacity-container {
1041
+ border-radius: 0;
1042
+ height: 20px;
1043
+ overflow: hidden;
1044
+ }
1045
+ .codemirror-colorpicker.mini .control .drag-bar,
1046
+ .codemirror-colorpicker.mini .control .drag-bar2 {
1047
+ background-color: transparent;
1048
+ border: 0;
1049
+ box-shadow: none;
1050
+ box-sizing: border-box;
1051
+ height: 100%;
1052
+ width: 5px;
1053
+ }
1054
+ .codemirror-colorpicker.mini .control .drag-bar2.last:before,
1055
+ .codemirror-colorpicker.mini .control .drag-bar2.lastafter,
1056
+ .codemirror-colorpicker.mini .control .drag-bar.last:before,
1057
+ .codemirror-colorpicker.mini .control .drag-bar.lastafter {
1058
+ left: 1px;
1059
+ }
1060
+ .codemirror-colorpicker.mini .control .drag-bar2.first:after,
1061
+ .codemirror-colorpicker.mini .control .drag-bar2.first:before,
1062
+ .codemirror-colorpicker.mini .control .drag-bar.first:after,
1063
+ .codemirror-colorpicker.mini .control .drag-bar.first:before {
1064
+ left: 3px;
1065
+ }
1066
+ .codemirror-colorpicker.mini .control .drag-bar2:before,
1067
+ .codemirror-colorpicker.mini .control .drag-bar:before {
1068
+ border-left: 4px solid transparent;
1069
+ border-right: 4px solid transparent;
1070
+ border-top: 4px solid #000;
1071
+ content: "";
1072
+ height: 0;
1073
+ left: 2px;
1074
+ position: absolute;
1075
+ top: 0;
1076
+ transform: translateX(-50%);
1077
+ width: 0;
1078
+ }
1079
+ .codemirror-colorpicker.mini .control .drag-bar2:after,
1080
+ .codemirror-colorpicker.mini .control .drag-bar:after {
1081
+ border-bottom: 4px solid #000;
1082
+ border-left: 4px solid transparent;
1083
+ border-right: 4px solid transparent;
1084
+ bottom: 0;
1085
+ content: "";
1086
+ height: 0;
1087
+ left: 2px;
1088
+ position: absolute;
1089
+ transform: translateX(-50%);
1090
+ width: 0;
1091
+ }
1092
+ .codemirror-colorpicker.mini-vertical {
1093
+ display: inline-block;
1094
+ width: 180px;
1095
+ }
1096
+ .codemirror-colorpicker.mini-vertical .color {
1097
+ display: inline-block;
1098
+ height: 160px;
1099
+ vertical-align: middle;
1100
+ width: 140px;
1101
+ }
1102
+ .codemirror-colorpicker.mini-vertical .control {
1103
+ display: inline-block;
1104
+ height: 160px;
1105
+ padding: 0;
1106
+ vertical-align: middle;
1107
+ }
1108
+ .codemirror-colorpicker.mini-vertical .control .hue,
1109
+ .codemirror-colorpicker.mini-vertical .control .opacity {
1110
+ display: inline-block;
1111
+ height: 100%;
1112
+ margin: 0;
1113
+ padding: 0;
1114
+ position: relative;
1115
+ vertical-align: middle;
1116
+ width: 20px;
1117
+ }
1118
+ .codemirror-colorpicker.mini-vertical .control .hue > .hue-container {
1119
+ background: linear-gradient(
1120
+ 0deg,
1121
+ red 0,
1122
+ #ff0 17%,
1123
+ #0f0 33%,
1124
+ #0ff 50%,
1125
+ #00f 67%,
1126
+ #f0f 83%,
1127
+ red
1128
+ );
1129
+ border-radius: 0;
1130
+ height: 100%;
1131
+ overflow: hidden;
1132
+ }
1133
+ .codemirror-colorpicker.mini-vertical .control .opacity > .opacity-container {
1134
+ border-radius: 0;
1135
+ height: 100%;
1136
+ overflow: hidden;
1137
+ width: 20px;
1138
+ }
1139
+ .codemirror-colorpicker.mini-vertical .control .drag-bar,
1140
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2 {
1141
+ background-color: transparent;
1142
+ border: 0;
1143
+ box-shadow: none;
1144
+ box-sizing: border-box;
1145
+ height: 2px;
1146
+ transform: none;
1147
+ width: 100%;
1148
+ }
1149
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2.last:after,
1150
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2.last:before,
1151
+ .codemirror-colorpicker.mini-vertical .control .drag-bar.last:after,
1152
+ .codemirror-colorpicker.mini-vertical .control .drag-bar.last:before {
1153
+ top: 2px;
1154
+ }
1155
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2.first:after,
1156
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2.first:before,
1157
+ .codemirror-colorpicker.mini-vertical .control .drag-bar.first:after,
1158
+ .codemirror-colorpicker.mini-vertical .control .drag-bar.first:before {
1159
+ top: -1px;
1160
+ }
1161
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2:before,
1162
+ .codemirror-colorpicker.mini-vertical .control .drag-bar:before {
1163
+ border-bottom: 4px solid transparent;
1164
+ border-left: 4px solid #000;
1165
+ border-top: 4px solid transparent;
1166
+ content: "";
1167
+ height: 0;
1168
+ left: 0;
1169
+ position: absolute;
1170
+ top: 2px;
1171
+ transform: translateY(-50%);
1172
+ width: 0;
1173
+ }
1174
+ .codemirror-colorpicker.mini-vertical .control .drag-bar2:after,
1175
+ .codemirror-colorpicker.mini-vertical .control .drag-bar:after {
1176
+ border-bottom: 4px solid transparent;
1177
+ border-right: 4px solid #000;
1178
+ border-top: 4px solid transparent;
1179
+ content: "";
1180
+ height: 0;
1181
+ position: absolute;
1182
+ right: 0;
1183
+ top: 2px;
1184
+ transform: translateY(-50%);
1185
+ width: 0;
1186
+ }
1187
+ .codemirror-colorpicker.ring .colorpicker-body > .color {
1188
+ height: 120px;
1189
+ left: 52px;
1190
+ position: absolute;
1191
+ top: 52px;
1192
+ width: 120px;
1193
+ }
1194
+ .codemirror-colorpicker.ring .colorpicker-body .wheel {
1195
+ box-sizing: border-box;
1196
+ height: 224px;
1197
+ position: relative;
1198
+ width: 224px;
1199
+ }
1200
+ .codemirror-colorpicker.ring .colorpicker-body .wheel .wheel-canvas {
1201
+ border-radius: 50%;
1202
+ height: 214px;
1203
+ left: 5px;
1204
+ position: absolute;
1205
+ top: 5px;
1206
+ width: 214px;
1207
+ }
1208
+ .codemirror-colorpicker.ring .colorpicker-body .wheel .drag-pointer {
1209
+ border: 1px solid #fff;
1210
+ border-radius: 50%;
1211
+ display: inline-block;
1212
+ height: 10px;
1213
+ left: 50%;
1214
+ position: absolute;
1215
+ top: 50%;
1216
+ transform: translateX(-50%) translateY(-50%);
1217
+ width: 10px;
1218
+ z-index: 2;
1219
+ }
1220
+ .codemirror-colorpicker.ring .control {
1221
+ padding-top: 0;
1222
+ }
1223
+ .codemirror-colorpicker.ring .control .value {
1224
+ display: none;
1225
+ }
1226
+ .codemirror-colorpicker.ring .control > .color,
1227
+ .codemirror-colorpicker.ring .control > .empty {
1228
+ border-radius: 2px;
1229
+ height: 30px;
1230
+ top: -17px;
1231
+ width: 30px;
1232
+ }
1233
+ .codemirror-colorpicker.xd {
1234
+ display: inline-block;
1235
+ padding-top: 12px;
1236
+ width: 245px;
1237
+ }
1238
+ .codemirror-colorpicker.xd .color {
1239
+ border: 1px solid #cecece;
1240
+ border-radius: 3px;
1241
+ box-sizing: border-box;
1242
+ display: inline-block;
1243
+ height: 170px;
1244
+ margin-bottom: 12px;
1245
+ margin-left: 12px;
1246
+ overflow: hidden;
1247
+ vertical-align: middle;
1248
+ width: 170px;
1249
+ }
1250
+ .codemirror-colorpicker.xd .color > .saturation > .value > .drag-pointer {
1251
+ border: 2px solid #fff;
1252
+ box-shadow: 0 0 1px 0 #000, inset 0 0 1px 0 #000;
1253
+ height: 7px;
1254
+ width: 7px;
1255
+ }
1256
+ .codemirror-colorpicker.xd .control {
1257
+ display: inline-block;
1258
+ height: 170px;
1259
+ margin-bottom: 12px;
1260
+ margin-right: 12px;
1261
+ padding: 0;
1262
+ vertical-align: middle;
1263
+ }
1264
+ .codemirror-colorpicker.xd .control .hue,
1265
+ .codemirror-colorpicker.xd .control .opacity {
1266
+ border-radius: 3px;
1267
+ display: inline-block;
1268
+ height: 100%;
1269
+ margin: 0 0 0 8px;
1270
+ overflow: hidden;
1271
+ padding: 0;
1272
+ position: relative;
1273
+ vertical-align: middle;
1274
+ width: 13px;
1275
+ }
1276
+ .codemirror-colorpicker.xd .control .hue > .hue-container {
1277
+ background: linear-gradient(
1278
+ 0deg,
1279
+ red 0,
1280
+ #ff0 17%,
1281
+ #0f0 33%,
1282
+ #0ff 50%,
1283
+ #00f 67%,
1284
+ #f0f 83%,
1285
+ red
1286
+ );
1287
+ border-radius: 0;
1288
+ height: 100%;
1289
+ overflow: hidden;
1290
+ }
1291
+ .codemirror-colorpicker.xd .control .opacity > .opacity-container {
1292
+ border-radius: 0;
1293
+ height: 100%;
1294
+ overflow: hidden;
1295
+ }
1296
+ .codemirror-colorpicker.xd .control .drag-bar,
1297
+ .codemirror-colorpicker.xd .control .drag-bar2 {
1298
+ background-color: transparent;
1299
+ border: 2px solid #fff;
1300
+ box-shadow: 0 0 1px 0 #000, inset 0 0 1px 0 #000;
1301
+ box-sizing: border-box;
1302
+ height: 10px;
1303
+ left: 50%;
1304
+ overflow: hidden;
1305
+ transform: none;
1306
+ transform: translateX(-50%) translateY(-50%);
1307
+ width: 10px;
1308
+ }
1309
+ .codemirror-colorpicker.xd .information {
1310
+ margin-top: 5px;
1311
+ }
1312
+ .codemirror-colorpicker.vscode {
1313
+ background-color: #333;
1314
+ border: 1px solid #ececec;
1315
+ box-sizing: border-box;
1316
+ width: 336px;
1317
+ }
1318
+ .codemirror-colorpicker.vscode,
1319
+ .codemirror-colorpicker.vscode .colorpicker-body {
1320
+ border-radius: 0;
1321
+ display: inline-block;
1322
+ }
1323
+ .codemirror-colorpicker.vscode .colorpicker-body .color-view {
1324
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC")
1325
+ repeat;
1326
+ height: 34px;
1327
+ }
1328
+ .codemirror-colorpicker.vscode
1329
+ .colorpicker-body
1330
+ .color-view
1331
+ .color-view-container {
1332
+ cursor: pointer;
1333
+ font-size: 14px;
1334
+ height: 100%;
1335
+ line-height: 34px;
1336
+ text-align: center;
1337
+ text-shadow: 0 0 3px #535353;
1338
+ -webkit-user-select: none;
1339
+ -moz-user-select: none;
1340
+ -ms-user-select: none;
1341
+ user-select: none;
1342
+ width: 100%;
1343
+ }
1344
+ .codemirror-colorpicker.vscode .colorpicker-body .color-tool {
1345
+ padding: 8px;
1346
+ }
1347
+ .codemirror-colorpicker.vscode .color {
1348
+ display: inline-block;
1349
+ height: 160px;
1350
+ vertical-align: middle;
1351
+ width: 240px;
1352
+ }
1353
+ .codemirror-colorpicker.vscode .control {
1354
+ display: inline-block;
1355
+ height: 160px;
1356
+ padding: 0 0 0 4px;
1357
+ vertical-align: middle;
1358
+ }
1359
+ .codemirror-colorpicker.vscode .control .hue,
1360
+ .codemirror-colorpicker.vscode .control .opacity {
1361
+ display: inline-block;
1362
+ height: 100%;
1363
+ margin: 0;
1364
+ padding: 0;
1365
+ position: relative;
1366
+ vertical-align: middle;
1367
+ width: 30px;
1368
+ }
1369
+ .codemirror-colorpicker.vscode .control .hue {
1370
+ padding-left: 5px;
1371
+ width: 35px;
1372
+ }
1373
+ .codemirror-colorpicker.vscode .control .hue > .hue-container {
1374
+ background: linear-gradient(
1375
+ 0deg,
1376
+ red 0,
1377
+ #ff0 17%,
1378
+ #0f0 33%,
1379
+ #0ff 50%,
1380
+ #00f 67%,
1381
+ #f0f 83%,
1382
+ red
1383
+ );
1384
+ border-radius: 0;
1385
+ height: 100%;
1386
+ }
1387
+ .codemirror-colorpicker.vscode .control .opacity > .opacity-container {
1388
+ border-radius: 0;
1389
+ height: 100%;
1390
+ width: 30px;
1391
+ }
1392
+ .codemirror-colorpicker.vscode .control .drag-bar,
1393
+ .codemirror-colorpicker.vscode .control .drag-bar2 {
1394
+ background-color: transparent;
1395
+ border: 1px solid #fff;
1396
+ border-radius: 0;
1397
+ box-shadow: none;
1398
+ box-shadow: 0 0 2px 0 #000, inset 0 0 0 0 #000;
1399
+ box-sizing: border-box;
1400
+ height: 5px;
1401
+ transform: translateY(-50%) translateX(-2px);
1402
+ width: 33px;
1403
+ }
1404
+ .colorsets-contextmenu {
1405
+ background-color: #ececec;
1406
+ border: 1px solid #ccc;
1407
+ border-radius: 6px;
1408
+ display: none;
1409
+ font-size: 13px;
1410
+ list-style: none;
1411
+ padding: 4px 0;
1412
+ position: fixed;
1413
+ }
1414
+ .colorsets-contextmenu.show {
1415
+ display: inline-block;
1416
+ }
1417
+ .colorsets-contextmenu .menu-item {
1418
+ cursor: default;
1419
+ padding: 2px 20px;
1420
+ }
1421
+ .colorsets-contextmenu .menu-item:hover {
1422
+ background-color: #5ea3fb;
1423
+ color: #fff;
1424
+ }
1425
+ .colorsets-contextmenu.small .menu-item.small-hide {
1426
+ display: none;
1427
+ }
1428
+ .CodeMirror {
1429
+ color: #000;
1430
+ direction: ltr;
1431
+ font-family: monospace;
1432
+ height: 300px;
1433
+ }
1434
+ .CodeMirror-lines {
1435
+ padding: 4px 0;
1436
+ }
1437
+ .CodeMirror pre.CodeMirror-line,
1438
+ .CodeMirror pre.CodeMirror-line-like {
1439
+ padding: 0 4px;
1440
+ }
1441
+ .CodeMirror-gutter-filler,
1442
+ .CodeMirror-scrollbar-filler {
1443
+ background-color: #fff;
1444
+ }
1445
+ .CodeMirror-gutters {
1446
+ background-color: #f7f7f7;
1447
+ border-right: 1px solid #ddd;
1448
+ white-space: nowrap;
1449
+ }
1450
+ .CodeMirror-linenumber {
1451
+ color: #999;
1452
+ min-width: 20px;
1453
+ padding: 0 3px 0 5px;
1454
+ text-align: right;
1455
+ white-space: nowrap;
1456
+ }
1457
+ .CodeMirror-guttermarker {
1458
+ color: #000;
1459
+ }
1460
+ .CodeMirror-guttermarker-subtle {
1461
+ color: #999;
1462
+ }
1463
+ .CodeMirror-cursor {
1464
+ border-left: 1px solid #000;
1465
+ border-right: none;
1466
+ width: 0;
1467
+ }
1468
+ .CodeMirror div.CodeMirror-secondarycursor {
1469
+ border-left: 1px solid silver;
1470
+ }
1471
+ .cm-fat-cursor .CodeMirror-cursor {
1472
+ background: #7e7;
1473
+ border: 0 !important;
1474
+ width: auto;
1475
+ }
1476
+ .cm-fat-cursor div.CodeMirror-cursors {
1477
+ z-index: 1;
1478
+ }
1479
+ .cm-fat-cursor-mark {
1480
+ background-color: rgba(20, 255, 20, 0.5);
1481
+ }
1482
+ .cm-animate-fat-cursor,
1483
+ .cm-fat-cursor-mark {
1484
+ -webkit-animation: blink 1.06s steps(1) infinite;
1485
+ animation: blink 1.06s steps(1) infinite;
1486
+ }
1487
+ .cm-animate-fat-cursor {
1488
+ background-color: #7e7;
1489
+ width: auto;
1490
+ }
1491
+ @-webkit-keyframes blink {
1492
+ 50% {
1493
+ background-color: transparent;
1494
+ }
1495
+ }
1496
+ @keyframes blink {
1497
+ 50% {
1498
+ background-color: transparent;
1499
+ }
1500
+ }
1501
+ .cm-tab {
1502
+ display: inline-block;
1503
+ text-decoration: inherit;
1504
+ }
1505
+ .CodeMirror-rulers {
1506
+ bottom: 0;
1507
+ left: 0;
1508
+ overflow: hidden;
1509
+ position: absolute;
1510
+ right: 0;
1511
+ top: -50px;
1512
+ }
1513
+ .CodeMirror-ruler {
1514
+ border-left: 1px solid #ccc;
1515
+ bottom: 0;
1516
+ position: absolute;
1517
+ top: 0;
1518
+ }
1519
+ .cm-s-default .cm-header {
1520
+ color: blue;
1521
+ }
1522
+ .cm-s-default .cm-quote {
1523
+ color: #090;
1524
+ }
1525
+ .cm-negative {
1526
+ color: #d44;
1527
+ }
1528
+ .cm-positive {
1529
+ color: #292;
1530
+ }
1531
+ .cm-header,
1532
+ .cm-strong {
1533
+ font-weight: 700;
1534
+ }
1535
+ .cm-em {
1536
+ font-style: italic;
1537
+ }
1538
+ .cm-link {
1539
+ text-decoration: underline;
1540
+ }
1541
+ .cm-strikethrough {
1542
+ text-decoration: line-through;
1543
+ }
1544
+ .cm-s-default .cm-keyword {
1545
+ color: #708;
1546
+ }
1547
+ .cm-s-default .cm-atom {
1548
+ color: #219;
1549
+ }
1550
+ .cm-s-default .cm-number {
1551
+ color: #164;
1552
+ }
1553
+ .cm-s-default .cm-def {
1554
+ color: #00f;
1555
+ }
1556
+ .cm-s-default .cm-variable-2 {
1557
+ color: #05a;
1558
+ }
1559
+ .cm-s-default .cm-type,
1560
+ .cm-s-default .cm-variable-3 {
1561
+ color: #085;
1562
+ }
1563
+ .cm-s-default .cm-comment {
1564
+ color: #a50;
1565
+ }
1566
+ .cm-s-default .cm-string {
1567
+ color: #a11;
1568
+ }
1569
+ .cm-s-default .cm-string-2 {
1570
+ color: #f50;
1571
+ }
1572
+ .cm-s-default .cm-meta,
1573
+ .cm-s-default .cm-qualifier {
1574
+ color: #555;
1575
+ }
1576
+ .cm-s-default .cm-builtin {
1577
+ color: #30a;
1578
+ }
1579
+ .cm-s-default .cm-bracket {
1580
+ color: #997;
1581
+ }
1582
+ .cm-s-default .cm-tag {
1583
+ color: #170;
1584
+ }
1585
+ .cm-s-default .cm-attribute {
1586
+ color: #00c;
1587
+ }
1588
+ .cm-s-default .cm-hr {
1589
+ color: #999;
1590
+ }
1591
+ .cm-s-default .cm-link {
1592
+ color: #00c;
1593
+ }
1594
+ .cm-invalidchar,
1595
+ .cm-s-default .cm-error {
1596
+ color: red;
1597
+ }
1598
+ .CodeMirror-composing {
1599
+ border-bottom: 2px solid;
1600
+ }
1601
+ div.CodeMirror span.CodeMirror-matchingbracket {
1602
+ color: #0b0;
1603
+ }
1604
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {
1605
+ color: #a22;
1606
+ }
1607
+ .CodeMirror-matchingtag {
1608
+ background: rgba(255, 150, 0, 0.3);
1609
+ }
1610
+ .CodeMirror-activeline-background {
1611
+ background: #e8f2ff;
1612
+ }
1613
+ .CodeMirror {
1614
+ background: #fff;
1615
+ overflow: hidden;
1616
+ position: relative;
1617
+ }
1618
+ .CodeMirror-scroll {
1619
+ height: 100%;
1620
+ margin-bottom: -50px;
1621
+ margin-right: -50px;
1622
+ outline: none;
1623
+ overflow: scroll !important;
1624
+ padding-bottom: 50px;
1625
+ position: relative;
1626
+ }
1627
+ .CodeMirror-sizer {
1628
+ border-right: 50px solid transparent;
1629
+ position: relative;
1630
+ }
1631
+ .CodeMirror-gutter-filler,
1632
+ .CodeMirror-hscrollbar,
1633
+ .CodeMirror-scrollbar-filler,
1634
+ .CodeMirror-vscrollbar {
1635
+ display: none;
1636
+ outline: none;
1637
+ position: absolute;
1638
+ z-index: 6;
1639
+ }
1640
+ .CodeMirror-vscrollbar {
1641
+ overflow-x: hidden;
1642
+ overflow-y: scroll;
1643
+ right: 0;
1644
+ top: 0;
1645
+ }
1646
+ .CodeMirror-hscrollbar {
1647
+ bottom: 0;
1648
+ left: 0;
1649
+ overflow-x: scroll;
1650
+ overflow-y: hidden;
1651
+ }
1652
+ .CodeMirror-scrollbar-filler {
1653
+ bottom: 0;
1654
+ right: 0;
1655
+ }
1656
+ .CodeMirror-gutter-filler {
1657
+ bottom: 0;
1658
+ left: 0;
1659
+ }
1660
+ .CodeMirror-gutters {
1661
+ left: 0;
1662
+ min-height: 100%;
1663
+ position: absolute;
1664
+ top: 0;
1665
+ z-index: 3;
1666
+ }
1667
+ .CodeMirror-gutter {
1668
+ display: inline-block;
1669
+ height: 100%;
1670
+ margin-bottom: -50px;
1671
+ vertical-align: top;
1672
+ white-space: normal;
1673
+ }
1674
+ .CodeMirror-gutter-wrapper {
1675
+ background: none !important;
1676
+ border: none !important;
1677
+ position: absolute;
1678
+ z-index: 4;
1679
+ }
1680
+ .CodeMirror-gutter-background {
1681
+ bottom: 0;
1682
+ position: absolute;
1683
+ top: 0;
1684
+ z-index: 4;
1685
+ }
1686
+ .CodeMirror-gutter-elt {
1687
+ cursor: default;
1688
+ position: absolute;
1689
+ z-index: 4;
1690
+ }
1691
+ .CodeMirror-gutter-wrapper ::selection {
1692
+ background-color: transparent;
1693
+ }
1694
+ .CodeMirror-gutter-wrapper ::-moz-selection {
1695
+ background-color: transparent;
1696
+ }
1697
+ .CodeMirror-lines {
1698
+ cursor: text;
1699
+ min-height: 1px;
1700
+ }
1701
+ .CodeMirror pre.CodeMirror-line,
1702
+ .CodeMirror pre.CodeMirror-line-like {
1703
+ word-wrap: normal;
1704
+ -webkit-tap-highlight-color: transparent;
1705
+ font-feature-settings: "calt";
1706
+ background: transparent;
1707
+ border-radius: 0;
1708
+ border-width: 0;
1709
+ color: inherit;
1710
+ font-family: inherit;
1711
+ font-size: inherit;
1712
+ -webkit-font-variant-ligatures: contextual;
1713
+ font-variant-ligatures: contextual;
1714
+ line-height: inherit;
1715
+ margin: 0;
1716
+ overflow: visible;
1717
+ position: relative;
1718
+ white-space: pre;
1719
+ z-index: 2;
1720
+ }
1721
+ .CodeMirror-wrap pre.CodeMirror-line,
1722
+ .CodeMirror-wrap pre.CodeMirror-line-like {
1723
+ word-wrap: break-word;
1724
+ white-space: pre-wrap;
1725
+ word-break: normal;
1726
+ }
1727
+ .CodeMirror-linebackground {
1728
+ bottom: 0;
1729
+ left: 0;
1730
+ position: absolute;
1731
+ right: 0;
1732
+ top: 0;
1733
+ z-index: 0;
1734
+ }
1735
+ .CodeMirror-linewidget {
1736
+ padding: 0.1px;
1737
+ position: relative;
1738
+ z-index: 2;
1739
+ }
1740
+ .CodeMirror-rtl pre {
1741
+ direction: rtl;
1742
+ }
1743
+ .CodeMirror-gutter,
1744
+ .CodeMirror-gutters,
1745
+ .CodeMirror-linenumber,
1746
+ .CodeMirror-scroll,
1747
+ .CodeMirror-sizer {
1748
+ box-sizing: content-box;
1749
+ }
1750
+ .CodeMirror-measure {
1751
+ height: 0;
1752
+ overflow: hidden;
1753
+ position: absolute;
1754
+ visibility: hidden;
1755
+ width: 100%;
1756
+ }
1757
+ .CodeMirror-cursor {
1758
+ pointer-events: none;
1759
+ position: absolute;
1760
+ }
1761
+ .CodeMirror-measure pre {
1762
+ position: static;
1763
+ }
1764
+ div.CodeMirror-cursors {
1765
+ position: relative;
1766
+ visibility: hidden;
1767
+ z-index: 3;
1768
+ }
1769
+ .CodeMirror-focused div.CodeMirror-cursors,
1770
+ div.CodeMirror-dragcursors {
1771
+ visibility: visible;
1772
+ }
1773
+ .CodeMirror-selected {
1774
+ background: #d9d9d9;
1775
+ }
1776
+ .CodeMirror-focused .CodeMirror-selected {
1777
+ background: #d7d4f0;
1778
+ }
1779
+ .CodeMirror-crosshair {
1780
+ cursor: crosshair;
1781
+ }
1782
+ .CodeMirror-line::selection,
1783
+ .CodeMirror-line > span::selection,
1784
+ .CodeMirror-line > span > span::selection {
1785
+ background: #d7d4f0;
1786
+ }
1787
+ .CodeMirror-line::-moz-selection,
1788
+ .CodeMirror-line > span::-moz-selection,
1789
+ .CodeMirror-line > span > span::-moz-selection {
1790
+ background: #d7d4f0;
1791
+ }
1792
+ .cm-searching {
1793
+ background-color: #ffa;
1794
+ background-color: rgba(255, 255, 0, 0.4);
1795
+ }
1796
+ .cm-force-border {
1797
+ padding-right: 0.1px;
1798
+ }
1799
+ @media print {
1800
+ .CodeMirror div.CodeMirror-cursors {
1801
+ visibility: hidden;
1802
+ }
1803
+ }
1804
+ .cm-tab-wrap-hack:after {
1805
+ content: "";
1806
+ }
1807
+ span.CodeMirror-selectedtext {
1808
+ background: none;
1809
+ }
1810
+ .CodeMirror-dialog {
1811
+ background: inherit;
1812
+ color: inherit;
1813
+ left: 0;
1814
+ overflow: hidden;
1815
+ padding: 0.1em 0.8em;
1816
+ position: absolute;
1817
+ right: 0;
1818
+ z-index: 15;
1819
+ }
1820
+ .CodeMirror-dialog-top {
1821
+ border-bottom: 1px solid #eee;
1822
+ top: 0;
1823
+ }
1824
+ .CodeMirror-dialog-bottom {
1825
+ border-top: 1px solid #eee;
1826
+ bottom: 0;
1827
+ }
1828
+ .CodeMirror-dialog input {
1829
+ background: transparent;
1830
+ border: none;
1831
+ color: inherit;
1832
+ font-family: monospace;
1833
+ outline: none;
1834
+ width: 20em;
1835
+ }
1836
+ .CodeMirror-dialog button {
1837
+ font-size: 70%;
1838
+ }
1839
+ .CodeMirror-lint-markers {
1840
+ width: 16px;
1841
+ }
1842
+ .CodeMirror-lint-tooltip {
1843
+ background-color: #ffd;
1844
+ border: 1px solid #000;
1845
+ border-radius: 4px 4px 4px 4px;
1846
+ color: #000;
1847
+ font-family: monospace;
1848
+ font-size: 10pt;
1849
+ max-width: 600px;
1850
+ opacity: 0;
1851
+ overflow: hidden;
1852
+ padding: 2px 5px;
1853
+ position: fixed;
1854
+ transition: opacity 0.4s;
1855
+ -moz-transition: opacity 0.4s;
1856
+ -webkit-transition: opacity 0.4s;
1857
+ -o-transition: opacity 0.4s;
1858
+ -ms-transition: opacity 0.4s;
1859
+ white-space: pre;
1860
+ white-space: pre-wrap;
1861
+ z-index: 100;
1862
+ }
1863
+ .CodeMirror-lint-mark {
1864
+ background-position: 0 100%;
1865
+ background-repeat: repeat-x;
1866
+ }
1867
+ .CodeMirror-lint-mark-warning {
1868
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
1869
+ }
1870
+ .CodeMirror-lint-mark-error {
1871
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
1872
+ }
1873
+ .CodeMirror-lint-marker {
1874
+ background-position: 50%;
1875
+ background-repeat: no-repeat;
1876
+ cursor: pointer;
1877
+ display: inline-block;
1878
+ height: 16px;
1879
+ position: relative;
1880
+ vertical-align: middle;
1881
+ width: 16px;
1882
+ }
1883
+ .CodeMirror-lint-message {
1884
+ background-position: 0 0;
1885
+ background-repeat: no-repeat;
1886
+ padding-left: 18px;
1887
+ }
1888
+ .CodeMirror-lint-marker-warning,
1889
+ .CodeMirror-lint-message-warning {
1890
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
1891
+ }
1892
+ .CodeMirror-lint-marker-error,
1893
+ .CodeMirror-lint-message-error {
1894
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
1895
+ }
1896
+ .CodeMirror-lint-marker-multiple {
1897
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
1898
+ background-position: 100% 100%;
1899
+ background-repeat: no-repeat;
1900
+ height: 100%;
1901
+ width: 100%;
1902
+ }
1903
+ .CodeMirror-lint-line-error {
1904
+ background-color: rgba(183, 76, 81, 0.08);
1905
+ }
1906
+ .CodeMirror-lint-line-warning {
1907
+ background-color: rgba(255, 211, 0, 0.1);
1908
+ }
1909
+ .CodeMirror {
1910
+ background-color: #fff;
1911
+ border: 1px solid #dfdfdf;
1912
+ border-radius: 3px;
1913
+ height: auto !important;
1914
+ }
1915
+ .CodeMirror-code {
1916
+ outline: none;
1917
+ }
1918
+ .CodeMirror-focused .cm-matchhighlight {
1919
+ color: #fff !important;
1920
+ outline: 1px solid green;
1921
+ }
1922
+ .cm-s-rubyblue .CodeMirror-cursor {
1923
+ border-left: 1px solid #fff !important;
1924
+ }
1925
+ .CodeMirror-lint-marker-multiple,
1926
+ [class*="CodeMirror-lint-marker"],
1927
+ [class*="CodeMirror-lint-message"] {
1928
+ background-image: none;
1929
+ }
1930
+ .CodeMirror-lint-marker-error,
1931
+ .CodeMirror-lint-marker-warning {
1932
+ cursor: help;
1933
+ }
1934
+ .CodeMirror-lint-marker-multiple {
1935
+ position: absolute;
1936
+ top: 0;
1937
+ }
1938
+ [class*="CodeMirror-lint-marker"]:before {
1939
+ font: normal 18px/1 dashicons;
1940
+ position: relative;
1941
+ top: -2px;
1942
+ }
1943
+ [class*="CodeMirror-lint-message"]:before {
1944
+ font: normal 16px/1 dashicons;
1945
+ left: 16px;
1946
+ position: absolute;
1947
+ }
1948
+ .CodeMirror-lint-message-error,
1949
+ .CodeMirror-lint-message-warning {
1950
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
1951
+ margin: 5px 0 2px;
1952
+ padding: 3px 12px 3px 28px;
1953
+ }
1954
+ .CodeMirror-lint-message-warning {
1955
+ background-color: #fff8e5;
1956
+ border-left: 4px solid #ffb900;
1957
+ }
1958
+ .CodeMirror-lint-marker-warning:before,
1959
+ .CodeMirror-lint-message-warning:before {
1960
+ color: #f6a306;
1961
+ content: "\f534";
1962
+ }
1963
+ .CodeMirror-lint-message-error {
1964
+ background-color: #fbeaea;
1965
+ border-left: 4px solid #dc3232;
1966
+ }
1967
+ .CodeMirror-lint-marker-error:before,
1968
+ .CodeMirror-lint-message-error:before {
1969
+ color: #dc3232;
1970
+ content: "\f153";
1971
+ }
1972
+ .CodeMirror-lint-tooltip {
1973
+ background: none;
1974
+ border: none;
1975
+ border-radius: 0;
1976
+ direction: ltr;
1977
+ }
1978
+ .CodeMirror .CodeMirror-matchingbracket {
1979
+ background: rgba(255, 150, 0, 0.3);
1980
+ color: inherit;
1981
+ }
1982
+ .CodeMirror .CodeMirror-linenumber {
1983
+ color: #666;
1984
+ }
assets/editor.js ADDED
@@ -0,0 +1,33757 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !(function t(e, n, i) {
2
+ function r(s, a) {
3
+ if (!n[s]) {
4
+ if (!e[s]) {
5
+ var l = "function" == typeof require && require;
6
+ if (!a && l) return l(s, !0);
7
+ if (o) return o(s, !0);
8
+ var c = new Error("Cannot find module '" + s + "'");
9
+ throw ((c.code = "MODULE_NOT_FOUND"), c);
10
+ }
11
+ var h = (n[s] = { exports: {} });
12
+ e[s][0].call(
13
+ h.exports,
14
+ function (t) {
15
+ return r(e[s][1][t] || t);
16
+ },
17
+ h,
18
+ h.exports,
19
+ t,
20
+ e,
21
+ n,
22
+ i
23
+ );
24
+ }
25
+ return n[s].exports;
26
+ }
27
+ for (
28
+ var o = "function" == typeof require && require, s = 0;
29
+ s < i.length;
30
+ s++
31
+ )
32
+ r(i[s]);
33
+ return r;
34
+ })(
35
+ {
36
+ 1: [
37
+ function (t, e, n) {
38
+ "use strict";
39
+ var i,
40
+ r =
41
+ (i = t("codemirror/lib/codemirror")) && i.__esModule
42
+ ? i
43
+ : { default: i };
44
+ t("codemirror/mode/php/php"),
45
+ t("codemirror/addon/edit/matchbrackets"),
46
+ t("codemirror/addon/edit/closebrackets"),
47
+ t("codemirror/addon/search/search"),
48
+ t("codemirror/addon/search/match-highlighter"),
49
+ t(
50
+ "../node_modules/codemirror-colorpicker/dist/codemirror-colorpicker"
51
+ ),
52
+ t("./php-lint"),
53
+ (window.Code_Snippets_CodeMirror = r.default),
54
+ r.default.defineMode("php-snippet", function (t) {
55
+ return r.default.getMode(t, {
56
+ name: "application/x-httpd-php",
57
+ startOpen: !0,
58
+ });
59
+ });
60
+ },
61
+ {
62
+ "../node_modules/codemirror-colorpicker/dist/codemirror-colorpicker": 3,
63
+ "./php-lint": 2,
64
+ "codemirror/addon/edit/closebrackets": 5,
65
+ "codemirror/addon/edit/matchbrackets": 6,
66
+ "codemirror/addon/search/match-highlighter": 9,
67
+ "codemirror/addon/search/search": 11,
68
+ "codemirror/lib/codemirror": 13,
69
+ "codemirror/mode/php/php": 18,
70
+ },
71
+ ],
72
+ 2: [
73
+ function (t, e, n) {
74
+ "use strict";
75
+ var i = o(t("php-parser/src/index")),
76
+ r = o(t("codemirror/lib/codemirror"));
77
+ function o(t) {
78
+ return t && t.__esModule ? t : { default: t };
79
+ }
80
+ function s(t, e) {
81
+ var n =
82
+ ("undefined" != typeof Symbol && t[Symbol.iterator]) ||
83
+ t["@@iterator"];
84
+ if (!n) {
85
+ if (
86
+ Array.isArray(t) ||
87
+ (n = (function (t, e) {
88
+ if (!t) return;
89
+ if ("string" == typeof t) return a(t, e);
90
+ var n = Object.prototype.toString.call(t).slice(8, -1);
91
+ "Object" === n && t.constructor && (n = t.constructor.name);
92
+ if ("Map" === n || "Set" === n) return Array.from(t);
93
+ if (
94
+ "Arguments" === n ||
95
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
96
+ )
97
+ return a(t, e);
98
+ })(t)) ||
99
+ (e && t && "number" == typeof t.length)
100
+ ) {
101
+ n && (t = n);
102
+ var i = 0,
103
+ r = function () {};
104
+ return {
105
+ s: r,
106
+ n: function () {
107
+ return i >= t.length
108
+ ? { done: !0 }
109
+ : { done: !1, value: t[i++] };
110
+ },
111
+ e: function (t) {
112
+ throw t;
113
+ },
114
+ f: r,
115
+ };
116
+ }
117
+ throw new TypeError(
118
+ "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
119
+ );
120
+ }
121
+ var o,
122
+ s = !0,
123
+ l = !1;
124
+ return {
125
+ s: function () {
126
+ n = n.call(t);
127
+ },
128
+ n: function () {
129
+ var t = n.next();
130
+ return (s = t.done), t;
131
+ },
132
+ e: function (t) {
133
+ (l = !0), (o = t);
134
+ },
135
+ f: function () {
136
+ try {
137
+ s || null == n.return || n.return();
138
+ } finally {
139
+ if (l) throw o;
140
+ }
141
+ },
142
+ };
143
+ }
144
+ function a(t, e) {
145
+ (null == e || e > t.length) && (e = t.length);
146
+ for (var n = 0, i = new Array(e); n < e; n++) i[n] = t[n];
147
+ return i;
148
+ }
149
+ function l(t, e) {
150
+ for (var n = 0; n < e.length; n++) {
151
+ var i = e[n];
152
+ (i.enumerable = i.enumerable || !1),
153
+ (i.configurable = !0),
154
+ "value" in i && (i.writable = !0),
155
+ Object.defineProperty(t, i.key, i);
156
+ }
157
+ }
158
+ t("codemirror/addon/lint/lint");
159
+ var c = (function () {
160
+ function t(e) {
161
+ !(function (t, e) {
162
+ if (!(t instanceof e))
163
+ throw new TypeError("Cannot call a class as a function");
164
+ })(this, t),
165
+ (this.code = e),
166
+ (this.annotations = []),
167
+ (this.function_names = new Set()),
168
+ (this.class_names = new Set());
169
+ }
170
+ var e, n, o;
171
+ return (
172
+ (e = t),
173
+ (n = [
174
+ {
175
+ key: "lint",
176
+ value: function () {
177
+ var t = new i.default({
178
+ parser: { suppressErrors: !0, version: 800 },
179
+ ast: { withPositions: !0 },
180
+ });
181
+ try {
182
+ var e = t.parseEval(this.code);
183
+ if (e.errors && e.errors.length > 0)
184
+ for (var n = 0; n < e.errors.length; n++)
185
+ this.annotate(e.errors[n].message, e.errors[n].loc);
186
+ this.visit(e);
187
+ } catch (t) {
188
+ this.annotate(t.message, t);
189
+ }
190
+ },
191
+ },
192
+ {
193
+ key: "visit",
194
+ value: function (t) {
195
+ if (
196
+ (t.hasOwnProperty("kind") && this.validate(t),
197
+ t.hasOwnProperty("children"))
198
+ ) {
199
+ var e,
200
+ n = s(t.children);
201
+ try {
202
+ for (n.s(); !(e = n.n()).done; ) {
203
+ var i = e.value;
204
+ this.visit(i);
205
+ }
206
+ } catch (t) {
207
+ n.e(t);
208
+ } finally {
209
+ n.f();
210
+ }
211
+ }
212
+ },
213
+ },
214
+ {
215
+ key: "validate",
216
+ value: function (t) {
217
+ ("function" !== t.kind && "class" !== t.kind) ||
218
+ !t.hasOwnProperty("name") ||
219
+ "identifier" !== t.name.kind ||
220
+ ("function" === t.kind
221
+ ? this.function_names.has(t.name.name)
222
+ ? this.annotate(
223
+ "Cannot redeclare function ".concat(
224
+ t.name.name,
225
+ "()"
226
+ ),
227
+ t.name.loc
228
+ )
229
+ : this.function_names.add(t.name.name)
230
+ : "class" === t.kind &&
231
+ (this.class_names.has(t.name.name)
232
+ ? this.annotate(
233
+ "Cannot redeclare class ".concat(t.name.name),
234
+ t.name.loc
235
+ )
236
+ : this.class_names.add(t.name.name)));
237
+ },
238
+ },
239
+ {
240
+ key: "annotate",
241
+ value: function (t, e, n) {
242
+ var i, o;
243
+ e.lineNumber && e.columnNumber
244
+ ? ((i = r.default.Pos(
245
+ e.lineNumber - 1,
246
+ e.columnNumber - 1
247
+ )),
248
+ (o = r.default.Pos(e.lineNumber - 1, e.columnNumber)))
249
+ : e.start &&
250
+ e.end &&
251
+ (e.end.offset < e.start.offset
252
+ ? ((o = r.default.Pos(
253
+ e.start.line - 1,
254
+ e.start.column
255
+ )),
256
+ (i = r.default.Pos(e.end.line - 1, e.end.column)))
257
+ : ((i = r.default.Pos(
258
+ e.start.line - 1,
259
+ e.start.column
260
+ )),
261
+ (o = r.default.Pos(e.end.line - 1, e.end.column)))),
262
+ i &&
263
+ o &&
264
+ ((n = n || "error"),
265
+ this.annotations.push({
266
+ message: t,
267
+ severity: n,
268
+ from: i,
269
+ to: o,
270
+ }));
271
+ },
272
+ },
273
+ ]) && l(e.prototype, n),
274
+ o && l(e, o),
275
+ t
276
+ );
277
+ })();
278
+ r.default.registerHelper("lint", "php", function (t, e) {
279
+ var n = new c(t);
280
+ return n.lint(), n.annotations;
281
+ });
282
+ },
283
+ {
284
+ "codemirror/addon/lint/lint": 7,
285
+ "codemirror/lib/codemirror": 13,
286
+ "php-parser/src/index": 132,
287
+ },
288
+ ],
289
+ 3: [
290
+ function (t, e, n) {
291
+ var i, r;
292
+ (i = this),
293
+ (r = function () {
294
+ "use strict";
295
+ function e(t, e) {
296
+ var o =
297
+ arguments.length > 2 && void 0 !== arguments[2]
298
+ ? arguments[2]
299
+ : "rgba(0, 0, 0, 0)";
300
+ return (
301
+ Array.isArray(t) &&
302
+ (t = { r: t[0], g: t[1], b: t[2], a: t[3] }),
303
+ "hex" == e ? n(t) : "rgb" == e ? i(t, o) : "hsl" == e ? r(t) : t
304
+ );
305
+ }
306
+ function n(t) {
307
+ Array.isArray(t) && (t = { r: t[0], g: t[1], b: t[2], a: t[3] });
308
+ var e = t.r.toString(16);
309
+ t.r < 16 && (e = "0" + e);
310
+ var n = t.g.toString(16);
311
+ t.g < 16 && (n = "0" + n);
312
+ var i = t.b.toString(16);
313
+ t.b < 16 && (i = "0" + i);
314
+ var r = "";
315
+ if (t.a < 1) {
316
+ var o = Math.floor(255 * t.a);
317
+ (r = o.toString(16)), o < 16 && (r = "0" + r);
318
+ }
319
+ return "#" + e + n + i + r;
320
+ }
321
+ function i(t) {
322
+ var e =
323
+ arguments.length > 1 && void 0 !== arguments[1]
324
+ ? arguments[1]
325
+ : "rgba(0, 0, 0, 0)";
326
+ if (
327
+ (Array.isArray(t) &&
328
+ (t = { r: t[0], g: t[1], b: t[2], a: t[3] }),
329
+ void 0 !== t)
330
+ )
331
+ return 1 == t.a || void 0 === t.a
332
+ ? isNaN(t.r)
333
+ ? e
334
+ : "rgb(" + t.r + "," + t.g + "," + t.b + ")"
335
+ : "rgba(" + t.r + "," + t.g + "," + t.b + "," + t.a + ")";
336
+ }
337
+ function r(t) {
338
+ return (
339
+ Array.isArray(t) &&
340
+ (t = { r: t[0], g: t[1], b: t[2], a: t[3] }),
341
+ 1 == t.a || void 0 === t.a
342
+ ? "hsl(" + t.h + "," + t.s + "%," + t.l + "%)"
343
+ : "hsla(" + t.h + "," + t.s + "%," + t.l + "%," + t.a + ")"
344
+ );
345
+ }
346
+ var o = { format: e, rgb: i, hsl: r, hex: n };
347
+ function s(t, e) {
348
+ return (e = void 0 === e ? 1 : e), Math.round(t * e) / e;
349
+ }
350
+ function a(t) {
351
+ return (t * Math.PI) / 180;
352
+ }
353
+ function l(t) {
354
+ var e = (180 * t) / Math.PI;
355
+ return e < 0 && (e = 360 + e), e;
356
+ }
357
+ function c(t, e) {
358
+ var n =
359
+ arguments.length > 2 && void 0 !== arguments[2]
360
+ ? arguments[2]
361
+ : 0;
362
+ return n + e * Math.cos(a(t));
363
+ }
364
+ function h(t, e) {
365
+ var n =
366
+ arguments.length > 2 && void 0 !== arguments[2]
367
+ ? arguments[2]
368
+ : 0;
369
+ return n + e * Math.sin(a(t));
370
+ }
371
+ function u(t, e) {
372
+ return l(Math.atan2(e, t));
373
+ }
374
+ var f = {
375
+ round: s,
376
+ radianToDegree: l,
377
+ degreeToRadian: a,
378
+ getXInCircle: c,
379
+ getYInCircle: h,
380
+ caculateAngle: u,
381
+ },
382
+ d = {
383
+ aliceblue: "rgb(240, 248, 255)",
384
+ antiquewhite: "rgb(250, 235, 215)",
385
+ aqua: "rgb(0, 255, 255)",
386
+ aquamarine: "rgb(127, 255, 212)",
387
+ azure: "rgb(240, 255, 255)",
388
+ beige: "rgb(245, 245, 220)",
389
+ bisque: "rgb(255, 228, 196)",
390
+ black: "rgb(0, 0, 0)",
391
+ blanchedalmond: "rgb(255, 235, 205)",
392
+ blue: "rgb(0, 0, 255)",
393
+ blueviolet: "rgb(138, 43, 226)",
394
+ brown: "rgb(165, 42, 42)",
395
+ burlywood: "rgb(222, 184, 135)",
396
+ cadetblue: "rgb(95, 158, 160)",
397
+ chartreuse: "rgb(127, 255, 0)",
398
+ chocolate: "rgb(210, 105, 30)",
399
+ coral: "rgb(255, 127, 80)",
400
+ cornflowerblue: "rgb(100, 149, 237)",
401
+ cornsilk: "rgb(255, 248, 220)",
402
+ crimson: "rgb(237, 20, 61)",
403
+ cyan: "rgb(0, 255, 255)",
404
+ darkblue: "rgb(0, 0, 139)",
405
+ darkcyan: "rgb(0, 139, 139)",
406
+ darkgoldenrod: "rgb(184, 134, 11)",
407
+ darkgray: "rgb(169, 169, 169)",
408
+ darkgrey: "rgb(169, 169, 169)",
409
+ darkgreen: "rgb(0, 100, 0)",
410
+ darkkhaki: "rgb(189, 183, 107)",
411
+ darkmagenta: "rgb(139, 0, 139)",
412
+ darkolivegreen: "rgb(85, 107, 47)",
413
+ darkorange: "rgb(255, 140, 0)",
414
+ darkorchid: "rgb(153, 50, 204)",
415
+ darkred: "rgb(139, 0, 0)",
416
+ darksalmon: "rgb(233, 150, 122)",
417
+ darkseagreen: "rgb(143, 188, 143)",
418
+ darkslateblue: "rgb(72, 61, 139)",
419
+ darkslategray: "rgb(47, 79, 79)",
420
+ darkslategrey: "rgb(47, 79, 79)",
421
+ darkturquoise: "rgb(0, 206, 209)",
422
+ darkviolet: "rgb(148, 0, 211)",
423
+ deeppink: "rgb(255, 20, 147)",
424
+ deepskyblue: "rgb(0, 191, 255)",
425
+ dimgray: "rgb(105, 105, 105)",
426
+ dimgrey: "rgb(105, 105, 105)",
427
+ dodgerblue: "rgb(30, 144, 255)",
428
+ firebrick: "rgb(178, 34, 34)",
429
+ floralwhite: "rgb(255, 250, 240)",
430
+ forestgreen: "rgb(34, 139, 34)",
431
+ fuchsia: "rgb(255, 0, 255)",
432
+ gainsboro: "rgb(220, 220, 220)",
433
+ ghostwhite: "rgb(248, 248, 255)",
434
+ gold: "rgb(255, 215, 0)",
435
+ goldenrod: "rgb(218, 165, 32)",
436
+ gray: "rgb(128, 128, 128)",
437
+ grey: "rgb(128, 128, 128)",
438
+ green: "rgb(0, 128, 0)",
439
+ greenyellow: "rgb(173, 255, 47)",
440
+ honeydew: "rgb(240, 255, 240)",
441
+ hotpink: "rgb(255, 105, 180)",
442
+ indianred: "rgb(205, 92, 92)",
443
+ indigo: "rgb(75, 0, 130)",
444
+ ivory: "rgb(255, 255, 240)",
445
+ khaki: "rgb(240, 230, 140)",
446
+ lavender: "rgb(230, 230, 250)",
447
+ lavenderblush: "rgb(255, 240, 245)",
448
+ lawngreen: "rgb(124, 252, 0)",
449
+ lemonchiffon: "rgb(255, 250, 205)",
450
+ lightblue: "rgb(173, 216, 230)",
451
+ lightcoral: "rgb(240, 128, 128)",
452
+ lightcyan: "rgb(224, 255, 255)",
453
+ lightgoldenrodyellow: "rgb(250, 250, 210)",
454
+ lightgreen: "rgb(144, 238, 144)",
455
+ lightgray: "rgb(211, 211, 211)",
456
+ lightgrey: "rgb(211, 211, 211)",
457
+ lightpink: "rgb(255, 182, 193)",
458
+ lightsalmon: "rgb(255, 160, 122)",
459
+ lightseagreen: "rgb(32, 178, 170)",
460
+ lightskyblue: "rgb(135, 206, 250)",
461
+ lightslategray: "rgb(119, 136, 153)",
462
+ lightslategrey: "rgb(119, 136, 153)",
463
+ lightsteelblue: "rgb(176, 196, 222)",
464
+ lightyellow: "rgb(255, 255, 224)",
465
+ lime: "rgb(0, 255, 0)",
466
+ limegreen: "rgb(50, 205, 50)",
467
+ linen: "rgb(250, 240, 230)",
468
+ magenta: "rgb(255, 0, 255)",
469
+ maroon: "rgb(128, 0, 0)",
470
+ mediumaquamarine: "rgb(102, 205, 170)",
471
+ mediumblue: "rgb(0, 0, 205)",
472
+ mediumorchid: "rgb(186, 85, 211)",
473
+ mediumpurple: "rgb(147, 112, 219)",
474
+ mediumseagreen: "rgb(60, 179, 113)",
475
+ mediumslateblue: "rgb(123, 104, 238)",
476
+ mediumspringgreen: "rgb(0, 250, 154)",
477
+ mediumturquoise: "rgb(72, 209, 204)",
478
+ mediumvioletred: "rgb(199, 21, 133)",
479
+ midnightblue: "rgb(25, 25, 112)",
480
+ mintcream: "rgb(245, 255, 250)",
481
+ mistyrose: "rgb(255, 228, 225)",
482
+ moccasin: "rgb(255, 228, 181)",
483
+ navajowhite: "rgb(255, 222, 173)",
484
+ navy: "rgb(0, 0, 128)",
485
+ oldlace: "rgb(253, 245, 230)",
486
+ olive: "rgb(128, 128, 0)",
487
+ olivedrab: "rgb(107, 142, 35)",
488
+ orange: "rgb(255, 165, 0)",
489
+ orangered: "rgb(255, 69, 0)",
490
+ orchid: "rgb(218, 112, 214)",
491
+ palegoldenrod: "rgb(238, 232, 170)",
492
+ palegreen: "rgb(152, 251, 152)",
493
+ paleturquoise: "rgb(175, 238, 238)",
494
+ palevioletred: "rgb(219, 112, 147)",
495
+ papayawhip: "rgb(255, 239, 213)",
496
+ peachpuff: "rgb(255, 218, 185)",
497
+ peru: "rgb(205, 133, 63)",
498
+ pink: "rgb(255, 192, 203)",
499
+ plum: "rgb(221, 160, 221)",
500
+ powderblue: "rgb(176, 224, 230)",
501
+ purple: "rgb(128, 0, 128)",
502
+ rebeccapurple: "rgb(102, 51, 153)",
503
+ red: "rgb(255, 0, 0)",
504
+ rosybrown: "rgb(188, 143, 143)",
505
+ royalblue: "rgb(65, 105, 225)",
506
+ saddlebrown: "rgb(139, 69, 19)",
507
+ salmon: "rgb(250, 128, 114)",
508
+ sandybrown: "rgb(244, 164, 96)",
509
+ seagreen: "rgb(46, 139, 87)",
510
+ seashell: "rgb(255, 245, 238)",
511
+ sienna: "rgb(160, 82, 45)",
512
+ silver: "rgb(192, 192, 192)",
513
+ skyblue: "rgb(135, 206, 235)",
514
+ slateblue: "rgb(106, 90, 205)",
515
+ slategray: "rgb(112, 128, 144)",
516
+ slategrey: "rgb(112, 128, 144)",
517
+ snow: "rgb(255, 250, 250)",
518
+ springgreen: "rgb(0, 255, 127)",
519
+ steelblue: "rgb(70, 130, 180)",
520
+ tan: "rgb(210, 180, 140)",
521
+ teal: "rgb(0, 128, 128)",
522
+ thistle: "rgb(216, 191, 216)",
523
+ tomato: "rgb(255, 99, 71)",
524
+ turquoise: "rgb(64, 224, 208)",
525
+ violet: "rgb(238, 130, 238)",
526
+ wheat: "rgb(245, 222, 179)",
527
+ white: "rgb(255, 255, 255)",
528
+ whitesmoke: "rgb(245, 245, 245)",
529
+ yellow: "rgb(255, 255, 0)",
530
+ yellowgreen: "rgb(154, 205, 50)",
531
+ transparent: "rgba(0, 0, 0, 0)",
532
+ },
533
+ p = {
534
+ isColorName: function (t) {
535
+ return !!d[t];
536
+ },
537
+ getColorByName: function (t) {
538
+ return d[t];
539
+ },
540
+ };
541
+ function g(t, e, n) {
542
+ return (
543
+ n < 0 && (n += 1),
544
+ n > 1 && (n -= 1),
545
+ n < 1 / 6
546
+ ? t + 6 * (e - t) * n
547
+ : n < 0.5
548
+ ? e
549
+ : n < 2 / 3
550
+ ? t + (e - t) * (2 / 3 - n) * 6
551
+ : t
552
+ );
553
+ }
554
+ function m(t, e, n) {
555
+ if (1 == arguments.length) {
556
+ var i = arguments[0];
557
+ (t = i.h), (e = i.s), (n = i.l);
558
+ }
559
+ var r, o, a;
560
+ if (((t /= 360), (n /= 100), 0 == (e /= 100))) r = o = a = n;
561
+ else {
562
+ var l = n < 0.5 ? n * (1 + e) : n + e - n * e,
563
+ c = 2 * n - l;
564
+ (r = g(c, l, t + 1 / 3)),
565
+ (o = g(c, l, t)),
566
+ (a = g(c, l, t - 1 / 3));
567
+ }
568
+ return { r: s(255 * r), g: s(255 * o), b: s(255 * a) };
569
+ }
570
+ var v = {
571
+ HUEtoRGB: g,
572
+ HSLtoHSV: function (t, e, n) {
573
+ if (1 == arguments.length) {
574
+ var i = arguments[0];
575
+ (t = i.h), (e = i.s), (n = i.l);
576
+ }
577
+ var r = m(t, e, n);
578
+ return D(r.r, r.g, r.b);
579
+ },
580
+ HSLtoRGB: m,
581
+ },
582
+ _ = function (t, e) {
583
+ if (!(t instanceof e))
584
+ throw new TypeError("Cannot call a class as a function");
585
+ },
586
+ y = (function () {
587
+ function t(t, e) {
588
+ for (var n = 0; n < e.length; n++) {
589
+ var i = e[n];
590
+ (i.enumerable = i.enumerable || !1),
591
+ (i.configurable = !0),
592
+ "value" in i && (i.writable = !0),
593
+ Object.defineProperty(t, i.key, i);
594
+ }
595
+ }
596
+ return function (e, n, i) {
597
+ return n && t(e.prototype, n), i && t(e, i), e;
598
+ };
599
+ })(),
600
+ x = function (t, e, n) {
601
+ return (
602
+ e in t
603
+ ? Object.defineProperty(t, e, {
604
+ value: n,
605
+ enumerable: !0,
606
+ configurable: !0,
607
+ writable: !0,
608
+ })
609
+ : (t[e] = n),
610
+ t
611
+ );
612
+ },
613
+ k =
614
+ Object.assign ||
615
+ function (t) {
616
+ for (var e = 1; e < arguments.length; e++) {
617
+ var n = arguments[e];
618
+ for (var i in n)
619
+ Object.prototype.hasOwnProperty.call(n, i) &&
620
+ (t[i] = n[i]);
621
+ }
622
+ return t;
623
+ },
624
+ b = function t(e, n, i) {
625
+ null === e && (e = Function.prototype);
626
+ var r = Object.getOwnPropertyDescriptor(e, n);
627
+ if (void 0 === r) {
628
+ var o = Object.getPrototypeOf(e);
629
+ return null === o ? void 0 : t(o, n, i);
630
+ }
631
+ if ("value" in r) return r.value;
632
+ var s = r.get;
633
+ return void 0 !== s ? s.call(i) : void 0;
634
+ },
635
+ T = function (t, e) {
636
+ if ("function" != typeof e && null !== e)
637
+ throw new TypeError(
638
+ "Super expression must either be null or a function, not " +
639
+ typeof e
640
+ );
641
+ (t.prototype = Object.create(e && e.prototype, {
642
+ constructor: {
643
+ value: t,
644
+ enumerable: !1,
645
+ writable: !0,
646
+ configurable: !0,
647
+ },
648
+ })),
649
+ e &&
650
+ (Object.setPrototypeOf
651
+ ? Object.setPrototypeOf(t, e)
652
+ : (t.__proto__ = e));
653
+ },
654
+ C = function (t, e) {
655
+ if (!t)
656
+ throw new ReferenceError(
657
+ "this hasn't been initialised - super() hasn't been called"
658
+ );
659
+ return !e || ("object" != typeof e && "function" != typeof e)
660
+ ? t
661
+ : e;
662
+ },
663
+ w = function (t, e) {
664
+ if (Array.isArray(t)) return t;
665
+ if (Symbol.iterator in Object(t))
666
+ return (function (t, e) {
667
+ var n = [],
668
+ i = !0,
669
+ r = !1,
670
+ o = void 0;
671
+ try {
672
+ for (
673
+ var s, a = t[Symbol.iterator]();
674
+ !(i = (s = a.next()).done) &&
675
+ (n.push(s.value), !e || n.length !== e);
676
+ i = !0
677
+ );
678
+ } catch (t) {
679
+ (r = !0), (o = t);
680
+ } finally {
681
+ try {
682
+ !i && a.return && a.return();
683
+ } finally {
684
+ if (r) throw o;
685
+ }
686
+ }
687
+ return n;
688
+ })(t, e);
689
+ throw new TypeError(
690
+ "Invalid attempt to destructure non-iterable instance"
691
+ );
692
+ },
693
+ E = function (t) {
694
+ if (Array.isArray(t)) {
695
+ for (var e = 0, n = Array(t.length); e < t.length; e++)
696
+ n[e] = t[e];
697
+ return n;
698
+ }
699
+ return Array.from(t);
700
+ },
701
+ S =
702
+ /(#(?:[\da-f]{8})|#(?:[\da-f]{3}){1,2}|rgb\((?:\s*\d{1,3},\s*){2}\d{1,3}\s*\)|rgba\((?:\s*\d{1,3},\s*){3}\d*\.?\d+\s*\)|hsl\(\s*\d{1,3}(?:,\s*\d{1,3}%){2}\s*\)|hsla\(\s*\d{1,3}(?:,\s*\d{1,3}%){2},\s*\d*\.?\d+\s*\)|([\w_\-]+))/gi;
703
+ function A(t) {
704
+ var e = t.match(S),
705
+ n = [];
706
+ if (!e) return n;
707
+ for (var i = 0, r = e.length; i < r; i++)
708
+ if (
709
+ e[i].indexOf("#") > -1 ||
710
+ e[i].indexOf("rgb") > -1 ||
711
+ e[i].indexOf("hsl") > -1
712
+ )
713
+ n.push({ color: e[i] });
714
+ else {
715
+ var o = p.getColorByName(e[i]);
716
+ o && n.push({ color: e[i], nameColor: o });
717
+ }
718
+ var s = { next: 0 };
719
+ return (
720
+ n.forEach(function (e) {
721
+ var n = t.indexOf(e.color, s.next);
722
+ (e.startIndex = n),
723
+ (e.endIndex = n + e.color.length),
724
+ (s.next = e.endIndex);
725
+ }),
726
+ n
727
+ );
728
+ }
729
+ function L(t) {
730
+ var e = A(t);
731
+ return (
732
+ e.forEach(function (e, n) {
733
+ t = t.replace(e.color, "@" + n);
734
+ }),
735
+ { str: t, matches: e }
736
+ );
737
+ }
738
+ function O(t) {
739
+ var e =
740
+ arguments.length > 1 && void 0 !== arguments[1]
741
+ ? arguments[1]
742
+ : ",",
743
+ n = L(t);
744
+ return n.str.split(e).map(function (t, e) {
745
+ return (
746
+ (t = I(t)),
747
+ n.matches[e] && (t = t.replace("@" + e, n.matches[e].color)),
748
+ t
749
+ );
750
+ });
751
+ }
752
+ function N(t, e) {
753
+ return (
754
+ e.forEach(function (e, n) {
755
+ t = t.replace("@" + n, e.color);
756
+ }),
757
+ t
758
+ );
759
+ }
760
+ function I(t) {
761
+ return t.replace(/^\s+|\s+$/g, "");
762
+ }
763
+ function M(t) {
764
+ if ("string" == typeof t) {
765
+ if (
766
+ (p.isColorName(t) && (t = p.getColorByName(t)),
767
+ t.indexOf("rgb(") > -1)
768
+ ) {
769
+ for (
770
+ var e = 0,
771
+ n = (r = t
772
+ .replace("rgb(", "")
773
+ .replace(")", "")
774
+ .split(",")).length;
775
+ e < n;
776
+ e++
777
+ )
778
+ r[e] = parseInt(I(r[e]), 10);
779
+ var i = { type: "rgb", r: r[0], g: r[1], b: r[2], a: 1 };
780
+ return (i = Object.assign(i, P(i)));
781
+ }
782
+ if (t.indexOf("rgba(") > -1) {
783
+ for (
784
+ e = 0,
785
+ n = (r = t
786
+ .replace("rgba(", "")
787
+ .replace(")", "")
788
+ .split(",")).length;
789
+ e < n;
790
+ e++
791
+ )
792
+ r[e] =
793
+ n - 1 == e ? parseFloat(I(r[e])) : parseInt(I(r[e]), 10);
794
+ return (
795
+ (i = { type: "rgb", r: r[0], g: r[1], b: r[2], a: r[3] }),
796
+ (i = Object.assign(i, P(i)))
797
+ );
798
+ }
799
+ if (t.indexOf("hsl(") > -1) {
800
+ for (
801
+ e = 0,
802
+ n = (r = t
803
+ .replace("hsl(", "")
804
+ .replace(")", "")
805
+ .split(",")).length;
806
+ e < n;
807
+ e++
808
+ )
809
+ r[e] = parseFloat(I(r[e]));
810
+ return (
811
+ (i = { type: "hsl", h: r[0], s: r[1], l: r[2], a: 1 }),
812
+ (i = Object.assign(i, m(i)))
813
+ );
814
+ }
815
+ if (t.indexOf("hsla(") > -1) {
816
+ for (
817
+ e = 0,
818
+ n = (r = t
819
+ .replace("hsla(", "")
820
+ .replace(")", "")
821
+ .split(",")).length;
822
+ e < n;
823
+ e++
824
+ )
825
+ r[e] =
826
+ n - 1 == e ? parseFloat(I(r[e])) : parseInt(I(r[e]), 10);
827
+ return (
828
+ (i = { type: "hsl", h: r[0], s: r[1], l: r[2], a: r[3] }),
829
+ (i = Object.assign(i, m(i)))
830
+ );
831
+ }
832
+ if (0 == t.indexOf("#")) {
833
+ var r = [],
834
+ o = 1;
835
+ if (3 == (t = t.replace("#", "")).length)
836
+ for (e = 0, n = t.length; e < n; e++) {
837
+ var s = t.substr(e, 1);
838
+ r.push(parseInt(s + s, 16));
839
+ }
840
+ else if (8 === t.length) {
841
+ for (e = 0, n = t.length; e < n; e += 2)
842
+ r.push(parseInt(t.substr(e, 2), 16));
843
+ o = r.pop() / 255;
844
+ } else
845
+ for (e = 0, n = t.length; e < n; e += 2)
846
+ r.push(parseInt(t.substr(e, 2), 16));
847
+ return (
848
+ (i = { type: "hex", r: r[0], g: r[1], b: r[2], a: o }),
849
+ (i = Object.assign(i, P(i)))
850
+ );
851
+ }
852
+ } else if ("number" == typeof t) {
853
+ if (0 <= t && t <= 16777215)
854
+ return (
855
+ (i = {
856
+ type: "hex",
857
+ r: (16711680 & t) >> 16,
858
+ g: (65280 & t) >> 8,
859
+ b: (255 & t) >> 0,
860
+ a: 1,
861
+ }),
862
+ (i = Object.assign(i, P(i)))
863
+ );
864
+ if (0 <= t && t <= 4294967295)
865
+ return (
866
+ (i = {
867
+ type: "hex",
868
+ r: (4278190080 & t) >> 24,
869
+ g: (16711680 & t) >> 16,
870
+ b: (65280 & t) >> 8,
871
+ a: (255 & t) / 255,
872
+ }),
873
+ (i = Object.assign(i, P(i)))
874
+ );
875
+ }
876
+ return t;
877
+ }
878
+ function $(t) {
879
+ "string" == typeof t && (t = O(t));
880
+ var e = (t = t.map(function (t) {
881
+ if ("string" == typeof t) {
882
+ var e = L(t),
883
+ n = I(e.str).split(" ");
884
+ return (
885
+ n[1]
886
+ ? n[1].includes("%")
887
+ ? (n[1] = parseFloat(n[1].replace(/%/, "")) / 100)
888
+ : (n[1] = parseFloat(n[1]))
889
+ : (n[1] = "*"),
890
+ (n[0] = N(n[0], e.matches)),
891
+ n
892
+ );
893
+ }
894
+ if (Array.isArray(t))
895
+ return (
896
+ t[1]
897
+ ? "string" == typeof t[1] &&
898
+ (t[1].includes("%")
899
+ ? (t[1] = parseFloat(t[1].replace(/%/, "")) / 100)
900
+ : (t[1] = +t[1]))
901
+ : (t[1] = "*"),
902
+ [].concat(E(t))
903
+ );
904
+ })).filter(function (t) {
905
+ return "*" === t[1];
906
+ }).length;
907
+ if (e > 0) {
908
+ var n =
909
+ (1 -
910
+ t
911
+ .filter(function (t) {
912
+ return "*" != t[1] && 1 != t[1];
913
+ })
914
+ .map(function (t) {
915
+ return t[1];
916
+ })
917
+ .reduce(function (t, e) {
918
+ return t + e;
919
+ }, 0)) /
920
+ e;
921
+ t.forEach(function (e, i) {
922
+ "*" == e[1] && i > 0 && (t.length - 1 == i || (e[1] = n));
923
+ });
924
+ }
925
+ return t;
926
+ }
927
+ var R = {
928
+ matches: A,
929
+ convertMatches: L,
930
+ convertMatchesArray: O,
931
+ reverseMatches: N,
932
+ parse: M,
933
+ parseGradient: $,
934
+ trim: I,
935
+ color_regexp: S,
936
+ color_split: ",",
937
+ };
938
+ function D(t, e, n) {
939
+ if (1 == arguments.length) {
940
+ var i = arguments[0];
941
+ (t = i.r), (e = i.g), (n = i.b);
942
+ }
943
+ var r = t / 255,
944
+ o = e / 255,
945
+ s = n / 255,
946
+ a = Math.max(r, o, s),
947
+ l = Math.min(r, o, s),
948
+ c = a - l,
949
+ h = 0;
950
+ return (
951
+ 0 == c
952
+ ? (h = 0)
953
+ : a == r
954
+ ? (h = (((o - s) / c) % 6) * 60)
955
+ : a == o
956
+ ? (h = 60 * ((s - r) / c + 2))
957
+ : a == s && (h = 60 * ((r - o) / c + 4)),
958
+ h < 0 && (h = 360 + h),
959
+ { h: h, s: 0 == a ? 0 : c / a, v: a }
960
+ );
961
+ }
962
+ function P(t, e, n) {
963
+ if (1 == arguments.length) {
964
+ var i = arguments[0];
965
+ (t = i.r), (e = i.g), (n = i.b);
966
+ }
967
+ (t /= 255), (e /= 255), (n /= 255);
968
+ var r,
969
+ o,
970
+ a = Math.max(t, e, n),
971
+ l = Math.min(t, e, n),
972
+ c = (a + l) / 2;
973
+ if (a == l) r = o = 0;
974
+ else {
975
+ var h = a - l;
976
+ switch (((o = c > 0.5 ? h / (2 - a - l) : h / (a + l)), a)) {
977
+ case t:
978
+ r = (e - n) / h + (e < n ? 6 : 0);
979
+ break;
980
+ case e:
981
+ r = (n - t) / h + 2;
982
+ break;
983
+ case n:
984
+ r = (t - e) / h + 4;
985
+ }
986
+ r /= 6;
987
+ }
988
+ return { h: s(360 * r), s: s(100 * o), l: s(100 * c) };
989
+ }
990
+ function F(t) {
991
+ return { r: t, g: t, b: t };
992
+ }
993
+ function B(t, e, n) {
994
+ return Math.ceil(0.2126 * t + 0.7152 * e + 0.0722 * n);
995
+ }
996
+ function U(t, e, n) {
997
+ if (1 == arguments.length) {
998
+ var i = arguments[0];
999
+ (t = i.r), (e = i.g), (n = i.b);
1000
+ }
1001
+ var r = B(t, e, n),
1002
+ o = 0.564 * (n - r),
1003
+ s = 0.713 * (t - r);
1004
+ return { y: r, cr: s, cb: o };
1005
+ }
1006
+ function H(t) {
1007
+ var e =
1008
+ arguments.length > 1 && void 0 !== arguments[1]
1009
+ ? arguments[1]
1010
+ : 0.04045;
1011
+ return (
1012
+ 100 * (t > e ? Math.pow((t + 0.055) / 1.055, 2.4) : t / 12.92)
1013
+ );
1014
+ }
1015
+ function z(t, e, n) {
1016
+ if (1 == arguments.length) {
1017
+ var i = arguments[0];
1018
+ (t = i.r), (e = i.g), (n = i.b);
1019
+ }
1020
+ var r = t / 255,
1021
+ o = e / 255,
1022
+ s = n / 255,
1023
+ a =
1024
+ 0.4124 * (r = H(r)) +
1025
+ 0.3576 * (o = H(o)) +
1026
+ 0.1805 * (s = H(s)),
1027
+ l = 0.2126 * r + 0.7152 * o + 0.0722 * s,
1028
+ c = 0.0193 * r + 0.1192 * o + 0.9505 * s;
1029
+ return { x: a, y: l, z: c };
1030
+ }
1031
+ var W = {
1032
+ RGBtoCMYK: function (t, e, n) {
1033
+ if (1 == arguments.length) {
1034
+ var i = arguments[0];
1035
+ (t = i.r), (e = i.g), (n = i.b);
1036
+ }
1037
+ var r = t / 255,
1038
+ o = e / 255,
1039
+ s = n / 255,
1040
+ a = 1 - Math.max(r, o, s),
1041
+ l = (1 - r - a) / (1 - a),
1042
+ c = (1 - o - a) / (1 - a),
1043
+ h = (1 - s - a) / (1 - a);
1044
+ return { c: l, m: c, y: h, k: a };
1045
+ },
1046
+ RGBtoGray: function (t, e, n) {
1047
+ if (1 == arguments.length) {
1048
+ var i = arguments[0];
1049
+ (t = i.r), (e = i.g), (n = i.b);
1050
+ }
1051
+ return F(U(t, e, n).y);
1052
+ },
1053
+ RGBtoHSL: P,
1054
+ RGBtoHSV: D,
1055
+ RGBtoLAB: function (t, e, n) {
1056
+ if (1 == arguments.length) {
1057
+ var i = arguments[0];
1058
+ (t = i.r), (e = i.g), (n = i.b);
1059
+ }
1060
+ return XYZtoLAB(z(t, e, n));
1061
+ },
1062
+ RGBtoSimpleGray: function (t, e, n) {
1063
+ if (1 == arguments.length) {
1064
+ var i = arguments[0];
1065
+ (t = i.r), (e = i.g), (n = i.b);
1066
+ }
1067
+ return F(Math.ceil((t + e + n) / 3));
1068
+ },
1069
+ RGBtoXYZ: z,
1070
+ RGBtoYCrCb: U,
1071
+ c: function (t, e, n) {
1072
+ if (1 == arguments.length) {
1073
+ var i = arguments[0];
1074
+ (t = i.r), (e = i.g), (n = i.b);
1075
+ }
1076
+ return F((t + e + n) / 3 > 90 ? 0 : 255);
1077
+ },
1078
+ brightness: B,
1079
+ gray: F,
1080
+ },
1081
+ j = {
1082
+ CMYKtoRGB: function (t, e, n, i) {
1083
+ if (1 == arguments.length) {
1084
+ var r = arguments[0];
1085
+ (t = r.c), (e = r.m), (n = r.y), (i = r.k);
1086
+ }
1087
+ var o = 255 * (1 - t) * (1 - i),
1088
+ s = 255 * (1 - e) * (1 - i),
1089
+ a = 255 * (1 - n) * (1 - i);
1090
+ return { r: o, g: s, b: a };
1091
+ },
1092
+ };
1093
+ function G(t) {
1094
+ return Math.pow(t, 3) > 0.008856
1095
+ ? Math.pow(t, 3)
1096
+ : (t - 16 / 116) / 7.787;
1097
+ }
1098
+ function q(t) {
1099
+ return t > 0.0031308
1100
+ ? 1.055 * Math.pow(t, 1 / 2.4) - 0.055
1101
+ : 12.92 * t;
1102
+ }
1103
+ function V(t, e, n) {
1104
+ if (1 == arguments.length) {
1105
+ var i = arguments[0];
1106
+ (t = i.x), (e = i.y), (n = i.z);
1107
+ }
1108
+ var r = t / 100,
1109
+ o = e / 100,
1110
+ a = n / 100,
1111
+ l = 3.2406 * r + -1.5372 * o + -0.4986 * a,
1112
+ c = -0.9689 * r + 1.8758 * o + 0.0415 * a,
1113
+ h = 0.0557 * r + -0.204 * o + 1.057 * a;
1114
+ (l = q(l)), (c = q(c)), (h = q(h));
1115
+ var u = s(255 * l),
1116
+ f = s(255 * c),
1117
+ d = s(255 * h);
1118
+ return { r: u, g: f, b: d };
1119
+ }
1120
+ function Y(t, e, n) {
1121
+ if (1 == arguments.length) {
1122
+ var i = arguments[0];
1123
+ (t = i.l), (e = i.a), (n = i.b);
1124
+ }
1125
+ var r = (t + 16) / 116,
1126
+ o = e / 500 + r,
1127
+ s = r - n / 200;
1128
+ r = G(r);
1129
+ var a = 95.047 * (o = G(o)),
1130
+ l = 100 * r,
1131
+ c = 108.883 * (s = G(s));
1132
+ return { x: a, y: l, z: c };
1133
+ }
1134
+ var K = {
1135
+ XYZtoRGB: V,
1136
+ LABtoRGB: function (t, e, n) {
1137
+ if (1 == arguments.length) {
1138
+ var i = arguments[0];
1139
+ (t = i.l), (e = i.a), (n = i.b);
1140
+ }
1141
+ return V(Y(t, e, n));
1142
+ },
1143
+ LABtoXYZ: Y,
1144
+ };
1145
+ function X(t, e, n) {
1146
+ if (1 == arguments.length) {
1147
+ var i = arguments[0];
1148
+ (t = i.h), (e = i.s), (n = i.v);
1149
+ }
1150
+ var r = t,
1151
+ o = e,
1152
+ a = n;
1153
+ r >= 360 && (r = 0);
1154
+ var l = o * a,
1155
+ c = l * (1 - Math.abs(((r / 60) % 2) - 1)),
1156
+ h = a - l,
1157
+ u = [];
1158
+ return (
1159
+ 0 <= r && r < 60
1160
+ ? (u = [l, c, 0])
1161
+ : 60 <= r && r < 120
1162
+ ? (u = [c, l, 0])
1163
+ : 120 <= r && r < 180
1164
+ ? (u = [0, l, c])
1165
+ : 180 <= r && r < 240
1166
+ ? (u = [0, c, l])
1167
+ : 240 <= r && r < 300
1168
+ ? (u = [c, 0, l])
1169
+ : 300 <= r && r < 360 && (u = [l, 0, c]),
1170
+ {
1171
+ r: s(255 * (u[0] + h)),
1172
+ g: s(255 * (u[1] + h)),
1173
+ b: s(255 * (u[2] + h)),
1174
+ }
1175
+ );
1176
+ }
1177
+ var Q = {
1178
+ HSVtoHSL: function (t, e, n) {
1179
+ if (1 == arguments.length) {
1180
+ var i = arguments[0];
1181
+ (t = i.h), (e = i.s), (n = i.v);
1182
+ }
1183
+ var r = X(t, e, n);
1184
+ return P(r.r, r.g, r.b);
1185
+ },
1186
+ HSVtoRGB: X,
1187
+ },
1188
+ Z = {
1189
+ YCrCbtoRGB: function (t, e, n, i) {
1190
+ if (1 == arguments.length) {
1191
+ var r = arguments[0];
1192
+ (t = r.y), (e = r.cr), (n = r.cb), (i = (i = r.bit) || 0);
1193
+ }
1194
+ var o = t + 1.402 * (e - i),
1195
+ s = t - 0.344 * (n - i) - 0.714 * (e - i),
1196
+ a = t + 1.772 * (n - i);
1197
+ return { r: Math.ceil(o), g: Math.ceil(s), b: Math.ceil(a) };
1198
+ },
1199
+ };
1200
+ function J(t, n) {
1201
+ var i =
1202
+ arguments.length > 2 && void 0 !== arguments[2]
1203
+ ? arguments[2]
1204
+ : 0.5,
1205
+ r =
1206
+ arguments.length > 3 && void 0 !== arguments[3]
1207
+ ? arguments[3]
1208
+ : "hex",
1209
+ o = {
1210
+ r: s(t.r + (n.r - t.r) * i),
1211
+ g: s(t.g + (n.g - t.g) * i),
1212
+ b: s(t.b + (n.b - t.b) * i),
1213
+ a: s(t.a + (n.a - t.a) * i, 100),
1214
+ };
1215
+ return e(o, o.a < 1 ? "rgb" : r);
1216
+ }
1217
+ function tt(t) {
1218
+ var e =
1219
+ arguments.length > 1 && void 0 !== arguments[1]
1220
+ ? arguments[1]
1221
+ : 5;
1222
+ if (!t) return [];
1223
+ "string" == typeof t && (t = O(t));
1224
+ for (var n = (t = t || []).length, i = [], r = 0; r < n - 1; r++)
1225
+ for (var o = 0; o < e; o++) i.push(et(t[r], t[r + 1], o / e));
1226
+ return i;
1227
+ }
1228
+ function et(t, e) {
1229
+ var n =
1230
+ arguments.length > 2 && void 0 !== arguments[2]
1231
+ ? arguments[2]
1232
+ : 0.5,
1233
+ i =
1234
+ arguments.length > 3 && void 0 !== arguments[3]
1235
+ ? arguments[3]
1236
+ : "hex",
1237
+ r = M(t),
1238
+ o = M(e);
1239
+ return J(r, o, n, i);
1240
+ }
1241
+ function nt(t) {
1242
+ return (
1243
+ (t = M(t)),
1244
+ (Math.round(299 * t.r) +
1245
+ Math.round(587 * t.g) +
1246
+ Math.round(114 * t.b)) /
1247
+ 1e3
1248
+ );
1249
+ }
1250
+ function it(t) {
1251
+ for (
1252
+ var n =
1253
+ arguments.length > 1 && void 0 !== arguments[1]
1254
+ ? arguments[1]
1255
+ : "h",
1256
+ i =
1257
+ arguments.length > 2 && void 0 !== arguments[2]
1258
+ ? arguments[2]
1259
+ : 9,
1260
+ r =
1261
+ arguments.length > 3 && void 0 !== arguments[3]
1262
+ ? arguments[3]
1263
+ : "rgb",
1264
+ o =
1265
+ arguments.length > 4 && void 0 !== arguments[4]
1266
+ ? arguments[4]
1267
+ : 0,
1268
+ s =
1269
+ arguments.length > 5 && void 0 !== arguments[5]
1270
+ ? arguments[5]
1271
+ : 1,
1272
+ a =
1273
+ arguments.length > 6 && void 0 !== arguments[6]
1274
+ ? arguments[6]
1275
+ : 100,
1276
+ l = M(t),
1277
+ c = D(l),
1278
+ h = ((s - o) * a) / i,
1279
+ u = [],
1280
+ f = 1;
1281
+ f <= i;
1282
+ f++
1283
+ )
1284
+ (c[n] = Math.abs((a - h * f) / a)), u.push(e(X(c), r));
1285
+ return u;
1286
+ }
1287
+ (tt.parula = function (t) {
1288
+ return tt(
1289
+ ["#352a87", "#0f5cdd", "#00b5a6", "#ffc337", "#fdff00"],
1290
+ t
1291
+ );
1292
+ }),
1293
+ (tt.jet = function (t) {
1294
+ return tt(
1295
+ [
1296
+ "#00008f",
1297
+ "#0020ff",
1298
+ "#00ffff",
1299
+ "#51ff77",
1300
+ "#fdff00",
1301
+ "#ff0000",
1302
+ "#800000",
1303
+ ],
1304
+ t
1305
+ );
1306
+ }),
1307
+ (tt.hsv = function (t) {
1308
+ return tt(
1309
+ [
1310
+ "#ff0000",
1311
+ "#ffff00",
1312
+ "#00ff00",
1313
+ "#00ffff",
1314
+ "#0000ff",
1315
+ "#ff00ff",
1316
+ "#ff0000",
1317
+ ],
1318
+ t
1319
+ );
1320
+ }),
1321
+ (tt.hot = function (t) {
1322
+ return tt(["#0b0000", "#ff0000", "#ffff00", "#ffffff"], t);
1323
+ }),
1324
+ (tt.pink = function (t) {
1325
+ return tt(["#1e0000", "#bd7b7b", "#e7e5b2", "#ffffff"], t);
1326
+ }),
1327
+ (tt.bone = function (t) {
1328
+ return tt(["#000000", "#4a4a68", "#a6c6c6", "#ffffff"], t);
1329
+ }),
1330
+ (tt.copper = function (t) {
1331
+ return tt(
1332
+ ["#000000", "#3d2618", "#9d623e", "#ffa167", "#ffc77f"],
1333
+ t
1334
+ );
1335
+ });
1336
+ var rt = {
1337
+ interpolateRGB: J,
1338
+ blend: et,
1339
+ mix: function (t, e) {
1340
+ var n =
1341
+ arguments.length > 2 && void 0 !== arguments[2]
1342
+ ? arguments[2]
1343
+ : 0.5,
1344
+ i =
1345
+ arguments.length > 3 && void 0 !== arguments[3]
1346
+ ? arguments[3]
1347
+ : "hex";
1348
+ return et(t, e, n, i);
1349
+ },
1350
+ scale: tt,
1351
+ contrast: nt,
1352
+ contrastColor: function (t) {
1353
+ return nt(t) >= 128 ? "black" : "white";
1354
+ },
1355
+ gradient: function (t) {
1356
+ for (
1357
+ var e =
1358
+ arguments.length > 1 && void 0 !== arguments[1]
1359
+ ? arguments[1]
1360
+ : 10,
1361
+ n = [],
1362
+ i = e - ((t = $(t)).length - 1),
1363
+ r = i,
1364
+ o = 1,
1365
+ s = t.length;
1366
+ o < s;
1367
+ o++
1368
+ ) {
1369
+ var a = t[o - 1][0],
1370
+ l = t[o][0],
1371
+ c = 1 == o ? t[o][1] : t[o][1] - t[o - 1][1],
1372
+ h = o == t.length - 1 ? r : Math.floor(c * i);
1373
+ (n = n.concat(tt([a, l], h), [l])), (r -= h);
1374
+ }
1375
+ return n;
1376
+ },
1377
+ scaleHSV: it,
1378
+ scaleH: function (t) {
1379
+ var e =
1380
+ arguments.length > 1 && void 0 !== arguments[1]
1381
+ ? arguments[1]
1382
+ : 9,
1383
+ n =
1384
+ arguments.length > 2 && void 0 !== arguments[2]
1385
+ ? arguments[2]
1386
+ : "rgb",
1387
+ i =
1388
+ arguments.length > 3 && void 0 !== arguments[3]
1389
+ ? arguments[3]
1390
+ : 0,
1391
+ r =
1392
+ arguments.length > 4 && void 0 !== arguments[4]
1393
+ ? arguments[4]
1394
+ : 360;
1395
+ return it(t, "h", e, n, i, r, 1);
1396
+ },
1397
+ scaleS: function (t) {
1398
+ var e =
1399
+ arguments.length > 1 && void 0 !== arguments[1]
1400
+ ? arguments[1]
1401
+ : 9,
1402
+ n =
1403
+ arguments.length > 2 && void 0 !== arguments[2]
1404
+ ? arguments[2]
1405
+ : "rgb",
1406
+ i =
1407
+ arguments.length > 3 && void 0 !== arguments[3]
1408
+ ? arguments[3]
1409
+ : 0,
1410
+ r =
1411
+ arguments.length > 4 && void 0 !== arguments[4]
1412
+ ? arguments[4]
1413
+ : 1;
1414
+ return it(t, "s", e, n, i, r, 100);
1415
+ },
1416
+ scaleV: function (t) {
1417
+ var e =
1418
+ arguments.length > 1 && void 0 !== arguments[1]
1419
+ ? arguments[1]
1420
+ : 9,
1421
+ n =
1422
+ arguments.length > 2 && void 0 !== arguments[2]
1423
+ ? arguments[2]
1424
+ : "rgb",
1425
+ i =
1426
+ arguments.length > 3 && void 0 !== arguments[3]
1427
+ ? arguments[3]
1428
+ : 0,
1429
+ r =
1430
+ arguments.length > 4 && void 0 !== arguments[4]
1431
+ ? arguments[4]
1432
+ : 1;
1433
+ return it(t, "v", e, n, i, r, 100);
1434
+ },
1435
+ };
1436
+ function ot(t, e) {
1437
+ if (t.length !== e.length) return !1;
1438
+ for (var n = 0, i = t.length; n < i; ++n)
1439
+ if (t[n] !== e[n]) return !1;
1440
+ return !0;
1441
+ }
1442
+ var st = {
1443
+ euclidean: function (t, e) {
1444
+ for (var n = 0, i = 0, r = t.length; i < r; i++)
1445
+ n += Math.pow(e[i] - t[i], 2);
1446
+ return Math.sqrt(n);
1447
+ },
1448
+ manhattan: function (t, e) {
1449
+ for (var n = 0, i = 0, r = t.length; i < r; i++)
1450
+ n += Math.abs(e[i] - t[i]);
1451
+ return n;
1452
+ },
1453
+ max: function (t, e) {
1454
+ for (var n = 0, i = 0, r = t.length; i < r; i++)
1455
+ n = Math.max(n, Math.abs(e[i] - t[i]));
1456
+ return n;
1457
+ },
1458
+ },
1459
+ at = {
1460
+ linear: function (t, e) {
1461
+ var n = [],
1462
+ i = Math.round(Math.random() * t),
1463
+ r = Math.floor(t / e);
1464
+ do {
1465
+ n.push(i), (i = (i + r) % t);
1466
+ } while (n.length < e);
1467
+ return n;
1468
+ },
1469
+ shuffle: function (t, e) {
1470
+ for (var n = []; n.length < e; ) {
1471
+ var i = Math.round(Math.random() * t);
1472
+ -1 == n.indexOf(i) && n.push(i);
1473
+ }
1474
+ return n;
1475
+ },
1476
+ };
1477
+ function lt(t, e) {
1478
+ var n =
1479
+ arguments.length > 2 && void 0 !== arguments[2]
1480
+ ? arguments[2]
1481
+ : "linear",
1482
+ i = at[n](t.length, e);
1483
+ return i.map(function (e) {
1484
+ return t[e];
1485
+ });
1486
+ }
1487
+ function ct(t, e, n) {
1488
+ var i = 1 / 0,
1489
+ r = 0;
1490
+ return (
1491
+ e.forEach(function (e, o) {
1492
+ var s = n(t, e);
1493
+ s < i && ((i = s), (r = o));
1494
+ }),
1495
+ r
1496
+ );
1497
+ }
1498
+ function ht(t) {
1499
+ if (!t.length) return [];
1500
+ for (
1501
+ var e = new Array(t[0].length), n = 0, i = e.length;
1502
+ n < i;
1503
+ n++
1504
+ )
1505
+ e[n] = 0;
1506
+ var r = 0;
1507
+ for (i = t.length; r < i; r++)
1508
+ for (var o = t[r], s = r + 1, a = 0, l = o.length; a < l; a++)
1509
+ e[a] += (o[a] - e[a]) / s;
1510
+ return (e = e.map(function (t) {
1511
+ return Math.floor(t);
1512
+ }));
1513
+ }
1514
+ function ut(t, e, n, i) {
1515
+ for (var r = new Array(t), o = 0; o < t; o++) r[o] = [];
1516
+ for (var s = 0, a = e.length; s < a; s++) {
1517
+ var l = e[s];
1518
+ r[ct(l, n, i)].push(l);
1519
+ }
1520
+ return r;
1521
+ }
1522
+ function ft(t, e, n, i, r, o) {
1523
+ for (var s = 0; s < t; s++) {
1524
+ var a = n[s],
1525
+ l = i[s],
1526
+ c = new Array(l.length);
1527
+ (c = a.length > 0 ? ht(a) : e[Math.floor(o() * e.length)]),
1528
+ (r = !ot(c, l)),
1529
+ (i[s] = c);
1530
+ }
1531
+ return r;
1532
+ }
1533
+ function dt(t, e, n) {
1534
+ var i =
1535
+ arguments.length > 3 && void 0 !== arguments[3]
1536
+ ? arguments[3]
1537
+ : 10,
1538
+ r =
1539
+ arguments.length > 4 && void 0 !== arguments[4]
1540
+ ? arguments[4]
1541
+ : "linear";
1542
+ (t = t),
1543
+ (e = e || Math.max(2, Math.ceil(Math.sqrt(t.length / 2))));
1544
+ var o = n || "euclidean";
1545
+ "string" == typeof o && (o = st[o]);
1546
+ for (
1547
+ var s = 0,
1548
+ a = function () {
1549
+ return (s = (9301 * s + 49297) % 233280) / 233280;
1550
+ },
1551
+ l = lt(t, e, r),
1552
+ c = !0,
1553
+ h = 0;
1554
+ c;
1555
+
1556
+ ) {
1557
+ var u = ut(e, t, l, o);
1558
+ if (((c = ft(e, t, u, l, !1, a)), ++h % i == 0)) break;
1559
+ }
1560
+ return l;
1561
+ }
1562
+ var pt = {
1563
+ create: function (t, e) {
1564
+ var n = document.createElement("canvas");
1565
+ return (n.width = t || 0), (n.height = e || 0), n;
1566
+ },
1567
+ drawPixels: function (t) {
1568
+ var e = this.create(t.width, t.height),
1569
+ n = e.getContext("2d"),
1570
+ i = n.getImageData(0, 0, e.width, e.height);
1571
+ return i.data.set(t.pixels), n.putImageData(i, 0, 0), e;
1572
+ },
1573
+ createHistogram: function (t, e, n, i) {
1574
+ var r =
1575
+ arguments.length > 4 && void 0 !== arguments[4]
1576
+ ? arguments[4]
1577
+ : { black: !0, red: !1, green: !1, blue: !1 },
1578
+ o = this.create(t, e),
1579
+ s = o.getContext("2d");
1580
+ s.clearRect(0, 0, t, e),
1581
+ (s.fillStyle = "white"),
1582
+ s.fillRect(0, 0, t, e),
1583
+ (s.globalAlpha = 0.7);
1584
+ var a = { black: !1 };
1585
+ r.black ? (a.black = !1) : (a.black = !0),
1586
+ r.red ? (a.red = !1) : (a.red = !0),
1587
+ r.green ? (a.green = !1) : (a.green = !0),
1588
+ r.blue ? (a.blue = !1) : (a.blue = !0),
1589
+ Object.keys(n).forEach(function (i) {
1590
+ if (!a[i]) {
1591
+ var r = n[i],
1592
+ o = Math.max.apply(Math, r),
1593
+ l = t / r.length;
1594
+ (s.fillStyle = i),
1595
+ r.forEach(function (t, n) {
1596
+ var i = e * (t / o),
1597
+ r = n * l;
1598
+ s.fillRect(r, e - i, l, i);
1599
+ });
1600
+ }
1601
+ }),
1602
+ "function" == typeof i && i(o);
1603
+ },
1604
+ getHistogram: function (t) {
1605
+ for (
1606
+ var e = new Array(256),
1607
+ n = new Array(256),
1608
+ i = new Array(256),
1609
+ r = new Array(256),
1610
+ o = 0;
1611
+ o < 256;
1612
+ o++
1613
+ )
1614
+ (e[o] = 0), (n[o] = 0), (i[o] = 0), (r[o] = 0);
1615
+ return (
1616
+ (function (t, e) {
1617
+ !(function (t, e) {
1618
+ for (var n = 0; n < t; n += 4) e(n);
1619
+ })(t.pixels.length, function (n) {
1620
+ e(t.pixels, n);
1621
+ });
1622
+ })(t, function (t, o) {
1623
+ var s = Math.round(
1624
+ Ze.brightness(t[o], t[o + 1], t[o + 2])
1625
+ );
1626
+ e[s]++, n[t[o]]++, i[t[o + 1]]++, r[t[o + 2]]++;
1627
+ }),
1628
+ { black: e, red: n, green: i, blue: r }
1629
+ );
1630
+ },
1631
+ getBitmap: function (t, e) {
1632
+ var n = this.drawPixels(t);
1633
+ return {
1634
+ pixels: n
1635
+ .getContext("2d")
1636
+ .getImageData(
1637
+ e.x || 0,
1638
+ e.y || 0,
1639
+ e.width || n.width,
1640
+ e.height || n.height
1641
+ ).data,
1642
+ width: e.width,
1643
+ height: e.height,
1644
+ };
1645
+ },
1646
+ putBitmap: function (t, e, n) {
1647
+ var i = this.drawPixels(t),
1648
+ r = this.drawPixels(e),
1649
+ o = i.getContext("2d");
1650
+ return (
1651
+ o.drawImage(r, n.x, n.y),
1652
+ (t.pixels = o.getImageData(0, 0, t.width, t.height).data),
1653
+ t
1654
+ );
1655
+ },
1656
+ },
1657
+ gt = (function () {
1658
+ function t(e) {
1659
+ var n =
1660
+ arguments.length > 1 && void 0 !== arguments[1]
1661
+ ? arguments[1]
1662
+ : {};
1663
+ _(this, t),
1664
+ (this.isLoaded = !1),
1665
+ (this.imageUrl = e),
1666
+ (this.opt = n),
1667
+ this.initialize();
1668
+ }
1669
+ return (
1670
+ y(t, [
1671
+ {
1672
+ key: "initialize",
1673
+ value: function () {
1674
+ (this.canvas = this.createCanvas()),
1675
+ (this.context = this.canvas.getContext("2d"));
1676
+ },
1677
+ },
1678
+ {
1679
+ key: "createCanvas",
1680
+ value: function () {
1681
+ return document.createElement("canvas");
1682
+ },
1683
+ },
1684
+ {
1685
+ key: "load",
1686
+ value: function (t) {
1687
+ this.loadImage(t);
1688
+ },
1689
+ },
1690
+ {
1691
+ key: "loadImage",
1692
+ value: function (t) {
1693
+ var e = this,
1694
+ n = this.context;
1695
+ this.newImage = new Image();
1696
+ var i = this.newImage;
1697
+ (i.onload = function () {
1698
+ var r = i.height / i.width;
1699
+ e.opt.canvasWidth && e.opt.canvasHeight
1700
+ ? ((e.canvas.width = e.opt.canvasWidth),
1701
+ (e.canvas.height = e.opt.canvasHeight))
1702
+ : ((e.canvas.width = e.opt.maxWidth
1703
+ ? e.opt.maxWidth
1704
+ : i.width),
1705
+ (e.canvas.height = e.canvas.width * r)),
1706
+ n.drawImage(
1707
+ i,
1708
+ 0,
1709
+ 0,
1710
+ i.width,
1711
+ i.height,
1712
+ 0,
1713
+ 0,
1714
+ e.canvas.width,
1715
+ e.canvas.height
1716
+ ),
1717
+ (e.isLoaded = !0),
1718
+ t && t();
1719
+ }),
1720
+ this.getImageUrl(function (t) {
1721
+ i.src = t;
1722
+ });
1723
+ },
1724
+ },
1725
+ {
1726
+ key: "load",
1727
+ value: function (t) {
1728
+ var e = this;
1729
+ this.newImage = new Image();
1730
+ var n = this.newImage;
1731
+ (n.onload = function () {
1732
+ (e.isLoaded = !0), t && t();
1733
+ }),
1734
+ this.getImageUrl(function (t) {
1735
+ n.src = t;
1736
+ });
1737
+ },
1738
+ },
1739
+ {
1740
+ key: "getImageUrl",
1741
+ value: function (t) {
1742
+ if ("string" == typeof this.imageUrl)
1743
+ return t(this.imageUrl);
1744
+ if (this.imageUrl instanceof Blob) {
1745
+ var e = new FileReader();
1746
+ (e.onload = function (e) {
1747
+ t(e.target.result);
1748
+ }),
1749
+ e.readAsDataURL(this.imageUrl);
1750
+ }
1751
+ },
1752
+ },
1753
+ {
1754
+ key: "getRGBA",
1755
+ value: function (t, e, n, i) {
1756
+ return [t, e, n, i];
1757
+ },
1758
+ },
1759
+ {
1760
+ key: "toArray",
1761
+ value: function (t, e) {
1762
+ var n =
1763
+ arguments.length > 2 && void 0 !== arguments[2]
1764
+ ? arguments[2]
1765
+ : {},
1766
+ i = this.context.getImageData(
1767
+ 0,
1768
+ 0,
1769
+ this.canvas.width,
1770
+ this.canvas.height
1771
+ ),
1772
+ r = i.width,
1773
+ o = i.height,
1774
+ s = new Uint8ClampedArray(i.data),
1775
+ a = { pixels: s, width: r, height: o };
1776
+ t ||
1777
+ (t = function (t, e) {
1778
+ e(t);
1779
+ }),
1780
+ t(
1781
+ a,
1782
+ function (t) {
1783
+ var i = pt.drawPixels(t);
1784
+ "canvas" == n.returnTo
1785
+ ? e(i)
1786
+ : e(i.toDataURL(n.outputFormat || "image/png"));
1787
+ },
1788
+ n
1789
+ );
1790
+ },
1791
+ },
1792
+ {
1793
+ key: "toHistogram",
1794
+ value: function (t) {
1795
+ var e = this.context.getImageData(
1796
+ 0,
1797
+ 0,
1798
+ this.canvas.width,
1799
+ this.canvas.height
1800
+ ),
1801
+ n = e.width,
1802
+ i = e.height,
1803
+ r = {
1804
+ pixels: new Uint8ClampedArray(e.data),
1805
+ width: n,
1806
+ height: i,
1807
+ };
1808
+ return pt.getHistogram(r);
1809
+ },
1810
+ },
1811
+ {
1812
+ key: "toRGB",
1813
+ value: function () {
1814
+ for (
1815
+ var t = this.context.getImageData(
1816
+ 0,
1817
+ 0,
1818
+ this.canvas.width,
1819
+ this.canvas.height
1820
+ ).data,
1821
+ e = [],
1822
+ n = 0,
1823
+ i = t.length;
1824
+ n < i;
1825
+ n += 4
1826
+ )
1827
+ e[e.length] = [
1828
+ t[n + 0],
1829
+ t[n + 1],
1830
+ t[n + 2],
1831
+ t[n + 3],
1832
+ ];
1833
+ return e;
1834
+ },
1835
+ },
1836
+ ]),
1837
+ t
1838
+ );
1839
+ })(),
1840
+ mt = {
1841
+ identity: function () {
1842
+ return [1, 0, 0, 0, 1, 0, 0, 0, 1];
1843
+ },
1844
+ stretching: function (t) {
1845
+ return [t, 0, 0, 0, 1, 0, 0, 0, 1];
1846
+ },
1847
+ squeezing: function (t) {
1848
+ return [t, 0, 0, 0, 1 / t, 0, 0, 0, 1];
1849
+ },
1850
+ scale: function () {
1851
+ var t =
1852
+ arguments.length > 0 && void 0 !== arguments[0]
1853
+ ? arguments[0]
1854
+ : 1,
1855
+ e =
1856
+ arguments.length > 1 && void 0 !== arguments[1]
1857
+ ? arguments[1]
1858
+ : 1;
1859
+ return [
1860
+ (t = t || 0 === t ? t : 1),
1861
+ 0,
1862
+ 0,
1863
+ 0,
1864
+ (e = e || 0 === e ? e : 1),
1865
+ 0,
1866
+ 0,
1867
+ 0,
1868
+ 1,
1869
+ ];
1870
+ },
1871
+ scaleX: function (t) {
1872
+ return this.scale(t);
1873
+ },
1874
+ scaleY: function (t) {
1875
+ return this.scale(1, t);
1876
+ },
1877
+ translate: function (t, e) {
1878
+ return [1, 0, t, 0, 1, e, 0, 0, 1];
1879
+ },
1880
+ rotate: function (t) {
1881
+ var e = this.radian(t);
1882
+ return [
1883
+ Math.cos(e),
1884
+ -Math.sin(e),
1885
+ 0,
1886
+ Math.sin(e),
1887
+ Math.cos(e),
1888
+ 0,
1889
+ 0,
1890
+ 0,
1891
+ 1,
1892
+ ];
1893
+ },
1894
+ rotate90: function () {
1895
+ return [0, -1, 0, 1, 0, 0, 0, 0, 1];
1896
+ },
1897
+ rotate180: function () {
1898
+ return [-1, 0, 0, 0, -1, 0, 0, 0, 1];
1899
+ },
1900
+ rotate270: function () {
1901
+ return [0, 1, 0, -1, 0, 0, 0, 0, 1];
1902
+ },
1903
+ radian: function (t) {
1904
+ return (t * Math.PI) / 180;
1905
+ },
1906
+ skew: function (t, e) {
1907
+ var n = this.radian(t),
1908
+ i = this.radian(e);
1909
+ return [1, Math.tan(n), 0, Math.tan(i), 1, 0, 0, 0, 1];
1910
+ },
1911
+ skewX: function (t) {
1912
+ var e = this.radian(t);
1913
+ return [1, Math.tan(e), 0, 0, 1, 0, 0, 0, 1];
1914
+ },
1915
+ skewY: function (t) {
1916
+ var e = this.radian(t);
1917
+ return [1, 0, 0, Math.tan(e), 1, 0, 0, 0, 1];
1918
+ },
1919
+ shear1: function (t) {
1920
+ return [
1921
+ 1,
1922
+ -Math.tan(this.radian(t) / 2),
1923
+ 0,
1924
+ 0,
1925
+ 1,
1926
+ 0,
1927
+ 0,
1928
+ 0,
1929
+ 1,
1930
+ ];
1931
+ },
1932
+ shear2: function (t) {
1933
+ return [1, 0, 0, Math.sin(this.radian(t)), 1, 0, 0, 0, 1];
1934
+ },
1935
+ },
1936
+ vt = {
1937
+ CONSTANT: mt,
1938
+ radian: function (t) {
1939
+ return mt.radian(t);
1940
+ },
1941
+ multiply: function (t, e) {
1942
+ return [
1943
+ t[0] * e[0] + t[1] * e[1] + t[2] * e[2],
1944
+ t[3] * e[0] + t[4] * e[1] + t[5] * e[2],
1945
+ t[6] * e[0] + t[7] * e[1] + t[8] * e[2],
1946
+ ];
1947
+ },
1948
+ identity: function (t) {
1949
+ return this.multiply(mt.identity(), t);
1950
+ },
1951
+ translate: function (t, e, n) {
1952
+ return this.multiply(mt.translate(t, e), n);
1953
+ },
1954
+ rotate: function (t, e) {
1955
+ return this.multiply(mt.rotate(t), e);
1956
+ },
1957
+ shear1: function (t, e) {
1958
+ return this.multiply(mt.shear1(t), e);
1959
+ },
1960
+ shear2: function (t, e) {
1961
+ return this.multiply(mt.shear2(t), e);
1962
+ },
1963
+ rotateShear: function (t, e) {
1964
+ var n = e;
1965
+ return (
1966
+ (n = this.shear1(t, n)),
1967
+ (n = this.shear2(t, n)),
1968
+ (n = this.shear1(t, n))
1969
+ );
1970
+ },
1971
+ };
1972
+ function _t(t) {
1973
+ var e =
1974
+ arguments.length > 1 && void 0 !== arguments[1]
1975
+ ? arguments[1]
1976
+ : "center",
1977
+ n =
1978
+ arguments.length > 2 && void 0 !== arguments[2]
1979
+ ? arguments[2]
1980
+ : "center";
1981
+ return function (i, r) {
1982
+ var o =
1983
+ arguments.length > 2 && void 0 !== arguments[2]
1984
+ ? arguments[2]
1985
+ : {},
1986
+ s = Vt(i.pixels.length, i.width, i.height),
1987
+ a = i.width,
1988
+ l = i.height;
1989
+ "center" == e && (e = Math.floor(a / 2)),
1990
+ "center" == n && (n = Math.floor(l / 2));
1991
+ var c = vt.CONSTANT.translate(-e, -n),
1992
+ h = vt.CONSTANT.translate(e, n),
1993
+ u = vt.CONSTANT.shear1(t),
1994
+ f = vt.CONSTANT.shear2(t);
1995
+ ae(function (t, e, n, r) {
1996
+ var o = vt.multiply(c, [n, r, 1]);
1997
+ (o = vt.multiply(u, o).map(Math.round)),
1998
+ (o = vt.multiply(f, o).map(Math.round)),
1999
+ (o = vt.multiply(u, o).map(Math.round)),
2000
+ (o = vt.multiply(h, o));
2001
+ var s = w(o, 2),
2002
+ d = s[0],
2003
+ p = s[1];
2004
+ d < 0 ||
2005
+ p < 0 ||
2006
+ d > a - 1 ||
2007
+ p > l - 1 ||
2008
+ he(t, (p * a + d) << 2, i.pixels, e);
2009
+ })(
2010
+ s,
2011
+ function () {
2012
+ r(s);
2013
+ },
2014
+ o
2015
+ );
2016
+ };
2017
+ }
2018
+ function yt() {
2019
+ var t =
2020
+ arguments.length > 0 && void 0 !== arguments[0]
2021
+ ? arguments[0]
2022
+ : 200,
2023
+ e =
2024
+ arguments.length > 1 && void 0 !== arguments[1]
2025
+ ? arguments[1]
2026
+ : 100,
2027
+ n =
2028
+ !(arguments.length > 2 && void 0 !== arguments[2]) ||
2029
+ arguments[2],
2030
+ i = Jt(t),
2031
+ r = (e = Jt(e)) / 100,
2032
+ o = n;
2033
+ return re(
2034
+ "\n // refer to Color.brightness \n const v = ($C * Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722) ) >= $scale ? 255 : 0;\n\n if ($hasColor) {\n\n if (v == 0) {\n $r = 0 \n $g = 0 \n $b = 0\n }\n \n } else {\n const value = Math.round(v)\n $r = value \n $g = value \n $b = value \n }\n \n ",
2035
+ { $C: r, $scale: i, $hasColor: o }
2036
+ );
2037
+ }
2038
+ function xt() {
2039
+ var t =
2040
+ arguments.length > 0 && void 0 !== arguments[0]
2041
+ ? arguments[0]
2042
+ : 100,
2043
+ e = (t = Jt(t)) / 100;
2044
+ return de(Ht([1, 2, 1, 2, 4, 2, 1, 2, 1], (1 / 16) * e));
2045
+ }
2046
+ function kt() {
2047
+ var t =
2048
+ arguments.length > 0 && void 0 !== arguments[0]
2049
+ ? arguments[0]
2050
+ : 100,
2051
+ e = (t = Jt(t)) / 100;
2052
+ return de(
2053
+ Ht(
2054
+ [
2055
+ 1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 6, 24, 36, 24, 6, 4, 16,
2056
+ 24, 16, 4, 1, 4, 6, 4, 1,
2057
+ ],
2058
+ (1 / 256) * e
2059
+ )
2060
+ );
2061
+ }
2062
+ function bt() {
2063
+ var t =
2064
+ arguments.length > 0 && void 0 !== arguments[0]
2065
+ ? arguments[0]
2066
+ : 1;
2067
+ return (t = Jt(t)), de([5, 5, 5, -3, 0, -3, -3, -3, -3]);
2068
+ }
2069
+ function Tt() {
2070
+ var t =
2071
+ arguments.length > 0 && void 0 !== arguments[0]
2072
+ ? arguments[0]
2073
+ : 1;
2074
+ return (t = Jt(t)), de([5, -3, -3, 5, 0, -3, 5, -3, -3]);
2075
+ }
2076
+ function Ct() {
2077
+ var t =
2078
+ arguments.length > 0 && void 0 !== arguments[0]
2079
+ ? arguments[0]
2080
+ : 100;
2081
+ return de(
2082
+ Ht(
2083
+ [
2084
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1,
2085
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2086
+ ],
2087
+ (t = Jt(t)) / 100
2088
+ )
2089
+ );
2090
+ }
2091
+ function wt() {
2092
+ return de(
2093
+ Ht(
2094
+ [
2095
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2096
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2097
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2098
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2099
+ 1,
2100
+ ],
2101
+ 1 / 9
2102
+ )
2103
+ );
2104
+ }
2105
+ function Et() {
2106
+ return de(
2107
+ Ht(
2108
+ [
2109
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
2110
+ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
2111
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
2112
+ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
2113
+ 1,
2114
+ ],
2115
+ 1 / 9
2116
+ )
2117
+ );
2118
+ }
2119
+ function St() {
2120
+ return de(
2121
+ Ht(
2122
+ [
2123
+ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0,
2124
+ 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1,
2125
+ 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0,
2126
+ 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0,
2127
+ 1,
2128
+ ],
2129
+ 1 / 9
2130
+ )
2131
+ );
2132
+ }
2133
+ function At() {
2134
+ return de([-1, -2, -1, 0, 0, 0, 1, 2, 1]);
2135
+ }
2136
+ function Lt() {
2137
+ return de([-1, 0, 1, -2, 0, 2, -1, 0, 1]);
2138
+ }
2139
+ var Ot = [
2140
+ 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388,
2141
+ 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388,
2142
+ 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345,
2143
+ 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388,
2144
+ 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497,
2145
+ 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345,
2146
+ 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507,
2147
+ 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388,
2148
+ 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307,
2149
+ 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497,
2150
+ 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411,
2151
+ 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345,
2152
+ 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294,
2153
+ 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507,
2154
+ 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,
2155
+ 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388,
2156
+ 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344,
2157
+ 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307,
2158
+ 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275,
2159
+ 273, 271, 269, 267, 265, 263, 261, 259,
2160
+ ],
2161
+ Nt = [
2162
+ 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17,
2163
+ 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19,
2164
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20,
2165
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
2166
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
2167
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,
2168
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
2169
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23,
2170
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
2171
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
2172
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
2173
+ 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
2174
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
2175
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
2176
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
2177
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
2178
+ ];
2179
+ function It() {
2180
+ (this.r = 0),
2181
+ (this.g = 0),
2182
+ (this.b = 0),
2183
+ (this.a = 0),
2184
+ (this.next = null);
2185
+ }
2186
+ function Mt(t, e, n) {
2187
+ return n
2188
+ ? (function (t, e, n, i) {
2189
+ if (isNaN(i) || i < 1) return t;
2190
+ i |= 0;
2191
+ var r,
2192
+ o,
2193
+ s,
2194
+ a,
2195
+ l,
2196
+ c,
2197
+ h,
2198
+ u,
2199
+ f,
2200
+ d,
2201
+ p,
2202
+ g,
2203
+ m,
2204
+ v,
2205
+ _,
2206
+ y,
2207
+ x,
2208
+ k,
2209
+ b,
2210
+ T,
2211
+ C = t.pixels,
2212
+ w = t.width,
2213
+ E = t.height,
2214
+ S = i + i + 1,
2215
+ A = w - 1,
2216
+ L = E - 1,
2217
+ O = i + 1,
2218
+ N = (O * (O + 1)) / 2,
2219
+ I = new It(),
2220
+ M = I;
2221
+ for (s = 1; s < S; s++)
2222
+ if (((M = M.next = new It()), s == O)) var $ = M;
2223
+ M.next = I;
2224
+ var R = null,
2225
+ D = null;
2226
+ h = c = 0;
2227
+ var P = Ot[i],
2228
+ F = Nt[i];
2229
+ for (o = 0; o < E; o++) {
2230
+ for (
2231
+ v = _ = y = u = f = d = 0,
2232
+ p = O * (x = C[c]),
2233
+ g = O * (k = C[c + 1]),
2234
+ m = O * (b = C[c + 2]),
2235
+ u += N * x,
2236
+ f += N * k,
2237
+ d += N * b,
2238
+ M = I,
2239
+ s = 0;
2240
+ s < O;
2241
+ s++
2242
+ )
2243
+ (M.r = x), (M.g = k), (M.b = b), (M = M.next);
2244
+ for (s = 1; s < O; s++)
2245
+ (a = c + ((A < s ? A : s) << 2)),
2246
+ (u += (M.r = x = C[a]) * (T = O - s)),
2247
+ (f += (M.g = k = C[a + 1]) * T),
2248
+ (d += (M.b = b = C[a + 2]) * T),
2249
+ (v += x),
2250
+ (_ += k),
2251
+ (y += b),
2252
+ (M = M.next);
2253
+ for (R = I, D = $, r = 0; r < w; r++)
2254
+ (C[c] = (u * P) >> F),
2255
+ (C[c + 1] = (f * P) >> F),
2256
+ (C[c + 2] = (d * P) >> F),
2257
+ (u -= p),
2258
+ (f -= g),
2259
+ (d -= m),
2260
+ (p -= R.r),
2261
+ (g -= R.g),
2262
+ (m -= R.b),
2263
+ (a = (h + ((a = r + i + 1) < A ? a : A)) << 2),
2264
+ (u += v += R.r = C[a]),
2265
+ (f += _ += R.g = C[a + 1]),
2266
+ (d += y += R.b = C[a + 2]),
2267
+ (R = R.next),
2268
+ (p += x = D.r),
2269
+ (g += k = D.g),
2270
+ (m += b = D.b),
2271
+ (v -= x),
2272
+ (_ -= k),
2273
+ (y -= b),
2274
+ (D = D.next),
2275
+ (c += 4);
2276
+ h += w;
2277
+ }
2278
+ for (r = 0; r < w; r++) {
2279
+ for (
2280
+ _ = y = v = f = d = u = 0,
2281
+ p = O * (x = C[(c = r << 2)]),
2282
+ g = O * (k = C[c + 1]),
2283
+ m = O * (b = C[c + 2]),
2284
+ u += N * x,
2285
+ f += N * k,
2286
+ d += N * b,
2287
+ M = I,
2288
+ s = 0;
2289
+ s < O;
2290
+ s++
2291
+ )
2292
+ (M.r = x), (M.g = k), (M.b = b), (M = M.next);
2293
+ for (l = w, s = 1; s <= i; s++)
2294
+ (c = (l + r) << 2),
2295
+ (u += (M.r = x = C[c]) * (T = O - s)),
2296
+ (f += (M.g = k = C[c + 1]) * T),
2297
+ (d += (M.b = b = C[c + 2]) * T),
2298
+ (v += x),
2299
+ (_ += k),
2300
+ (y += b),
2301
+ (M = M.next),
2302
+ s < L && (l += w);
2303
+ for (c = r, R = I, D = $, o = 0; o < E; o++)
2304
+ (C[(a = c << 2)] = (u * P) >> F),
2305
+ (C[a + 1] = (f * P) >> F),
2306
+ (C[a + 2] = (d * P) >> F),
2307
+ (u -= p),
2308
+ (f -= g),
2309
+ (d -= m),
2310
+ (p -= R.r),
2311
+ (g -= R.g),
2312
+ (m -= R.b),
2313
+ (a = (r + ((a = o + O) < L ? a : L) * w) << 2),
2314
+ (u += v += R.r = C[a]),
2315
+ (f += _ += R.g = C[a + 1]),
2316
+ (d += y += R.b = C[a + 2]),
2317
+ (R = R.next),
2318
+ (p += x = D.r),
2319
+ (g += k = D.g),
2320
+ (m += b = D.b),
2321
+ (v -= x),
2322
+ (_ -= k),
2323
+ (y -= b),
2324
+ (D = D.next),
2325
+ (c += w);
2326
+ }
2327
+ return t;
2328
+ })(t, 0, 0, e)
2329
+ : stackBlurCanvasRGB(t, 0, 0, e);
2330
+ }
2331
+ function $t() {
2332
+ var t =
2333
+ arguments.length > 0 && void 0 !== arguments[0]
2334
+ ? arguments[0]
2335
+ : 10,
2336
+ e =
2337
+ !(arguments.length > 1 && void 0 !== arguments[1]) ||
2338
+ arguments[1];
2339
+ return (
2340
+ (t = Jt(t)),
2341
+ function (n, i) {
2342
+ i(Mt(n, t, e));
2343
+ }
2344
+ );
2345
+ }
2346
+ function Rt() {
2347
+ var t =
2348
+ arguments.length > 0 && void 0 !== arguments[0]
2349
+ ? arguments[0]
2350
+ : 256;
2351
+ return de(
2352
+ Ht(
2353
+ [
2354
+ 1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 6, 24, -476, 24, 6, 4, 16,
2355
+ 24, 16, 4, 1, 4, 6, 4, 1,
2356
+ ],
2357
+ -1 / (t = Jt(t))
2358
+ )
2359
+ );
2360
+ }
2361
+ var Dt,
2362
+ Pt = k(
2363
+ {},
2364
+ {
2365
+ crop: function () {
2366
+ var t =
2367
+ arguments.length > 0 && void 0 !== arguments[0]
2368
+ ? arguments[0]
2369
+ : 0,
2370
+ e =
2371
+ arguments.length > 1 && void 0 !== arguments[1]
2372
+ ? arguments[1]
2373
+ : 0,
2374
+ n = arguments[2],
2375
+ i = arguments[3],
2376
+ r = Vt(n * i * 4, n, i);
2377
+ return function (o, s) {
2378
+ for (var a = e, l = 0; a < i; a++, l++)
2379
+ for (var c = t, h = 0; c < n; c++, h++)
2380
+ r.pixels[l * n * h] = o.pixels[a * n * c];
2381
+ s(r);
2382
+ };
2383
+ },
2384
+ resize: function (t, e) {
2385
+ return function (n, i) {
2386
+ var r = pt.drawPixels(n),
2387
+ o = r.getContext("2d");
2388
+ (r.width = t),
2389
+ (r.height = e),
2390
+ i({
2391
+ pixels: new Uint8ClampedArray(
2392
+ o.getImageData(0, 0, t, e).data
2393
+ ),
2394
+ width: t,
2395
+ height: e,
2396
+ });
2397
+ };
2398
+ },
2399
+ flipH: function () {
2400
+ return function (t, e) {
2401
+ for (
2402
+ var n = t.width,
2403
+ i = t.height,
2404
+ r = n % 2 == 1 ? Math.floor(n / 2) : n / 2,
2405
+ o = 0;
2406
+ o < i;
2407
+ o++
2408
+ )
2409
+ for (var s = 0; s < r; s++) {
2410
+ var a = (o * n + s) << 2,
2411
+ l = (o * n + (n - 1 - s)) << 2;
2412
+ se(t.pixels, a, l);
2413
+ }
2414
+ e(t);
2415
+ };
2416
+ },
2417
+ flipV: function () {
2418
+ return function (t, e) {
2419
+ for (
2420
+ var n = t.width,
2421
+ i = t.height,
2422
+ r = i % 2 == 1 ? Math.floor(i / 2) : i / 2,
2423
+ o = 0;
2424
+ o < r;
2425
+ o++
2426
+ )
2427
+ for (var s = 0; s < n; s++) {
2428
+ var a = (o * n + s) << 2,
2429
+ l = ((i - 1 - o) * n + s) << 2;
2430
+ se(t.pixels, a, l);
2431
+ }
2432
+ e(t);
2433
+ };
2434
+ },
2435
+ rotate: function () {
2436
+ var t =
2437
+ arguments.length > 0 && void 0 !== arguments[0]
2438
+ ? arguments[0]
2439
+ : 0;
2440
+ return (
2441
+ (t = Jt(t)),
2442
+ (t %= 360),
2443
+ function (e, n) {
2444
+ var i =
2445
+ arguments.length > 2 && void 0 !== arguments[2]
2446
+ ? arguments[2]
2447
+ : {};
2448
+ if (0 == t) return e;
2449
+ if (90 == t || 270 == t)
2450
+ var r = Vt(e.pixels.length, e.height, e.width);
2451
+ else {
2452
+ if (180 != t) return _t(t)(e, n, i);
2453
+ r = Vt(e.pixels.length, e.width, e.height);
2454
+ }
2455
+ ae(function (n, i, o, s) {
2456
+ if (90 == t)
2457
+ var a = (o * r.width + (r.width - 1 - s)) << 2;
2458
+ else
2459
+ 270 == t
2460
+ ? (a = ((r.height - 1 - o) * r.width + s) << 2)
2461
+ : 180 == t &&
2462
+ (a =
2463
+ ((r.height - 1 - s) * r.width +
2464
+ (r.width - 1 - o)) <<
2465
+ 2);
2466
+ he(r.pixels, a, e.pixels, i);
2467
+ })(
2468
+ e,
2469
+ function () {
2470
+ n(r);
2471
+ },
2472
+ i
2473
+ );
2474
+ }
2475
+ );
2476
+ },
2477
+ rotateDegree: _t,
2478
+ histogram: function () {
2479
+ for (
2480
+ var t =
2481
+ arguments.length > 0 && void 0 !== arguments[0]
2482
+ ? arguments[0]
2483
+ : "gray",
2484
+ e =
2485
+ arguments.length > 1 && void 0 !== arguments[1]
2486
+ ? arguments[1]
2487
+ : [],
2488
+ n = [],
2489
+ i = 0;
2490
+ i < e.length - 1;
2491
+ i++
2492
+ )
2493
+ for (
2494
+ var r = e[i],
2495
+ o = e[i + 1],
2496
+ s = o[0] - r[0],
2497
+ a = o[1] - r[1],
2498
+ l = a / s,
2499
+ c = 0,
2500
+ h = r[0];
2501
+ c < s;
2502
+ c++, h++
2503
+ )
2504
+ n[h] = r[1] + c * l;
2505
+ return (
2506
+ (n[255] = 255),
2507
+ re(
2508
+ "red" === t
2509
+ ? function () {
2510
+ $r = n[$r];
2511
+ }
2512
+ : "green" === t
2513
+ ? function () {
2514
+ $g = n[$g];
2515
+ }
2516
+ : "blue" === t
2517
+ ? function () {
2518
+ $b = n[$b];
2519
+ }
2520
+ : function () {
2521
+ var t = Color.RGBtoYCrCb($r, $g, $b),
2522
+ e = Color.YCrCbtoRGB(
2523
+ clamp(n[clamp(t.y)]),
2524
+ t.cr,
2525
+ t.cb,
2526
+ 0
2527
+ );
2528
+ ($r = e.r), ($g = e.g), ($b = e.b);
2529
+ },
2530
+ {},
2531
+ { $realPoints: n }
2532
+ )
2533
+ );
2534
+ },
2535
+ "rotate-degree": _t,
2536
+ },
2537
+ {
2538
+ bitonal: function (t, e) {
2539
+ var n =
2540
+ arguments.length > 2 && void 0 !== arguments[2]
2541
+ ? arguments[2]
2542
+ : 100,
2543
+ i = Ze.parse(t),
2544
+ r = Ze.parse(e),
2545
+ o = n;
2546
+ return re(
2547
+ "\n const thresholdColor = ( $r + $g + $b ) <= $threshold ? $darkColor : $lightColor\n\n $r = thresholdColor.r\n $g = thresholdColor.g \n $b = thresholdColor.b \n ",
2548
+ { $threshold: o },
2549
+ { $darkColor: i, $lightColor: r }
2550
+ );
2551
+ },
2552
+ brightness: function () {
2553
+ var t =
2554
+ arguments.length > 0 && void 0 !== arguments[0]
2555
+ ? arguments[0]
2556
+ : 1;
2557
+ t = Jt(t);
2558
+ var e = Math.floor((t / 100) * 255);
2559
+ return re(
2560
+ "\n $r += $C \n $g += $C \n $b += $C \n ",
2561
+ { $C: e }
2562
+ );
2563
+ },
2564
+ brownie: function () {
2565
+ return re(
2566
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2567
+ {
2568
+ $matrix: [
2569
+ 0.5997023498159715, 0.34553243048391263,
2570
+ -0.2708298674538042, 0, -0.037703249837783157,
2571
+ 0.8609577587992641, 0.15059552388459913, 0,
2572
+ 0.24113635128153335, -0.07441037908422492,
2573
+ 0.44972182064877153, 0, 0, 0, 0, 1,
2574
+ ],
2575
+ }
2576
+ );
2577
+ },
2578
+ clip: function () {
2579
+ var t =
2580
+ arguments.length > 0 && void 0 !== arguments[0]
2581
+ ? arguments[0]
2582
+ : 0;
2583
+ t = Jt(t);
2584
+ var e = 2.55 * Math.abs(t);
2585
+ return re(
2586
+ "\n\n $r = ($r > 255 - $C) ? 255 : 0\n $g = ($g > 255 - $C) ? 255 : 0\n $b = ($b > 255 - $C) ? 255 : 0\n\n ",
2587
+ { $C: e }
2588
+ );
2589
+ },
2590
+ contrast: function () {
2591
+ var t =
2592
+ arguments.length > 0 && void 0 !== arguments[0]
2593
+ ? arguments[0]
2594
+ : 0;
2595
+ t = Jt(t);
2596
+ var e = Math.max((128 + t) / 128, 0);
2597
+ return re(
2598
+ "\n $r *= $C\n $g *= $C\n $b *= $C\n ",
2599
+ { $C: e }
2600
+ );
2601
+ },
2602
+ gamma: function () {
2603
+ var t =
2604
+ arguments.length > 0 && void 0 !== arguments[0]
2605
+ ? arguments[0]
2606
+ : 1,
2607
+ e = Jt(t);
2608
+ return re(
2609
+ "\n $r = Math.pow($r / 255, $C) * 255\n $g = Math.pow($g / 255, $C) * 255\n $b = Math.pow($b / 255, $C) * 255\n ",
2610
+ { $C: e }
2611
+ );
2612
+ },
2613
+ gradient: function () {
2614
+ var t = [].concat(Array.prototype.slice.call(arguments));
2615
+ 1 === t.length &&
2616
+ "string" == typeof t[0] &&
2617
+ (t = Ze.convertMatchesArray(t[0]));
2618
+ var e = (t = t.map(function (t) {
2619
+ return Ze.matches(t).length
2620
+ ? { type: "param", value: t }
2621
+ : { type: "scale", value: t };
2622
+ })).filter(function (t) {
2623
+ return "scale" == t.type;
2624
+ })[0];
2625
+ (e = e ? +e.value : 256),
2626
+ (t = t
2627
+ .filter(function (t) {
2628
+ return "param" == t.type;
2629
+ })
2630
+ .map(function (t) {
2631
+ return t.value;
2632
+ })
2633
+ .join(","));
2634
+ var n = Ze.gradient(t, e).map(function (t) {
2635
+ var e = Ze.parse(t);
2636
+ return { r: e.r, g: e.g, b: e.b, a: e.a };
2637
+ });
2638
+ return re(
2639
+ "\n const colorIndex = clamp(Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722))\n const newColorIndex = clamp(Math.floor(colorIndex * ($scale / 256)))\n const color = $colors[newColorIndex]\n\n $r = color.r \n $g = color.g \n $b = color.b \n $a = clamp(Math.floor(color.a * 256))\n ",
2640
+ {},
2641
+ { $colors: n, $scale: e }
2642
+ );
2643
+ },
2644
+ grayscale: function (t) {
2645
+ var e = (t = Jt(t)) / 100;
2646
+ return (
2647
+ e > 1 && (e = 1),
2648
+ re(
2649
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a\n ",
2650
+ {
2651
+ $matrix: [
2652
+ 0.2126 + 0.7874 * (1 - e),
2653
+ 0.7152 - 0.7152 * (1 - e),
2654
+ 0.0722 - 0.0722 * (1 - e),
2655
+ 0,
2656
+ 0.2126 - 0.2126 * (1 - e),
2657
+ 0.7152 + 0.2848 * (1 - e),
2658
+ 0.0722 - 0.0722 * (1 - e),
2659
+ 0,
2660
+ 0.2126 - 0.2126 * (1 - e),
2661
+ 0.7152 - 0.7152 * (1 - e),
2662
+ 0.0722 + 0.9278 * (1 - e),
2663
+ 0,
2664
+ 0,
2665
+ 0,
2666
+ 0,
2667
+ 1,
2668
+ ],
2669
+ }
2670
+ )
2671
+ );
2672
+ },
2673
+ hue: function () {
2674
+ var t =
2675
+ arguments.length > 0 && void 0 !== arguments[0]
2676
+ ? arguments[0]
2677
+ : 360,
2678
+ e = Jt(t);
2679
+ return re(
2680
+ "\n var hsv = Color.RGBtoHSV($r, $g, $b);\n\n // 0 ~ 360 \n var h = hsv.h;\n h += Math.abs($C)\n h = h % 360\n hsv.h = h\n\n var rgb = Color.HSVtoRGB(hsv);\n\n $r = rgb.r\n $g = rgb.g\n $b = rgb.b\n ",
2681
+ { $C: e }
2682
+ );
2683
+ },
2684
+ invert: function () {
2685
+ var t =
2686
+ arguments.length > 0 && void 0 !== arguments[0]
2687
+ ? arguments[0]
2688
+ : 100,
2689
+ e = (t = Jt(t)) / 100;
2690
+ return re(
2691
+ "\n $r = (255 - $r) * $C\n $g = (255 - $g) * $C\n $b = (255 - $b) * $C\n ",
2692
+ { $C: e }
2693
+ );
2694
+ },
2695
+ kodachrome: function () {
2696
+ return re(
2697
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2698
+ {
2699
+ $matrix: [
2700
+ 1.1285582396593525, -0.3967382283601348,
2701
+ -0.03992559172921793, 0, -0.16404339962244616,
2702
+ 1.0835251566291304, -0.05498805115633132, 0,
2703
+ -0.16786010706155763, -0.5603416277695248,
2704
+ 1.6014850761964943, 0, 0, 0, 0, 1,
2705
+ ],
2706
+ }
2707
+ );
2708
+ },
2709
+ matrix: function () {
2710
+ var t =
2711
+ arguments.length > 0 && void 0 !== arguments[0]
2712
+ ? arguments[0]
2713
+ : 0,
2714
+ e =
2715
+ arguments.length > 1 && void 0 !== arguments[1]
2716
+ ? arguments[1]
2717
+ : 0,
2718
+ n =
2719
+ arguments.length > 2 && void 0 !== arguments[2]
2720
+ ? arguments[2]
2721
+ : 0,
2722
+ i =
2723
+ arguments.length > 3 && void 0 !== arguments[3]
2724
+ ? arguments[3]
2725
+ : 0,
2726
+ r =
2727
+ arguments.length > 4 && void 0 !== arguments[4]
2728
+ ? arguments[4]
2729
+ : 0,
2730
+ o =
2731
+ arguments.length > 5 && void 0 !== arguments[5]
2732
+ ? arguments[5]
2733
+ : 0,
2734
+ s =
2735
+ arguments.length > 6 && void 0 !== arguments[6]
2736
+ ? arguments[6]
2737
+ : 0,
2738
+ a =
2739
+ arguments.length > 7 && void 0 !== arguments[7]
2740
+ ? arguments[7]
2741
+ : 0,
2742
+ l =
2743
+ arguments.length > 8 && void 0 !== arguments[8]
2744
+ ? arguments[8]
2745
+ : 0,
2746
+ c =
2747
+ arguments.length > 9 && void 0 !== arguments[9]
2748
+ ? arguments[9]
2749
+ : 0,
2750
+ h =
2751
+ arguments.length > 10 && void 0 !== arguments[10]
2752
+ ? arguments[10]
2753
+ : 0,
2754
+ u =
2755
+ arguments.length > 11 && void 0 !== arguments[11]
2756
+ ? arguments[11]
2757
+ : 0,
2758
+ f =
2759
+ arguments.length > 12 && void 0 !== arguments[12]
2760
+ ? arguments[12]
2761
+ : 0,
2762
+ d =
2763
+ arguments.length > 13 && void 0 !== arguments[13]
2764
+ ? arguments[13]
2765
+ : 0,
2766
+ p =
2767
+ arguments.length > 14 && void 0 !== arguments[14]
2768
+ ? arguments[14]
2769
+ : 0,
2770
+ g =
2771
+ arguments.length > 15 && void 0 !== arguments[15]
2772
+ ? arguments[15]
2773
+ : 0,
2774
+ m = [t, e, n, i, r, o, s, a, l, c, h, u, f, d, p, g];
2775
+ return re(
2776
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2777
+ { $matrix: m }
2778
+ );
2779
+ },
2780
+ noise: function () {
2781
+ var t =
2782
+ arguments.length > 0 && void 0 !== arguments[0]
2783
+ ? arguments[0]
2784
+ : 1,
2785
+ e = Jt(t);
2786
+ return re(
2787
+ "\n const C = Math.abs($C) * 5\n const min = -C\n const max = C \n const noiseValue = Math.round(min + (Math.random() * (max - min)))\n\n $r += noiseValue\n $g += noiseValue\n $b += noiseValue\n ",
2788
+ { $C: e }
2789
+ );
2790
+ },
2791
+ opacity: function () {
2792
+ var t =
2793
+ arguments.length > 0 && void 0 !== arguments[0]
2794
+ ? arguments[0]
2795
+ : 100,
2796
+ e = (t = Jt(t)) / 100;
2797
+ return re("\n $a *= $C \n ", { $C: e });
2798
+ },
2799
+ polaroid: function () {
2800
+ return re(
2801
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2802
+ {
2803
+ $matrix: [
2804
+ 1.438, -0.062, -0.062, 0, -0.122, 1.378, -0.122, 0,
2805
+ -0.016, -0.016, 1.483, 0, 0, 0, 0, 1,
2806
+ ],
2807
+ }
2808
+ );
2809
+ },
2810
+ saturation: function () {
2811
+ var t =
2812
+ arguments.length > 0 && void 0 !== arguments[0]
2813
+ ? arguments[0]
2814
+ : 100,
2815
+ e = (t = Jt(t)) / 100,
2816
+ n = 1 - Math.abs(e),
2817
+ i = [n, 0, 0, 0, 0, n, 0, 0, 0, 0, n, 0, 0, 0, 0, n];
2818
+ return re(
2819
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2820
+ { $matrix: i }
2821
+ );
2822
+ },
2823
+ sepia: function () {
2824
+ var t =
2825
+ arguments.length > 0 && void 0 !== arguments[0]
2826
+ ? arguments[0]
2827
+ : 1,
2828
+ e = Jt(t);
2829
+ e > 1 && (e = 1);
2830
+ var n = [
2831
+ 0.393 + 0.607 * (1 - e),
2832
+ 0.769 - 0.769 * (1 - e),
2833
+ 0.189 - 0.189 * (1 - e),
2834
+ 0,
2835
+ 0.349 - 0.349 * (1 - e),
2836
+ 0.686 + 0.314 * (1 - e),
2837
+ 0.168 - 0.168 * (1 - e),
2838
+ 0,
2839
+ 0.272 - 0.272 * (1 - e),
2840
+ 0.534 - 0.534 * (1 - e),
2841
+ 0.131 + 0.869 * (1 - e),
2842
+ 0,
2843
+ 0,
2844
+ 0,
2845
+ 0,
2846
+ 1,
2847
+ ];
2848
+ return re(
2849
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2850
+ { $matrix: n }
2851
+ );
2852
+ },
2853
+ shade: function () {
2854
+ var t =
2855
+ arguments.length > 0 && void 0 !== arguments[0]
2856
+ ? arguments[0]
2857
+ : 1,
2858
+ e =
2859
+ arguments.length > 1 && void 0 !== arguments[1]
2860
+ ? arguments[1]
2861
+ : 1,
2862
+ n =
2863
+ arguments.length > 2 && void 0 !== arguments[2]
2864
+ ? arguments[2]
2865
+ : 1,
2866
+ i = Jt(t),
2867
+ r = Jt(e),
2868
+ o = Jt(n);
2869
+ return re(
2870
+ "\n $r *= $redValue\n $g *= $greenValue\n $b *= $blueValue\n ",
2871
+ { $redValue: i, $greenValue: r, $blueValue: o }
2872
+ );
2873
+ },
2874
+ shift: function () {
2875
+ return re(
2876
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2877
+ {
2878
+ $matrix: [
2879
+ 1.438, -0.062, -0.062, 0, -0.122, 1.378, -0.122, 0,
2880
+ -0.016, -0.016, 1.483, 0, 0, 0, 0, 1,
2881
+ ],
2882
+ }
2883
+ );
2884
+ },
2885
+ solarize: function (t, e, n) {
2886
+ return re(
2887
+ "\n $r = ($r < $redValue) ? 255 - $r: $r\n $g = ($g < $greenValue) ? 255 - $g: $g\n $b = ($b < $blueValue) ? 255 - $b: $b\n ",
2888
+ {
2889
+ $redValue: Jt(t),
2890
+ $greenValue: Jt(e),
2891
+ $blueValue: Jt(n),
2892
+ }
2893
+ );
2894
+ },
2895
+ technicolor: function () {
2896
+ return re(
2897
+ "\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a \n ",
2898
+ {
2899
+ $matrix: [
2900
+ 1.9125277891456083, -0.8545344976951645,
2901
+ -0.09155508482755585, 0, -0.3087833385928097,
2902
+ 1.7658908555458428, -0.10601743074722245, 0,
2903
+ -0.231103377548616, -0.7501899197440212,
2904
+ 1.847597816108189, 0, 0, 0, 0, 1,
2905
+ ],
2906
+ }
2907
+ );
2908
+ },
2909
+ threshold: function () {
2910
+ var t =
2911
+ arguments.length > 0 && void 0 !== arguments[0]
2912
+ ? arguments[0]
2913
+ : 200,
2914
+ e =
2915
+ arguments.length > 1 && void 0 !== arguments[1]
2916
+ ? arguments[1]
2917
+ : 100;
2918
+ return yt(t, e, !1);
2919
+ },
2920
+ "threshold-color": yt,
2921
+ tint: function () {
2922
+ var t =
2923
+ arguments.length > 0 && void 0 !== arguments[0]
2924
+ ? arguments[0]
2925
+ : 1,
2926
+ e =
2927
+ arguments.length > 1 && void 0 !== arguments[1]
2928
+ ? arguments[1]
2929
+ : 1,
2930
+ n =
2931
+ arguments.length > 2 && void 0 !== arguments[2]
2932
+ ? arguments[2]
2933
+ : 1,
2934
+ i = Jt(t),
2935
+ r = Jt(e),
2936
+ o = Jt(n);
2937
+ return re(
2938
+ "\n\n $r += (255 - $r) * $redTint\n $g += (255 - $g) * $greenTint\n $b += (255 - $b) * $blueTint\n\n ",
2939
+ { $redTint: i, $greenTint: r, $blueTint: o }
2940
+ );
2941
+ },
2942
+ },
2943
+ {
2944
+ blur: function () {
2945
+ var t =
2946
+ arguments.length > 0 && void 0 !== arguments[0]
2947
+ ? arguments[0]
2948
+ : 3;
2949
+ return de(le((t = Jt(t))));
2950
+ },
2951
+ emboss: function () {
2952
+ var t =
2953
+ arguments.length > 0 && void 0 !== arguments[0]
2954
+ ? arguments[0]
2955
+ : 4;
2956
+ return de([-2 * (t = Jt(t)), -t, 0, -t, 1, t, 0, t, 2 * t]);
2957
+ },
2958
+ gaussianBlur: xt,
2959
+ "gaussian-blur": xt,
2960
+ gaussianBlur5x: kt,
2961
+ "gaussian-blur-5x": kt,
2962
+ grayscale2: function () {
2963
+ var t =
2964
+ arguments.length > 0 && void 0 !== arguments[0]
2965
+ ? arguments[0]
2966
+ : 100;
2967
+ return de(
2968
+ Ht(
2969
+ [
2970
+ 0.3, 0.3, 0.3, 0, 0, 0.59, 0.59, 0.59, 0, 0, 0.11,
2971
+ 0.11, 0.11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2972
+ ],
2973
+ (t = Jt(t)) / 100
2974
+ )
2975
+ );
2976
+ },
2977
+ normal: function () {
2978
+ return de([0, 0, 0, 0, 1, 0, 0, 0, 0]);
2979
+ },
2980
+ kirschHorizontal: bt,
2981
+ "kirsch-horizontal": bt,
2982
+ kirschVertical: Tt,
2983
+ "kirsch-vertical": Tt,
2984
+ laplacian: function () {
2985
+ var t =
2986
+ arguments.length > 0 && void 0 !== arguments[0]
2987
+ ? arguments[0]
2988
+ : 100;
2989
+ return de(
2990
+ Ht([-1, -1, -1, -1, 8, -1, -1, -1, -1], (t = Jt(t)) / 100)
2991
+ );
2992
+ },
2993
+ laplacian5x: Ct,
2994
+ "laplacian-5x": Ct,
2995
+ motionBlur: wt,
2996
+ "motion-blur": wt,
2997
+ motionBlur2: Et,
2998
+ "motion-blur-2": Et,
2999
+ motionBlur3: St,
3000
+ "motion-blur-3": St,
3001
+ negative: function () {
3002
+ var t =
3003
+ arguments.length > 0 && void 0 !== arguments[0]
3004
+ ? arguments[0]
3005
+ : 100;
3006
+ return de(
3007
+ Ht(
3008
+ [
3009
+ -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0,
3010
+ 0, 1, 0, 1, 1, 1, 1, 1,
3011
+ ],
3012
+ (t = Jt(t)) / 100
3013
+ )
3014
+ );
3015
+ },
3016
+ sepia2: function () {
3017
+ var t =
3018
+ arguments.length > 0 && void 0 !== arguments[0]
3019
+ ? arguments[0]
3020
+ : 100;
3021
+ return de(
3022
+ Ht(
3023
+ [
3024
+ 0.393, 0.349, 0.272, 0, 0, 0.769, 0.686, 0.534, 0, 0,
3025
+ 0.189, 0.168, 0.131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3026
+ 0,
3027
+ ],
3028
+ (t = Jt(t)) / 100
3029
+ )
3030
+ );
3031
+ },
3032
+ sharpen: function () {
3033
+ var t =
3034
+ arguments.length > 0 && void 0 !== arguments[0]
3035
+ ? arguments[0]
3036
+ : 100;
3037
+ return de(
3038
+ Ht([0, -1, 0, -1, 5, -1, 0, -1, 0], (t = Jt(t)) / 100)
3039
+ );
3040
+ },
3041
+ sobelHorizontal: At,
3042
+ "sobel-horizontal": At,
3043
+ sobelVertical: Lt,
3044
+ "sobel-vertical": Lt,
3045
+ stackBlur: $t,
3046
+ "stack-blur": $t,
3047
+ transparency: function () {
3048
+ var t =
3049
+ arguments.length > 0 && void 0 !== arguments[0]
3050
+ ? arguments[0]
3051
+ : 100;
3052
+ return de(
3053
+ Ht(
3054
+ [
3055
+ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
3056
+ 0.3, 0, 0, 0, 0, 0, 1,
3057
+ ],
3058
+ (t = Jt(t)) / 100
3059
+ )
3060
+ );
3061
+ },
3062
+ unsharpMasking: Rt,
3063
+ "unsharp-masking": Rt,
3064
+ },
3065
+ {
3066
+ kirsch: function () {
3067
+ return ve("kirsch-horizontal kirsch-vertical");
3068
+ },
3069
+ sobel: function () {
3070
+ return ve("sobel-horizontal sobel-vertical");
3071
+ },
3072
+ vintage: function () {
3073
+ return ve("brightness(15) saturation(-20) gamma(1.8)");
3074
+ },
3075
+ }
3076
+ ),
3077
+ Ft = 0,
3078
+ Bt =
3079
+ (x(
3080
+ (Dt = {
3081
+ partial: ke,
3082
+ multi: ye,
3083
+ merge: xe,
3084
+ weight: Ht,
3085
+ repeat: zt,
3086
+ colorMatrix: function (t, e, n) {
3087
+ var i = t[e],
3088
+ r = t[e + 1],
3089
+ o = t[e + 2],
3090
+ s = t[e + 3];
3091
+ ce(
3092
+ t,
3093
+ e,
3094
+ n[0] * i + n[1] * r + n[2] * o + n[3] * s,
3095
+ n[4] * i + n[5] * r + n[6] * o + n[7] * s,
3096
+ n[8] * i + n[9] * r + n[10] * o + n[11] * s,
3097
+ n[12] * i + n[13] * r + n[14] * o + n[15] * s
3098
+ );
3099
+ },
3100
+ each: Gt,
3101
+ eachXY: qt,
3102
+ createRandomCount: function () {
3103
+ return [9, 16, 25, 36, 49, 64, 81, 100].sort(function (
3104
+ t,
3105
+ e
3106
+ ) {
3107
+ return 0.5 - Math.random();
3108
+ })[0];
3109
+ },
3110
+ createRandRange: function (t, e, n) {
3111
+ for (var i = [], r = 1; r <= n; r++) {
3112
+ var o = Math.random() * (e - t) + t,
3113
+ s = Math.floor(10 * Math.random()) % 2 == 0 ? -1 : 1;
3114
+ i.push(s * o);
3115
+ }
3116
+ i.sort();
3117
+ var a = Math.floor(n >> 1),
3118
+ l = i[a];
3119
+ return (i[a] = i[0]), (i[0] = l), i;
3120
+ },
3121
+ createBitmap: Vt,
3122
+ createBlurMatrix: le,
3123
+ pack: function (t) {
3124
+ return function (e, n) {
3125
+ Gt(
3126
+ e.pixels.length,
3127
+ function (n, i) {
3128
+ t(
3129
+ e.pixels,
3130
+ n,
3131
+ i,
3132
+ e.pixels[n],
3133
+ e.pixels[n + 1],
3134
+ e.pixels[n + 2],
3135
+ e.pixels[n + 3]
3136
+ );
3137
+ },
3138
+ function () {
3139
+ n(e);
3140
+ }
3141
+ );
3142
+ };
3143
+ },
3144
+ packXY: ae,
3145
+ pixel: re,
3146
+ getBitmap: Qt,
3147
+ putBitmap: Zt,
3148
+ radian: function (t) {
3149
+ return vt.CONSTANT.radian(t);
3150
+ },
3151
+ convolution: de,
3152
+ parseParamNumber: Jt,
3153
+ filter: ve,
3154
+ clamp: me,
3155
+ fillColor: ce,
3156
+ fillPixelColor: he,
3157
+ }),
3158
+ "multi",
3159
+ ye
3160
+ ),
3161
+ x(Dt, "merge", xe),
3162
+ x(Dt, "matches", pe),
3163
+ x(Dt, "parseFilter", ge),
3164
+ x(Dt, "partial", ke),
3165
+ Dt),
3166
+ Ut = Bt;
3167
+ function Ht(t) {
3168
+ var e =
3169
+ arguments.length > 1 && void 0 !== arguments[1]
3170
+ ? arguments[1]
3171
+ : 1;
3172
+ return t.map(function (t) {
3173
+ return t * e;
3174
+ });
3175
+ }
3176
+ function zt(t, e) {
3177
+ for (var n = new Array(e), i = 0; i < e; i++) n[i] = t;
3178
+ return n;
3179
+ }
3180
+ function Wt(t) {
3181
+ if ("function" == typeof t) return t;
3182
+ "string" == typeof t && (t = [t]);
3183
+ var e = (t = t.slice(0)).shift();
3184
+ if ("function" == typeof e) return e;
3185
+ var n = t,
3186
+ i = Pt[e] || Ut[e];
3187
+ if (!i)
3188
+ throw new Error(
3189
+ e + " is not filter. please check filter name."
3190
+ );
3191
+ return i.apply(i, n);
3192
+ }
3193
+ function jt(t) {
3194
+ var e =
3195
+ arguments.length > 1 && void 0 !== arguments[1]
3196
+ ? arguments[1]
3197
+ : 0,
3198
+ n =
3199
+ arguments.length > 2 && void 0 !== arguments[2]
3200
+ ? arguments[2]
3201
+ : 1,
3202
+ i = arguments[3],
3203
+ r = arguments[4],
3204
+ o =
3205
+ arguments.length > 5 && void 0 !== arguments[5]
3206
+ ? arguments[5]
3207
+ : 1e4,
3208
+ s =
3209
+ arguments.length > 6 && void 0 !== arguments[6]
3210
+ ? arguments[6]
3211
+ : "full",
3212
+ a =
3213
+ arguments.length > 7 && void 0 !== arguments[7]
3214
+ ? arguments[7]
3215
+ : 50,
3216
+ l = e,
3217
+ c = function (t) {
3218
+ setTimeout(t, 0);
3219
+ };
3220
+ function h() {
3221
+ var t =
3222
+ arguments.length > 0 && void 0 !== arguments[0]
3223
+ ? arguments[0]
3224
+ : 50,
3225
+ e = [].concat(E(Array(t))),
3226
+ n = e
3227
+ .map(function (t) {
3228
+ return "cri = ri + i * s; if (cri >= mx) return {currentRunIndex: cri, i: null}; c(cri); i++;";
3229
+ })
3230
+ .join("\n"),
3231
+ i = new Function(
3232
+ "ri",
3233
+ "i",
3234
+ "s",
3235
+ "mx",
3236
+ "c",
3237
+ "\n let cri = ri;\n \n " +
3238
+ n +
3239
+ "\n \n return {currentRunIndex: cri, i: i} \n "
3240
+ );
3241
+ return i;
3242
+ }
3243
+ function u() {
3244
+ for (var e = h(a), r = l, s = {}, c = 0; c < o; ) {
3245
+ if (null == (s = e(l, c, n, t, i)).i) {
3246
+ r = s.currentRunIndex;
3247
+ break;
3248
+ }
3249
+ (c = s.i), (r = s.currentRunIndex);
3250
+ }
3251
+ f(r);
3252
+ }
3253
+ function f(e) {
3254
+ e ? (l = e) : (l += n), l >= t ? r() : c ? c(u) : u();
3255
+ }
3256
+ "requestAnimationFrame" == s &&
3257
+ ((c = requestAnimationFrame), (o = 1e3)),
3258
+ "full" == s && ((c = null), (o = t)),
3259
+ u();
3260
+ }
3261
+ function Gt(t, e, n) {
3262
+ var i =
3263
+ arguments.length > 3 && void 0 !== arguments[3]
3264
+ ? arguments[3]
3265
+ : {};
3266
+ jt(
3267
+ t,
3268
+ 0,
3269
+ 4,
3270
+ function (t) {
3271
+ e(t, t >> 2);
3272
+ },
3273
+ function () {
3274
+ n();
3275
+ },
3276
+ i.functionDumpCount,
3277
+ i.frameTimer,
3278
+ i.loopCount
3279
+ );
3280
+ }
3281
+ function qt(t, e, n, i) {
3282
+ var r =
3283
+ arguments.length > 4 && void 0 !== arguments[4]
3284
+ ? arguments[4]
3285
+ : {};
3286
+ jt(
3287
+ t,
3288
+ 0,
3289
+ 4,
3290
+ function (t) {
3291
+ var i = t >> 2;
3292
+ n(t, i % e, Math.floor(i / e));
3293
+ },
3294
+ function () {
3295
+ i();
3296
+ },
3297
+ r.functionDumpCount,
3298
+ r.frameTimer,
3299
+ r.loopCount
3300
+ );
3301
+ }
3302
+ function Vt(t, e, n) {
3303
+ return { pixels: new Uint8ClampedArray(t), width: e, height: n };
3304
+ }
3305
+ function Yt(t, e, n, i) {
3306
+ for (
3307
+ var r = e.pixels.length / 4,
3308
+ o = 0,
3309
+ s = 0,
3310
+ a = 0,
3311
+ l = 0,
3312
+ c = 0,
3313
+ h = 0,
3314
+ u = 0;
3315
+ u < r;
3316
+ u++
3317
+ )
3318
+ (a = u % e.width),
3319
+ (s = i + (l = Math.floor(u / e.width))),
3320
+ (o = n + a) > t.width ||
3321
+ s > t.height ||
3322
+ ((c = (l * e.width + a) << 2),
3323
+ (h = (s * t.width + o) << 2),
3324
+ (t.pixels[h] = e.pixels[c]),
3325
+ (t.pixels[h + 1] = e.pixels[c + 1]),
3326
+ (t.pixels[h + 2] = e.pixels[c + 2]),
3327
+ (t.pixels[h + 3] = e.pixels[c + 3]));
3328
+ }
3329
+ function Kt(t, e, n, i) {
3330
+ for (
3331
+ var r = e.pixels.length >> 2,
3332
+ o = 0,
3333
+ s = 0,
3334
+ a = 0,
3335
+ l = 0,
3336
+ c = 0,
3337
+ h = 0,
3338
+ u = 0;
3339
+ u < r;
3340
+ u++
3341
+ )
3342
+ (a = u % e.width),
3343
+ (s = i + (l = Math.floor(u / e.width))),
3344
+ (o = n + a) > t.width ||
3345
+ s > t.height ||
3346
+ ((c = (s * t.width + o) << 2),
3347
+ (h = (l * e.width + a) << 2),
3348
+ (e.pixels[h] = t.pixels[c]),
3349
+ (e.pixels[h + 1] = t.pixels[c + 1]),
3350
+ (e.pixels[h + 2] = t.pixels[c + 2]),
3351
+ (e.pixels[h + 3] = t.pixels[c + 3]));
3352
+ }
3353
+ function Xt(t) {
3354
+ var e =
3355
+ arguments.length > 1 && void 0 !== arguments[1]
3356
+ ? arguments[1]
3357
+ : 0,
3358
+ n = t.width + e,
3359
+ i = t.height + e,
3360
+ r = {
3361
+ pixels: new Uint8ClampedArray(n * i * 4),
3362
+ width: n,
3363
+ height: i,
3364
+ };
3365
+ return r;
3366
+ }
3367
+ function Qt(t, e) {
3368
+ return pt.getBitmap(t, e);
3369
+ }
3370
+ function Zt(t, e, n) {
3371
+ return pt.putBitmap(t, e, n);
3372
+ }
3373
+ function Jt(t) {
3374
+ return (
3375
+ "string" == typeof t &&
3376
+ (t = (t = t.replace(/deg/, "")).replace(/px/, "")),
3377
+ +t
3378
+ );
3379
+ }
3380
+ var te = /(([\w_\-]+)(\(([^\)]*)\))?)+/gi;
3381
+ function ee(t) {
3382
+ var e = t
3383
+ .map(function (t) {
3384
+ return (
3385
+ " \n " +
3386
+ t.userFunction.$preContext +
3387
+ "\n\n " +
3388
+ t.userFunction.$preCallbackString +
3389
+ "\n\n $r = clamp($r); $g = clamp($g); $b = clamp($b); $a = clamp($a);\n "
3390
+ );
3391
+ })
3392
+ .join("\n\n"),
3393
+ n = { clamp: me, Color: Ze };
3394
+ t.forEach(function (t) {
3395
+ Object.assign(n, t.userFunction.rootContextObject);
3396
+ });
3397
+ var i =
3398
+ "const " +
3399
+ Object.keys(n)
3400
+ .map(function (t) {
3401
+ return " " + t + " = $rc." + t + " ";
3402
+ })
3403
+ .join(","),
3404
+ r = new Function(
3405
+ "$p",
3406
+ "$pi",
3407
+ "$rc",
3408
+ " \n let $r = $p[$pi], $g = $p[$pi+1], $b = $p[$pi+2], $a = $p[$pi+3];\n \n " +
3409
+ i +
3410
+ "\n\n " +
3411
+ e +
3412
+ "\n \n $p[$pi] = $r; $p[$pi+1] = $g; $p[$pi+2] = $b; $p[$pi+3] = $a;\n "
3413
+ );
3414
+ return function (t, e) {
3415
+ r(t, e, n);
3416
+ };
3417
+ }
3418
+ function ne(t) {
3419
+ var e = {},
3420
+ n = t.map(function (t) {
3421
+ var n = [];
3422
+ Object.keys(t.context).forEach(function (t, e) {
3423
+ n[t] = "n$" + Ft++ + t + "$";
3424
+ }),
3425
+ Object.keys(t.rootContext).forEach(function (i, r) {
3426
+ (n[i] = "r$" + Ft++ + i + "$"),
3427
+ (e[n[i]] = t.rootContext[i]);
3428
+ });
3429
+ var i = Object.keys(t.context)
3430
+ .filter(function (e) {
3431
+ return (
3432
+ "number" != typeof t.context[e] &&
3433
+ "string" != typeof t.context[e] &&
3434
+ (!Array.isArray(t.context[e]) ||
3435
+ ("number" != typeof t.context[e][0] &&
3436
+ "string" != typeof t.context[e][0]))
3437
+ );
3438
+ })
3439
+ .map(function (e, i) {
3440
+ return [n[e], JSON.stringify(t.context[e])].join(" = ");
3441
+ }),
3442
+ r = t.callback;
3443
+ return (
3444
+ "function" == typeof t.callback &&
3445
+ ((r = t.callback.toString().split("{")).shift(),
3446
+ (r = (r = r.join("{")).split("}")).pop(),
3447
+ (r = r.join("}"))),
3448
+ Object.keys(n).forEach(function (e) {
3449
+ var i = n[e];
3450
+ "number" == typeof t.context[e] ||
3451
+ "string" == typeof t.context[e]
3452
+ ? (r = r.replace(
3453
+ new RegExp("\\" + e, "g"),
3454
+ t.context[e]
3455
+ ))
3456
+ : !Array.isArray(t.context[e]) ||
3457
+ ("number" != typeof t.context[e][0] &&
3458
+ "string" != typeof t.context[e][0])
3459
+ ? (r = r.replace(new RegExp("\\" + e, "g"), i))
3460
+ : t.context[e].forEach(function (t, n) {
3461
+ r = r.replace(
3462
+ new RegExp("\\" + e + "\\[" + n + "\\]", "g"),
3463
+ t
3464
+ );
3465
+ });
3466
+ }),
3467
+ { preCallbackString: r, preContext: i }
3468
+ );
3469
+ }),
3470
+ i = n
3471
+ .map(function (t, e) {
3472
+ return t.preContext.length
3473
+ ? "const " + t.preContext + ";"
3474
+ : "";
3475
+ })
3476
+ .join("\n\n"),
3477
+ r = n
3478
+ .map(function (t) {
3479
+ return t.preCallbackString;
3480
+ })
3481
+ .join("\n\n"),
3482
+ o = new Function(
3483
+ "$pixels",
3484
+ "$pixelIndex",
3485
+ "$clamp",
3486
+ "$Color",
3487
+ " \n let $r = $pixels[$pixelIndex], $g = $pixels[$pixelIndex+1], $b = $pixels[$pixelIndex+2], $a = $pixels[$pixelIndex+3];\n\n " +
3488
+ i +
3489
+ "\n\n " +
3490
+ r +
3491
+ "\n \n $pixels[$pixelIndex] = $r\n $pixels[$pixelIndex+1] = $g \n $pixels[$pixelIndex+2] = $b \n $pixels[$pixelIndex+3] = $a \n "
3492
+ );
3493
+ return (
3494
+ (o.$preCallbackString = r),
3495
+ (o.$preContext = i),
3496
+ (o.rootContextObject = e),
3497
+ o
3498
+ );
3499
+ }
3500
+ function ie(t) {
3501
+ var e =
3502
+ arguments.length > 1 && void 0 !== arguments[1]
3503
+ ? arguments[1]
3504
+ : {},
3505
+ n =
3506
+ arguments.length > 2 && void 0 !== arguments[2]
3507
+ ? arguments[2]
3508
+ : {};
3509
+ return ne([{ callback: t, context: e, rootContext: n }]);
3510
+ }
3511
+ function re(t) {
3512
+ var e =
3513
+ arguments.length > 1 && void 0 !== arguments[1]
3514
+ ? arguments[1]
3515
+ : {},
3516
+ n =
3517
+ arguments.length > 2 && void 0 !== arguments[2]
3518
+ ? arguments[2]
3519
+ : {},
3520
+ i = ie(t, e, n),
3521
+ r = function (t, e) {};
3522
+ return (r.userFunction = i), r;
3523
+ }
3524
+ var oe = [0, 1, 2, 3];
3525
+ function se(t, e, n) {
3526
+ oe.forEach(function (i) {
3527
+ var r = t[e + i];
3528
+ (t[e + i] = t[n + i]), (t[n + i] = r);
3529
+ });
3530
+ }
3531
+ function ae(t) {
3532
+ return function (e, n) {
3533
+ var i =
3534
+ arguments.length > 2 && void 0 !== arguments[2]
3535
+ ? arguments[2]
3536
+ : {};
3537
+ qt(
3538
+ e.pixels.length,
3539
+ e.width,
3540
+ function (n, i, r) {
3541
+ t(e.pixels, n, i, r);
3542
+ },
3543
+ function () {
3544
+ n(e);
3545
+ },
3546
+ i
3547
+ );
3548
+ };
3549
+ }
3550
+ function le() {
3551
+ var t =
3552
+ arguments.length > 0 && void 0 !== arguments[0]
3553
+ ? arguments[0]
3554
+ : 3,
3555
+ e = Math.pow(t, 2),
3556
+ n = 1 / e;
3557
+ return zt(n, e);
3558
+ }
3559
+ function ce(t, e, n, i, r, o) {
3560
+ if (3 == arguments.length) {
3561
+ var s = arguments[2];
3562
+ (n = s.r), (i = s.g), (r = s.b), (o = s.a);
3563
+ }
3564
+ "number" == typeof n && (t[e] = n),
3565
+ "number" == typeof i && (t[e + 1] = i),
3566
+ "number" == typeof r && (t[e + 2] = r),
3567
+ "number" == typeof o && (t[e + 3] = o);
3568
+ }
3569
+ function he(t, e, n, i) {
3570
+ ce(t, e, n[i], n[i + 1], n[i + 2], n[i + 3]);
3571
+ }
3572
+ function ue(t) {
3573
+ var e =
3574
+ arguments.length > 1 && void 0 !== arguments[1]
3575
+ ? arguments[1]
3576
+ : 0,
3577
+ n =
3578
+ arguments.length > 2 && void 0 !== arguments[2]
3579
+ ? arguments[2]
3580
+ : 255,
3581
+ i = [];
3582
+ return (
3583
+ (i = t.map(function (t, e) {
3584
+ return [];
3585
+ })),
3586
+ t.forEach(function (t, r) {
3587
+ if (0 != t) {
3588
+ var o = i[r];
3589
+ for (r = e; r <= n; r++) o[r] = t * r;
3590
+ }
3591
+ }),
3592
+ i
3593
+ );
3594
+ }
3595
+ function fe(t, e, n, i, r) {
3596
+ var o = Math.round(Math.sqrt(t.length)),
3597
+ s = Math.floor(o / 2),
3598
+ a = r ? 1 : 0,
3599
+ l = "let r = 0, g = 0, b = 0, a = 0, scy = 0, scx =0, si = 0; ",
3600
+ c = [],
3601
+ h = [],
3602
+ u = [],
3603
+ f = [];
3604
+ t.forEach(function (t, e) {
3605
+ var i = Math.floor(e / o) - s,
3606
+ r = (e % o) - s;
3607
+ 0 != t &&
3608
+ (c.push(
3609
+ "$t[" +
3610
+ e +
3611
+ "][$sp[(($sy + (" +
3612
+ i +
3613
+ ")) * " +
3614
+ n +
3615
+ " + ($sx + (" +
3616
+ r +
3617
+ "))) * 4]]"
3618
+ ),
3619
+ h.push(
3620
+ "$t[" +
3621
+ e +
3622
+ "][$sp[(($sy + (" +
3623
+ i +
3624
+ ")) * " +
3625
+ n +
3626
+ " + ($sx + (" +
3627
+ r +
3628
+ "))) * 4 + 1]]"
3629
+ ),
3630
+ u.push(
3631
+ "$t[" +
3632
+ e +
3633
+ "][$sp[(($sy + (" +
3634
+ i +
3635
+ ")) * " +
3636
+ n +
3637
+ " + ($sx + (" +
3638
+ r +
3639
+ "))) * 4 + 2]]"
3640
+ ),
3641
+ f.push(
3642
+ "$t[" +
3643
+ e +
3644
+ "][$sp[(($sy + (" +
3645
+ i +
3646
+ ")) * " +
3647
+ n +
3648
+ " + ($sx + (" +
3649
+ r +
3650
+ "))) * 4 + 3]]"
3651
+ ));
3652
+ }),
3653
+ (l +=
3654
+ "r = " +
3655
+ c.join(" + ") +
3656
+ "; g = " +
3657
+ h.join(" + ") +
3658
+ "; b = " +
3659
+ u.join(" + ") +
3660
+ "; a = " +
3661
+ f.join(" + ") +
3662
+ ";"),
3663
+ (l +=
3664
+ "$dp[$di] = r; $dp[$di+1] = g;$dp[$di+2] = b;$dp[$di+3] = a + (" +
3665
+ a +
3666
+ ")*(255-a); ");
3667
+ var d = new Function("$dp", "$sp", "$di", "$sx", "$sy", "$t", l);
3668
+ return function (t, n, i, r, o) {
3669
+ d(t, n, i, r, o, e);
3670
+ };
3671
+ }
3672
+ function de(t) {
3673
+ var e =
3674
+ !(arguments.length > 1 && void 0 !== arguments[1]) ||
3675
+ arguments[1],
3676
+ n = ue(t);
3677
+ return function (i, r) {
3678
+ var o = Math.round(Math.sqrt(t.length)),
3679
+ s = Xt(i, 2 * o);
3680
+ Yt(s, i, o, o);
3681
+ for (
3682
+ var a = Vt(s.pixels.length, s.width, s.height),
3683
+ l = Vt(i.pixels.length, i.width, i.height),
3684
+ c = fe(t, n, s.width, s.height, e),
3685
+ h = i.pixels.length / 4,
3686
+ u = 0;
3687
+ u < h;
3688
+ u++
3689
+ ) {
3690
+ var f = u,
3691
+ d = (f % i.width) + o,
3692
+ p = Math.floor(f / i.width) + o;
3693
+ c(a.pixels, s.pixels, 4 * (p * s.width + d), d, p);
3694
+ }
3695
+ Kt(a, l, o, o), r(l);
3696
+ };
3697
+ }
3698
+ function pe(t) {
3699
+ var e = Ze.convertMatches(t),
3700
+ n = e.str.match(te),
3701
+ i = [];
3702
+ if (!n) return i;
3703
+ i = n.map(function (t) {
3704
+ return { filter: t, origin: Ze.reverseMatches(t, e.matches) };
3705
+ });
3706
+ var r = { next: 0 };
3707
+ return (i = i
3708
+ .map(function (e) {
3709
+ var n = t.indexOf(e.origin, r.next);
3710
+ return (
3711
+ (e.startIndex = n),
3712
+ (e.endIndex = n + e.origin.length),
3713
+ (e.arr = ge(e.origin)),
3714
+ (r.next = e.endIndex),
3715
+ e
3716
+ );
3717
+ })
3718
+ .filter(function (t) {
3719
+ return !!t.arr.length;
3720
+ }));
3721
+ }
3722
+ function ge(t) {
3723
+ var e = Ze.convertMatches(t),
3724
+ n = e.str.match(te);
3725
+ if (!n[0]) return [];
3726
+ var i = n[0].split("("),
3727
+ r = i.shift(),
3728
+ o = [];
3729
+ return (
3730
+ i.length &&
3731
+ (o = i
3732
+ .shift()
3733
+ .split(")")[0]
3734
+ .split(",")
3735
+ .map(function (t) {
3736
+ return Ze.reverseMatches(t, e.matches);
3737
+ })),
3738
+ [r].concat(E(o)).map(Ze.trim)
3739
+ );
3740
+ }
3741
+ function me(t) {
3742
+ return Math.min(255, t);
3743
+ }
3744
+ function ve(t) {
3745
+ return xe(
3746
+ pe(t).map(function (t) {
3747
+ return t.arr;
3748
+ })
3749
+ );
3750
+ }
3751
+ function _e() {
3752
+ for (
3753
+ var t =
3754
+ arguments.length > 0 && void 0 !== arguments[0]
3755
+ ? arguments[0]
3756
+ : [],
3757
+ e = [],
3758
+ n = [],
3759
+ i = 0,
3760
+ r = t.length;
3761
+ i < r;
3762
+ i++
3763
+ ) {
3764
+ var o = t[i];
3765
+ o.userFunction
3766
+ ? n.push(o)
3767
+ : (n.length && e.push([].concat(E(n))), e.push(o), (n = []));
3768
+ }
3769
+ return (
3770
+ n.length && e.push([].concat(E(n))),
3771
+ e.forEach(function (t, n) {
3772
+ var i;
3773
+ Array.isArray(t) &&
3774
+ (e[n] =
3775
+ ((i = ee(t)),
3776
+ function (t, e) {
3777
+ for (var n = 0, r = t.pixels.length; n < r; n += 4)
3778
+ i(t.pixels, n);
3779
+ e(t);
3780
+ }));
3781
+ }),
3782
+ e
3783
+ );
3784
+ }
3785
+ function ye() {
3786
+ for (var t = arguments.length, e = Array(t), n = 0; n < t; n++)
3787
+ e[n] = arguments[n];
3788
+ var i = (e = _e(
3789
+ (e = e
3790
+ .map(function (t) {
3791
+ return Wt(t);
3792
+ })
3793
+ .filter(function (t) {
3794
+ return t;
3795
+ }))
3796
+ )).length;
3797
+ return function (t, n) {
3798
+ var r =
3799
+ arguments.length > 2 && void 0 !== arguments[2]
3800
+ ? arguments[2]
3801
+ : {},
3802
+ o = t,
3803
+ s = 0;
3804
+ function a() {
3805
+ e[s].call(
3806
+ null,
3807
+ o,
3808
+ function (t) {
3809
+ (o = t), l();
3810
+ },
3811
+ r
3812
+ );
3813
+ }
3814
+ function l() {
3815
+ ++s >= i ? n(o) : a();
3816
+ }
3817
+ a();
3818
+ };
3819
+ }
3820
+ function xe(t) {
3821
+ return ye.apply(void 0, E(t));
3822
+ }
3823
+ function ke(t) {
3824
+ for (
3825
+ var e = null,
3826
+ n = arguments.length,
3827
+ i = Array(n > 1 ? n - 1 : 0),
3828
+ r = 1;
3829
+ r < n;
3830
+ r++
3831
+ )
3832
+ i[r - 1] = arguments[r];
3833
+ return (
3834
+ (e =
3835
+ 1 == i.length && "string" == typeof i[0] ? ve(i[0]) : xe(i)),
3836
+ function (n, i) {
3837
+ var r =
3838
+ arguments.length > 2 && void 0 !== arguments[2]
3839
+ ? arguments[2]
3840
+ : {};
3841
+ e(
3842
+ Qt(n, t),
3843
+ function (e) {
3844
+ i(Zt(n, e, t));
3845
+ },
3846
+ r
3847
+ );
3848
+ }
3849
+ );
3850
+ }
3851
+ function be(t) {
3852
+ return (
3853
+ "string" == typeof t &&
3854
+ (t = (t = t.replace(/deg/, "")).replace(/px/, "")),
3855
+ +t
3856
+ );
3857
+ }
3858
+ function Te(t) {
3859
+ var e =
3860
+ arguments.length > 1 && void 0 !== arguments[1]
3861
+ ? arguments[1]
3862
+ : 1;
3863
+ return t.map(function (t) {
3864
+ return t * e;
3865
+ });
3866
+ }
3867
+ var Ce = 0;
3868
+ function we(t) {
3869
+ return [].concat(Array.prototype.slice.call(arguments));
3870
+ }
3871
+ function Ee(t) {
3872
+ return { type: "convolution", length: t.length, content: t };
3873
+ }
3874
+ function Se(t, e) {
3875
+ return (
3876
+ "\n if (u_filterIndex == " +
3877
+ e +
3878
+ ".0) {\n " +
3879
+ t +
3880
+ "\n }\n "
3881
+ );
3882
+ }
3883
+ function Ae(t, e) {
3884
+ return {
3885
+ type: "shader",
3886
+ index: Ce,
3887
+ options: e,
3888
+ content: Se(t, Ce++),
3889
+ };
3890
+ }
3891
+ function Le(t) {
3892
+ return (
3893
+ "\n \n if (u_kernelSelect == " +
3894
+ t +
3895
+ ".0) {\n vec4 colorSum = " +
3896
+ (function (t) {
3897
+ var e = Math.sqrt(t),
3898
+ n = Math.floor(e / 2);
3899
+ return []
3900
+ .concat(E(Array(t)))
3901
+ .map(function (i, r) {
3902
+ var o = Math.floor(r / e) - n;
3903
+ return (
3904
+ "texture(u_image, v_texCoord + onePixel * vec2(" +
3905
+ ((r % e) - n) +
3906
+ ", " +
3907
+ o +
3908
+ ")) * u_kernel" +
3909
+ t +
3910
+ "[" +
3911
+ r +
3912
+ "]"
3913
+ );
3914
+ })
3915
+ .join(" + \n");
3916
+ })(t) +
3917
+ "; \n\n outColor = vec4((colorSum / u_kernel" +
3918
+ t +
3919
+ "Weight).rgb, 1);\n \n }\n "
3920
+ );
3921
+ }
3922
+ function Oe(t) {
3923
+ return (
3924
+ "vec4(" +
3925
+ (t = [t.r / 255, t.g / 255, t.b / 255, t.a || 0].map(Ne)) +
3926
+ ")"
3927
+ );
3928
+ }
3929
+ function Ne(t) {
3930
+ return t == Math.floor(t) ? t + ".0" : t;
3931
+ }
3932
+ function Ie() {
3933
+ var t =
3934
+ arguments.length > 0 && void 0 !== arguments[0]
3935
+ ? arguments[0]
3936
+ : 1,
3937
+ e = be(t) * (1 / 16);
3938
+ return Ee(Te([1, 2, 1, 2, 4, 2, 1, 2, 1], e));
3939
+ }
3940
+ function Me() {
3941
+ return Ee([
3942
+ 1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 6, 24, 36, 24, 6, 4, 16, 24,
3943
+ 16, 4, 1, 4, 6, 4, 1,
3944
+ ]);
3945
+ }
3946
+ function $e() {
3947
+ return Ee([5, 5, 5, -3, 0, -3, -3, -3, -3]);
3948
+ }
3949
+ function Re() {
3950
+ return Ee([5, -3, -3, 5, 0, -3, 5, -3, -3]);
3951
+ }
3952
+ function De() {
3953
+ return Ee([
3954
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1, -1,
3955
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,
3956
+ ]);
3957
+ }
3958
+ function Pe() {
3959
+ return Ee([
3960
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
3961
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
3962
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
3963
+ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
3964
+ ]);
3965
+ }
3966
+ function Fe() {
3967
+ return Ee([
3968
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
3969
+ 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0,
3970
+ 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
3971
+ 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
3972
+ ]);
3973
+ }
3974
+ function Be() {
3975
+ return Ee([
3976
+ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1,
3977
+ 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1,
3978
+ 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0,
3979
+ 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
3980
+ ]);
3981
+ }
3982
+ function Ue() {
3983
+ return Ee([-1, -2, -1, 0, 0, 0, 1, 2, 1]);
3984
+ }
3985
+ function He() {
3986
+ return Ee([-1, 0, 1, -2, 0, 2, -1, 0, 1]);
3987
+ }
3988
+ function ze() {
3989
+ return Ee(
3990
+ Te(
3991
+ [
3992
+ 1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 6, 24, -476, 24, 6, 4, 16,
3993
+ 24, 16, 4, 1, 4, 6, 4, 1,
3994
+ ],
3995
+ -1 / 256
3996
+ )
3997
+ );
3998
+ }
3999
+ function We() {
4000
+ var t =
4001
+ arguments.length > 0 && void 0 !== arguments[0]
4002
+ ? arguments[0]
4003
+ : 0,
4004
+ e =
4005
+ arguments.length > 1 && void 0 !== arguments[1]
4006
+ ? arguments[1]
4007
+ : 0,
4008
+ n =
4009
+ arguments.length > 2 && void 0 !== arguments[2]
4010
+ ? arguments[2]
4011
+ : 0,
4012
+ i =
4013
+ arguments.length > 3 && void 0 !== arguments[3]
4014
+ ? arguments[3]
4015
+ : 0,
4016
+ r =
4017
+ arguments.length > 4 && void 0 !== arguments[4]
4018
+ ? arguments[4]
4019
+ : 0,
4020
+ o =
4021
+ arguments.length > 5 && void 0 !== arguments[5]
4022
+ ? arguments[5]
4023
+ : 0,
4024
+ s =
4025
+ arguments.length > 6 && void 0 !== arguments[6]
4026
+ ? arguments[6]
4027
+ : 0,
4028
+ a =
4029
+ arguments.length > 7 && void 0 !== arguments[7]
4030
+ ? arguments[7]
4031
+ : 0,
4032
+ l =
4033
+ arguments.length > 8 && void 0 !== arguments[8]
4034
+ ? arguments[8]
4035
+ : 0,
4036
+ c =
4037
+ arguments.length > 9 && void 0 !== arguments[9]
4038
+ ? arguments[9]
4039
+ : 0,
4040
+ h =
4041
+ arguments.length > 10 && void 0 !== arguments[10]
4042
+ ? arguments[10]
4043
+ : 0,
4044
+ u =
4045
+ arguments.length > 11 && void 0 !== arguments[11]
4046
+ ? arguments[11]
4047
+ : 0,
4048
+ f =
4049
+ arguments.length > 12 && void 0 !== arguments[12]
4050
+ ? arguments[12]
4051
+ : 0,
4052
+ d =
4053
+ arguments.length > 13 && void 0 !== arguments[13]
4054
+ ? arguments[13]
4055
+ : 0,
4056
+ p =
4057
+ arguments.length > 14 && void 0 !== arguments[14]
4058
+ ? arguments[14]
4059
+ : 0,
4060
+ g =
4061
+ arguments.length > 15 && void 0 !== arguments[15]
4062
+ ? arguments[15]
4063
+ : 0,
4064
+ m = [t, e, n, i, r, o, s, a, l, c, h, u, f, d, p, g].map(Ne);
4065
+ return Ae(
4066
+ "\n\n outColor = vec4(\n " +
4067
+ m[0] +
4068
+ " * pixelColor.r + " +
4069
+ m[1] +
4070
+ " * pixelColor.g + " +
4071
+ m[2] +
4072
+ " * pixelColor.b + " +
4073
+ m[3] +
4074
+ " * pixelColor.a,\n " +
4075
+ m[4] +
4076
+ " * pixelColor.r + " +
4077
+ m[5] +
4078
+ " * pixelColor.g + " +
4079
+ m[6] +
4080
+ " * pixelColor.b + " +
4081
+ m[7] +
4082
+ " * pixelColor.a,\n " +
4083
+ m[8] +
4084
+ " * pixelColor.r + " +
4085
+ m[9] +
4086
+ " * pixelColor.g + " +
4087
+ m[10] +
4088
+ " * pixelColor.b + " +
4089
+ m[11] +
4090
+ " * pixelColor.a,\n " +
4091
+ m[12] +
4092
+ " * pixelColor.r + " +
4093
+ m[13] +
4094
+ " * pixelColor.g + " +
4095
+ m[14] +
4096
+ " * pixelColor.b + " +
4097
+ m[15] +
4098
+ " * pixelColor.a\n ); \n "
4099
+ );
4100
+ }
4101
+ function je() {
4102
+ var t =
4103
+ arguments.length > 0 && void 0 !== arguments[0]
4104
+ ? arguments[0]
4105
+ : 1;
4106
+ return Ae(
4107
+ "\n float c = ( (pixelColor.r * 0.2126 + pixelColor.g * 0.7152 + pixelColor.b * 0.0722) ) >= " +
4108
+ (t = Ne(be(t))) +
4109
+ " ? 1.0 : 0.0;\n\n outColor = vec4(c, c, c, pixelColor.a);\n "
4110
+ );
4111
+ }
4112
+ var Ge = k(
4113
+ {},
4114
+ {
4115
+ blur: function () {
4116
+ return Ee([1, 1, 1, 1, 1, 1, 1, 1, 1]);
4117
+ },
4118
+ normal: function () {
4119
+ return Ee([0, 0, 0, 0, 1, 0, 0, 0, 0]);
4120
+ },
4121
+ emboss: function () {
4122
+ var t =
4123
+ arguments.length > 0 && void 0 !== arguments[0]
4124
+ ? arguments[0]
4125
+ : 4;
4126
+ return Ee([-2 * (t = be(t)), -t, 0, -t, 1, t, 0, t, 2 * t]);
4127
+ },
4128
+ gaussianBlur: Ie,
4129
+ "gaussian-blur": Ie,
4130
+ gaussianBlur5x: Me,
4131
+ "gaussian-blur-5x": Me,
4132
+ grayscale2: function () {
4133
+ return Ee([
4134
+ 0.3, 0.3, 0.3, 0, 0, 0.59, 0.59, 0.59, 0, 0, 0.11, 0.11,
4135
+ 0.11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4136
+ ]);
4137
+ },
4138
+ kirschHorizontal: $e,
4139
+ "kirsch-horizontal": $e,
4140
+ kirschVertical: Re,
4141
+ "kirsch-vertical": Re,
4142
+ laplacian: function () {
4143
+ return Ee([-1, -1, -1, -1, 8, -1, -1, -1, -1]);
4144
+ },
4145
+ laplacian5x: De,
4146
+ "laplacian-5x": De,
4147
+ motionBlur: Pe,
4148
+ "motion-blur": Pe,
4149
+ motionBlur2: Fe,
4150
+ "motion-blur-2": Fe,
4151
+ motionBlur3: Be,
4152
+ "motion-blur-3": Be,
4153
+ negative: function () {
4154
+ return Ee([
4155
+ -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0,
4156
+ 1, 0, 1, 1, 1, 1, 1,
4157
+ ]);
4158
+ },
4159
+ sepia2: function () {
4160
+ return Ee([
4161
+ 0.393, 0.349, 0.272, 0, 0, 0.769, 0.686, 0.534, 0, 0,
4162
+ 0.189, 0.168, 0.131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4163
+ ]);
4164
+ },
4165
+ sharpen: function () {
4166
+ return Ee([0, -1, 0, -1, 5, -1, 0, -1, 0]);
4167
+ },
4168
+ sobelHorizontal: Ue,
4169
+ "sobel-horizontal": Ue,
4170
+ sobelVertical: He,
4171
+ "sobel-vertical": He,
4172
+ transparency: function () {
4173
+ return Ee([
4174
+ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.3,
4175
+ 0, 0, 0, 0, 0, 1,
4176
+ ]);
4177
+ },
4178
+ unsharpMasking: ze,
4179
+ "unsharp-masking": ze,
4180
+ },
4181
+ {
4182
+ bitonal: function (t, e) {
4183
+ var n =
4184
+ arguments.length > 2 && void 0 !== arguments[2]
4185
+ ? arguments[2]
4186
+ : 0.5,
4187
+ i = Ne(n),
4188
+ r = Oe(Ze.parse(t)),
4189
+ o = Oe(Ze.parse(e));
4190
+ return Ae(
4191
+ "\n if ((pixelColor.r + pixelColor.g + pixelColor.b) > " +
4192
+ i +
4193
+ ") {\n outColor = vec4(" +
4194
+ o +
4195
+ ".rgb, pixelColor.a);\n } else {\n outColor = vec4(" +
4196
+ r +
4197
+ ".rgb, pixelColor.a);\n }\n "
4198
+ );
4199
+ },
4200
+ brightness: function () {
4201
+ var t =
4202
+ arguments.length > 0 && void 0 !== arguments[0]
4203
+ ? arguments[0]
4204
+ : 1,
4205
+ e = Ne(be(t));
4206
+ return Ae(
4207
+ "\n outColor = pixelColor + (" + e + ");\n "
4208
+ );
4209
+ },
4210
+ brownie: function () {
4211
+ return We(
4212
+ 0.5997023498159715,
4213
+ 0.34553243048391263,
4214
+ -0.2708298674538042,
4215
+ 0,
4216
+ -0.037703249837783157,
4217
+ 0.8609577587992641,
4218
+ 0.15059552388459913,
4219
+ 0,
4220
+ 0.24113635128153335,
4221
+ -0.07441037908422492,
4222
+ 0.44972182064877153,
4223
+ 0,
4224
+ 0,
4225
+ 0,
4226
+ 0,
4227
+ 1
4228
+ );
4229
+ },
4230
+ clip: function () {
4231
+ var t =
4232
+ arguments.length > 0 && void 0 !== arguments[0]
4233
+ ? arguments[0]
4234
+ : 0,
4235
+ e = Ne(be(t));
4236
+ return Ae(
4237
+ "\n outColor = vec4(\n (pixelColor.r > 1.0 - " +
4238
+ e +
4239
+ ") ? 1.0 : 0.0,\n (pixelColor.g > 1.0 - " +
4240
+ e +
4241
+ ") ? 1.0 : 0.0,\n (pixelColor.b > 1.0 - " +
4242
+ e +
4243
+ ") ? 1.0 : 0.0,\n pixelColor.a \n );\n "
4244
+ );
4245
+ },
4246
+ chaos: function () {
4247
+ var t =
4248
+ arguments.length > 0 && void 0 !== arguments[0]
4249
+ ? arguments[0]
4250
+ : 10,
4251
+ e = Ne(be(t));
4252
+ return Ae(
4253
+ "\n vec2 st = pixelColor.st;\n st *= " +
4254
+ e +
4255
+ ";\n \n vec2 ipos = floor(st); // get the integer coords\n\n vec3 color = vec3(random( ipos ));\n\n outColor = vec4(color, pixelColor.a);\n "
4256
+ );
4257
+ },
4258
+ contrast: function () {
4259
+ var t =
4260
+ arguments.length > 0 && void 0 !== arguments[0]
4261
+ ? arguments[0]
4262
+ : 1,
4263
+ e = Ne(be(t));
4264
+ return Ae(
4265
+ "\n outColor = pixelColor * " + e + ";\n "
4266
+ );
4267
+ },
4268
+ gamma: function () {
4269
+ var t =
4270
+ arguments.length > 0 && void 0 !== arguments[0]
4271
+ ? arguments[0]
4272
+ : 1,
4273
+ e = Ne(be(t));
4274
+ return Ae(
4275
+ "\n outColor = vec4(pow(pixelColor.r, " +
4276
+ e +
4277
+ "), pow(pixelColor.g, " +
4278
+ e +
4279
+ "), pow(pixelColor.b, " +
4280
+ e +
4281
+ "), pixelColor.a );\n "
4282
+ );
4283
+ },
4284
+ gradient: function () {
4285
+ var t = [].concat(Array.prototype.slice.call(arguments));
4286
+ 1 === t.length &&
4287
+ "string" == typeof t[0] &&
4288
+ (t = Ze.convertMatchesArray(t[0])),
4289
+ (t = t
4290
+ .map(function (t) {
4291
+ return t;
4292
+ })
4293
+ .join(", "));
4294
+ var e = Ze.parseGradient(t);
4295
+ (e[0][1] = 0), (e[e.length - 1][1] = 1);
4296
+ for (
4297
+ var n = [],
4298
+ i = 0,
4299
+ r = (e = e.map(function (t) {
4300
+ var e = Ze.parse(t[0]);
4301
+ return [{ r: e.r, g: e.g, b: e.b, a: e.a }, t[1]];
4302
+ })).length;
4303
+ i < r - 1;
4304
+ i++
4305
+ ) {
4306
+ var o = e[i],
4307
+ s = e[i + 1],
4308
+ a = Oe(o[0]),
4309
+ l = Oe(s[0]),
4310
+ c = Ne(o[1]),
4311
+ h = Ne(s[1]);
4312
+ n.push(
4313
+ "\n if (" +
4314
+ c +
4315
+ " <= rate && rate < " +
4316
+ h +
4317
+ ") {\n outColor = mix(" +
4318
+ a +
4319
+ ", " +
4320
+ l +
4321
+ ", (rate - " +
4322
+ c +
4323
+ ")/(" +
4324
+ h +
4325
+ " - " +
4326
+ c +
4327
+ "));\n }\n "
4328
+ );
4329
+ }
4330
+ return Ae(
4331
+ "\n float rate = (pixelColor.r * 0.2126 + pixelColor.g * 0.7152 + pixelColor.b * 0.0722); \n\n " +
4332
+ n.join("\n") +
4333
+ " \n "
4334
+ );
4335
+ },
4336
+ grayscale: function () {
4337
+ var t =
4338
+ arguments.length > 0 && void 0 !== arguments[0]
4339
+ ? arguments[0]
4340
+ : 1,
4341
+ e = be(t);
4342
+ return (
4343
+ e > 1 && (e = 1),
4344
+ We(
4345
+ 0.2126 + 0.7874 * (1 - e),
4346
+ 0.7152 - 0.7152 * (1 - e),
4347
+ 0.0722 - 0.0722 * (1 - e),
4348
+ 0,
4349
+ 0.2126 - 0.2126 * (1 - e),
4350
+ 0.7152 + 0.2848 * (1 - e),
4351
+ 0.0722 - 0.0722 * (1 - e),
4352
+ 0,
4353
+ 0.2126 - 0.2126 * (1 - e),
4354
+ 0.7152 - 0.7152 * (1 - e),
4355
+ 0.0722 + 0.9278 * (1 - e),
4356
+ 0,
4357
+ 0,
4358
+ 0,
4359
+ 0,
4360
+ 1
4361
+ )
4362
+ );
4363
+ },
4364
+ hue: function () {
4365
+ var t =
4366
+ arguments.length > 0 && void 0 !== arguments[0]
4367
+ ? arguments[0]
4368
+ : 1,
4369
+ e = Ne(be(t));
4370
+ return Ae(
4371
+ "\n vec3 hsv = rgb2hsv(pixelColor.rgb);\n hsv.x += " +
4372
+ e +
4373
+ ";\n outColor = vec4(hsv2rgb(hsv).rgb, pixelColor.a);\n "
4374
+ );
4375
+ },
4376
+ invert: function () {
4377
+ var t =
4378
+ arguments.length > 0 && void 0 !== arguments[0]
4379
+ ? arguments[0]
4380
+ : 1,
4381
+ e = Ne(be(t));
4382
+ return Ae(
4383
+ "\n outColor = vec4(\n (1.0 - pixelColor.r) * " +
4384
+ e +
4385
+ ",\n (1.0 - pixelColor.g) * " +
4386
+ e +
4387
+ ",\n (1.0 - pixelColor.b) * " +
4388
+ e +
4389
+ ",\n pixelColor.a\n );\n "
4390
+ );
4391
+ },
4392
+ kodachrome: function () {
4393
+ return We(
4394
+ 1.1285582396593525,
4395
+ -0.3967382283601348,
4396
+ -0.03992559172921793,
4397
+ 0,
4398
+ -0.16404339962244616,
4399
+ 1.0835251566291304,
4400
+ -0.05498805115633132,
4401
+ 0,
4402
+ -0.16786010706155763,
4403
+ -0.5603416277695248,
4404
+ 1.6014850761964943,
4405
+ 0,
4406
+ 0,
4407
+ 0,
4408
+ 0,
4409
+ 1
4410
+ );
4411
+ },
4412
+ matrix: We,
4413
+ noise: function () {
4414
+ var t =
4415
+ arguments.length > 0 && void 0 !== arguments[0]
4416
+ ? arguments[0]
4417
+ : 1,
4418
+ e = Math.abs(be(t)),
4419
+ n = Ne(-e),
4420
+ i = Ne(e);
4421
+ return Ae(
4422
+ "\n float rnd = " +
4423
+ n +
4424
+ " + random( pixelColor.st ) * (" +
4425
+ i +
4426
+ " - " +
4427
+ n +
4428
+ ");\n\n outColor = vec4(pixelColor.rgb + rnd, 1.0);\n "
4429
+ );
4430
+ },
4431
+ opacity: function () {
4432
+ var t =
4433
+ arguments.length > 0 && void 0 !== arguments[0]
4434
+ ? arguments[0]
4435
+ : 1,
4436
+ e = Ne(be(t));
4437
+ return Ae(
4438
+ "\n outColor = vec4(pixelColor.rgb, pixelColor.a * " +
4439
+ e +
4440
+ ");\n "
4441
+ );
4442
+ },
4443
+ polaroid: function () {
4444
+ return We(
4445
+ 1.438,
4446
+ -0.062,
4447
+ -0.062,
4448
+ 0,
4449
+ -0.122,
4450
+ 1.378,
4451
+ -0.122,
4452
+ 0,
4453
+ -0.016,
4454
+ -0.016,
4455
+ 1.483,
4456
+ 0,
4457
+ 0,
4458
+ 0,
4459
+ 0,
4460
+ 1
4461
+ );
4462
+ },
4463
+ saturation: function () {
4464
+ var t =
4465
+ arguments.length > 0 && void 0 !== arguments[0]
4466
+ ? arguments[0]
4467
+ : 0,
4468
+ e = 1 - Math.abs(be(t));
4469
+ return We(e, 0, 0, 0, 0, e, 0, 0, 0, 0, e, 0, 0, 0, 0, e);
4470
+ },
4471
+ sepia: function () {
4472
+ var t =
4473
+ arguments.length > 0 && void 0 !== arguments[0]
4474
+ ? arguments[0]
4475
+ : 1,
4476
+ e = be(t);
4477
+ return (
4478
+ e > 1 && (e = 1),
4479
+ We(
4480
+ 0.393 + 0.607 * (1 - e),
4481
+ 0.769 - 0.769 * (1 - e),
4482
+ 0.189 - 0.189 * (1 - e),
4483
+ 0,
4484
+ 0.349 - 0.349 * (1 - e),
4485
+ 0.686 + 0.314 * (1 - e),
4486
+ 0.168 - 0.168 * (1 - e),
4487
+ 0,
4488
+ 0.272 - 0.272 * (1 - e),
4489
+ 0.534 - 0.534 * (1 - e),
4490
+ 0.131 + 0.869 * (1 - e),
4491
+ 0,
4492
+ 0,
4493
+ 0,
4494
+ 0,
4495
+ 1
4496
+ )
4497
+ );
4498
+ },
4499
+ shade: function () {
4500
+ var t =
4501
+ arguments.length > 0 && void 0 !== arguments[0]
4502
+ ? arguments[0]
4503
+ : 1,
4504
+ e =
4505
+ arguments.length > 1 && void 0 !== arguments[1]
4506
+ ? arguments[1]
4507
+ : 1,
4508
+ n =
4509
+ arguments.length > 2 && void 0 !== arguments[2]
4510
+ ? arguments[2]
4511
+ : 1,
4512
+ i = Ne(be(t) / 255),
4513
+ r = Ne(be(e) / 255),
4514
+ o = Ne(be(n) / 255);
4515
+ return Ae(
4516
+ "\n outColor = vec4(\n pixelColor.r * " +
4517
+ i +
4518
+ ",\n pixelColor.g * " +
4519
+ r +
4520
+ ",\n pixelColor.b * " +
4521
+ o +
4522
+ ",\n pixelColor.a\n );\n "
4523
+ );
4524
+ },
4525
+ shift: function () {
4526
+ return We(
4527
+ 1.438,
4528
+ -0.062,
4529
+ -0.062,
4530
+ 0,
4531
+ -0.122,
4532
+ 1.378,
4533
+ -0.122,
4534
+ 0,
4535
+ -0.016,
4536
+ -0.016,
4537
+ 1.483,
4538
+ 0,
4539
+ 0,
4540
+ 0,
4541
+ 0,
4542
+ 1
4543
+ );
4544
+ },
4545
+ solarize: function (t, e, n) {
4546
+ return Ae(
4547
+ "\n outColor = vec4(\n (pixelColor.r < " +
4548
+ Ne(be(t)) +
4549
+ ") ? 1.0 - pixelColor.r: pixelColor.r,\n (pixelColor.g < " +
4550
+ Ne(be(e)) +
4551
+ ") ? 1.0 - pixelColor.g: pixelColor.g,\n (pixelColor.b < " +
4552
+ Ne(be(n)) +
4553
+ ") ? 1.0 - pixelColor.b: pixelColor.b,\n pixelColor.a\n );\n "
4554
+ );
4555
+ },
4556
+ technicolor: function () {
4557
+ return We(
4558
+ 1.9125277891456083,
4559
+ -0.8545344976951645,
4560
+ -0.09155508482755585,
4561
+ 0,
4562
+ -0.3087833385928097,
4563
+ 1.7658908555458428,
4564
+ -0.10601743074722245,
4565
+ 0,
4566
+ -0.231103377548616,
4567
+ -0.7501899197440212,
4568
+ 1.847597816108189,
4569
+ 0,
4570
+ 0,
4571
+ 0,
4572
+ 0,
4573
+ 1
4574
+ );
4575
+ },
4576
+ threshold: function () {
4577
+ var t =
4578
+ arguments.length > 0 && void 0 !== arguments[0]
4579
+ ? arguments[0]
4580
+ : 200,
4581
+ e =
4582
+ arguments.length > 1 && void 0 !== arguments[1]
4583
+ ? arguments[1]
4584
+ : 100;
4585
+ return je(t, e, !1);
4586
+ },
4587
+ "threshold-color": je,
4588
+ tint: function () {
4589
+ var t =
4590
+ arguments.length > 0 && void 0 !== arguments[0]
4591
+ ? arguments[0]
4592
+ : 0,
4593
+ e =
4594
+ arguments.length > 1 && void 0 !== arguments[1]
4595
+ ? arguments[1]
4596
+ : 0,
4597
+ n =
4598
+ arguments.length > 2 && void 0 !== arguments[2]
4599
+ ? arguments[2]
4600
+ : 0,
4601
+ i = be(t),
4602
+ r = be(e),
4603
+ o = be(n);
4604
+ return Ae(
4605
+ "\n outColor = vec4(\n pixelColor.r += (1 - pixelColor.r) * " +
4606
+ i +
4607
+ ",\n pixelColor.g += (1 - pixelColor.g) * " +
4608
+ r +
4609
+ ",\n pixelColor.b += (1 - pixelColor.b) * " +
4610
+ o +
4611
+ ",\n pixelColor.a\n );\n "
4612
+ );
4613
+ },
4614
+ },
4615
+ {
4616
+ kirsch: function () {
4617
+ return we("kirsch-horizontal kirsch-vertical");
4618
+ },
4619
+ sobel: function () {
4620
+ return we("sobel-horizontal sobel-vertical");
4621
+ },
4622
+ vintage: function () {
4623
+ return we("brightness(0.15) saturation(-0.2) gamma(1.8)");
4624
+ },
4625
+ }
4626
+ ),
4627
+ qe = 0,
4628
+ Ve = {
4629
+ GLCanvas: (function () {
4630
+ function t() {
4631
+ var e =
4632
+ arguments.length > 0 && void 0 !== arguments[0]
4633
+ ? arguments[0]
4634
+ : { width: "400px", height: "300px" };
4635
+ _(this, t),
4636
+ (this.img = e.img),
4637
+ (this.width = parseFloat(
4638
+ this.img.width || e.width || "400px"
4639
+ )),
4640
+ (this.height = parseFloat(
4641
+ this.img.height || e.height || "300px"
4642
+ )),
4643
+ this.init();
4644
+ }
4645
+ return (
4646
+ y(t, [
4647
+ {
4648
+ key: "resize",
4649
+ value: function () {
4650
+ (this.canvas.width = this.width),
4651
+ (this.canvas.height = this.height),
4652
+ (this.canvas.style.width = this.width + "px"),
4653
+ (this.canvas.style.height = this.height + "px"),
4654
+ this.viewport();
4655
+ },
4656
+ },
4657
+ {
4658
+ key: "clear",
4659
+ value: function () {
4660
+ var t =
4661
+ arguments.length > 0 && void 0 !== arguments[0]
4662
+ ? arguments[0]
4663
+ : 0,
4664
+ e =
4665
+ arguments.length > 1 && void 0 !== arguments[1]
4666
+ ? arguments[1]
4667
+ : 0,
4668
+ n =
4669
+ arguments.length > 2 && void 0 !== arguments[2]
4670
+ ? arguments[2]
4671
+ : 0,
4672
+ i =
4673
+ arguments.length > 3 && void 0 !== arguments[3]
4674
+ ? arguments[3]
4675
+ : 0,
4676
+ r = this.gl;
4677
+ r.clearColor(t, e, n, i),
4678
+ r.clear(r.COLOR_BUFFER_BIT | r.DEPTH_BUFFER_BIT);
4679
+ },
4680
+ },
4681
+ {
4682
+ key: "viewport",
4683
+ value: function (t, e, n, i) {
4684
+ var r = this.gl;
4685
+ r.viewport(
4686
+ t || 0,
4687
+ e || 0,
4688
+ n || r.canvas.width,
4689
+ i || r.canvas.height
4690
+ );
4691
+ },
4692
+ },
4693
+ {
4694
+ key: "initCanvas",
4695
+ value: function (t, e) {
4696
+ if (
4697
+ ((this.canvas = document.createElement("canvas")),
4698
+ (this.gl = this.canvas.getContext("webgl2")),
4699
+ !this.gl)
4700
+ )
4701
+ throw new Error("you need webgl2 support");
4702
+ (this.program = this.createProgram(t, e)),
4703
+ this.resize(),
4704
+ this.initBuffer();
4705
+ },
4706
+ },
4707
+ {
4708
+ key: "draw",
4709
+ value: function () {
4710
+ var t =
4711
+ arguments.length > 0 && void 0 !== arguments[0]
4712
+ ? arguments[0]
4713
+ : "TRIANGLES",
4714
+ e =
4715
+ arguments.length > 1 && void 0 !== arguments[1]
4716
+ ? arguments[1]
4717
+ : 0,
4718
+ n =
4719
+ arguments.length > 2 && void 0 !== arguments[2]
4720
+ ? arguments[2]
4721
+ : 6,
4722
+ i = this.gl;
4723
+ i.drawArrays(i[t], e, n);
4724
+ },
4725
+ },
4726
+ {
4727
+ key: "triangles",
4728
+ value: function () {
4729
+ var t =
4730
+ arguments.length > 0 && void 0 !== arguments[0]
4731
+ ? arguments[0]
4732
+ : 0,
4733
+ e =
4734
+ arguments.length > 1 && void 0 !== arguments[1]
4735
+ ? arguments[1]
4736
+ : 6;
4737
+ this.draw("TRIANGLES", t, e);
4738
+ },
4739
+ },
4740
+ {
4741
+ key: "uniform2f",
4742
+ value: function () {
4743
+ for (
4744
+ var t, e = arguments.length, n = Array(e), i = 0;
4745
+ i < e;
4746
+ i++
4747
+ )
4748
+ n[i] = arguments[i];
4749
+ var r = n.shift();
4750
+ (t = this.gl).uniform2f.apply(
4751
+ t,
4752
+ [this.locations[r]].concat(n)
4753
+ );
4754
+ },
4755
+ },
4756
+ {
4757
+ key: "uniform1f",
4758
+ value: function () {
4759
+ for (
4760
+ var t, e = arguments.length, n = Array(e), i = 0;
4761
+ i < e;
4762
+ i++
4763
+ )
4764
+ n[i] = arguments[i];
4765
+ var r = n.shift();
4766
+ (t = this.gl).uniform1f.apply(
4767
+ t,
4768
+ [this.locations[r]].concat(n)
4769
+ );
4770
+ },
4771
+ },
4772
+ {
4773
+ key: "uniform1fv",
4774
+ value: function () {
4775
+ for (
4776
+ var t, e = arguments.length, n = Array(e), i = 0;
4777
+ i < e;
4778
+ i++
4779
+ )
4780
+ n[i] = arguments[i];
4781
+ var r = n.shift();
4782
+ (t = this.gl).uniform1fv.apply(
4783
+ t,
4784
+ [this.locations[r]].concat(n)
4785
+ );
4786
+ },
4787
+ },
4788
+ {
4789
+ key: "uniform1i",
4790
+ value: function () {
4791
+ for (
4792
+ var t, e = arguments.length, n = Array(e), i = 0;
4793
+ i < e;
4794
+ i++
4795
+ )
4796
+ n[i] = arguments[i];
4797
+ var r = n.shift();
4798
+ (t = this.gl).uniform1i.apply(
4799
+ t,
4800
+ [this.locations[r]].concat(n)
4801
+ );
4802
+ },
4803
+ },
4804
+ {
4805
+ key: "useProgram",
4806
+ value: function () {
4807
+ this.gl.useProgram(this.program);
4808
+ },
4809
+ },
4810
+ {
4811
+ key: "bindBuffer",
4812
+ value: function (t, e) {
4813
+ var n =
4814
+ arguments.length > 2 && void 0 !== arguments[2]
4815
+ ? arguments[2]
4816
+ : "STATIC_DRAW",
4817
+ i = this.gl;
4818
+ this.buffers[t] ||
4819
+ (this.buffers[t] = i.createBuffer()),
4820
+ i.bindBuffer(i.ARRAY_BUFFER, this.buffers[t]),
4821
+ e &&
4822
+ i.bufferData(
4823
+ i.ARRAY_BUFFER,
4824
+ new Float32Array(e),
4825
+ i[n]
4826
+ );
4827
+ },
4828
+ },
4829
+ {
4830
+ key: "enable",
4831
+ value: function (t) {
4832
+ this.gl.enableVertexAttribArray(this.locations[t]);
4833
+ },
4834
+ },
4835
+ {
4836
+ key: "location",
4837
+ value: function (t) {
4838
+ var e =
4839
+ arguments.length > 1 && void 0 !== arguments[1]
4840
+ ? arguments[1]
4841
+ : "attribute";
4842
+ "attribute" === e
4843
+ ? (this.locations[t] = this.gl.getAttribLocation(
4844
+ this.program,
4845
+ t
4846
+ ))
4847
+ : "uniform" === e &&
4848
+ (this.locations[t] = this.gl.getUniformLocation(
4849
+ this.program,
4850
+ t
4851
+ ));
4852
+ },
4853
+ },
4854
+ {
4855
+ key: "a",
4856
+ value: function (t) {
4857
+ return this.location(t);
4858
+ },
4859
+ },
4860
+ {
4861
+ key: "u",
4862
+ value: function (t) {
4863
+ return this.location(t, "uniform");
4864
+ },
4865
+ },
4866
+ {
4867
+ key: "pointer",
4868
+ value: function (t) {
4869
+ var e =
4870
+ arguments.length > 1 && void 0 !== arguments[1]
4871
+ ? arguments[1]
4872
+ : "FLOAT",
4873
+ n =
4874
+ arguments.length > 2 && void 0 !== arguments[2]
4875
+ ? arguments[2]
4876
+ : 2,
4877
+ i =
4878
+ arguments.length > 3 &&
4879
+ void 0 !== arguments[3] &&
4880
+ arguments[3],
4881
+ r =
4882
+ arguments.length > 4 && void 0 !== arguments[4]
4883
+ ? arguments[4]
4884
+ : 0,
4885
+ o =
4886
+ arguments.length > 5 && void 0 !== arguments[5]
4887
+ ? arguments[5]
4888
+ : 0,
4889
+ s = this.gl;
4890
+ s.vertexAttribPointer(
4891
+ this.locations[t],
4892
+ n,
4893
+ s[e],
4894
+ i,
4895
+ r,
4896
+ o
4897
+ );
4898
+ },
4899
+ },
4900
+ {
4901
+ key: "bufferData",
4902
+ value: function () {
4903
+ var t =
4904
+ arguments.length > 0 && void 0 !== arguments[0]
4905
+ ? arguments[0]
4906
+ : [],
4907
+ e = this.gl;
4908
+ e.bufferData(
4909
+ e.ARRAY_BUFFER,
4910
+ new Float32Array(t),
4911
+ e.STATIC_DRAW
4912
+ );
4913
+ },
4914
+ },
4915
+ {
4916
+ key: "isPowerOf2",
4917
+ value: function (t) {
4918
+ return 0 == (t & (t - 1));
4919
+ },
4920
+ },
4921
+ {
4922
+ key: "bindTexture",
4923
+ value: function (t) {
4924
+ var e =
4925
+ arguments.length > 1 && void 0 !== arguments[1]
4926
+ ? arguments[1]
4927
+ : void 0,
4928
+ n =
4929
+ arguments.length > 2 && void 0 !== arguments[2]
4930
+ ? arguments[2]
4931
+ : 0,
4932
+ i =
4933
+ arguments.length > 3 && void 0 !== arguments[3]
4934
+ ? arguments[3]
4935
+ : "RGBA",
4936
+ r =
4937
+ arguments.length > 4 && void 0 !== arguments[4]
4938
+ ? arguments[4]
4939
+ : "RGBA",
4940
+ o =
4941
+ arguments.length > 5 && void 0 !== arguments[5]
4942
+ ? arguments[5]
4943
+ : "UNSIGNED_BYTE",
4944
+ s = this.gl;
4945
+ 1 != arguments.length
4946
+ ? (this.textures[t] ||
4947
+ (this.textures[t] = s.createTexture()),
4948
+ (this.textureIndex[t] = qe++),
4949
+ s.bindTexture(s.TEXTURE_2D, this.textures[t]),
4950
+ this.setTextureParameter(),
4951
+ s.texImage2D(
4952
+ s.TEXTURE_2D,
4953
+ n,
4954
+ s[i],
4955
+ s[r],
4956
+ s[o],
4957
+ e.newImage || e
4958
+ ))
4959
+ : s.bindTexture(s.TEXTURE_2D, this.textures[t]);
4960
+ },
4961
+ },
4962
+ {
4963
+ key: "bindColorTexture",
4964
+ value: function (t, e) {
4965
+ var n =
4966
+ arguments.length > 2 && void 0 !== arguments[2]
4967
+ ? arguments[2]
4968
+ : 256,
4969
+ i =
4970
+ arguments.length > 3 && void 0 !== arguments[3]
4971
+ ? arguments[3]
4972
+ : 1,
4973
+ r =
4974
+ arguments.length > 4 && void 0 !== arguments[4]
4975
+ ? arguments[4]
4976
+ : 0,
4977
+ o =
4978
+ arguments.length > 5 && void 0 !== arguments[5]
4979
+ ? arguments[5]
4980
+ : "RGBA",
4981
+ s =
4982
+ arguments.length > 6 && void 0 !== arguments[6]
4983
+ ? arguments[6]
4984
+ : "RGBA",
4985
+ a =
4986
+ arguments.length > 7 && void 0 !== arguments[7]
4987
+ ? arguments[7]
4988
+ : "UNSIGNED_BYTE",
4989
+ l = this.gl;
4990
+ this.textures[t] ||
4991
+ (this.textures[t] = l.createTexture()),
4992
+ (this.textureIndex[t] = qe++),
4993
+ l.bindTexture(l.TEXTURE_2D, this.textures[t]),
4994
+ this.setTextureParameter(),
4995
+ l.texImage2D(
4996
+ l.TEXTURE_2D,
4997
+ r,
4998
+ l[o],
4999
+ n,
5000
+ i,
5001
+ 0,
5002
+ l[s],
5003
+ l[a],
5004
+ new Uint8Array(e)
5005
+ );
5006
+ },
5007
+ },
5008
+ {
5009
+ key: "bindEmptyTexture",
5010
+ value: function (t, e, n) {
5011
+ var i =
5012
+ arguments.length > 3 && void 0 !== arguments[3]
5013
+ ? arguments[3]
5014
+ : 0,
5015
+ r =
5016
+ arguments.length > 4 && void 0 !== arguments[4]
5017
+ ? arguments[4]
5018
+ : "RGBA",
5019
+ o =
5020
+ arguments.length > 5 && void 0 !== arguments[5]
5021
+ ? arguments[5]
5022
+ : "RGBA",
5023
+ s =
5024
+ arguments.length > 6 && void 0 !== arguments[6]
5025
+ ? arguments[6]
5026
+ : "UNSIGNED_BYTE",
5027
+ a = this.gl;
5028
+ this.textures[t] ||
5029
+ (this.textures[t] = a.createTexture()),
5030
+ (this.textureIndex[t] = qe++),
5031
+ a.bindTexture(a.TEXTURE_2D, this.textures[t]),
5032
+ this.setTextureParameter();
5033
+ var l = 0,
5034
+ c = null;
5035
+ a.texImage2D(
5036
+ a.TEXTURE_2D,
5037
+ i,
5038
+ a[r],
5039
+ e,
5040
+ n,
5041
+ l,
5042
+ a[o],
5043
+ a[s],
5044
+ c
5045
+ );
5046
+ },
5047
+ },
5048
+ {
5049
+ key: "setTextureParameter",
5050
+ value: function () {
5051
+ var t = this.gl;
5052
+ t.texParameteri(
5053
+ t.TEXTURE_2D,
5054
+ t.TEXTURE_WRAP_S,
5055
+ t.CLAMP_TO_EDGE
5056
+ ),
5057
+ t.texParameteri(
5058
+ t.TEXTURE_2D,
5059
+ t.TEXTURE_WRAP_T,
5060
+ t.CLAMP_TO_EDGE
5061
+ ),
5062
+ t.texParameteri(
5063
+ t.TEXTURE_2D,
5064
+ t.TEXTURE_MIN_FILTER,
5065
+ t.NEAREST
5066
+ ),
5067
+ t.texParameteri(
5068
+ t.TEXTURE_2D,
5069
+ t.TEXTURE_MAG_FILTER,
5070
+ t.NEAREST
5071
+ );
5072
+ },
5073
+ },
5074
+ {
5075
+ key: "bindFrameBufferWithTexture",
5076
+ value: function (t, e, n, i) {
5077
+ this.bindEmptyTexture(e, n, i),
5078
+ this.bindFrameBuffer(t, e);
5079
+ },
5080
+ },
5081
+ {
5082
+ key: "enumToString",
5083
+ value: function (t) {
5084
+ var e = this.gl;
5085
+ if (0 === t) return "NONE";
5086
+ for (var n in e) if (e[n] === t) return n;
5087
+ return "0x" + t.toString(16);
5088
+ },
5089
+ },
5090
+ {
5091
+ key: "bindFrameBuffer",
5092
+ value: function (t) {
5093
+ var e =
5094
+ arguments.length > 1 && void 0 !== arguments[1]
5095
+ ? arguments[1]
5096
+ : null,
5097
+ n = this.gl;
5098
+ if (1 !== arguments.length) {
5099
+ this.framebuffers[t] ||
5100
+ (this.framebuffers[t] = n.createFramebuffer()),
5101
+ n.bindFramebuffer(
5102
+ n.FRAMEBUFFER,
5103
+ this.framebuffers[t]
5104
+ );
5105
+ var i = 0,
5106
+ r = n.COLOR_ATTACHMENT0;
5107
+ n.framebufferTexture2D(
5108
+ n.FRAMEBUFFER,
5109
+ r,
5110
+ n.TEXTURE_2D,
5111
+ this.textures[e],
5112
+ i
5113
+ ),
5114
+ n.checkFramebufferStatus(n.FRAMEBUFFER),
5115
+ n.FRAMEBUFFER_COMPLETE;
5116
+ } else
5117
+ n.bindFramebuffer(
5118
+ n.FRAMEBUFFER,
5119
+ null == t ? null : this.framebuffers[t]
5120
+ );
5121
+ },
5122
+ },
5123
+ {
5124
+ key: "bindVA",
5125
+ value: function () {
5126
+ var t = this.gl;
5127
+ this.vao || (this.vao = t.createVertexArray()),
5128
+ t.bindVertexArray(this.vao);
5129
+ },
5130
+ },
5131
+ {
5132
+ key: "bindAttr",
5133
+ value: function (t, e) {
5134
+ var n =
5135
+ arguments.length > 2 && void 0 !== arguments[2]
5136
+ ? arguments[2]
5137
+ : "STATIC_DRAW",
5138
+ i =
5139
+ arguments.length > 3 && void 0 !== arguments[3]
5140
+ ? arguments[3]
5141
+ : 2;
5142
+ this.bindBuffer(t, e, n),
5143
+ this.enable(t),
5144
+ this.pointer(t, "FLOAT", i);
5145
+ },
5146
+ },
5147
+ {
5148
+ key: "initBuffer",
5149
+ value: function () {
5150
+ var t = this.canvas,
5151
+ e = t.width,
5152
+ n = t.height;
5153
+ this.a("a_position"),
5154
+ this.a("a_texCoord"),
5155
+ this.u("u_resolution"),
5156
+ this.u("u_image"),
5157
+ this.u("u_flipY"),
5158
+ this.u("u_kernelSelect"),
5159
+ this.u("u_filterIndex"),
5160
+ this.u("u_kernel9[0]"),
5161
+ this.u("u_kernel9Weight"),
5162
+ this.u("u_kernel25[0]"),
5163
+ this.u("u_kernel25Weight"),
5164
+ this.u("u_kernel49[0]"),
5165
+ this.u("u_kernel49Weight"),
5166
+ this.u("u_kernel81[0]"),
5167
+ this.u("u_kernel81Weight"),
5168
+ this.bindVA(),
5169
+ this.bindAttr(
5170
+ "a_position",
5171
+ [0, 0, e, 0, 0, n, 0, n, e, 0, e, n],
5172
+ "STATIC_DRAW",
5173
+ 2
5174
+ ),
5175
+ this.bindAttr(
5176
+ "a_texCoord",
5177
+ [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1],
5178
+ "STATIC_DRAW",
5179
+ 2
5180
+ ),
5181
+ this.bindTexture("u_image", this.img),
5182
+ this.bindFrameBufferWithTexture(
5183
+ "frame_buffer_0",
5184
+ "img_texture_0",
5185
+ e,
5186
+ n
5187
+ ),
5188
+ this.bindFrameBufferWithTexture(
5189
+ "frame_buffer_1",
5190
+ "img_texture_1",
5191
+ e,
5192
+ n
5193
+ );
5194
+ },
5195
+ },
5196
+ {
5197
+ key: "activeTexture",
5198
+ value: function () {
5199
+ var t =
5200
+ arguments.length > 0 && void 0 !== arguments[0]
5201
+ ? arguments[0]
5202
+ : 0,
5203
+ e = this.gl;
5204
+ e.activeTexture(e.TEXTURE0 + t);
5205
+ },
5206
+ },
5207
+ {
5208
+ key: "drawFilter",
5209
+ value: function () {
5210
+ var t = this,
5211
+ e = this.gl;
5212
+ this.resize(),
5213
+ this.clear(),
5214
+ this.useProgram(),
5215
+ this.bindVA(),
5216
+ this.activeTexture(0),
5217
+ this.bindTexture("u_image"),
5218
+ this.uniform1i("u_image", 0),
5219
+ this.uniform1f("u_flipY", 1);
5220
+ var n = e.canvas,
5221
+ i = n.width,
5222
+ r = n.height;
5223
+ this.eachFilter(function (e, n) {
5224
+ t.bindFrameBuffer("frame_buffer_" + (n % 2)),
5225
+ t.uniform2f("u_resolution", i, r),
5226
+ t.viewport(0, 0, i, r),
5227
+ t.effectFilter(e),
5228
+ t.bindTexture("img_texture_" + (n % 2));
5229
+ }),
5230
+ this.uniform1f("u_flipY", -1),
5231
+ this.bindFrameBuffer(null),
5232
+ this.uniform2f("u_resolution", i, r),
5233
+ this.viewport(0, 0, i, r),
5234
+ this.clear(),
5235
+ this.effectFilter("normal");
5236
+ },
5237
+ },
5238
+ {
5239
+ key: "effectFilter",
5240
+ value: function (t) {
5241
+ "string" == typeof t &&
5242
+ (t = (Ge[t] || Ge.normal).call(Ge)),
5243
+ "convolution" == t.type
5244
+ ? (this.uniform1f("u_kernelSelect", t.length),
5245
+ this.uniform1f("u_filterIndex", -1),
5246
+ this.uniform1fv(
5247
+ "u_kernel" + t.length + "[0]",
5248
+ t.content
5249
+ ),
5250
+ this.uniform1f(
5251
+ "u_kernel" + t.length + "Weight",
5252
+ this.computeKernelWeight(t.content)
5253
+ ))
5254
+ : (this.uniform1f("u_kernelSelect", -1),
5255
+ this.uniform1f("u_filterIndex", t.index)),
5256
+ this.triangles(0, 6);
5257
+ },
5258
+ },
5259
+ {
5260
+ key: "computeKernelWeight",
5261
+ value: function (t) {
5262
+ var e = t.reduce(function (t, e) {
5263
+ return t + e;
5264
+ });
5265
+ return e <= 0 ? 1 : e;
5266
+ },
5267
+ },
5268
+ {
5269
+ key: "createProgram",
5270
+ value: function (t, e) {
5271
+ var n = this.gl,
5272
+ i = n.createProgram();
5273
+ if (
5274
+ ((this.vertexShader = this.createVertexShader(t)),
5275
+ (this.fragmentShader =
5276
+ this.createFragmentShader(e)),
5277
+ n.attachShader(i, this.vertexShader),
5278
+ n.attachShader(i, this.fragmentShader),
5279
+ n.linkProgram(i),
5280
+ n.getProgramParameter(i, n.LINK_STATUS))
5281
+ )
5282
+ return i;
5283
+ console.error(n.getProgramInfoLog(i)),
5284
+ n.deleteProgram(i);
5285
+ },
5286
+ },
5287
+ {
5288
+ key: "createShader",
5289
+ value: function (t, e) {
5290
+ var n = this.gl,
5291
+ i = n.createShader(t);
5292
+ if (
5293
+ (n.shaderSource(i, e),
5294
+ n.compileShader(i),
5295
+ n.getShaderParameter(i, n.COMPILE_STATUS))
5296
+ )
5297
+ return i;
5298
+ console.error(n.getShaderInfoLog(i)),
5299
+ n.deleteShader(i);
5300
+ },
5301
+ },
5302
+ {
5303
+ key: "createVertexShader",
5304
+ value: function (t) {
5305
+ var e = this.gl;
5306
+ return this.createShader(e.VERTEX_SHADER, t);
5307
+ },
5308
+ },
5309
+ {
5310
+ key: "createFragmentShader",
5311
+ value: function (t) {
5312
+ var e = this.gl;
5313
+ return this.createShader(e.FRAGMENT_SHADER, t);
5314
+ },
5315
+ },
5316
+ {
5317
+ key: "eachFilter",
5318
+ value: function (t) {
5319
+ this.filterList.forEach(t);
5320
+ },
5321
+ },
5322
+ {
5323
+ key: "init",
5324
+ value: function () {
5325
+ (this.locations = {}),
5326
+ (this.buffers = {}),
5327
+ (this.framebuffers = {}),
5328
+ (this.textures = {}),
5329
+ (this.textureIndex = {}),
5330
+ (this.hasTexParameter = {});
5331
+ },
5332
+ },
5333
+ {
5334
+ key: "destroy",
5335
+ value: function () {
5336
+ var t = this.gl;
5337
+ this.init(), t.deleteProgram(this.program);
5338
+ },
5339
+ },
5340
+ {
5341
+ key: "filter",
5342
+ value: function (t, e) {
5343
+ var n, i, r;
5344
+ (this.filterList = t),
5345
+ this.initCanvas(
5346
+ "#version 300 es \n\n in vec2 a_position;\n in vec2 a_texCoord; \n\n uniform vec2 u_resolution;\n uniform float u_flipY;\n\n out vec2 v_texCoord; \n\n void main() {\n vec2 zeroToOne = a_position / u_resolution;\n\n vec2 zeroToTwo = zeroToOne * 2.0;\n\n vec2 clipSpace = zeroToTwo - 1.0;\n\n gl_Position = vec4(clipSpace * vec2(1, u_flipY), 0, 1);\n\n v_texCoord = a_texCoord;\n\n }\n ",
5347
+ ((n = this.filterList),
5348
+ (i = n
5349
+ .filter(function (t) {
5350
+ return "shader" == t.type;
5351
+ })
5352
+ .map(function (t) {
5353
+ return t.content;
5354
+ })
5355
+ .join("\n\n")),
5356
+ (r = { 9: !0 }),
5357
+ n
5358
+ .filter(function (t) {
5359
+ return "convolution" == t.type;
5360
+ })
5361
+ .forEach(function (t) {
5362
+ r[t.length] = !0;
5363
+ }),
5364
+ "#version 300 es\n\n precision highp int;\n precision mediump float;\n \n uniform sampler2D u_image;\n\n // 3 is 3x3 matrix kernel \n uniform float u_kernelSelect;\n uniform float u_filterIndex;\n\n uniform float u_kernel9[9];\n uniform float u_kernel9Weight;\n uniform float u_kernel25[25];\n uniform float u_kernel25Weight;\n uniform float u_kernel49[49];\n uniform float u_kernel49Weight;\n uniform float u_kernel81[81];\n uniform float u_kernel81Weight; \n\n in vec2 v_texCoord;\n \n out vec4 outColor;\n\n float random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n } \n\n // \n vec3 rgb2hsv(vec3 c)\n {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\n vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\n\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n vec3 hsv2rgb(vec3 c)\n {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n \n void main() {\n vec4 pixelColor = texture(u_image, v_texCoord);\n vec2 onePixel = vec2(1) / vec2(textureSize(u_image, 0)); \n\n " +
5365
+ i +
5366
+ "\n\n " +
5367
+ Object.keys(r)
5368
+ .map(function (t) {
5369
+ return Le(+t);
5370
+ })
5371
+ .join("\n") +
5372
+ "\n\n }")
5373
+ ),
5374
+ this.drawFilter(),
5375
+ "function" == typeof e && e(this);
5376
+ },
5377
+ },
5378
+ ]),
5379
+ t
5380
+ );
5381
+ })(),
5382
+ },
5383
+ Ye = {
5384
+ filter: function (t, e, n, i) {
5385
+ var r = new Ve.GLCanvas({
5386
+ width: i.width || t.width,
5387
+ height: i.height || t.height,
5388
+ img: t,
5389
+ });
5390
+ r.filter(Ke(e), function () {
5391
+ "function" == typeof n && n(r);
5392
+ });
5393
+ },
5394
+ };
5395
+ function Ke(t) {
5396
+ var e = [];
5397
+ "string" == typeof t ? (e = pe(t)) : Array.isArray(t) && (e = t);
5398
+ var n = [];
5399
+ return (
5400
+ e.forEach(function (t) {
5401
+ var e = t.arr[0];
5402
+ if (Ge[e]) {
5403
+ var i = (function (t) {
5404
+ var e = t.arr[0],
5405
+ n = Ge[e],
5406
+ i = t.arr;
5407
+ return i.shift(), n.apply(this, i);
5408
+ })(t);
5409
+ "convolution" == i.type || "shader" == i.type
5410
+ ? n.push(i)
5411
+ : i.forEach(function (t) {
5412
+ n = n.concat(Ke(t));
5413
+ });
5414
+ }
5415
+ }),
5416
+ n
5417
+ );
5418
+ }
5419
+ var Xe = k({}, Ve, Ye);
5420
+ function Qe(t, e, n) {
5421
+ var i =
5422
+ arguments.length > 3 && void 0 !== arguments[3]
5423
+ ? arguments[3]
5424
+ : { frameTimer: "full" },
5425
+ r = new gt(t);
5426
+ r.loadImage(function () {
5427
+ r.toArray(
5428
+ e,
5429
+ function (t) {
5430
+ "function" == typeof n && n(t);
5431
+ },
5432
+ i
5433
+ );
5434
+ });
5435
+ }
5436
+ var Ze = k({}, o, f, rt, R, Z, W, j, Q, v, K, {
5437
+ palette: function (t) {
5438
+ var n =
5439
+ arguments.length > 1 && void 0 !== arguments[1]
5440
+ ? arguments[1]
5441
+ : 6,
5442
+ i =
5443
+ arguments.length > 2 && void 0 !== arguments[2]
5444
+ ? arguments[2]
5445
+ : "hex";
5446
+ return (
5447
+ t.length > n && (t = dt(t, n)),
5448
+ t.map(function (t) {
5449
+ return e(t, i);
5450
+ })
5451
+ );
5452
+ },
5453
+ ImageToCanvas: function (t, e, n) {
5454
+ var i =
5455
+ arguments.length > 3 && void 0 !== arguments[3]
5456
+ ? arguments[3]
5457
+ : { frameTimer: "full" };
5458
+ Qe(t, e, n, Object.assign({ returnTo: "canvas" }, i));
5459
+ },
5460
+ ImageToHistogram: function (t, e) {
5461
+ var n =
5462
+ arguments.length > 2 && void 0 !== arguments[2]
5463
+ ? arguments[2]
5464
+ : { width: 200, height: 100 },
5465
+ i = new gt(t);
5466
+ i.loadImage(function () {
5467
+ pt.createHistogram(
5468
+ n.width || 200,
5469
+ n.height || 100,
5470
+ i.toHistogram(n),
5471
+ function (t) {
5472
+ "function" == typeof e && e(t.toDataURL("image/png"));
5473
+ },
5474
+ n
5475
+ );
5476
+ });
5477
+ },
5478
+ ImageToRGB: function (t) {
5479
+ var e =
5480
+ arguments.length > 1 && void 0 !== arguments[1]
5481
+ ? arguments[1]
5482
+ : {},
5483
+ n = arguments[2];
5484
+ if (n) {
5485
+ if (n) {
5486
+ var i;
5487
+ (i = new gt(t, e)).loadImage(function () {
5488
+ "function" == typeof n && n(i.toRGB());
5489
+ });
5490
+ }
5491
+ } else
5492
+ (i = new gt(t)).loadImage(function () {
5493
+ "function" == typeof e && e(i.toRGB());
5494
+ });
5495
+ },
5496
+ ImageToURL: Qe,
5497
+ GLToCanvas: function (t, e, n) {
5498
+ var i =
5499
+ arguments.length > 3 && void 0 !== arguments[3]
5500
+ ? arguments[3]
5501
+ : {},
5502
+ r = new gt(t);
5503
+ r.load(function () {
5504
+ Xe.filter(
5505
+ r.newImage,
5506
+ e,
5507
+ function (t) {
5508
+ "function" == typeof n && n(t);
5509
+ },
5510
+ i
5511
+ );
5512
+ });
5513
+ },
5514
+ histogram: function (t, e) {
5515
+ var n =
5516
+ arguments.length > 2 && void 0 !== arguments[2]
5517
+ ? arguments[2]
5518
+ : {},
5519
+ i = new gt(t);
5520
+ i.loadImage(function () {
5521
+ "function" == typeof e && e(i.toHistogram(n));
5522
+ });
5523
+ },
5524
+ histogramToPoints: function (t) {
5525
+ for (
5526
+ var e =
5527
+ arguments.length > 1 && void 0 !== arguments[1]
5528
+ ? arguments[1]
5529
+ : 0.2,
5530
+ n = [],
5531
+ i = 0;
5532
+ i < t.length;
5533
+ i++
5534
+ ) {
5535
+ var r = t[i];
5536
+ if (0 != i)
5537
+ if (i != t.length - 1) {
5538
+ var o = t[i - 1],
5539
+ s = t[i + 1],
5540
+ a =
5541
+ (s[1],
5542
+ o[1],
5543
+ s[0],
5544
+ o[0],
5545
+ [
5546
+ o[0] + (s[0] - o[0]) * e,
5547
+ o[1] + (s[1] - o[1]) * e,
5548
+ ]),
5549
+ l = [[].concat(E(o)), [].concat(a)],
5550
+ c = Math.sqrt(
5551
+ Math.pow(r[0] - o[0], 2) + Math.pow(r[1] - o[1], 2)
5552
+ ),
5553
+ h = Math.sqrt(
5554
+ Math.pow(s[0] - r[0], 2) + Math.pow(s[1] - r[1], 2)
5555
+ ),
5556
+ u = c / h,
5557
+ f = l[0][0] + (l[1][0] - l[0][0]) * u,
5558
+ d = l[0][1] + (l[1][1] - l[0][1]) * u;
5559
+ (l[0][0] += r[0] - f),
5560
+ (l[0][1] += r[1] - d),
5561
+ (l[1][0] += r[0] - f),
5562
+ (l[1][1] += r[1] - d),
5563
+ (n[i] = l);
5564
+ } else n[i] = [];
5565
+ else n[i] = [];
5566
+ }
5567
+ return n;
5568
+ },
5569
+ }),
5570
+ Je = [
5571
+ { rgb: "#ff0000", start: 0 },
5572
+ { rgb: "#ffff00", start: 0.17 },
5573
+ { rgb: "#00ff00", start: 0.33 },
5574
+ { rgb: "#00ffff", start: 0.5 },
5575
+ { rgb: "#0000ff", start: 0.67 },
5576
+ { rgb: "#ff00ff", start: 0.83 },
5577
+ { rgb: "#ff0000", start: 1 },
5578
+ ];
5579
+ !(function () {
5580
+ for (var t = 0, e = Je.length; t < e; t++) {
5581
+ var n = Je[t],
5582
+ i = Ze.parse(n.rgb);
5583
+ (n.r = i.r), (n.g = i.g), (n.b = i.b);
5584
+ }
5585
+ })();
5586
+ var tn = {
5587
+ colors: Je,
5588
+ checkHueColor: function (t) {
5589
+ for (var e, n, i = 0; i < Je.length; i++)
5590
+ if (Je[i].start >= t) {
5591
+ (e = Je[i - 1]), (n = Je[i]);
5592
+ break;
5593
+ }
5594
+ return e && n
5595
+ ? Ze.interpolateRGB(
5596
+ e,
5597
+ n,
5598
+ (t - e.start) / (n.start - e.start)
5599
+ )
5600
+ : Je[0].rgb;
5601
+ },
5602
+ },
5603
+ en = k({}, Pt, Bt),
5604
+ nn = {
5605
+ Color: Ze,
5606
+ HueColor: tn,
5607
+ ColorNames: p,
5608
+ ImageFilter: en,
5609
+ GL: Xe,
5610
+ Canvas: pt,
5611
+ ImageLoader: gt,
5612
+ },
5613
+ rn = (Ze.color, 0),
5614
+ on = [],
5615
+ sn = (function () {
5616
+ function t(e, n, i) {
5617
+ if ((_(this, t), "string" != typeof e)) this.el = e;
5618
+ else {
5619
+ var r = document.createElement(e);
5620
+ for (var o in ((this.uniqId = rn++),
5621
+ n && (r.className = n),
5622
+ (i = i || {})))
5623
+ r.setAttribute(o, i[o]);
5624
+ this.el = r;
5625
+ }
5626
+ }
5627
+ return (
5628
+ y(
5629
+ t,
5630
+ [
5631
+ {
5632
+ key: "attr",
5633
+ value: function (t, e) {
5634
+ return 1 == arguments.length
5635
+ ? this.el.getAttribute(t)
5636
+ : (this.el.setAttribute(t, e), this);
5637
+ },
5638
+ },
5639
+ {
5640
+ key: "closest",
5641
+ value: function (e) {
5642
+ for (var n = this, i = !1; !(i = n.hasClass(e)); ) {
5643
+ if (!n.el.parentNode) return null;
5644
+ n = new t(n.el.parentNode);
5645
+ }
5646
+ return i ? n : null;
5647
+ },
5648
+ },
5649
+ {
5650
+ key: "checked",
5651
+ value: function () {
5652
+ return this.el.checked;
5653
+ },
5654
+ },
5655
+ {
5656
+ key: "removeClass",
5657
+ value: function (t) {
5658
+ return (
5659
+ (this.el.className = (" " + this.el.className + " ")
5660
+ .replace(" " + t + " ", " ")
5661
+ .trim()),
5662
+ this
5663
+ );
5664
+ },
5665
+ },
5666
+ {
5667
+ key: "hasClass",
5668
+ value: function (t) {
5669
+ return (
5670
+ !!this.el.className &&
5671
+ (" " + this.el.className + " ").indexOf(
5672
+ " " + t + " "
5673
+ ) > -1
5674
+ );
5675
+ },
5676
+ },
5677
+ {
5678
+ key: "addClass",
5679
+ value: function (t) {
5680
+ return (
5681
+ this.hasClass(t) ||
5682
+ (this.el.className = this.el.className + " " + t),
5683
+ this
5684
+ );
5685
+ },
5686
+ },
5687
+ {
5688
+ key: "toggleClass",
5689
+ value: function (t) {
5690
+ this.hasClass(t)
5691
+ ? this.removeClass(t)
5692
+ : this.addClass(t);
5693
+ },
5694
+ },
5695
+ {
5696
+ key: "html",
5697
+ value: function (t) {
5698
+ try {
5699
+ "string" == typeof t
5700
+ ? (this.el.innerHTML = t)
5701
+ : this.empty().append(t);
5702
+ } catch (e) {
5703
+ console.log(t);
5704
+ }
5705
+ return this;
5706
+ },
5707
+ },
5708
+ {
5709
+ key: "find",
5710
+ value: function (t) {
5711
+ return this.el.querySelector(t);
5712
+ },
5713
+ },
5714
+ {
5715
+ key: "$",
5716
+ value: function (e) {
5717
+ return new t(this.find(e));
5718
+ },
5719
+ },
5720
+ {
5721
+ key: "findAll",
5722
+ value: function (t) {
5723
+ return this.el.querySelectorAll(t);
5724
+ },
5725
+ },
5726
+ {
5727
+ key: "$$",
5728
+ value: function (e) {
5729
+ return []
5730
+ .concat(E(this.findAll(e)))
5731
+ .map(function (e) {
5732
+ return new t(e);
5733
+ });
5734
+ },
5735
+ },
5736
+ {
5737
+ key: "empty",
5738
+ value: function () {
5739
+ return this.html("");
5740
+ },
5741
+ },
5742
+ {
5743
+ key: "append",
5744
+ value: function (t) {
5745
+ return (
5746
+ "string" == typeof t
5747
+ ? this.el.appendChild(document.createTextNode(t))
5748
+ : this.el.appendChild(t.el || t),
5749
+ this
5750
+ );
5751
+ },
5752
+ },
5753
+ {
5754
+ key: "appendTo",
5755
+ value: function (t) {
5756
+ return (t.el ? t.el : t).appendChild(this.el), this;
5757
+ },
5758
+ },
5759
+ {
5760
+ key: "remove",
5761
+ value: function () {
5762
+ return (
5763
+ this.el.parentNode &&
5764
+ this.el.parentNode.removeChild(this.el),
5765
+ this
5766
+ );
5767
+ },
5768
+ },
5769
+ {
5770
+ key: "text",
5771
+ value: function () {
5772
+ return this.el.textContent;
5773
+ },
5774
+ },
5775
+ {
5776
+ key: "css",
5777
+ value: function (t, e) {
5778
+ var n = this;
5779
+ if (2 == arguments.length) this.el.style[t] = e;
5780
+ else if (1 == arguments.length) {
5781
+ if ("string" == typeof t)
5782
+ return getComputedStyle(this.el)[t];
5783
+ var i = t || {};
5784
+ Object.keys(i).forEach(function (t) {
5785
+ n.el.style[t] = i[t];
5786
+ });
5787
+ }
5788
+ return this;
5789
+ },
5790
+ },
5791
+ {
5792
+ key: "cssFloat",
5793
+ value: function (t) {
5794
+ return parseFloat(this.css(t));
5795
+ },
5796
+ },
5797
+ {
5798
+ key: "cssInt",
5799
+ value: function (t) {
5800
+ return parseInt(this.css(t));
5801
+ },
5802
+ },
5803
+ {
5804
+ key: "offset",
5805
+ value: function () {
5806
+ var e = this.el.getBoundingClientRect();
5807
+ return {
5808
+ top: e.top + t.getScrollTop(),
5809
+ left: e.left + t.getScrollLeft(),
5810
+ };
5811
+ },
5812
+ },
5813
+ {
5814
+ key: "rect",
5815
+ value: function () {
5816
+ return this.el.getBoundingClientRect();
5817
+ },
5818
+ },
5819
+ {
5820
+ key: "position",
5821
+ value: function () {
5822
+ return this.el.style.top
5823
+ ? {
5824
+ top: parseFloat(this.css("top")),
5825
+ left: parseFloat(this.css("left")),
5826
+ }
5827
+ : this.el.getBoundingClientRect();
5828
+ },
5829
+ },
5830
+ {
5831
+ key: "size",
5832
+ value: function () {
5833
+ return [this.width(), this.height()];
5834
+ },
5835
+ },
5836
+ {
5837
+ key: "width",
5838
+ value: function () {
5839
+ return (
5840
+ this.el.offsetWidth ||
5841
+ this.el.getBoundingClientRect().width
5842
+ );
5843
+ },
5844
+ },
5845
+ {
5846
+ key: "contentWidth",
5847
+ value: function () {
5848
+ return (
5849
+ this.width() -
5850
+ this.cssFloat("padding-left") -
5851
+ this.cssFloat("padding-right")
5852
+ );
5853
+ },
5854
+ },
5855
+ {
5856
+ key: "height",
5857
+ value: function () {
5858
+ return (
5859
+ this.el.offsetHeight ||
5860
+ this.el.getBoundingClientRect().height
5861
+ );
5862
+ },
5863
+ },
5864
+ {
5865
+ key: "contentHeight",
5866
+ value: function () {
5867
+ return (
5868
+ this.height() -
5869
+ this.cssFloat("padding-top") -
5870
+ this.cssFloat("padding-bottom")
5871
+ );
5872
+ },
5873
+ },
5874
+ {
5875
+ key: "dataKey",
5876
+ value: function (t) {
5877
+ return this.uniqId + "." + t;
5878
+ },
5879
+ },
5880
+ {
5881
+ key: "data",
5882
+ value: function (t, e) {
5883
+ if (2 != arguments.length) {
5884
+ if (1 == arguments.length)
5885
+ return on[this.dataKey(t)];
5886
+ var n = Object.keys(on),
5887
+ i = this.uniqId + ".";
5888
+ return n
5889
+ .filter(function (t) {
5890
+ return 0 == t.indexOf(i);
5891
+ })
5892
+ .map(function (t) {
5893
+ return on[t];
5894
+ });
5895
+ }
5896
+ return (on[this.dataKey(t)] = e), this;
5897
+ },
5898
+ },
5899
+ {
5900
+ key: "val",
5901
+ value: function (t) {
5902
+ return 0 == arguments.length
5903
+ ? this.el.value
5904
+ : (1 == arguments.length && (this.el.value = t),
5905
+ this);
5906
+ },
5907
+ },
5908
+ {
5909
+ key: "int",
5910
+ value: function () {
5911
+ return parseInt(this.val(), 10);
5912
+ },
5913
+ },
5914
+ {
5915
+ key: "float",
5916
+ value: function () {
5917
+ return parseFloat(this.val());
5918
+ },
5919
+ },
5920
+ {
5921
+ key: "show",
5922
+ value: function () {
5923
+ return this.css("display", "block");
5924
+ },
5925
+ },
5926
+ {
5927
+ key: "hide",
5928
+ value: function () {
5929
+ return this.css("display", "none");
5930
+ },
5931
+ },
5932
+ {
5933
+ key: "toggle",
5934
+ value: function () {
5935
+ return "none" == this.css("display")
5936
+ ? this.show()
5937
+ : this.hide();
5938
+ },
5939
+ },
5940
+ {
5941
+ key: "scrollTop",
5942
+ value: function () {
5943
+ return this.el === document.body
5944
+ ? t.getScrollTop()
5945
+ : this.el.scrollTop;
5946
+ },
5947
+ },
5948
+ {
5949
+ key: "scrollLeft",
5950
+ value: function () {
5951
+ return this.el === document.body
5952
+ ? t.getScrollLeft()
5953
+ : this.el.scrollLeft;
5954
+ },
5955
+ },
5956
+ {
5957
+ key: "on",
5958
+ value: function (t, e, n, i) {
5959
+ return this.el.addEventListener(t, e, n, i), this;
5960
+ },
5961
+ },
5962
+ {
5963
+ key: "off",
5964
+ value: function (t, e) {
5965
+ return this.el.removeEventListener(t, e), this;
5966
+ },
5967
+ },
5968
+ {
5969
+ key: "getElement",
5970
+ value: function () {
5971
+ return this.el;
5972
+ },
5973
+ },
5974
+ {
5975
+ key: "createChild",
5976
+ value: function (e) {
5977
+ var n =
5978
+ arguments.length > 1 && void 0 !== arguments[1]
5979
+ ? arguments[1]
5980
+ : "",
5981
+ i =
5982
+ arguments.length > 2 && void 0 !== arguments[2]
5983
+ ? arguments[2]
5984
+ : {},
5985
+ r =
5986
+ arguments.length > 3 && void 0 !== arguments[3]
5987
+ ? arguments[3]
5988
+ : {},
5989
+ o = new t(e, n, i);
5990
+ return o.css(r), this.append(o), o;
5991
+ },
5992
+ },
5993
+ {
5994
+ key: "firstChild",
5995
+ value: function () {
5996
+ return new t(this.el.firstElementChild);
5997
+ },
5998
+ },
5999
+ {
6000
+ key: "replace",
6001
+ value: function (t, e) {
6002
+ return this.el.replaceChild(e, t), this;
6003
+ },
6004
+ },
6005
+ ],
6006
+ [
6007
+ {
6008
+ key: "getScrollTop",
6009
+ value: function () {
6010
+ return Math.max(
6011
+ window.pageYOffset,
6012
+ document.documentElement.scrollTop,
6013
+ document.body.scrollTop
6014
+ );
6015
+ },
6016
+ },
6017
+ {
6018
+ key: "getScrollLeft",
6019
+ value: function () {
6020
+ return Math.max(
6021
+ window.pageXOffset,
6022
+ document.documentElement.scrollLeft,
6023
+ document.body.scrollLeft
6024
+ );
6025
+ },
6026
+ },
6027
+ ]
6028
+ ),
6029
+ t
6030
+ );
6031
+ })(),
6032
+ an = (function () {
6033
+ function t(e) {
6034
+ _(this, t), (this.$store = e), this.initialize();
6035
+ }
6036
+ return (
6037
+ y(t, [
6038
+ {
6039
+ key: "initialize",
6040
+ value: function () {
6041
+ var t = this;
6042
+ this.filterProps().forEach(function (e) {
6043
+ t.$store.action(e, t);
6044
+ });
6045
+ },
6046
+ },
6047
+ {
6048
+ key: "filterProps",
6049
+ value: function () {
6050
+ var t =
6051
+ arguments.length > 0 && void 0 !== arguments[0]
6052
+ ? arguments[0]
6053
+ : "/";
6054
+ return Object.getOwnPropertyNames(
6055
+ this.__proto__
6056
+ ).filter(function (e) {
6057
+ return e.startsWith(t);
6058
+ });
6059
+ },
6060
+ },
6061
+ ]),
6062
+ t
6063
+ );
6064
+ })(),
6065
+ ln = (function (t) {
6066
+ function e() {
6067
+ return (
6068
+ _(this, e),
6069
+ C(
6070
+ this,
6071
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
6072
+ this,
6073
+ arguments
6074
+ )
6075
+ )
6076
+ );
6077
+ }
6078
+ return (
6079
+ T(e, t),
6080
+ y(e, [
6081
+ {
6082
+ key: "initialize",
6083
+ value: function () {
6084
+ b(
6085
+ e.prototype.__proto__ ||
6086
+ Object.getPrototypeOf(e.prototype),
6087
+ "initialize",
6088
+ this
6089
+ ).call(this),
6090
+ (this.$store.colorSetsList = [
6091
+ {
6092
+ name: "Material",
6093
+ colors: [
6094
+ "#F44336",
6095
+ "#E91E63",
6096
+ "#9C27B0",
6097
+ "#673AB7",
6098
+ "#3F51B5",
6099
+ "#2196F3",
6100
+ "#03A9F4",
6101
+ "#00BCD4",
6102
+ "#009688",
6103
+ "#4CAF50",
6104
+ "#8BC34A",
6105
+ "#CDDC39",
6106
+ "#FFEB3B",
6107
+ "#FFC107",
6108
+ "#FF9800",
6109
+ "#FF5722",
6110
+ "#795548",
6111
+ "#9E9E9E",
6112
+ "#607D8B",
6113
+ ],
6114
+ },
6115
+ { name: "Custom", edit: !0, colors: [] },
6116
+ {
6117
+ name: "Color Scale",
6118
+ scale: ["red", "yellow", "black"],
6119
+ count: 5,
6120
+ },
6121
+ ]),
6122
+ (this.$store.currentColorSets = {});
6123
+ },
6124
+ },
6125
+ {
6126
+ key: "/list",
6127
+ value: function (t) {
6128
+ return Array.isArray(t.userList) && t.userList.length
6129
+ ? t.userList
6130
+ : t.colorSetsList;
6131
+ },
6132
+ },
6133
+ {
6134
+ key: "/setUserPalette",
6135
+ value: function (t, e) {
6136
+ (t.userList = e),
6137
+ t.dispatch("/resetUserPalette"),
6138
+ t.dispatch("/setCurrentColorSets");
6139
+ },
6140
+ },
6141
+ {
6142
+ key: "/resetUserPalette",
6143
+ value: function (t) {
6144
+ t.userList &&
6145
+ t.userList.length &&
6146
+ ((t.userList = t.userList.map(function (e, n) {
6147
+ if ("function" == typeof e.colors) {
6148
+ var i = e.colors;
6149
+ (e.colors = i(t)), (e._colors = i);
6150
+ }
6151
+ return Object.assign(
6152
+ { name: "color-" + n, colors: [] },
6153
+ e
6154
+ );
6155
+ })),
6156
+ t.emit("changeUserList"));
6157
+ },
6158
+ },
6159
+ {
6160
+ key: "/setCurrentColorSets",
6161
+ value: function (t, e) {
6162
+ var n = t.dispatch("/list");
6163
+ (t.currentColorSets =
6164
+ void 0 === e
6165
+ ? n[0]
6166
+ : "number" == typeof e
6167
+ ? n[e]
6168
+ : n.filter(function (t) {
6169
+ return t.name == e;
6170
+ })[0]),
6171
+ t.emit("changeCurrentColorSets");
6172
+ },
6173
+ },
6174
+ {
6175
+ key: "/getCurrentColorSets",
6176
+ value: function (t) {
6177
+ return t.currentColorSets;
6178
+ },
6179
+ },
6180
+ {
6181
+ key: "/addCurrentColor",
6182
+ value: function (t, e) {
6183
+ Array.isArray(t.currentColorSets.colors) &&
6184
+ (t.currentColorSets.colors.push(e),
6185
+ t.emit("changeCurrentColorSets"));
6186
+ },
6187
+ },
6188
+ {
6189
+ key: "/setCurrentColorAll",
6190
+ value: function (t) {
6191
+ var e =
6192
+ arguments.length > 1 && void 0 !== arguments[1]
6193
+ ? arguments[1]
6194
+ : [];
6195
+ (t.currentColorSets.colors = e),
6196
+ t.emit("changeCurrentColorSets");
6197
+ },
6198
+ },
6199
+ {
6200
+ key: "/removeCurrentColor",
6201
+ value: function (t, e) {
6202
+ t.currentColorSets.colors[e] &&
6203
+ (t.currentColorSets.colors.splice(e, 1),
6204
+ t.emit("changeCurrentColorSets"));
6205
+ },
6206
+ },
6207
+ {
6208
+ key: "/removeCurrentColorToTheRight",
6209
+ value: function (t, e) {
6210
+ t.currentColorSets.colors[e] &&
6211
+ (t.currentColorSets.colors.splice(
6212
+ e,
6213
+ Number.MAX_VALUE
6214
+ ),
6215
+ t.emit("changeCurrentColorSets"));
6216
+ },
6217
+ },
6218
+ {
6219
+ key: "/clearPalette",
6220
+ value: function (t) {
6221
+ t.currentColorSets.colors &&
6222
+ ((t.currentColorSets.colors = []),
6223
+ t.emit("changeCurrentColorSets"));
6224
+ },
6225
+ },
6226
+ {
6227
+ key: "/getCurrentColors",
6228
+ value: function (t) {
6229
+ return t.dispatch("/getColors", t.currentColorSets);
6230
+ },
6231
+ },
6232
+ {
6233
+ key: "/getColors",
6234
+ value: function (t, e) {
6235
+ return e.scale
6236
+ ? Ze.scale(e.scale, e.count)
6237
+ : e.colors || [];
6238
+ },
6239
+ },
6240
+ {
6241
+ key: "/getColorSetsList",
6242
+ value: function (t) {
6243
+ return t.dispatch("/list").map(function (e) {
6244
+ return {
6245
+ name: e.name,
6246
+ edit: e.edit,
6247
+ colors: t.dispatch("/getColors", e),
6248
+ };
6249
+ });
6250
+ },
6251
+ },
6252
+ ]),
6253
+ e
6254
+ );
6255
+ })(an),
6256
+ cn = {
6257
+ addEvent: function (t, e, n, i) {
6258
+ t && t.addEventListener(e, n, i);
6259
+ },
6260
+ removeEvent: function (t, e, n) {
6261
+ t && t.removeEventListener(e, n);
6262
+ },
6263
+ pos: function (t) {
6264
+ return t.touches && t.touches[0] ? t.touches[0] : t;
6265
+ },
6266
+ posXY: function (t) {
6267
+ var e = this.pos(t);
6268
+ return { x: e.pageX, y: e.pageY };
6269
+ },
6270
+ },
6271
+ hn = (function () {
6272
+ function t(e) {
6273
+ var n =
6274
+ arguments.length > 1 && void 0 !== arguments[1]
6275
+ ? arguments[1]
6276
+ : {};
6277
+ _(this, t), (this.masterObj = e), (this.settingObj = n);
6278
+ }
6279
+ return (
6280
+ y(t, [
6281
+ {
6282
+ key: "set",
6283
+ value: function (t, e) {
6284
+ var n =
6285
+ arguments.length > 2 && void 0 !== arguments[2]
6286
+ ? arguments[2]
6287
+ : void 0;
6288
+ this.settingObj[t] = e || n;
6289
+ },
6290
+ },
6291
+ {
6292
+ key: "init",
6293
+ value: function (t) {
6294
+ if (!this.has(t)) {
6295
+ var e = t.split("."),
6296
+ n =
6297
+ this.masterObj.refs[e[0]] ||
6298
+ this.masterObj[e[0]] ||
6299
+ this.masterObj,
6300
+ i = e.pop();
6301
+ if (n[i]) {
6302
+ for (
6303
+ var r = arguments.length,
6304
+ o = Array(r > 1 ? r - 1 : 0),
6305
+ s = 1;
6306
+ s < r;
6307
+ s++
6308
+ )
6309
+ o[s - 1] = arguments[s];
6310
+ var a = n[i].apply(n, o);
6311
+ this.set(t, a);
6312
+ }
6313
+ }
6314
+ },
6315
+ },
6316
+ {
6317
+ key: "get",
6318
+ value: function (t) {
6319
+ var e =
6320
+ arguments.length > 1 && void 0 !== arguments[1]
6321
+ ? arguments[1]
6322
+ : "";
6323
+ return this.init(t, e), this.settingObj[t] || e;
6324
+ },
6325
+ },
6326
+ {
6327
+ key: "has",
6328
+ value: function (t) {
6329
+ return !!this.settingObj[t];
6330
+ },
6331
+ },
6332
+ ]),
6333
+ t
6334
+ );
6335
+ })(),
6336
+ un =
6337
+ /^(click|mouse(down|up|move|enter|leave)|touch(start|move|end)|key(down|up|press)|contextmenu|change|input)/gi,
6338
+ fn = /^load (.*)/gi,
6339
+ dn = ["Control", "Shift", "Alt", "Meta"],
6340
+ pn = (function () {
6341
+ function t() {
6342
+ _(this, t),
6343
+ (this.state = new hn(this)),
6344
+ (this.refs = {}),
6345
+ (this.childComponents = this.components());
6346
+ }
6347
+ return (
6348
+ y(t, [
6349
+ {
6350
+ key: "newChildComponents",
6351
+ value: function () {
6352
+ var t = this;
6353
+ Object.keys(this.childComponents).forEach(function (e) {
6354
+ var n = t.childComponents[e];
6355
+ t[e] = new n(t);
6356
+ });
6357
+ },
6358
+ },
6359
+ {
6360
+ key: "render",
6361
+ value: function () {
6362
+ (this.$el = this.parseTemplate(this.template())),
6363
+ (this.refs.$el = this.$el),
6364
+ this.parseTarget(),
6365
+ this.load(),
6366
+ this.afterRender();
6367
+ },
6368
+ },
6369
+ { key: "afterRender", value: function () {} },
6370
+ {
6371
+ key: "components",
6372
+ value: function () {
6373
+ return {};
6374
+ },
6375
+ },
6376
+ {
6377
+ key: "parseTemplate",
6378
+ value: function (t) {
6379
+ var e = this,
6380
+ n = new sn("div").html(t).firstChild(),
6381
+ i = n.findAll("[ref]");
6382
+ return (
6383
+ [].concat(E(i)).forEach(function (t) {
6384
+ var n = t.getAttribute("ref");
6385
+ e.refs[n] = new sn(t);
6386
+ }),
6387
+ n
6388
+ );
6389
+ },
6390
+ },
6391
+ {
6392
+ key: "parseTarget",
6393
+ value: function () {
6394
+ var t = this,
6395
+ e = this.$el.findAll("[target]");
6396
+ [].concat(E(e)).forEach(function (e) {
6397
+ var n = e.getAttribute("target"),
6398
+ i = e.getAttribute("ref") || n,
6399
+ r = new (0, t.childComponents[n])(t);
6400
+ (t[i] = r),
6401
+ (t.refs[i] = r.$el),
6402
+ r &&
6403
+ (r.render(),
6404
+ new sn(e.parentNode).replace(e, r.$el.el));
6405
+ });
6406
+ },
6407
+ },
6408
+ {
6409
+ key: "load",
6410
+ value: function () {
6411
+ var t = this;
6412
+ this.filterProps(fn).forEach(function (e) {
6413
+ var n = e.split("load ")[1];
6414
+ t.refs[n] &&
6415
+ t.refs[n].html(t.parseTemplate(t[e].call(t)));
6416
+ });
6417
+ },
6418
+ },
6419
+ {
6420
+ key: "template",
6421
+ value: function () {
6422
+ return "<div></div>";
6423
+ },
6424
+ },
6425
+ { key: "initialize", value: function () {} },
6426
+ {
6427
+ key: "initializeEvent",
6428
+ value: function () {
6429
+ var t = this;
6430
+ this.initializeEventMachin(),
6431
+ Object.keys(this.childComponents).forEach(function (
6432
+ e
6433
+ ) {
6434
+ t[e] && t[e].initializeEvent();
6435
+ });
6436
+ },
6437
+ },
6438
+ {
6439
+ key: "destroy",
6440
+ value: function () {
6441
+ var t = this;
6442
+ this.destroyEventMachin(),
6443
+ Object.keys(this.childComponents).forEach(function (
6444
+ e
6445
+ ) {
6446
+ t[e] && t[e].destroy();
6447
+ });
6448
+ },
6449
+ },
6450
+ {
6451
+ key: "destroyEventMachin",
6452
+ value: function () {
6453
+ this.removeEventAll();
6454
+ },
6455
+ },
6456
+ {
6457
+ key: "initializeEventMachin",
6458
+ value: function () {
6459
+ this.filterProps(un).forEach(
6460
+ this.parseEvent.bind(this)
6461
+ );
6462
+ },
6463
+ },
6464
+ {
6465
+ key: "collectProps",
6466
+ value: function () {
6467
+ if (!this.collapsedProps) {
6468
+ var t = this.__proto__,
6469
+ e = [];
6470
+ do {
6471
+ e.push.apply(e, E(Object.getOwnPropertyNames(t))),
6472
+ (t = t.__proto__);
6473
+ } while (t);
6474
+ this.collapsedProps = e;
6475
+ }
6476
+ return this.collapsedProps;
6477
+ },
6478
+ },
6479
+ {
6480
+ key: "filterProps",
6481
+ value: function (t) {
6482
+ return this.collectProps().filter(function (e) {
6483
+ return e.match(t);
6484
+ });
6485
+ },
6486
+ },
6487
+ {
6488
+ key: "parseEvent",
6489
+ value: function (t) {
6490
+ var e = t.split(" ");
6491
+ this.bindingEvent(e, this[t].bind(this));
6492
+ },
6493
+ },
6494
+ {
6495
+ key: "getDefaultDomElement",
6496
+ value: function (t) {
6497
+ var e = void 0;
6498
+ return (e = t
6499
+ ? this.refs[t] || this[t] || window[t]
6500
+ : this.el || this.$el || this.$root) instanceof sn
6501
+ ? e.getElement()
6502
+ : e;
6503
+ },
6504
+ },
6505
+ {
6506
+ key: "getDefaultEventObject",
6507
+ value: function (t) {
6508
+ var e = this,
6509
+ n = t.split("."),
6510
+ i = n.shift(),
6511
+ r = n.includes("Control"),
6512
+ o = n.includes("Shift"),
6513
+ s = n.includes("Alt"),
6514
+ a = n.includes("Meta"),
6515
+ l = (n = n.filter(function (t) {
6516
+ return !1 === dn.includes(t);
6517
+ })).filter(function (t) {
6518
+ return !!e[t];
6519
+ });
6520
+ return {
6521
+ eventName: i,
6522
+ isControl: r,
6523
+ isShift: o,
6524
+ isAlt: s,
6525
+ isMeta: a,
6526
+ codes: (n = n
6527
+ .filter(function (t) {
6528
+ return !1 === l.includes(t);
6529
+ })
6530
+ .map(function (t) {
6531
+ return t.toLowerCase();
6532
+ })),
6533
+ checkMethodList: l,
6534
+ };
6535
+ },
6536
+ },
6537
+ {
6538
+ key: "bindingEvent",
6539
+ value: function (t, e) {
6540
+ var n,
6541
+ i = ((n = t), Array.isArray(n) ? n : Array.from(n)),
6542
+ r = i[0],
6543
+ o = i[1],
6544
+ s = i.slice(2);
6545
+ o = this.getDefaultDomElement(o);
6546
+ var a = this.getDefaultEventObject(r);
6547
+ (a.dom = o),
6548
+ (a.delegate = s.join(" ")),
6549
+ this.addEvent(a, e);
6550
+ },
6551
+ },
6552
+ {
6553
+ key: "matchPath",
6554
+ value: function (t, e) {
6555
+ return t
6556
+ ? t.matches(e)
6557
+ ? t
6558
+ : this.matchPath(t.parentElement, e)
6559
+ : null;
6560
+ },
6561
+ },
6562
+ {
6563
+ key: "getBindings",
6564
+ value: function () {
6565
+ return (
6566
+ this._bindings || this.initBindings(), this._bindings
6567
+ );
6568
+ },
6569
+ },
6570
+ {
6571
+ key: "addBinding",
6572
+ value: function (t) {
6573
+ this.getBindings().push(t);
6574
+ },
6575
+ },
6576
+ {
6577
+ key: "initBindings",
6578
+ value: function () {
6579
+ this._bindings = [];
6580
+ },
6581
+ },
6582
+ {
6583
+ key: "checkEventType",
6584
+ value: function (t, e) {
6585
+ var n = this,
6586
+ i = !e.isControl || t.ctrlKey,
6587
+ r = !e.isShift || t.shiftKey,
6588
+ o = !e.isAlt || t.altKey,
6589
+ s = !e.isMeta || t.metaKey,
6590
+ a = !0;
6591
+ e.codes.length &&
6592
+ (a =
6593
+ e.codes.includes(t.code.toLowerCase()) ||
6594
+ e.codes.includes(t.key.toLowerCase()));
6595
+ var l = !0;
6596
+ return (
6597
+ e.checkMethodList.length &&
6598
+ (l = e.checkMethodList.every(function (e) {
6599
+ return n[e].call(n, t);
6600
+ })),
6601
+ i && o && r && s && a && l
6602
+ );
6603
+ },
6604
+ },
6605
+ {
6606
+ key: "makeCallback",
6607
+ value: function (t, e) {
6608
+ var n = this;
6609
+ return t.delegate
6610
+ ? function (i) {
6611
+ if (
6612
+ ((i.xy = cn.posXY(i)), n.checkEventType(i, t))
6613
+ ) {
6614
+ var r = n.matchPath(
6615
+ i.target || i.srcElement,
6616
+ t.delegate
6617
+ );
6618
+ if (r)
6619
+ return (
6620
+ (i.delegateTarget = r),
6621
+ (i.$delegateTarget = new sn(r)),
6622
+ e(i)
6623
+ );
6624
+ }
6625
+ }
6626
+ : function (i) {
6627
+ if (
6628
+ ((i.xy = cn.posXY(i)), n.checkEventType(i, t))
6629
+ )
6630
+ return e(i);
6631
+ };
6632
+ },
6633
+ },
6634
+ {
6635
+ key: "addEvent",
6636
+ value: function (t, e) {
6637
+ (t.callback = this.makeCallback(t, e)),
6638
+ this.addBinding(t);
6639
+ var n = !0;
6640
+ "touchstart" === t.eventName && (n = { passive: !0 }),
6641
+ cn.addEvent(t.dom, t.eventName, t.callback, n);
6642
+ },
6643
+ },
6644
+ {
6645
+ key: "removeEventAll",
6646
+ value: function () {
6647
+ var t = this;
6648
+ this.getBindings().forEach(function (e) {
6649
+ t.removeEvent(e);
6650
+ }),
6651
+ this.initBindings();
6652
+ },
6653
+ },
6654
+ {
6655
+ key: "removeEvent",
6656
+ value: function (t) {
6657
+ var e = t.eventName,
6658
+ n = t.dom,
6659
+ i = t.callback;
6660
+ cn.removeEvent(n, e, i);
6661
+ },
6662
+ },
6663
+ ]),
6664
+ t
6665
+ );
6666
+ })(),
6667
+ gn = /^@/,
6668
+ mn = (function (t) {
6669
+ function e(t) {
6670
+ _(this, e);
6671
+ var n = C(
6672
+ this,
6673
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
6674
+ );
6675
+ return (
6676
+ (n.opt = t || {}),
6677
+ t && t.$store && (n.$store = t.$store),
6678
+ n.initialize(),
6679
+ n.initializeStoreEvent(),
6680
+ n
6681
+ );
6682
+ }
6683
+ return (
6684
+ T(e, t),
6685
+ y(e, [
6686
+ {
6687
+ key: "initializeStoreEvent",
6688
+ value: function () {
6689
+ var t = this;
6690
+ (this.storeEvents = {}),
6691
+ this.filterProps(gn).forEach(function (e) {
6692
+ var n = e.split("@");
6693
+ n.shift();
6694
+ var i = n.join("@");
6695
+ (t.storeEvents[i] = t[e].bind(t)),
6696
+ t.$store.on(i, t.storeEvents[i]);
6697
+ });
6698
+ },
6699
+ },
6700
+ {
6701
+ key: "destoryStoreEvent",
6702
+ value: function () {
6703
+ var t = this;
6704
+ Object.keys(this.storeEvents).forEach(function (e) {
6705
+ t.$store.off(e, t.storeEvents[e]);
6706
+ });
6707
+ },
6708
+ },
6709
+ ]),
6710
+ e
6711
+ );
6712
+ })(pn),
6713
+ vn = (function (t) {
6714
+ function e() {
6715
+ return (
6716
+ _(this, e),
6717
+ C(
6718
+ this,
6719
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
6720
+ this,
6721
+ arguments
6722
+ )
6723
+ )
6724
+ );
6725
+ }
6726
+ return (
6727
+ T(e, t),
6728
+ y(e, [
6729
+ {
6730
+ key: "initialize",
6731
+ value: function () {
6732
+ b(
6733
+ e.prototype.__proto__ ||
6734
+ Object.getPrototypeOf(e.prototype),
6735
+ "initialize",
6736
+ this
6737
+ ).call(this),
6738
+ (this.$store.rgb = {}),
6739
+ (this.$store.hsl = {}),
6740
+ (this.$store.hsv = {}),
6741
+ (this.$store.alpha = 1),
6742
+ (this.$store.format = "hex");
6743
+ },
6744
+ },
6745
+ {
6746
+ key: "/changeFormat",
6747
+ value: function (t, e) {
6748
+ (t.format = e), t.emit("changeFormat");
6749
+ },
6750
+ },
6751
+ {
6752
+ key: "/initColor",
6753
+ value: function (t, e, n) {
6754
+ t.dispatch("/changeColor", e, n, !0),
6755
+ t.emit("initColor");
6756
+ },
6757
+ },
6758
+ {
6759
+ key: "/changeColor",
6760
+ value: function (t, e, n, i) {
6761
+ var r;
6762
+ "string" == typeof (e = e || "#FF0000") &&
6763
+ (e = Ze.parse(e)),
6764
+ (e.source = e.source || n),
6765
+ (t.alpha =
6766
+ void 0 === (r = e.a) || null == r ? t.alpha : e.a),
6767
+ (t.format = ("hsv" != e.type && e.type) || t.format),
6768
+ "hsl" == e.type
6769
+ ? ((t.hsl = Object.assign(t.hsl, e)),
6770
+ (t.rgb = Ze.HSLtoRGB(t.hsl)),
6771
+ (t.hsv = Ze.HSLtoHSV(e)))
6772
+ : "hex" == e.type || "rgb" == e.type
6773
+ ? ((t.rgb = Object.assign(t.rgb, e)),
6774
+ (t.hsl = Ze.RGBtoHSL(t.rgb)),
6775
+ (t.hsv = Ze.RGBtoHSV(e)))
6776
+ : "hsv" == e.type &&
6777
+ ((t.hsv = Object.assign(t.hsv, e)),
6778
+ (t.rgb = Ze.HSVtoRGB(t.hsv)),
6779
+ (t.hsl = Ze.HSVtoHSL(t.hsv))),
6780
+ i || t.emit("changeColor", e.source);
6781
+ },
6782
+ },
6783
+ {
6784
+ key: "/getHueColor",
6785
+ value: function (t) {
6786
+ return tn.checkHueColor(t.hsv.h / 360);
6787
+ },
6788
+ },
6789
+ {
6790
+ key: "/toString",
6791
+ value: function (t, e) {
6792
+ var n = t[(e = e || t.format)] || t.rgb;
6793
+ return Ze.format(k({}, n, { a: t.alpha }), e);
6794
+ },
6795
+ },
6796
+ {
6797
+ key: "/toColor",
6798
+ value: function (t, e) {
6799
+ return "rgb" == (e = e || t.format)
6800
+ ? t.dispatch("/toRGB")
6801
+ : "hsl" == e
6802
+ ? t.dispatch("/toHSL")
6803
+ : "hex" == e
6804
+ ? t.dispatch("/toHEX")
6805
+ : t.dispatch("/toString", e);
6806
+ },
6807
+ },
6808
+ {
6809
+ key: "/toRGB",
6810
+ value: function (t) {
6811
+ return t.dispatch("/toString", "rgb");
6812
+ },
6813
+ },
6814
+ {
6815
+ key: "/toHSL",
6816
+ value: function (t) {
6817
+ return t.dispatch("/toString", "hsl");
6818
+ },
6819
+ },
6820
+ {
6821
+ key: "/toHEX",
6822
+ value: function (t) {
6823
+ return t.dispatch("/toString", "hex").toUpperCase();
6824
+ },
6825
+ },
6826
+ ]),
6827
+ e
6828
+ );
6829
+ })(an),
6830
+ _n = (function () {
6831
+ function t(e) {
6832
+ _(this, t),
6833
+ (this.callbacks = []),
6834
+ (this.actions = []),
6835
+ (this.modules = e.modules || []),
6836
+ this.initialize();
6837
+ }
6838
+ return (
6839
+ y(t, [
6840
+ {
6841
+ key: "initialize",
6842
+ value: function () {
6843
+ this.initializeModule();
6844
+ },
6845
+ },
6846
+ {
6847
+ key: "initializeModule",
6848
+ value: function () {
6849
+ var t = this;
6850
+ this.modules.forEach(function (e) {
6851
+ new e(t);
6852
+ });
6853
+ },
6854
+ },
6855
+ {
6856
+ key: "action",
6857
+ value: function (t, e) {
6858
+ this.actions[t] = { context: e, callback: e[t] };
6859
+ },
6860
+ },
6861
+ {
6862
+ key: "dispatch",
6863
+ value: function (t) {
6864
+ var e = [].concat(
6865
+ Array.prototype.slice.call(arguments)
6866
+ ),
6867
+ n = ((t = e.shift()), this.actions[t]);
6868
+ if (n)
6869
+ return n.callback.apply(
6870
+ n.context,
6871
+ [this].concat(E(e))
6872
+ );
6873
+ },
6874
+ },
6875
+ { key: "module", value: function (t) {} },
6876
+ {
6877
+ key: "on",
6878
+ value: function (t, e) {
6879
+ this.callbacks.push({ event: t, callback: e });
6880
+ },
6881
+ },
6882
+ {
6883
+ key: "off",
6884
+ value: function (t, e) {
6885
+ 0 == arguments.length
6886
+ ? (this.callbacks = [])
6887
+ : 1 == arguments.length
6888
+ ? (this.callbacks = this.callbacks.filter(function (
6889
+ e
6890
+ ) {
6891
+ return e.event != t;
6892
+ }))
6893
+ : 2 == arguments.length &&
6894
+ (this.callbacks = this.callbacks.filter(function (
6895
+ n
6896
+ ) {
6897
+ return n.event != t && n.callback != e;
6898
+ }));
6899
+ },
6900
+ },
6901
+ {
6902
+ key: "emit",
6903
+ value: function () {
6904
+ var t = [].concat(
6905
+ Array.prototype.slice.call(arguments)
6906
+ ),
6907
+ e = t.shift();
6908
+ this.callbacks
6909
+ .filter(function (t) {
6910
+ return t.event == e;
6911
+ })
6912
+ .forEach(function (e) {
6913
+ e &&
6914
+ "function" == typeof e.callback &&
6915
+ e.callback.apply(e, E(t));
6916
+ });
6917
+ },
6918
+ },
6919
+ ]),
6920
+ t
6921
+ );
6922
+ })(),
6923
+ yn = (function (t) {
6924
+ function e(t) {
6925
+ _(this, e);
6926
+ var n = C(
6927
+ this,
6928
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
6929
+ );
6930
+ return (
6931
+ (n.isColorPickerShow = !1),
6932
+ (n.isShortCut = !1),
6933
+ (n.hideDelay = +(void 0 === n.opt.hideDeplay
6934
+ ? 2e3
6935
+ : n.opt.hideDelay)),
6936
+ n.timerCloseColorPicker,
6937
+ (n.autoHide = n.opt.autoHide || !0),
6938
+ (n.outputFormat = n.opt.outputFormat),
6939
+ (n.$checkColorPickerClass =
6940
+ n.checkColorPickerClass.bind(n)),
6941
+ n
6942
+ );
6943
+ }
6944
+ return (
6945
+ T(e, t),
6946
+ y(e, [
6947
+ {
6948
+ key: "initialize",
6949
+ value: function () {
6950
+ var t = this;
6951
+ (this.$body = null),
6952
+ (this.$root = null),
6953
+ (this.$store = new _n({ modules: [vn, ln] })),
6954
+ (this.callbackChange = function () {
6955
+ t.callbackColorValue();
6956
+ }),
6957
+ (this.callbackLastUpdate = function () {
6958
+ t.callbackLastUpdateColorValue();
6959
+ }),
6960
+ (this.colorpickerShowCallback = function () {}),
6961
+ (this.colorpickerHideCallback = function () {}),
6962
+ (this.colorpickerLastUpdateCallback = function () {}),
6963
+ (this.$body = new sn(this.getContainer())),
6964
+ (this.$root = new sn(
6965
+ "div",
6966
+ "codemirror-colorpicker"
6967
+ )),
6968
+ "inline" == this.opt.position &&
6969
+ this.$body.append(this.$root),
6970
+ this.opt.type && this.$root.addClass(this.opt.type),
6971
+ this.opt.hideInformation &&
6972
+ this.$root.addClass("hide-information"),
6973
+ this.opt.hideColorsets &&
6974
+ this.$root.addClass("hide-colorsets"),
6975
+ (this.$arrow = new sn("div", "arrow")),
6976
+ this.$root.append(this.$arrow),
6977
+ this.$store.dispatch(
6978
+ "/setUserPalette",
6979
+ this.opt.colorSets
6980
+ ),
6981
+ this.render(),
6982
+ this.$root.append(this.$el),
6983
+ this.initColorWithoutChangeEvent(this.opt.color),
6984
+ this.initializeEvent();
6985
+ },
6986
+ },
6987
+ {
6988
+ key: "initColorWithoutChangeEvent",
6989
+ value: function (t) {
6990
+ this.$store.dispatch("/initColor", t);
6991
+ },
6992
+ },
6993
+ {
6994
+ key: "show",
6995
+ value: function (t, e, n, i, r) {
6996
+ (this.colorpickerShowCallback = n),
6997
+ (this.colorpickerHideCallback = i),
6998
+ (this.colorpickerLastUpdateCallback = r),
6999
+ this.$root.css(this.getInitalizePosition()).show(),
7000
+ (this.isColorPickerShow = !0),
7001
+ (this.isShortCut = t.isShortCut || !1),
7002
+ (this.outputFormat = t.outputFormat),
7003
+ (this.hideDelay = +(void 0 === t.hideDelay
7004
+ ? 2e3
7005
+ : t.hideDelay)),
7006
+ this.hideDelay > 0 &&
7007
+ this.setHideDelay(this.hideDelay),
7008
+ this.$root.appendTo(this.$body),
7009
+ this.definePosition(t),
7010
+ this.initColorWithoutChangeEvent(e);
7011
+ },
7012
+ },
7013
+ {
7014
+ key: "initColor",
7015
+ value: function (t, e) {
7016
+ this.$store.dispatch("/changeColor", t, e);
7017
+ },
7018
+ },
7019
+ {
7020
+ key: "hide",
7021
+ value: function () {
7022
+ this.isColorPickerShow &&
7023
+ (this.$root.hide(),
7024
+ this.$root.remove(),
7025
+ (this.isColorPickerShow = !1),
7026
+ this.callbackHideColorValue());
7027
+ },
7028
+ },
7029
+ {
7030
+ key: "setColorsInPalette",
7031
+ value: function () {
7032
+ var t =
7033
+ arguments.length > 0 && void 0 !== arguments[0]
7034
+ ? arguments[0]
7035
+ : [];
7036
+ this.$store.dispatch("/setCurrentColorAll", t);
7037
+ },
7038
+ },
7039
+ {
7040
+ key: "setUserPalette",
7041
+ value: function () {
7042
+ var t =
7043
+ arguments.length > 0 && void 0 !== arguments[0]
7044
+ ? arguments[0]
7045
+ : [];
7046
+ this.$store.dispatch("/setUserPalette", t);
7047
+ },
7048
+ },
7049
+ {
7050
+ key: "getOption",
7051
+ value: function (t) {
7052
+ return this.opt[t];
7053
+ },
7054
+ },
7055
+ {
7056
+ key: "setOption",
7057
+ value: function (t, e) {
7058
+ this.opt[t] = e;
7059
+ },
7060
+ },
7061
+ {
7062
+ key: "isType",
7063
+ value: function (t) {
7064
+ return this.getOption("type") == t;
7065
+ },
7066
+ },
7067
+ {
7068
+ key: "isPaletteType",
7069
+ value: function () {
7070
+ return this.isType("palette");
7071
+ },
7072
+ },
7073
+ {
7074
+ key: "isSketchType",
7075
+ value: function () {
7076
+ return this.isType("sketch");
7077
+ },
7078
+ },
7079
+ {
7080
+ key: "getContainer",
7081
+ value: function () {
7082
+ return this.opt.container || document.body;
7083
+ },
7084
+ },
7085
+ {
7086
+ key: "getColor",
7087
+ value: function (t) {
7088
+ return this.$store.dispatch("/toColor", t);
7089
+ },
7090
+ },
7091
+ {
7092
+ key: "definePositionForArrow",
7093
+ value: function (t, e, n) {},
7094
+ },
7095
+ {
7096
+ key: "definePosition",
7097
+ value: function (t) {
7098
+ var e = this.$root.width(),
7099
+ n = this.$root.height(),
7100
+ i = t.left - this.$body.scrollLeft();
7101
+ e + i > window.innerWidth &&
7102
+ (i -= e + i - window.innerWidth),
7103
+ i < 0 && (i = 0);
7104
+ var r = t.top - this.$body.scrollTop();
7105
+ n + r > window.innerHeight &&
7106
+ (r -= n + r - window.innerHeight),
7107
+ r < 0 && (r = 0),
7108
+ this.$root.css({ left: i + "px", top: r + "px" });
7109
+ },
7110
+ },
7111
+ {
7112
+ key: "getInitalizePosition",
7113
+ value: function () {
7114
+ return "inline" == this.opt.position
7115
+ ? {
7116
+ position: "relative",
7117
+ left: "auto",
7118
+ top: "auto",
7119
+ display: "inline-block",
7120
+ }
7121
+ : {
7122
+ position: "fixed",
7123
+ left: "-10000px",
7124
+ top: "-10000px",
7125
+ };
7126
+ },
7127
+ },
7128
+ {
7129
+ key: "isAbsolute",
7130
+ value: function () {
7131
+ return "inline" !== this.opt.position;
7132
+ },
7133
+ },
7134
+ {
7135
+ key: "mouseup.isAbsolute document",
7136
+ value: function (t) {
7137
+ (this.__isMouseDown = !1),
7138
+ this.checkInHtml(t.target) ||
7139
+ (0 == this.checkColorPickerClass(t.target)
7140
+ ? this.hide()
7141
+ : this.__isMouseIn ||
7142
+ (clearTimeout(this.timerCloseColorPicker),
7143
+ (this.timerCloseColorPicker = setTimeout(
7144
+ this.hide.bind(this),
7145
+ this.delayTime || this.hideDelay
7146
+ ))));
7147
+ },
7148
+ },
7149
+ {
7150
+ key: "keyup.isAbsolute.escape $root",
7151
+ value: function (t) {
7152
+ this.hide();
7153
+ },
7154
+ },
7155
+ {
7156
+ key: "mouseover.isAbsolute $root",
7157
+ value: function (t) {
7158
+ clearTimeout(this.timerCloseColorPicker);
7159
+ },
7160
+ },
7161
+ {
7162
+ key: "mousemove.isAbsolute $root",
7163
+ value: function (t) {
7164
+ clearTimeout(this.timerCloseColorPicker);
7165
+ },
7166
+ },
7167
+ {
7168
+ key: "mouseenter.isAbsolute $root",
7169
+ value: function (t) {
7170
+ clearTimeout(this.timerCloseColorPicker),
7171
+ (this.__isMouseIn = !0);
7172
+ },
7173
+ },
7174
+ {
7175
+ key: "mouseleave.isAbsolute $root",
7176
+ value: function (t) {
7177
+ (this.__isMouseIn = !1),
7178
+ this.__isMouseDown ||
7179
+ (clearTimeout(this.timerCloseColorPicker),
7180
+ (this.timerCloseColorPicker = setTimeout(
7181
+ this.hide.bind(this),
7182
+ this.delayTime || this.hideDelay
7183
+ )));
7184
+ },
7185
+ },
7186
+ {
7187
+ key: "mousedown.isAbsolute $root",
7188
+ value: function (t) {
7189
+ this.__isMouseDown = !0;
7190
+ },
7191
+ },
7192
+ {
7193
+ key: "setHideDelay",
7194
+ value: function (t) {
7195
+ this.delayTime = t || 0;
7196
+ },
7197
+ },
7198
+ {
7199
+ key: "runHideDelay",
7200
+ value: function () {
7201
+ this.isColorPickerShow && this.setHideDelay();
7202
+ },
7203
+ },
7204
+ {
7205
+ key: "callbackColorValue",
7206
+ value: function (t) {
7207
+ (t = t || this.getCurrentColor()),
7208
+ "function" == typeof this.opt.onChange &&
7209
+ this.opt.onChange.call(this, t),
7210
+ "function" == typeof this.colorpickerShowCallback &&
7211
+ this.colorpickerShowCallback(t);
7212
+ },
7213
+ },
7214
+ {
7215
+ key: "callbackLastUpdateColorValue",
7216
+ value: function (t) {
7217
+ (t = t || this.getCurrentColor()),
7218
+ "function" == typeof this.opt.onLastUpdate &&
7219
+ this.opt.onLastUpdate.call(this, t),
7220
+ "function" ==
7221
+ typeof this.colorpickerLastUpdateCallback &&
7222
+ this.colorpickerLastUpdateCallback(t);
7223
+ },
7224
+ },
7225
+ {
7226
+ key: "callbackHideColorValue",
7227
+ value: function (t) {
7228
+ (t = t || this.getCurrentColor()),
7229
+ "function" == typeof this.opt.onHide &&
7230
+ this.opt.onHide.call(this, t),
7231
+ "function" == typeof this.colorpickerHideCallback &&
7232
+ this.colorpickerHideCallback(t);
7233
+ },
7234
+ },
7235
+ {
7236
+ key: "getCurrentColor",
7237
+ value: function () {
7238
+ return this.$store.dispatch(
7239
+ "/toColor",
7240
+ this.outputFormat
7241
+ );
7242
+ },
7243
+ },
7244
+ {
7245
+ key: "checkColorPickerClass",
7246
+ value: function (t) {
7247
+ var e = new sn(t).closest("codemirror-colorview"),
7248
+ n = new sn(t).closest("codemirror-colorpicker"),
7249
+ i = new sn(t).closest("CodeMirror");
7250
+ return t.nodeName, !!(n || e || i);
7251
+ },
7252
+ },
7253
+ {
7254
+ key: "checkInHtml",
7255
+ value: function (t) {
7256
+ return "HTML" == t.nodeName;
7257
+ },
7258
+ },
7259
+ {
7260
+ key: "initializeStoreEvent",
7261
+ value: function () {
7262
+ b(
7263
+ e.prototype.__proto__ ||
7264
+ Object.getPrototypeOf(e.prototype),
7265
+ "initializeStoreEvent",
7266
+ this
7267
+ ).call(this),
7268
+ this.$store.on("changeColor", this.callbackChange),
7269
+ this.$store.on(
7270
+ "lastUpdateColor",
7271
+ this.callbackLastUpdate
7272
+ ),
7273
+ this.$store.on("changeFormat", this.callbackChange);
7274
+ },
7275
+ },
7276
+ {
7277
+ key: "destroy",
7278
+ value: function () {
7279
+ b(
7280
+ e.prototype.__proto__ ||
7281
+ Object.getPrototypeOf(e.prototype),
7282
+ "destroy",
7283
+ this
7284
+ ).call(this),
7285
+ this.$store.off("changeColor", this.callbackChange),
7286
+ this.$store.off(
7287
+ "lastUpdateColor",
7288
+ this.callbackLastUpdate
7289
+ ),
7290
+ this.$store.off("changeFormat", this.callbackChange),
7291
+ (this.callbackChange = void 0),
7292
+ (this.callbackLastUpdate = void 0),
7293
+ (this.colorpickerShowCallback = void 0),
7294
+ (this.colorpickerHideCallback = void 0);
7295
+ },
7296
+ },
7297
+ ]),
7298
+ e
7299
+ );
7300
+ })(mn),
7301
+ xn = (function (t) {
7302
+ function e(t) {
7303
+ _(this, e);
7304
+ var n = C(
7305
+ this,
7306
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
7307
+ );
7308
+ return (
7309
+ (n.minValue = 0),
7310
+ (n.maxValue = 1),
7311
+ (n.source = "base-slider"),
7312
+ n
7313
+ );
7314
+ }
7315
+ return (
7316
+ T(e, t),
7317
+ y(e, [
7318
+ {
7319
+ key: "getMinMaxPosition",
7320
+ value: function () {
7321
+ var t = this.getMinPosition(),
7322
+ e = this.getMaxDist();
7323
+ return { min: t, max: t + e, width: e };
7324
+ },
7325
+ },
7326
+ {
7327
+ key: "getCurrent",
7328
+ value: function (t) {
7329
+ return min + this.getMaxDist() * t;
7330
+ },
7331
+ },
7332
+ {
7333
+ key: "getMinPosition",
7334
+ value: function () {
7335
+ return this.refs.$container.offset().left;
7336
+ },
7337
+ },
7338
+ {
7339
+ key: "getMaxDist",
7340
+ value: function () {
7341
+ return this.state.get("$container.width");
7342
+ },
7343
+ },
7344
+ {
7345
+ key: "getDist",
7346
+ value: function (t) {
7347
+ var e = this.getMinMaxPosition(),
7348
+ n = e.min,
7349
+ i = e.max;
7350
+ return t < n
7351
+ ? 0
7352
+ : t > i
7353
+ ? 100
7354
+ : ((t - n) / (i - n)) * 100;
7355
+ },
7356
+ },
7357
+ {
7358
+ key: "getCaculatedDist",
7359
+ value: function (t) {
7360
+ var e = t
7361
+ ? this.getMousePosition(t)
7362
+ : this.getCurrent(
7363
+ this.getDefaultValue() / this.maxValue
7364
+ );
7365
+ return this.getDist(e);
7366
+ },
7367
+ },
7368
+ {
7369
+ key: "getDefaultValue",
7370
+ value: function () {
7371
+ return 0;
7372
+ },
7373
+ },
7374
+ {
7375
+ key: "setMousePosition",
7376
+ value: function (t) {
7377
+ this.refs.$bar.css({ left: t + "px" });
7378
+ },
7379
+ },
7380
+ {
7381
+ key: "getMousePosition",
7382
+ value: function (t) {
7383
+ return cn.pos(t).pageX;
7384
+ },
7385
+ },
7386
+ {
7387
+ key: "refresh",
7388
+ value: function () {
7389
+ this.setColorUI();
7390
+ },
7391
+ },
7392
+ {
7393
+ key: "setColorUI",
7394
+ value: function (t) {
7395
+ (t = t || this.getDefaultValue()) <= this.minValue
7396
+ ? this.refs.$bar.addClass("first").removeClass("last")
7397
+ : t >= this.maxValue
7398
+ ? this.refs.$bar.addClass("last").removeClass("first")
7399
+ : this.refs.$bar
7400
+ .removeClass("last")
7401
+ .removeClass("first"),
7402
+ this.setMousePosition(
7403
+ this.getMaxDist() * ((t || 0) / this.maxValue)
7404
+ );
7405
+ },
7406
+ },
7407
+ ]),
7408
+ e
7409
+ );
7410
+ })(
7411
+ (function (t) {
7412
+ function e(t) {
7413
+ _(this, e);
7414
+ var n = C(
7415
+ this,
7416
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
7417
+ );
7418
+ return (n.source = "base-box"), n;
7419
+ }
7420
+ return (
7421
+ T(e, t),
7422
+ y(e, [
7423
+ { key: "refresh", value: function () {} },
7424
+ { key: "refreshColorUI", value: function (t) {} },
7425
+ {
7426
+ key: "changeColor",
7427
+ value: function (t) {
7428
+ this.$store.dispatch(
7429
+ "/changeColor",
7430
+ Object.assign({ source: this.source }, t || {})
7431
+ );
7432
+ },
7433
+ },
7434
+ {
7435
+ key: "mouseup document",
7436
+ value: function (t) {
7437
+ this.onDragEnd(t);
7438
+ },
7439
+ },
7440
+ {
7441
+ key: "mousemove document",
7442
+ value: function (t) {
7443
+ this.onDragMove(t);
7444
+ },
7445
+ },
7446
+ {
7447
+ key: "mousedown $bar",
7448
+ value: function (t) {
7449
+ t.preventDefault(), (this.isDown = !0);
7450
+ },
7451
+ },
7452
+ {
7453
+ key: "mousedown $container",
7454
+ value: function (t) {
7455
+ (this.isDown = !0), this.onDragStart(t);
7456
+ },
7457
+ },
7458
+ {
7459
+ key: "touchend document",
7460
+ value: function (t) {
7461
+ this.onDragEnd(t);
7462
+ },
7463
+ },
7464
+ {
7465
+ key: "touchmove document",
7466
+ value: function (t) {
7467
+ this.onDragMove(t);
7468
+ },
7469
+ },
7470
+ {
7471
+ key: "touchstart $bar",
7472
+ value: function (t) {
7473
+ t.preventDefault(), (this.isDown = !0);
7474
+ },
7475
+ },
7476
+ {
7477
+ key: "touchstart $container",
7478
+ value: function (t) {
7479
+ this.onDragStart(t);
7480
+ },
7481
+ },
7482
+ {
7483
+ key: "onDragStart",
7484
+ value: function (t) {
7485
+ (this.isDown = !0), this.refreshColorUI(t);
7486
+ },
7487
+ },
7488
+ {
7489
+ key: "onDragMove",
7490
+ value: function (t) {
7491
+ this.isDown && this.refreshColorUI(t);
7492
+ },
7493
+ },
7494
+ {
7495
+ key: "onDragEnd",
7496
+ value: function (t) {
7497
+ this.isDown &&
7498
+ (this.$store.emit("lastUpdateColor"),
7499
+ (this.isDown = !1));
7500
+ },
7501
+ },
7502
+ {
7503
+ key: "@changeColor",
7504
+ value: function (t) {
7505
+ this.source != t && this.refresh();
7506
+ },
7507
+ },
7508
+ {
7509
+ key: "@initColor",
7510
+ value: function () {
7511
+ this.refresh();
7512
+ },
7513
+ },
7514
+ ]),
7515
+ e
7516
+ );
7517
+ })(mn)
7518
+ ),
7519
+ kn = (function (t) {
7520
+ function e(t) {
7521
+ _(this, e);
7522
+ var n = C(
7523
+ this,
7524
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
7525
+ );
7526
+ return (
7527
+ (n.minValue = 0),
7528
+ (n.maxValue = 1),
7529
+ (n.source = "value-control"),
7530
+ n
7531
+ );
7532
+ }
7533
+ return (
7534
+ T(e, t),
7535
+ y(e, [
7536
+ {
7537
+ key: "template",
7538
+ value: function () {
7539
+ return '\n <div class="value">\n <div ref="$container" class="value-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n ';
7540
+ },
7541
+ },
7542
+ {
7543
+ key: "setBackgroundColor",
7544
+ value: function () {
7545
+ this.refs.$container.css(
7546
+ "background-color",
7547
+ this.$store.dispatch("/toRGB")
7548
+ );
7549
+ },
7550
+ },
7551
+ {
7552
+ key: "refresh",
7553
+ value: function () {
7554
+ b(
7555
+ e.prototype.__proto__ ||
7556
+ Object.getPrototypeOf(e.prototype),
7557
+ "refresh",
7558
+ this
7559
+ ).call(this),
7560
+ this.setBackgroundColor();
7561
+ },
7562
+ },
7563
+ {
7564
+ key: "getDefaultValue",
7565
+ value: function () {
7566
+ return this.$store.hsv.v;
7567
+ },
7568
+ },
7569
+ {
7570
+ key: "refreshColorUI",
7571
+ value: function (t) {
7572
+ var e = this.getCaculatedDist(t);
7573
+ this.setColorUI((e / 100) * this.maxValue),
7574
+ this.changeColor({
7575
+ type: "hsv",
7576
+ v: (e / 100) * this.maxValue,
7577
+ });
7578
+ },
7579
+ },
7580
+ ]),
7581
+ e
7582
+ );
7583
+ })(xn),
7584
+ bn = (function (t) {
7585
+ function e(t) {
7586
+ _(this, e);
7587
+ var n = C(
7588
+ this,
7589
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
7590
+ );
7591
+ return (
7592
+ (n.minValue = 0),
7593
+ (n.maxValue = 1),
7594
+ (n.source = "opacity-control"),
7595
+ n
7596
+ );
7597
+ }
7598
+ return (
7599
+ T(e, t),
7600
+ y(e, [
7601
+ {
7602
+ key: "template",
7603
+ value: function () {
7604
+ return '\n <div class="opacity">\n <div ref="$container" class="opacity-container">\n <div ref="$colorbar" class="color-bar"></div>\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n ';
7605
+ },
7606
+ },
7607
+ {
7608
+ key: "refresh",
7609
+ value: function () {
7610
+ b(
7611
+ e.prototype.__proto__ ||
7612
+ Object.getPrototypeOf(e.prototype),
7613
+ "refresh",
7614
+ this
7615
+ ).call(this),
7616
+ this.setOpacityColorBar();
7617
+ },
7618
+ },
7619
+ {
7620
+ key: "setOpacityColorBar",
7621
+ value: function () {
7622
+ var t = Object.assign({}, this.$store.rgb);
7623
+ t.a = 0;
7624
+ var e = Ze.format(t, "rgb");
7625
+ t.a = 1;
7626
+ var n = Ze.format(t, "rgb");
7627
+ this.setOpacityColorBarBackground(e, n);
7628
+ },
7629
+ },
7630
+ {
7631
+ key: "setOpacityColorBarBackground",
7632
+ value: function (t, e) {
7633
+ this.refs.$colorbar.css(
7634
+ "background",
7635
+ "linear-gradient(to right, " + t + ", " + e + ")"
7636
+ );
7637
+ },
7638
+ },
7639
+ {
7640
+ key: "getDefaultValue",
7641
+ value: function () {
7642
+ return this.$store.alpha;
7643
+ },
7644
+ },
7645
+ {
7646
+ key: "refreshColorUI",
7647
+ value: function (t) {
7648
+ var e = this.getCaculatedDist(t);
7649
+ this.setColorUI((e / 100) * this.maxValue),
7650
+ this.changeColor({
7651
+ a: (Math.floor(e) / 100) * this.maxValue,
7652
+ });
7653
+ },
7654
+ },
7655
+ ]),
7656
+ e
7657
+ );
7658
+ })(xn),
7659
+ Tn = (function (t) {
7660
+ function e() {
7661
+ return (
7662
+ _(this, e),
7663
+ C(
7664
+ this,
7665
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
7666
+ this,
7667
+ arguments
7668
+ )
7669
+ )
7670
+ );
7671
+ }
7672
+ return (
7673
+ T(e, t),
7674
+ y(e, [
7675
+ {
7676
+ key: "components",
7677
+ value: function () {
7678
+ return { Value: kn, Opacity: bn };
7679
+ },
7680
+ },
7681
+ {
7682
+ key: "template",
7683
+ value: function () {
7684
+ return '\n <div class="control">\n <div target="Value" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n </div>\n ';
7685
+ },
7686
+ },
7687
+ {
7688
+ key: "setBackgroundColor",
7689
+ value: function () {
7690
+ this.refs.$controlColor.css(
7691
+ "background-color",
7692
+ this.$store.dispatch("/toRGB")
7693
+ );
7694
+ },
7695
+ },
7696
+ {
7697
+ key: "refresh",
7698
+ value: function () {
7699
+ this.setColorUI(), this.setBackgroundColor();
7700
+ },
7701
+ },
7702
+ {
7703
+ key: "setColorUI",
7704
+ value: function () {
7705
+ this.Value.setColorUI(), this.Opacity.setColorUI();
7706
+ },
7707
+ },
7708
+ {
7709
+ key: "@changeColor",
7710
+ value: function (t) {
7711
+ "macos-control" != t && this.refresh();
7712
+ },
7713
+ },
7714
+ {
7715
+ key: "@initColor",
7716
+ value: function () {
7717
+ this.refresh();
7718
+ },
7719
+ },
7720
+ ]),
7721
+ e
7722
+ );
7723
+ })(mn),
7724
+ Cn = (function (t) {
7725
+ function e(t) {
7726
+ _(this, e);
7727
+ var n = C(
7728
+ this,
7729
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
7730
+ );
7731
+ return (
7732
+ (n.width = 214),
7733
+ (n.height = 214),
7734
+ (n.thinkness = 0),
7735
+ (n.half_thinkness = 0),
7736
+ (n.source = "colorwheel"),
7737
+ n
7738
+ );
7739
+ }
7740
+ return (
7741
+ T(e, t),
7742
+ y(e, [
7743
+ {
7744
+ key: "template",
7745
+ value: function () {
7746
+ return '\n <div class="wheel">\n <canvas class="wheel-canvas" ref="$colorwheel" ></canvas>\n <div class="wheel-canvas" ref="$valuewheel" ></div>\n <div class="drag-pointer" ref="$drag_pointer"></div>\n </div>\n ';
7747
+ },
7748
+ },
7749
+ {
7750
+ key: "refresh",
7751
+ value: function (t) {
7752
+ this.setColorUI(t);
7753
+ },
7754
+ },
7755
+ {
7756
+ key: "setColorUI",
7757
+ value: function (t) {
7758
+ this.renderCanvas(),
7759
+ this.renderValue(),
7760
+ this.setHueColor(null, t);
7761
+ },
7762
+ },
7763
+ {
7764
+ key: "renderValue",
7765
+ value: function () {
7766
+ var t = 1 - this.$store.hsv.v;
7767
+ this.refs.$valuewheel.css({
7768
+ "background-color": "rgba(0, 0, 0, " + t + ")",
7769
+ });
7770
+ },
7771
+ },
7772
+ {
7773
+ key: "renderWheel",
7774
+ value: function (t, e) {
7775
+ this.width && !t && (t = this.width),
7776
+ this.height && !e && (e = this.height);
7777
+ var n = new sn("canvas"),
7778
+ i = n.el.getContext("2d");
7779
+ (n.el.width = t),
7780
+ (n.el.height = e),
7781
+ n.css({ width: t + "px", height: e + "px" });
7782
+ for (
7783
+ var r = i.getImageData(0, 0, t, e),
7784
+ o = r.data,
7785
+ s = Math.floor(t / 2),
7786
+ a = Math.floor(e / 2),
7787
+ l = t > e ? a : s,
7788
+ c = s,
7789
+ h = a,
7790
+ f = 0;
7791
+ f < e;
7792
+ f++
7793
+ )
7794
+ for (var d = 0; d < t; d++) {
7795
+ var p = d - c + 1,
7796
+ g = f - h + 1,
7797
+ m = p * p + g * g,
7798
+ v = u(p, g),
7799
+ _ = Ze.HSVtoRGB(
7800
+ v,
7801
+ Math.min(Math.sqrt(m) / l, 1),
7802
+ 1
7803
+ ),
7804
+ y = 4 * (f * t + d);
7805
+ (o[y] = _.r),
7806
+ (o[y + 1] = _.g),
7807
+ (o[y + 2] = _.b),
7808
+ (o[y + 3] = 255);
7809
+ }
7810
+ return (
7811
+ i.putImageData(r, 0, 0),
7812
+ this.thinkness > 0 &&
7813
+ ((i.globalCompositeOperation = "destination-out"),
7814
+ (i.fillStyle = "black"),
7815
+ i.beginPath(),
7816
+ i.arc(c, h, l - this.thinkness, 0, 2 * Math.PI),
7817
+ i.closePath(),
7818
+ i.fill()),
7819
+ n
7820
+ );
7821
+ },
7822
+ },
7823
+ {
7824
+ key: "renderCanvas",
7825
+ value: function () {
7826
+ if (!this.$store.createdWheelCanvas) {
7827
+ var t = this.refs.$colorwheel,
7828
+ e = t.el.getContext("2d"),
7829
+ n = t.size(),
7830
+ i = w(n, 2),
7831
+ r = i[0],
7832
+ o = i[1];
7833
+ this.width && !r && (r = this.width),
7834
+ this.height && !o && (o = this.height),
7835
+ (t.el.width = r),
7836
+ (t.el.height = o),
7837
+ t.css({ width: r + "px", height: o + "px" });
7838
+ var s = this.renderWheel(r, o);
7839
+ e.drawImage(s.el, 0, 0),
7840
+ (this.$store.createdWheelCanvas = !0);
7841
+ }
7842
+ },
7843
+ },
7844
+ {
7845
+ key: "getDefaultValue",
7846
+ value: function () {
7847
+ return this.$store.hsv.h;
7848
+ },
7849
+ },
7850
+ {
7851
+ key: "getDefaultSaturation",
7852
+ value: function () {
7853
+ return this.$store.hsv.s;
7854
+ },
7855
+ },
7856
+ {
7857
+ key: "getCurrentXY",
7858
+ value: function (t, e, n, i, r) {
7859
+ return t
7860
+ ? cn.posXY(t)
7861
+ : (function (t, e) {
7862
+ var n =
7863
+ arguments.length > 3 && void 0 !== arguments[3]
7864
+ ? arguments[3]
7865
+ : 0;
7866
+ return {
7867
+ x: c(
7868
+ t,
7869
+ e,
7870
+ arguments.length > 2 &&
7871
+ void 0 !== arguments[2]
7872
+ ? arguments[2]
7873
+ : 0
7874
+ ),
7875
+ y: h(t, e, n),
7876
+ };
7877
+ })(e, n, i, r);
7878
+ },
7879
+ },
7880
+ {
7881
+ key: "getRectangle",
7882
+ value: function () {
7883
+ var t = this.state.get("$el.width"),
7884
+ e = this.state.get("$el.height"),
7885
+ n = this.state.get("$colorwheel.width") / 2,
7886
+ i = this.refs.$el.offset().left,
7887
+ r = i + t / 2,
7888
+ o = this.refs.$el.offset().top;
7889
+ return {
7890
+ minX: i,
7891
+ minY: o,
7892
+ width: t,
7893
+ height: e,
7894
+ radius: n,
7895
+ centerX: r,
7896
+ centerY: o + e / 2,
7897
+ };
7898
+ },
7899
+ },
7900
+ {
7901
+ key: "setHueColor",
7902
+ value: function (t, e) {
7903
+ if (this.state.get("$el.width")) {
7904
+ var n = this.getRectangle(),
7905
+ i = n.minX,
7906
+ r = n.minY,
7907
+ o = n.radius,
7908
+ s = n.centerX,
7909
+ a = n.centerY,
7910
+ l = this.getCurrentXY(
7911
+ t,
7912
+ this.getDefaultValue(),
7913
+ this.getDefaultSaturation() * o,
7914
+ s,
7915
+ a
7916
+ ),
7917
+ c = (g = l.x) - s,
7918
+ h = (m = l.y) - a,
7919
+ f = c * c + h * h,
7920
+ d = u(c, h);
7921
+ if (f > o * o)
7922
+ var p = this.getCurrentXY(null, d, o, s, a),
7923
+ g = p.x,
7924
+ m = p.y;
7925
+ var v = Math.min(Math.sqrt(f) / o, 1);
7926
+ this.refs.$drag_pointer.css({
7927
+ left: g - i + "px",
7928
+ top: m - r + "px",
7929
+ }),
7930
+ e || this.changeColor({ type: "hsv", h: d, s: v });
7931
+ }
7932
+ },
7933
+ },
7934
+ {
7935
+ key: "changeColor",
7936
+ value: function (t) {
7937
+ this.$store.dispatch(
7938
+ "/changeColor",
7939
+ Object.assign({ source: this.source }, t || {})
7940
+ );
7941
+ },
7942
+ },
7943
+ {
7944
+ key: "@changeColor",
7945
+ value: function (t) {
7946
+ this.source != t && this.refresh(!0);
7947
+ },
7948
+ },
7949
+ {
7950
+ key: "@initColor",
7951
+ value: function () {
7952
+ this.refresh(!0);
7953
+ },
7954
+ },
7955
+ {
7956
+ key: "mouseup document",
7957
+ value: function (t) {
7958
+ this.isDown &&
7959
+ ((this.isDown = !1),
7960
+ this.$store.emit("lastUpdateColor"));
7961
+ },
7962
+ },
7963
+ {
7964
+ key: "mousemove document",
7965
+ value: function (t) {
7966
+ this.isDown && this.setHueColor(t);
7967
+ },
7968
+ },
7969
+ {
7970
+ key: "mousedown $drag_pointer",
7971
+ value: function (t) {
7972
+ t.preventDefault(), (this.isDown = !0);
7973
+ },
7974
+ },
7975
+ {
7976
+ key: "mousedown $el",
7977
+ value: function (t) {
7978
+ (this.isDown = !0), this.setHueColor(t);
7979
+ },
7980
+ },
7981
+ {
7982
+ key: "touchend document",
7983
+ value: function (t) {
7984
+ this.isDown &&
7985
+ ((this.isDown = !1),
7986
+ this.$store.emit("lastUpdateColor"));
7987
+ },
7988
+ },
7989
+ {
7990
+ key: "touchmove document",
7991
+ value: function (t) {
7992
+ this.isDown && this.setHueColor(t);
7993
+ },
7994
+ },
7995
+ {
7996
+ key: "touchstart $drag_pointer",
7997
+ value: function (t) {
7998
+ t.preventDefault(), (this.isDown = !0);
7999
+ },
8000
+ },
8001
+ {
8002
+ key: "touchstart $el",
8003
+ value: function (t) {
8004
+ t.preventDefault(),
8005
+ (this.isDown = !0),
8006
+ this.setHueColor(t);
8007
+ },
8008
+ },
8009
+ ]),
8010
+ e
8011
+ );
8012
+ })(mn),
8013
+ wn = "chromedevtool-information",
8014
+ En = (function (t) {
8015
+ function e() {
8016
+ return (
8017
+ _(this, e),
8018
+ C(
8019
+ this,
8020
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8021
+ this,
8022
+ arguments
8023
+ )
8024
+ )
8025
+ );
8026
+ }
8027
+ return (
8028
+ T(e, t),
8029
+ y(e, [
8030
+ {
8031
+ key: "template",
8032
+ value: function () {
8033
+ return '\n <div class="information hex">\n <div ref="$informationChange" class="information-change">\n <button ref="$formatChangeButton" type="button" class="format-change-button arrow-button"></button>\n </div>\n <div class="information-item hex">\n <div class="input-field hex">\n <input ref="$hexCode" class="input" type="text" />\n <div class="title">HEX</div>\n </div>\n </div>\n <div class="information-item rgb">\n <div class="input-field rgb-r">\n <input ref="$rgb_r" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">R</div>\n </div>\n <div class="input-field rgb-g">\n <input ref="$rgb_g" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">G</div>\n </div>\n <div class="input-field rgb-b">\n <input ref="$rgb_b" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">B</div>\n </div> \n <div class="input-field rgb-a">\n <input ref="$rgb_a" class="input" type="number" step="0.01" min="0" max="1" />\n <div class="title">A</div>\n </div> \n </div>\n <div class="information-item hsl">\n <div class="input-field hsl-h">\n <input ref="$hsl_h" class="input" type="number" step="1" min="0" max="360" />\n <div class="title">H</div>\n </div>\n <div class="input-field hsl-s">\n <input ref="$hsl_s" class="input" type="number" step="1" min="0" max="100" />\n <div class="postfix">%</div>\n <div class="title">S</div>\n </div>\n <div class="input-field hsl-l">\n <input ref="$hsl_l" class="input" type="number" step="1" min="0" max="100" />\n <div class="postfix">%</div> \n <div class="title">L</div>\n </div>\n <div class="input-field hsl-a">\n <input ref="$hsl_a" class="input" type="number" step="0.01" min="0" max="1" />\n <div class="title">A</div>\n </div>\n </div>\n </div>\n ';
8034
+ },
8035
+ },
8036
+ {
8037
+ key: "setCurrentFormat",
8038
+ value: function (t) {
8039
+ (this.format = t), this.initFormat();
8040
+ },
8041
+ },
8042
+ {
8043
+ key: "initFormat",
8044
+ value: function () {
8045
+ var t = this,
8046
+ e = this.format || "hex";
8047
+ ["hex", "rgb", "hsl"]
8048
+ .filter(function (t) {
8049
+ return t !== e;
8050
+ })
8051
+ .forEach(function (e) {
8052
+ t.$el.removeClass(e);
8053
+ }),
8054
+ this.$el.addClass(e);
8055
+ },
8056
+ },
8057
+ {
8058
+ key: "nextFormat",
8059
+ value: function () {
8060
+ var t = this.$store.format || "hex",
8061
+ e = "hex";
8062
+ "hex" == t
8063
+ ? (e = "rgb")
8064
+ : "rgb" == t
8065
+ ? (e = "hsl")
8066
+ : "hsl" == t && (e = "hex"),
8067
+ (this.format = e),
8068
+ this.$store.dispatch("/changeFormat", e),
8069
+ this.$store.emit("lastUpdateColor"),
8070
+ this.initFormat();
8071
+ },
8072
+ },
8073
+ {
8074
+ key: "goToFormat",
8075
+ value: function (t) {
8076
+ (this.format = t),
8077
+ this.$store.dispatch("/changeFormat", this.format),
8078
+ this.$store.emit("lastUpdateColor"),
8079
+ this.initFormat();
8080
+ },
8081
+ },
8082
+ {
8083
+ key: "getFormat",
8084
+ value: function () {
8085
+ return this.format || "hex";
8086
+ },
8087
+ },
8088
+ {
8089
+ key: "checkNumberKey",
8090
+ value: function (t) {
8091
+ var e = t.which,
8092
+ n = !1;
8093
+ return (
8094
+ (37 != e && 39 != e && 8 != e && 46 != e && 9 != e) ||
8095
+ (n = !0),
8096
+ !(!n && (e < 48 || e > 57))
8097
+ );
8098
+ },
8099
+ },
8100
+ {
8101
+ key: "checkNotNumberKey",
8102
+ value: function (t) {
8103
+ return !this.checkNumberKey(t);
8104
+ },
8105
+ },
8106
+ {
8107
+ key: "changeRgbColor",
8108
+ value: function () {
8109
+ this.$store.dispatch("/changeColor", {
8110
+ type: "rgb",
8111
+ r: this.refs.$rgb_r.int(),
8112
+ g: this.refs.$rgb_g.int(),
8113
+ b: this.refs.$rgb_b.int(),
8114
+ a: this.refs.$rgb_a.float(),
8115
+ source: wn,
8116
+ }),
8117
+ this.$store.emit("lastUpdateColor");
8118
+ },
8119
+ },
8120
+ {
8121
+ key: "changeHslColor",
8122
+ value: function () {
8123
+ this.$store.dispatch("/changeColor", {
8124
+ type: "hsl",
8125
+ h: this.refs.$hsl_h.int(),
8126
+ s: this.refs.$hsl_s.int(),
8127
+ l: this.refs.$hsl_l.int(),
8128
+ a: this.refs.$hsl_a.float(),
8129
+ source: wn,
8130
+ }),
8131
+ this.$store.emit("lastUpdateColor");
8132
+ },
8133
+ },
8134
+ {
8135
+ key: "@changeColor",
8136
+ value: function (t) {
8137
+ wn != t && this.refresh();
8138
+ },
8139
+ },
8140
+ {
8141
+ key: "@initColor",
8142
+ value: function () {
8143
+ this.refresh();
8144
+ },
8145
+ },
8146
+ {
8147
+ key: "input $rgb_r",
8148
+ value: function (t) {
8149
+ this.changeRgbColor();
8150
+ },
8151
+ },
8152
+ {
8153
+ key: "input $rgb_g",
8154
+ value: function (t) {
8155
+ this.changeRgbColor();
8156
+ },
8157
+ },
8158
+ {
8159
+ key: "input $rgb_b",
8160
+ value: function (t) {
8161
+ this.changeRgbColor();
8162
+ },
8163
+ },
8164
+ {
8165
+ key: "input $rgb_a",
8166
+ value: function (t) {
8167
+ this.changeRgbColor();
8168
+ },
8169
+ },
8170
+ {
8171
+ key: "input $hsl_h",
8172
+ value: function (t) {
8173
+ this.changeHslColor();
8174
+ },
8175
+ },
8176
+ {
8177
+ key: "input $hsl_s",
8178
+ value: function (t) {
8179
+ this.changeHslColor();
8180
+ },
8181
+ },
8182
+ {
8183
+ key: "input $hsl_l",
8184
+ value: function (t) {
8185
+ this.changeHslColor();
8186
+ },
8187
+ },
8188
+ {
8189
+ key: "input $hsl_a",
8190
+ value: function (t) {
8191
+ this.changeHslColor();
8192
+ },
8193
+ },
8194
+ {
8195
+ key: "keyup $hexCode",
8196
+ value: function (t) {
8197
+ var e = this.refs.$hexCode.val();
8198
+ "#" != e.charAt(0) ||
8199
+ (7 != e.length && 9 !== e.length) ||
8200
+ (this.$store.dispatch("/changeColor", e, wn),
8201
+ this.$store.emit("lastUpdateColor"));
8202
+ },
8203
+ },
8204
+ {
8205
+ key: "click $formatChangeButton",
8206
+ value: function (t) {
8207
+ this.nextFormat();
8208
+ },
8209
+ },
8210
+ {
8211
+ key: "click $el .information-item.hex .input-field .title",
8212
+ value: function (t) {
8213
+ this.goToFormat("rgb");
8214
+ },
8215
+ },
8216
+ {
8217
+ key: "click $el .information-item.rgb .input-field .title",
8218
+ value: function (t) {
8219
+ this.goToFormat("hsl");
8220
+ },
8221
+ },
8222
+ {
8223
+ key: "click $el .information-item.hsl .input-field .title",
8224
+ value: function (t) {
8225
+ this.goToFormat("hex");
8226
+ },
8227
+ },
8228
+ {
8229
+ key: "setRGBInput",
8230
+ value: function () {
8231
+ this.refs.$rgb_r.val(this.$store.rgb.r),
8232
+ this.refs.$rgb_g.val(this.$store.rgb.g),
8233
+ this.refs.$rgb_b.val(this.$store.rgb.b),
8234
+ this.refs.$rgb_a.val(this.$store.alpha);
8235
+ },
8236
+ },
8237
+ {
8238
+ key: "setHSLInput",
8239
+ value: function () {
8240
+ this.refs.$hsl_h.val(this.$store.hsl.h),
8241
+ this.refs.$hsl_s.val(this.$store.hsl.s),
8242
+ this.refs.$hsl_l.val(this.$store.hsl.l),
8243
+ this.refs.$hsl_a.val(this.$store.alpha);
8244
+ },
8245
+ },
8246
+ {
8247
+ key: "setHexInput",
8248
+ value: function () {
8249
+ this.refs.$hexCode.val(this.$store.dispatch("/toHEX"));
8250
+ },
8251
+ },
8252
+ {
8253
+ key: "refresh",
8254
+ value: function () {
8255
+ this.setCurrentFormat(this.$store.format),
8256
+ this.setRGBInput(),
8257
+ this.setHSLInput(),
8258
+ this.setHexInput();
8259
+ },
8260
+ },
8261
+ ]),
8262
+ e
8263
+ );
8264
+ })(mn),
8265
+ Sn = (function (t) {
8266
+ function e() {
8267
+ return (
8268
+ _(this, e),
8269
+ C(
8270
+ this,
8271
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8272
+ this,
8273
+ arguments
8274
+ )
8275
+ )
8276
+ );
8277
+ }
8278
+ return (
8279
+ T(e, t),
8280
+ y(e, [
8281
+ {
8282
+ key: "template",
8283
+ value: function () {
8284
+ return '\n <div class="color-chooser">\n <div class="color-chooser-container">\n <div class="colorsets-item colorsets-item-header">\n <h1 class="title">Color Palettes</h1>\n <span ref="$toggleButton" class="items">&times;</span>\n </div>\n <div ref="$colorsetsList" class="colorsets-list"></div>\n </div>\n </div>\n ';
8285
+ },
8286
+ },
8287
+ {
8288
+ key: "refresh",
8289
+ value: function () {
8290
+ this.load();
8291
+ },
8292
+ },
8293
+ {
8294
+ key: "@changeCurrentColorSets",
8295
+ value: function () {
8296
+ this.refresh();
8297
+ },
8298
+ },
8299
+ {
8300
+ key: "@toggleColorChooser",
8301
+ value: function () {
8302
+ this.toggle();
8303
+ },
8304
+ },
8305
+ {
8306
+ key: "load $colorsetsList",
8307
+ value: function () {
8308
+ return (
8309
+ "\n <div>\n " +
8310
+ this.$store
8311
+ .dispatch("/getColorSetsList")
8312
+ .map(function (t, e) {
8313
+ return (
8314
+ '\n <div class="colorsets-item" data-colorsets-index="' +
8315
+ e +
8316
+ '" >\n <h1 class="title">' +
8317
+ t.name +
8318
+ '</h1>\n <div class="items">\n <div>\n ' +
8319
+ t.colors
8320
+ .filter(function (t, e) {
8321
+ return e < 5;
8322
+ })
8323
+ .map(function (t) {
8324
+ return (
8325
+ '<div class="color-item" title="' +
8326
+ (t = t || "rgba(255, 255, 255, 1)") +
8327
+ '">\n <div class="color-view" style="background-color: ' +
8328
+ t +
8329
+ '"></div>\n </div>'
8330
+ );
8331
+ })
8332
+ .join("") +
8333
+ "\n </div>\n </div>\n </div>"
8334
+ );
8335
+ })
8336
+ .join("") +
8337
+ "\n </div>\n "
8338
+ );
8339
+ },
8340
+ },
8341
+ {
8342
+ key: "show",
8343
+ value: function () {
8344
+ this.$el.addClass("open");
8345
+ },
8346
+ },
8347
+ {
8348
+ key: "hide",
8349
+ value: function () {
8350
+ this.$el.removeClass("open");
8351
+ },
8352
+ },
8353
+ {
8354
+ key: "toggle",
8355
+ value: function () {
8356
+ this.$el.toggleClass("open");
8357
+ },
8358
+ },
8359
+ {
8360
+ key: "click $toggleButton",
8361
+ value: function (t) {
8362
+ this.toggle();
8363
+ },
8364
+ },
8365
+ {
8366
+ key: "click $colorsetsList .colorsets-item",
8367
+ value: function (t) {
8368
+ var e = t.$delegateTarget;
8369
+ if (e) {
8370
+ var n = parseInt(e.attr("data-colorsets-index"));
8371
+ this.$store.dispatch("/setCurrentColorSets", n),
8372
+ this.hide();
8373
+ }
8374
+ },
8375
+ },
8376
+ {
8377
+ key: "destroy",
8378
+ value: function () {
8379
+ b(
8380
+ e.prototype.__proto__ ||
8381
+ Object.getPrototypeOf(e.prototype),
8382
+ "destroy",
8383
+ this
8384
+ ).call(this),
8385
+ this.hide();
8386
+ },
8387
+ },
8388
+ ]),
8389
+ e
8390
+ );
8391
+ })(mn),
8392
+ An = (function (t) {
8393
+ function e() {
8394
+ return (
8395
+ _(this, e),
8396
+ C(
8397
+ this,
8398
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8399
+ this,
8400
+ arguments
8401
+ )
8402
+ )
8403
+ );
8404
+ }
8405
+ return (
8406
+ T(e, t),
8407
+ y(e, [
8408
+ {
8409
+ key: "template",
8410
+ value: function () {
8411
+ return '\n <div class="colorsets">\n <div class="menu" title="Open Color Palettes">\n <button ref="$colorSetsChooseButton" type="button" class="color-sets-choose-btn arrow-button"></button>\n </div>\n <div ref="$colorSetsColorList" class="color-list"></div>\n </div>\n ';
8412
+ },
8413
+ },
8414
+ {
8415
+ key: "load $colorSetsColorList",
8416
+ value: function () {
8417
+ var t = this.$store.dispatch("/getCurrentColorSets");
8418
+ return (
8419
+ '\n <div class="current-color-sets">\n ' +
8420
+ this.$store
8421
+ .dispatch("/getCurrentColors")
8422
+ .map(function (t, e) {
8423
+ return (
8424
+ '<div class="color-item" title="' +
8425
+ t +
8426
+ '" data-index="' +
8427
+ e +
8428
+ '" data-color="' +
8429
+ t +
8430
+ '">\n <div class="empty"></div>\n <div class="color-view" style="background-color: ' +
8431
+ t +
8432
+ '"></div>\n </div>'
8433
+ );
8434
+ })
8435
+ .join("") +
8436
+ " \n " +
8437
+ (t.edit
8438
+ ? '<div class="add-color-item">+</div>'
8439
+ : "") +
8440
+ " \n </div>\n "
8441
+ );
8442
+ },
8443
+ },
8444
+ {
8445
+ key: "refresh",
8446
+ value: function () {
8447
+ this.load();
8448
+ },
8449
+ },
8450
+ {
8451
+ key: "addColor",
8452
+ value: function (t) {
8453
+ this.$store.dispatch("/addCurrentColor", t);
8454
+ },
8455
+ },
8456
+ {
8457
+ key: "@changeCurrentColorSets",
8458
+ value: function () {
8459
+ this.refresh();
8460
+ },
8461
+ },
8462
+ {
8463
+ key: "click $colorSetsChooseButton",
8464
+ value: function (t) {
8465
+ this.$store.emit("toggleColorChooser");
8466
+ },
8467
+ },
8468
+ {
8469
+ key: "contextmenu $colorSetsColorList",
8470
+ value: function (t) {
8471
+ if (
8472
+ (t.preventDefault(),
8473
+ this.$store.dispatch("/getCurrentColorSets").edit)
8474
+ ) {
8475
+ var e = new sn(t.target).closest("color-item");
8476
+ if (e) {
8477
+ var n = parseInt(e.attr("data-index"));
8478
+ this.$store.emit("showContextMenu", t, n);
8479
+ } else this.$store.emit("showContextMenu", t);
8480
+ }
8481
+ },
8482
+ },
8483
+ {
8484
+ key: "click $colorSetsColorList .add-color-item",
8485
+ value: function (t) {
8486
+ this.addColor(this.$store.dispatch("/toColor"));
8487
+ },
8488
+ },
8489
+ {
8490
+ key: "click $colorSetsColorList .color-item",
8491
+ value: function (t) {
8492
+ this.$store.dispatch(
8493
+ "/changeColor",
8494
+ t.$delegateTarget.attr("data-color")
8495
+ ),
8496
+ this.$store.emit("lastUpdateColor");
8497
+ },
8498
+ },
8499
+ ]),
8500
+ e
8501
+ );
8502
+ })(mn),
8503
+ Ln = (function (t) {
8504
+ function e() {
8505
+ return (
8506
+ _(this, e),
8507
+ C(
8508
+ this,
8509
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8510
+ this,
8511
+ arguments
8512
+ )
8513
+ )
8514
+ );
8515
+ }
8516
+ return (
8517
+ T(e, t),
8518
+ y(e, [
8519
+ {
8520
+ key: "template",
8521
+ value: function () {
8522
+ return '\n <ul class="colorsets-contextmenu">\n <li class="menu-item small-hide" data-type="remove-color">Remove color</li>\n <li class="menu-item small-hide" data-type="remove-all-to-the-right">Remove all to the right</li>\n <li class="menu-item" data-type="clear-palette">Clear palette</li>\n </ul>\n ';
8523
+ },
8524
+ },
8525
+ {
8526
+ key: "show",
8527
+ value: function (t, e) {
8528
+ var n = cn.pos(t);
8529
+ this.$el.css({
8530
+ top: n.clientY - 10 + "px",
8531
+ left: n.clientX + "px",
8532
+ }),
8533
+ this.$el.addClass("show"),
8534
+ (this.selectedColorIndex = e),
8535
+ void 0 === this.selectedColorIndex
8536
+ ? this.$el.addClass("small")
8537
+ : this.$el.removeClass("small");
8538
+ },
8539
+ },
8540
+ {
8541
+ key: "hide",
8542
+ value: function () {
8543
+ this.$el.removeClass("show");
8544
+ },
8545
+ },
8546
+ {
8547
+ key: "runCommand",
8548
+ value: function (t) {
8549
+ switch (t) {
8550
+ case "remove-color":
8551
+ this.$store.dispatch(
8552
+ "/removeCurrentColor",
8553
+ this.selectedColorIndex
8554
+ );
8555
+ break;
8556
+ case "remove-all-to-the-right":
8557
+ this.$store.dispatch(
8558
+ "/removeCurrentColorToTheRight",
8559
+ this.selectedColorIndex
8560
+ );
8561
+ break;
8562
+ case "clear-palette":
8563
+ this.$store.dispatch("/clearPalette");
8564
+ }
8565
+ },
8566
+ },
8567
+ {
8568
+ key: "@showContextMenu",
8569
+ value: function (t, e) {
8570
+ this.show(t, e);
8571
+ },
8572
+ },
8573
+ {
8574
+ key: "click $el .menu-item",
8575
+ value: function (t) {
8576
+ t.preventDefault(),
8577
+ this.runCommand(t.$delegateTarget.attr("data-type")),
8578
+ this.hide();
8579
+ },
8580
+ },
8581
+ ]),
8582
+ e
8583
+ );
8584
+ })(mn),
8585
+ On = (function (t) {
8586
+ function e() {
8587
+ return (
8588
+ _(this, e),
8589
+ C(
8590
+ this,
8591
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8592
+ this,
8593
+ arguments
8594
+ )
8595
+ )
8596
+ );
8597
+ }
8598
+ return (
8599
+ T(e, t),
8600
+ y(e, [
8601
+ {
8602
+ key: "template",
8603
+ value: function () {
8604
+ return '\n <div class=\'colorpicker-body\'>\n <div target="colorwheel"></div>\n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div> \n </div>\n ';
8605
+ },
8606
+ },
8607
+ {
8608
+ key: "components",
8609
+ value: function () {
8610
+ return {
8611
+ colorwheel: Cn,
8612
+ control: Tn,
8613
+ information: En,
8614
+ currentColorSets: An,
8615
+ colorSetsChooser: Sn,
8616
+ contextMenu: Ln,
8617
+ };
8618
+ },
8619
+ },
8620
+ ]),
8621
+ e
8622
+ );
8623
+ })(yn),
8624
+ Nn = (function (t) {
8625
+ function e(t) {
8626
+ _(this, e);
8627
+ var n = C(
8628
+ this,
8629
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
8630
+ );
8631
+ return (
8632
+ (n.minValue = 0),
8633
+ (n.maxValue = 360),
8634
+ (n.source = "hue-control"),
8635
+ n
8636
+ );
8637
+ }
8638
+ return (
8639
+ T(e, t),
8640
+ y(e, [
8641
+ {
8642
+ key: "template",
8643
+ value: function () {
8644
+ return '\n <div class="hue">\n <div ref="$container" class="hue-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n ';
8645
+ },
8646
+ },
8647
+ {
8648
+ key: "getDefaultValue",
8649
+ value: function () {
8650
+ return this.$store.hsv.h;
8651
+ },
8652
+ },
8653
+ {
8654
+ key: "refreshColorUI",
8655
+ value: function (t) {
8656
+ var e = this.getCaculatedDist(t);
8657
+ this.setColorUI((e / 100) * this.maxValue),
8658
+ this.changeColor({
8659
+ h: (e / 100) * this.maxValue,
8660
+ type: "hsv",
8661
+ });
8662
+ },
8663
+ },
8664
+ ]),
8665
+ e
8666
+ );
8667
+ })(xn),
8668
+ In = (function (t) {
8669
+ function e() {
8670
+ return (
8671
+ _(this, e),
8672
+ C(
8673
+ this,
8674
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8675
+ this,
8676
+ arguments
8677
+ )
8678
+ )
8679
+ );
8680
+ }
8681
+ return (
8682
+ T(e, t),
8683
+ y(e, [
8684
+ {
8685
+ key: "components",
8686
+ value: function () {
8687
+ return { Hue: Nn, Opacity: bn };
8688
+ },
8689
+ },
8690
+ {
8691
+ key: "template",
8692
+ value: function () {
8693
+ return '\n <div class="control">\n <div target="Hue" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n </div>\n ';
8694
+ },
8695
+ },
8696
+ {
8697
+ key: "setBackgroundColor",
8698
+ value: function () {
8699
+ this.refs.$controlColor.css(
8700
+ "background-color",
8701
+ this.$store.dispatch("/toRGB")
8702
+ );
8703
+ },
8704
+ },
8705
+ {
8706
+ key: "refresh",
8707
+ value: function () {
8708
+ this.setColorUI(), this.setBackgroundColor();
8709
+ },
8710
+ },
8711
+ {
8712
+ key: "setColorUI",
8713
+ value: function () {
8714
+ this.Hue.setColorUI(), this.Opacity.setColorUI();
8715
+ },
8716
+ },
8717
+ {
8718
+ key: "@changeColor",
8719
+ value: function (t) {
8720
+ "chromedevtool-control" != t && this.refresh();
8721
+ },
8722
+ },
8723
+ {
8724
+ key: "@initColor",
8725
+ value: function () {
8726
+ this.refresh();
8727
+ },
8728
+ },
8729
+ ]),
8730
+ e
8731
+ );
8732
+ })(mn),
8733
+ Mn = "chromedevtool-palette",
8734
+ $n = (function (t) {
8735
+ function e() {
8736
+ return (
8737
+ _(this, e),
8738
+ C(
8739
+ this,
8740
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8741
+ this,
8742
+ arguments
8743
+ )
8744
+ )
8745
+ );
8746
+ }
8747
+ return (
8748
+ T(e, t),
8749
+ y(e, [
8750
+ {
8751
+ key: "template",
8752
+ value: function () {
8753
+ return '\n <div class="color">\n <div ref="$saturation" class="saturation">\n <div ref="$value" class="value">\n <div ref="$drag_pointer" class="drag-pointer"></div>\n </div>\n </div> \n </div> \n ';
8754
+ },
8755
+ },
8756
+ {
8757
+ key: "setBackgroundColor",
8758
+ value: function (t) {
8759
+ this.$el.css("background-color", t);
8760
+ },
8761
+ },
8762
+ {
8763
+ key: "refresh",
8764
+ value: function () {
8765
+ this.setColorUI();
8766
+ },
8767
+ },
8768
+ {
8769
+ key: "caculateSV",
8770
+ value: function () {
8771
+ var t = this.drag_pointer_pos || { x: 0, y: 0 },
8772
+ e = this.state.get("$el.width"),
8773
+ n = this.state.get("$el.height"),
8774
+ i = t.x / e,
8775
+ r = (n - t.y) / n;
8776
+ this.$store.dispatch("/changeColor", {
8777
+ type: "hsv",
8778
+ s: i,
8779
+ v: r,
8780
+ source: Mn,
8781
+ });
8782
+ },
8783
+ },
8784
+ {
8785
+ key: "setColorUI",
8786
+ value: function () {
8787
+ var t = this.state.get("$el.width") * this.$store.hsv.s,
8788
+ e =
8789
+ this.state.get("$el.height") *
8790
+ (1 - this.$store.hsv.v);
8791
+ this.refs.$drag_pointer.css({
8792
+ left: t + "px",
8793
+ top: e + "px",
8794
+ }),
8795
+ (this.drag_pointer_pos = { x: t, y: e }),
8796
+ this.setBackgroundColor(
8797
+ this.$store.dispatch("/getHueColor")
8798
+ );
8799
+ },
8800
+ },
8801
+ {
8802
+ key: "setMainColor",
8803
+ value: function (t) {
8804
+ var e = this.$el.offset(),
8805
+ n = this.state.get("$el.contentWidth"),
8806
+ i = this.state.get("$el.contentHeight"),
8807
+ r = cn.pos(t).pageX - e.left,
8808
+ o = cn.pos(t).pageY - e.top;
8809
+ r < 0 ? (r = 0) : r > n && (r = n),
8810
+ o < 0 ? (o = 0) : o > i && (o = i),
8811
+ this.refs.$drag_pointer.css({
8812
+ left: r + "px",
8813
+ top: o + "px",
8814
+ }),
8815
+ (this.drag_pointer_pos = { x: r, y: o }),
8816
+ this.caculateSV();
8817
+ },
8818
+ },
8819
+ {
8820
+ key: "@changeColor",
8821
+ value: function (t) {
8822
+ Mn != t && this.refresh();
8823
+ },
8824
+ },
8825
+ {
8826
+ key: "@initColor",
8827
+ value: function () {
8828
+ this.refresh();
8829
+ },
8830
+ },
8831
+ {
8832
+ key: "mouseup document",
8833
+ value: function (t) {
8834
+ this.isDown &&
8835
+ ((this.isDown = !1),
8836
+ this.$store.emit("lastUpdateColor"));
8837
+ },
8838
+ },
8839
+ {
8840
+ key: "mousemove document",
8841
+ value: function (t) {
8842
+ this.isDown && this.setMainColor(t);
8843
+ },
8844
+ },
8845
+ {
8846
+ key: "mousedown",
8847
+ value: function (t) {
8848
+ (this.isDown = !0), this.setMainColor(t);
8849
+ },
8850
+ },
8851
+ {
8852
+ key: "touchend document",
8853
+ value: function (t) {
8854
+ this.isDown &&
8855
+ ((this.isDown = !1),
8856
+ this.$store.emit("lastUpdateColor"));
8857
+ },
8858
+ },
8859
+ {
8860
+ key: "touchmove document",
8861
+ value: function (t) {
8862
+ this.isDown && this.setMainColor(t);
8863
+ },
8864
+ },
8865
+ {
8866
+ key: "touchstart",
8867
+ value: function (t) {
8868
+ t.preventDefault(),
8869
+ (this.isDown = !0),
8870
+ this.setMainColor(t);
8871
+ },
8872
+ },
8873
+ ]),
8874
+ e
8875
+ );
8876
+ })(mn),
8877
+ Rn = (function (t) {
8878
+ function e() {
8879
+ return (
8880
+ _(this, e),
8881
+ C(
8882
+ this,
8883
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8884
+ this,
8885
+ arguments
8886
+ )
8887
+ )
8888
+ );
8889
+ }
8890
+ return (
8891
+ T(e, t),
8892
+ y(e, [
8893
+ {
8894
+ key: "template",
8895
+ value: function () {
8896
+ return '\n <div class=\'colorpicker-body\'>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n ';
8897
+ },
8898
+ },
8899
+ {
8900
+ key: "components",
8901
+ value: function () {
8902
+ return {
8903
+ palette: $n,
8904
+ control: In,
8905
+ information: En,
8906
+ currentColorSets: An,
8907
+ colorSetsChooser: Sn,
8908
+ contextMenu: Ln,
8909
+ };
8910
+ },
8911
+ },
8912
+ ]),
8913
+ e
8914
+ );
8915
+ })(yn),
8916
+ Dn = (function (t) {
8917
+ function e() {
8918
+ return (
8919
+ _(this, e),
8920
+ C(
8921
+ this,
8922
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8923
+ this,
8924
+ arguments
8925
+ )
8926
+ )
8927
+ );
8928
+ }
8929
+ return (
8930
+ T(e, t),
8931
+ y(e, [
8932
+ {
8933
+ key: "components",
8934
+ value: function () {
8935
+ return { Hue: Nn, Opacity: bn };
8936
+ },
8937
+ },
8938
+ {
8939
+ key: "template",
8940
+ value: function () {
8941
+ return '\n <div class="control">\n <div target="Hue" ></div>\n <div target="Opacity" ></div>\n </div>\n ';
8942
+ },
8943
+ },
8944
+ {
8945
+ key: "refresh",
8946
+ value: function () {
8947
+ this.setColorUI();
8948
+ },
8949
+ },
8950
+ {
8951
+ key: "setColorUI",
8952
+ value: function () {
8953
+ this.Hue.setColorUI(), this.Opacity.setColorUI();
8954
+ },
8955
+ },
8956
+ {
8957
+ key: "@changeColor",
8958
+ value: function (t) {
8959
+ "mini-control" != t && this.refresh();
8960
+ },
8961
+ },
8962
+ {
8963
+ key: "@initColor",
8964
+ value: function () {
8965
+ this.refresh();
8966
+ },
8967
+ },
8968
+ ]),
8969
+ e
8970
+ );
8971
+ })(mn),
8972
+ Pn = (function (t) {
8973
+ function e() {
8974
+ return (
8975
+ _(this, e),
8976
+ C(
8977
+ this,
8978
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
8979
+ this,
8980
+ arguments
8981
+ )
8982
+ )
8983
+ );
8984
+ }
8985
+ return (
8986
+ T(e, t),
8987
+ y(e, [
8988
+ {
8989
+ key: "template",
8990
+ value: function () {
8991
+ return '\n <div class=\'colorpicker-body\'>\n <div target="palette"></div>\n <div target="control"></div>\n </div>\n ';
8992
+ },
8993
+ },
8994
+ {
8995
+ key: "components",
8996
+ value: function () {
8997
+ return { palette: $n, control: Dn };
8998
+ },
8999
+ },
9000
+ ]),
9001
+ e
9002
+ );
9003
+ })(yn),
9004
+ Fn = (function (t) {
9005
+ function e(t) {
9006
+ _(this, e);
9007
+ var n = C(
9008
+ this,
9009
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
9010
+ );
9011
+ return (n.source = "vertical-slider"), n;
9012
+ }
9013
+ return (
9014
+ T(e, t),
9015
+ y(e, [
9016
+ {
9017
+ key: "getMaxDist",
9018
+ value: function () {
9019
+ return this.state.get("$container.height");
9020
+ },
9021
+ },
9022
+ {
9023
+ key: "setMousePosition",
9024
+ value: function (t) {
9025
+ this.refs.$bar.css({ top: t + "px" });
9026
+ },
9027
+ },
9028
+ {
9029
+ key: "getMousePosition",
9030
+ value: function (t) {
9031
+ return cn.pos(t).pageY;
9032
+ },
9033
+ },
9034
+ {
9035
+ key: "getMinPosition",
9036
+ value: function () {
9037
+ return this.refs.$container.offset().top;
9038
+ },
9039
+ },
9040
+ {
9041
+ key: "getCaculatedDist",
9042
+ value: function (t) {
9043
+ var e = t
9044
+ ? this.getMousePosition(t)
9045
+ : this.getCurrent(
9046
+ this.getDefaultValue() / this.maxValue
9047
+ );
9048
+ return 100 - this.getDist(e);
9049
+ },
9050
+ },
9051
+ {
9052
+ key: "setColorUI",
9053
+ value: function (t) {
9054
+ (t = t || this.getDefaultValue()) <= this.minValue
9055
+ ? this.refs.$bar.addClass("first").removeClass("last")
9056
+ : t >= this.maxValue
9057
+ ? this.refs.$bar.addClass("last").removeClass("first")
9058
+ : this.refs.$bar
9059
+ .removeClass("last")
9060
+ .removeClass("first");
9061
+ var e = 1 - (t || 0) / this.maxValue;
9062
+ this.setMousePosition(this.getMaxDist() * e);
9063
+ },
9064
+ },
9065
+ ]),
9066
+ e
9067
+ );
9068
+ })(xn),
9069
+ Bn = (function (t) {
9070
+ function e(t) {
9071
+ _(this, e);
9072
+ var n = C(
9073
+ this,
9074
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
9075
+ );
9076
+ return (
9077
+ (n.minValue = 0),
9078
+ (n.maxValue = 360),
9079
+ (n.source = "vertical-hue-control"),
9080
+ n
9081
+ );
9082
+ }
9083
+ return (
9084
+ T(e, t),
9085
+ y(e, [
9086
+ {
9087
+ key: "template",
9088
+ value: function () {
9089
+ return '\n <div class="hue">\n <div ref="$container" class="hue-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n ';
9090
+ },
9091
+ },
9092
+ {
9093
+ key: "getDefaultValue",
9094
+ value: function () {
9095
+ return this.$store.hsv.h;
9096
+ },
9097
+ },
9098
+ {
9099
+ key: "refreshColorUI",
9100
+ value: function (t) {
9101
+ var e = this.getCaculatedDist(t);
9102
+ this.setColorUI((e / 100) * this.maxValue),
9103
+ this.changeColor({
9104
+ h: (e / 100) * this.maxValue,
9105
+ type: "hsv",
9106
+ });
9107
+ },
9108
+ },
9109
+ ]),
9110
+ e
9111
+ );
9112
+ })(Fn),
9113
+ Un = (function (t) {
9114
+ function e(t) {
9115
+ _(this, e);
9116
+ var n = C(
9117
+ this,
9118
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
9119
+ );
9120
+ return (n.source = "vertical-opacity-control"), n;
9121
+ }
9122
+ return (
9123
+ T(e, t),
9124
+ y(e, [
9125
+ {
9126
+ key: "template",
9127
+ value: function () {
9128
+ return '\n <div class="opacity">\n <div ref="$container" class="opacity-container">\n <div ref="$colorbar" class="color-bar"></div>\n <div ref="$bar" class="drag-bar2"></div>\n </div>\n </div>\n ';
9129
+ },
9130
+ },
9131
+ {
9132
+ key: "refresh",
9133
+ value: function () {
9134
+ b(
9135
+ e.prototype.__proto__ ||
9136
+ Object.getPrototypeOf(e.prototype),
9137
+ "refresh",
9138
+ this
9139
+ ).call(this),
9140
+ this.setOpacityColorBar();
9141
+ },
9142
+ },
9143
+ {
9144
+ key: "setOpacityColorBar",
9145
+ value: function () {
9146
+ var t = Object.assign({}, this.$store.rgb);
9147
+ t.a = 0;
9148
+ var e = Ze.format(t, "rgb");
9149
+ t.a = 1;
9150
+ var n = Ze.format(t, "rgb");
9151
+ this.refs.$colorbar.css(
9152
+ "background",
9153
+ "linear-gradient(to top, " + e + ", " + n + ")"
9154
+ );
9155
+ },
9156
+ },
9157
+ {
9158
+ key: "getDefaultValue",
9159
+ value: function () {
9160
+ return this.$store.alpha;
9161
+ },
9162
+ },
9163
+ {
9164
+ key: "refreshColorUI",
9165
+ value: function (t) {
9166
+ var e = this.getCaculatedDist(t);
9167
+ this.setColorUI((e / 100) * this.maxValue),
9168
+ this.changeColor({
9169
+ a: (Math.floor(e) / 100) * this.maxValue,
9170
+ });
9171
+ },
9172
+ },
9173
+ ]),
9174
+ e
9175
+ );
9176
+ })(Fn),
9177
+ Hn = (function (t) {
9178
+ function e() {
9179
+ return (
9180
+ _(this, e),
9181
+ C(
9182
+ this,
9183
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9184
+ this,
9185
+ arguments
9186
+ )
9187
+ )
9188
+ );
9189
+ }
9190
+ return (
9191
+ T(e, t),
9192
+ y(e, [
9193
+ {
9194
+ key: "components",
9195
+ value: function () {
9196
+ return { Hue: Bn, Opacity: Un };
9197
+ },
9198
+ },
9199
+ {
9200
+ key: "template",
9201
+ value: function () {
9202
+ return '<div class="control"><div target="Hue" ></div><div target="Opacity" ></div></div>';
9203
+ },
9204
+ },
9205
+ {
9206
+ key: "refresh",
9207
+ value: function () {
9208
+ this.setColorUI();
9209
+ },
9210
+ },
9211
+ {
9212
+ key: "setColorUI",
9213
+ value: function () {
9214
+ this.Hue.setColorUI(), this.Opacity.setColorUI();
9215
+ },
9216
+ },
9217
+ {
9218
+ key: "@changeColor",
9219
+ value: function (t) {
9220
+ "mini-control" != t && this.refresh();
9221
+ },
9222
+ },
9223
+ {
9224
+ key: "@initColor",
9225
+ value: function () {
9226
+ this.refresh();
9227
+ },
9228
+ },
9229
+ ]),
9230
+ e
9231
+ );
9232
+ })(mn),
9233
+ zn = (function (t) {
9234
+ function e() {
9235
+ return (
9236
+ _(this, e),
9237
+ C(
9238
+ this,
9239
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9240
+ this,
9241
+ arguments
9242
+ )
9243
+ )
9244
+ );
9245
+ }
9246
+ return (
9247
+ T(e, t),
9248
+ y(e, [
9249
+ {
9250
+ key: "template",
9251
+ value: function () {
9252
+ return '\n <div class=\'colorpicker-body\'>\n <div target="palette"></div><div target="control"></div>\n </div>\n ';
9253
+ },
9254
+ },
9255
+ {
9256
+ key: "components",
9257
+ value: function () {
9258
+ return { palette: $n, control: Hn };
9259
+ },
9260
+ },
9261
+ ]),
9262
+ e
9263
+ );
9264
+ })(yn),
9265
+ Wn = (function (t) {
9266
+ function e() {
9267
+ return (
9268
+ _(this, e),
9269
+ C(
9270
+ this,
9271
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9272
+ this,
9273
+ arguments
9274
+ )
9275
+ )
9276
+ );
9277
+ }
9278
+ return (
9279
+ T(e, t),
9280
+ y(e, [
9281
+ {
9282
+ key: "components",
9283
+ value: function () {
9284
+ return { Value: kn, Opacity: bn };
9285
+ },
9286
+ },
9287
+ {
9288
+ key: "template",
9289
+ value: function () {
9290
+ return '\n <div class="control">\n <div target="Value" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n </div>\n ';
9291
+ },
9292
+ },
9293
+ {
9294
+ key: "setBackgroundColor",
9295
+ value: function () {
9296
+ this.refs.$controlColor.css(
9297
+ "background-color",
9298
+ this.$store.dispatch("/toRGB")
9299
+ );
9300
+ },
9301
+ },
9302
+ {
9303
+ key: "refresh",
9304
+ value: function () {
9305
+ this.setColorUI(), this.setBackgroundColor();
9306
+ },
9307
+ },
9308
+ {
9309
+ key: "setColorUI",
9310
+ value: function () {
9311
+ this.Value.setColorUI(), this.Opacity.setColorUI();
9312
+ },
9313
+ },
9314
+ {
9315
+ key: "@changeColor",
9316
+ value: function (t) {
9317
+ "macos-control" != t && this.refresh();
9318
+ },
9319
+ },
9320
+ {
9321
+ key: "@initColor",
9322
+ value: function () {
9323
+ this.refresh();
9324
+ },
9325
+ },
9326
+ ]),
9327
+ e
9328
+ );
9329
+ })(mn),
9330
+ jn = (function (t) {
9331
+ function e(t) {
9332
+ _(this, e);
9333
+ var n = C(
9334
+ this,
9335
+ (e.__proto__ || Object.getPrototypeOf(e)).call(this, t)
9336
+ );
9337
+ return (
9338
+ (n.width = 214),
9339
+ (n.height = 214),
9340
+ (n.thinkness = 16),
9341
+ (n.half_thinkness = n.thinkness / 2),
9342
+ (n.source = "colorring"),
9343
+ n
9344
+ );
9345
+ }
9346
+ return (
9347
+ T(e, t),
9348
+ y(e, [
9349
+ {
9350
+ key: "template",
9351
+ value: function () {
9352
+ return '\n <div class="wheel" data-type="ring">\n <canvas class="wheel-canvas" ref="$colorwheel" ></canvas>\n <div class="drag-pointer" ref="$drag_pointer"></div>\n </div>\n ';
9353
+ },
9354
+ },
9355
+ {
9356
+ key: "setColorUI",
9357
+ value: function (t) {
9358
+ this.renderCanvas(), this.setHueColor(null, t);
9359
+ },
9360
+ },
9361
+ {
9362
+ key: "getDefaultValue",
9363
+ value: function () {
9364
+ return this.$store.hsv.h;
9365
+ },
9366
+ },
9367
+ {
9368
+ key: "setHueColor",
9369
+ value: function (t, e) {
9370
+ if (this.state.get("$el.width")) {
9371
+ var n = this.getRectangle(),
9372
+ i = n.minX,
9373
+ r = n.minY,
9374
+ o = n.radius,
9375
+ s = n.centerX,
9376
+ a = n.centerY,
9377
+ l = this.getCurrentXY(
9378
+ t,
9379
+ this.getDefaultValue(),
9380
+ o,
9381
+ s,
9382
+ a
9383
+ ),
9384
+ c = u((f = l.x) - s, (d = l.y) - a),
9385
+ h = this.getCurrentXY(
9386
+ null,
9387
+ c,
9388
+ o - this.half_thinkness,
9389
+ s,
9390
+ a
9391
+ ),
9392
+ f = h.x,
9393
+ d = h.y;
9394
+ this.refs.$drag_pointer.css({
9395
+ left: f - i + "px",
9396
+ top: d - r + "px",
9397
+ }),
9398
+ e || this.changeColor({ type: "hsv", h: c });
9399
+ }
9400
+ },
9401
+ },
9402
+ ]),
9403
+ e
9404
+ );
9405
+ })(Cn),
9406
+ Gn = (function (t) {
9407
+ function e() {
9408
+ return (
9409
+ _(this, e),
9410
+ C(
9411
+ this,
9412
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9413
+ this,
9414
+ arguments
9415
+ )
9416
+ )
9417
+ );
9418
+ }
9419
+ return (
9420
+ T(e, t),
9421
+ y(e, [
9422
+ {
9423
+ key: "template",
9424
+ value: function () {
9425
+ return '\n <div class=\'colorpicker-body\'>\n <div target="colorring"></div>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n ';
9426
+ },
9427
+ },
9428
+ {
9429
+ key: "components",
9430
+ value: function () {
9431
+ return {
9432
+ colorring: jn,
9433
+ palette: $n,
9434
+ control: Wn,
9435
+ information: En,
9436
+ currentColorSets: An,
9437
+ colorSetsChooser: Sn,
9438
+ contextMenu: Ln,
9439
+ };
9440
+ },
9441
+ },
9442
+ ]),
9443
+ e
9444
+ );
9445
+ })(yn),
9446
+ qn = (function (t) {
9447
+ function e() {
9448
+ return (
9449
+ _(this, e),
9450
+ C(
9451
+ this,
9452
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9453
+ this,
9454
+ arguments
9455
+ )
9456
+ )
9457
+ );
9458
+ }
9459
+ return (
9460
+ T(e, t),
9461
+ y(e, [
9462
+ {
9463
+ key: "components",
9464
+ value: function () {
9465
+ return { Hue: Bn, Opacity: Un };
9466
+ },
9467
+ },
9468
+ {
9469
+ key: "template",
9470
+ value: function () {
9471
+ return '\n <div class="control">\n <div target="Hue" ></div>\n <div target="Opacity" ></div>\n </div>\n ';
9472
+ },
9473
+ },
9474
+ {
9475
+ key: "refresh",
9476
+ value: function () {
9477
+ this.setColorUI();
9478
+ },
9479
+ },
9480
+ {
9481
+ key: "setColorUI",
9482
+ value: function () {
9483
+ this.Hue.setColorUI(), this.Opacity.setColorUI();
9484
+ },
9485
+ },
9486
+ {
9487
+ key: "@changeColor",
9488
+ value: function () {
9489
+ this.refresh();
9490
+ },
9491
+ },
9492
+ {
9493
+ key: "@initColor",
9494
+ value: function () {
9495
+ this.refresh();
9496
+ },
9497
+ },
9498
+ ]),
9499
+ e
9500
+ );
9501
+ })(mn),
9502
+ Vn = (function (t) {
9503
+ function e() {
9504
+ return (
9505
+ _(this, e),
9506
+ C(
9507
+ this,
9508
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9509
+ this,
9510
+ arguments
9511
+ )
9512
+ )
9513
+ );
9514
+ }
9515
+ return (
9516
+ T(e, t),
9517
+ y(e, [
9518
+ {
9519
+ key: "template",
9520
+ value: function () {
9521
+ return '\n <div class=\'colorpicker-body\'>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n ';
9522
+ },
9523
+ },
9524
+ {
9525
+ key: "components",
9526
+ value: function () {
9527
+ return {
9528
+ palette: $n,
9529
+ control: qn,
9530
+ information: En,
9531
+ currentColorSets: An,
9532
+ colorSetsChooser: Sn,
9533
+ contextMenu: Ln,
9534
+ };
9535
+ },
9536
+ },
9537
+ ]),
9538
+ e
9539
+ );
9540
+ })(yn),
9541
+ Yn = (function (t) {
9542
+ function e() {
9543
+ return (
9544
+ _(this, e),
9545
+ C(
9546
+ this,
9547
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9548
+ this,
9549
+ arguments
9550
+ )
9551
+ )
9552
+ );
9553
+ }
9554
+ return (
9555
+ T(e, t),
9556
+ y(e, [
9557
+ {
9558
+ key: "components",
9559
+ value: function () {
9560
+ return { Hue: Bn, Opacity: Un };
9561
+ },
9562
+ },
9563
+ {
9564
+ key: "template",
9565
+ value: function () {
9566
+ return '\n <div class="control">\n <div target="Opacity" ></div> \n <div target="Hue" ></div>\n </div>\n ';
9567
+ },
9568
+ },
9569
+ {
9570
+ key: "refresh",
9571
+ value: function () {
9572
+ this.setColorUI();
9573
+ },
9574
+ },
9575
+ {
9576
+ key: "setColorUI",
9577
+ value: function () {
9578
+ this.Hue.setColorUI(), this.Opacity.setColorUI();
9579
+ },
9580
+ },
9581
+ {
9582
+ key: "@changeColor",
9583
+ value: function (t) {
9584
+ "mini-control" != t && this.refresh();
9585
+ },
9586
+ },
9587
+ {
9588
+ key: "@initColor",
9589
+ value: function () {
9590
+ this.refresh();
9591
+ },
9592
+ },
9593
+ ]),
9594
+ e
9595
+ );
9596
+ })(mn),
9597
+ Kn = (function (t) {
9598
+ function e() {
9599
+ return (
9600
+ _(this, e),
9601
+ C(
9602
+ this,
9603
+ (e.__proto__ || Object.getPrototypeOf(e)).apply(
9604
+ this,
9605
+ arguments
9606
+ )
9607
+ )
9608
+ );
9609
+ }
9610
+ return (
9611
+ T(e, t),
9612
+ y(e, [
9613
+ {
9614
+ key: "template",
9615
+ value: function () {
9616
+ return "\n <div class='colorpicker-body'>\n <div class='color-view'>\n <div class='color-view-container' ref=\"$colorview\"></div>\n </div>\n <div class='color-tool'>\n <div target=\"palette\"></div>\n <div target=\"control\"></div>\n </div>\n </div>\n ";
9617
+ },
9618
+ },
9619
+ {
9620
+ key: "components",
9621
+ value: function () {
9622
+ return { palette: $n, control: Yn };
9623
+ },
9624
+ },
9625
+ {
9626
+ key: "initColorWithoutChangeEvent",
9627
+ value: function (t) {
9628
+ this.$store.dispatch("/initColor", t), this.refresh();
9629
+ },
9630
+ },
9631
+ {
9632
+ key: "setBackgroundColor",
9633
+ value: function () {
9634
+ var t = this.$store.dispatch("/toColor"),
9635
+ e = this.$store.rgb,
9636
+ n = Ze.brightness(e.r, e.g, e.b);
9637
+ this.refs.$colorview.css({
9638
+ "background-color": t,
9639
+ color: n > 127 ? "black" : "white",
9640
+ }),
9641
+ this.refs.$colorview.html(t);
9642
+ },
9643
+ },
9644
+ {
9645
+ key: "click $colorview",
9646
+ value: function (t) {
9647
+ this.nextFormat();
9648
+ },
9649
+ },
9650
+ {
9651
+ key: "nextFormat",
9652
+ value: function () {
9653
+ var t = this.$store.format || "hex",
9654
+ e = "hex";
9655
+ "hex" == t
9656
+ ? (e = "rgb")
9657
+ : "rgb" == t
9658
+ ? (e = "hsl")
9659
+ : "hsl" == t && (e = "hex"),
9660
+ this.$store.dispatch("/changeFormat", e),
9661
+ this.$store.emit("lastUpdateColor"),
9662
+ this.refresh();
9663
+ },
9664
+ },
9665
+ {
9666
+ key: "refresh",
9667
+ value: function () {
9668
+ this.setBackgroundColor();
9669
+ },
9670
+ },
9671
+ {
9672
+ key: "@changeColor",
9673
+ value: function () {
9674
+ this.refresh();
9675
+ },
9676
+ },
9677
+ {
9678
+ key: "@initColor",
9679
+ value: function () {
9680
+ this.refresh();
9681
+ },
9682
+ },
9683
+ ]),
9684
+ e
9685
+ );
9686
+ })(yn),
9687
+ Xn = {
9688
+ create: function (t) {
9689
+ switch (t.type) {
9690
+ case "macos":
9691
+ return new On(t);
9692
+ case "xd":
9693
+ return new Vn(t);
9694
+ case "ring":
9695
+ return new Gn(t);
9696
+ case "mini":
9697
+ return new Pn(t);
9698
+ case "vscode":
9699
+ return new Kn(t);
9700
+ case "mini-vertical":
9701
+ return new zn(t);
9702
+ case "sketch":
9703
+ case "palette":
9704
+ default:
9705
+ return new Rn(t);
9706
+ }
9707
+ },
9708
+ ColorPicker: Rn,
9709
+ ChromeDevToolColorPicker: Rn,
9710
+ MacOSColorPicker: On,
9711
+ RingColorPicker: Gn,
9712
+ MiniColorPicker: Pn,
9713
+ VSCodePicker: Kn,
9714
+ MiniVerticalColorPicker: zn,
9715
+ },
9716
+ Qn = "codemirror-colorview",
9717
+ Zn = "codemirror-colorview-background",
9718
+ Jn = ["comment", "builtin", "qualifier"];
9719
+ function ti(t, e) {
9720
+ "setValue" == e.origin
9721
+ ? (t.state.colorpicker.init_color_update(),
9722
+ t.state.colorpicker.style_color_update())
9723
+ : t.state.colorpicker.style_color_update(t.getCursor().line);
9724
+ }
9725
+ function ei(t, e) {
9726
+ t.state.colorpicker.isUpdate ||
9727
+ ((t.state.colorpicker.isUpdate = !0),
9728
+ t.state.colorpicker.close_color_picker(),
9729
+ t.state.colorpicker.init_color_update(),
9730
+ t.state.colorpicker.style_color_update());
9731
+ }
9732
+ function ni(t, e) {
9733
+ ti(t, { origin: "setValue" });
9734
+ }
9735
+ function ii(t, e) {
9736
+ t.state.colorpicker.keyup(e);
9737
+ }
9738
+ function ri(t, e) {
9739
+ t.state.colorpicker.is_edit_mode() &&
9740
+ t.state.colorpicker.check_mousedown(e);
9741
+ }
9742
+ function oi(t, e) {
9743
+ ti(t, { origin: "setValue" });
9744
+ }
9745
+ function si(t) {
9746
+ t.state.colorpicker.close_color_picker();
9747
+ }
9748
+ function ai(t) {
9749
+ t.state.colorpicker.hide_delay_color_picker(
9750
+ t.state.colorpicker.opt.hideDelay || 1e3
9751
+ );
9752
+ }
9753
+ var li = (function () {
9754
+ function t(e, n) {
9755
+ _(this, t),
9756
+ (n =
9757
+ "boolean" == typeof n
9758
+ ? { mode: "edit" }
9759
+ : Object.assign({ mode: "edit" }, n || {})),
9760
+ (this.opt = n),
9761
+ (this.cm = e),
9762
+ (this.markers = {}),
9763
+ (this.excluded_token = this.opt.excluded_token || Jn),
9764
+ this.opt.colorpicker
9765
+ ? (this.colorpicker = this.opt.colorpicker(this.opt))
9766
+ : (this.colorpicker = Xn.create(this.opt)),
9767
+ this.init_event();
9768
+ }
9769
+ return (
9770
+ y(t, [
9771
+ {
9772
+ key: "init_event",
9773
+ value: function () {
9774
+ var t, e;
9775
+ this.cm.on("mousedown", ri),
9776
+ this.cm.on("keyup", ii),
9777
+ this.cm.on("change", ti),
9778
+ this.cm.on("update", ei),
9779
+ this.cm.on("refresh", ni),
9780
+ this.cm.on("blur", ai),
9781
+ (this.onPasteCallback =
9782
+ ((t = this.cm),
9783
+ (e = oi),
9784
+ function (n) {
9785
+ e.call(this, t, n);
9786
+ })),
9787
+ (this.onScrollEvent = (function (t, e) {
9788
+ var n = void 0;
9789
+ return function (i, r) {
9790
+ n && clearTimeout(n),
9791
+ (n = setTimeout(function () {
9792
+ t(i, r);
9793
+ }, e || 300));
9794
+ };
9795
+ })(si, 50)),
9796
+ this.cm
9797
+ .getWrapperElement()
9798
+ .addEventListener("paste", this.onPasteCallback),
9799
+ this.is_edit_mode() &&
9800
+ this.cm.on("scroll", this.onScrollEvent);
9801
+ },
9802
+ },
9803
+ {
9804
+ key: "is_edit_mode",
9805
+ value: function () {
9806
+ return "edit" == this.opt.mode;
9807
+ },
9808
+ },
9809
+ {
9810
+ key: "is_view_mode",
9811
+ value: function () {
9812
+ return "view" == this.opt.mode;
9813
+ },
9814
+ },
9815
+ {
9816
+ key: "destroy",
9817
+ value: function () {
9818
+ this.cm.off("mousedown", ri),
9819
+ this.cm.off("keyup", ii),
9820
+ this.cm.off("change", ti),
9821
+ this.cm.off("blur", ai),
9822
+ this.cm
9823
+ .getWrapperElement()
9824
+ .removeEventListener("paste", this.onPasteCallback),
9825
+ this.is_edit_mode() &&
9826
+ this.cm.off("scroll", this.onScrollEvent);
9827
+ },
9828
+ },
9829
+ {
9830
+ key: "hasClass",
9831
+ value: function (t, e) {
9832
+ return (
9833
+ !!t.className &&
9834
+ (" " + t.className + " ").indexOf(" " + e + " ") > -1
9835
+ );
9836
+ },
9837
+ },
9838
+ {
9839
+ key: "check_mousedown",
9840
+ value: function (t) {
9841
+ this.hasClass(t.target, Zn)
9842
+ ? this.open_color_picker(t.target.parentNode)
9843
+ : this.close_color_picker();
9844
+ },
9845
+ },
9846
+ {
9847
+ key: "popup_color_picker",
9848
+ value: function (t) {
9849
+ var e = this.cm.getCursor(),
9850
+ n = this,
9851
+ i = {
9852
+ lineNo: e.line,
9853
+ ch: e.ch,
9854
+ color: t || "#FFFFFF",
9855
+ isShortCut: !0,
9856
+ };
9857
+ Object.keys(this.markers).forEach(function (t) {
9858
+ if (("#" + t).indexOf("#" + i.lineNo + ":") > -1) {
9859
+ var e = n.markers[t];
9860
+ e.ch <= i.ch &&
9861
+ i.ch <= e.ch + e.color.length &&
9862
+ ((i.ch = e.ch),
9863
+ (i.color = e.color),
9864
+ (i.nameColor = e.nameColor));
9865
+ }
9866
+ }),
9867
+ this.open_color_picker(i);
9868
+ },
9869
+ },
9870
+ {
9871
+ key: "open_color_picker",
9872
+ value: function (t) {
9873
+ var e = this,
9874
+ n = t.lineNo,
9875
+ i = t.ch,
9876
+ r = t.nameColor,
9877
+ o = t.color;
9878
+ if (this.colorpicker) {
9879
+ var s = o,
9880
+ a = this.cm.charCoords({ line: n, ch: i });
9881
+ this.colorpicker.show(
9882
+ {
9883
+ left: a.left,
9884
+ top: a.bottom,
9885
+ isShortCut: t.isShortCut || !1,
9886
+ hideDelay: this.opt.hideDelay || 2e3,
9887
+ },
9888
+ r || o,
9889
+ function (t) {
9890
+ e.cm.replaceRange(
9891
+ t,
9892
+ { line: n, ch: i },
9893
+ { line: n, ch: i + s.length },
9894
+ "*colorpicker"
9895
+ ),
9896
+ e.cm.focus(),
9897
+ (s = t);
9898
+ }
9899
+ );
9900
+ }
9901
+ },
9902
+ },
9903
+ {
9904
+ key: "close_color_picker",
9905
+ value: function () {
9906
+ this.colorpicker && this.colorpicker.hide();
9907
+ },
9908
+ },
9909
+ {
9910
+ key: "hide_delay_color_picker",
9911
+ value: function () {
9912
+ this.colorpicker && this.colorpicker.runHideDelay();
9913
+ },
9914
+ },
9915
+ {
9916
+ key: "key",
9917
+ value: function (t, e) {
9918
+ return [t, e].join(":");
9919
+ },
9920
+ },
9921
+ {
9922
+ key: "keyup",
9923
+ value: function (t) {
9924
+ this.colorpicker &&
9925
+ ("Escape" == t.key ||
9926
+ 0 == this.colorpicker.isShortCut) &&
9927
+ this.colorpicker.hide();
9928
+ },
9929
+ },
9930
+ {
9931
+ key: "init_color_update",
9932
+ value: function () {
9933
+ this.markers = {};
9934
+ },
9935
+ },
9936
+ {
9937
+ key: "style_color_update",
9938
+ value: function (t) {
9939
+ if (t) this.match(t);
9940
+ else
9941
+ for (var e = this.cm.lineCount(), n = 0; n < e; n++)
9942
+ this.match(n);
9943
+ },
9944
+ },
9945
+ {
9946
+ key: "empty_marker",
9947
+ value: function (t, e) {
9948
+ for (
9949
+ var n, i, r = e.markedSpans || [], o = 0, s = r.length;
9950
+ o < s;
9951
+ o++
9952
+ ) {
9953
+ var a = this.key(t, r[o].from);
9954
+ a &&
9955
+ ((n = r[o].marker.replacedWith),
9956
+ (i = Qn),
9957
+ n &&
9958
+ n.className &&
9959
+ (" " + n.className + " ").indexOf(" " + i + " ") >
9960
+ -1) &&
9961
+ (delete this.markers[a], r[o].marker.clear());
9962
+ }
9963
+ },
9964
+ },
9965
+ {
9966
+ key: "match_result",
9967
+ value: function (t) {
9968
+ return Ze.matches(t.text);
9969
+ },
9970
+ },
9971
+ {
9972
+ key: "submatch",
9973
+ value: function (t, e) {
9974
+ var n = this;
9975
+ this.empty_marker(t, e);
9976
+ var i = this.match_result(e),
9977
+ r = { next: 0 };
9978
+ i.forEach(function (i) {
9979
+ n.render(r, t, e, i.color, i.nameColor);
9980
+ });
9981
+ },
9982
+ },
9983
+ {
9984
+ key: "match",
9985
+ value: function (t) {
9986
+ var e = this.cm.getLineHandle(t),
9987
+ n = this;
9988
+ this.cm.operation(function () {
9989
+ n.submatch(t, e);
9990
+ });
9991
+ },
9992
+ },
9993
+ {
9994
+ key: "make_element",
9995
+ value: function () {
9996
+ var t = document.createElement("div");
9997
+ return (
9998
+ (t.className = Qn),
9999
+ this.is_edit_mode()
10000
+ ? (t.title = "open color picker")
10001
+ : (t.title = ""),
10002
+ (t.back_element = this.make_background_element()),
10003
+ t.appendChild(t.back_element),
10004
+ t
10005
+ );
10006
+ },
10007
+ },
10008
+ {
10009
+ key: "make_background_element",
10010
+ value: function () {
10011
+ var t = document.createElement("div");
10012
+ return (t.className = Zn), t;
10013
+ },
10014
+ },
10015
+ {
10016
+ key: "set_state",
10017
+ value: function (t, e, n, i) {
10018
+ var r = this.create_marker(t, e);
10019
+ return (
10020
+ (r.lineNo = t),
10021
+ (r.ch = e),
10022
+ (r.color = n),
10023
+ (r.nameColor = i),
10024
+ r
10025
+ );
10026
+ },
10027
+ },
10028
+ {
10029
+ key: "create_marker",
10030
+ value: function (t, e) {
10031
+ return (
10032
+ this.has_marker(t, e) || this.init_marker(t, e),
10033
+ this.get_marker(t, e)
10034
+ );
10035
+ },
10036
+ },
10037
+ {
10038
+ key: "init_marker",
10039
+ value: function (t, e) {
10040
+ this.markers[this.key(t, e)] = this.make_element();
10041
+ },
10042
+ },
10043
+ {
10044
+ key: "has_marker",
10045
+ value: function (t, e) {
10046
+ return !!this.get_marker(t, e);
10047
+ },
10048
+ },
10049
+ {
10050
+ key: "get_marker",
10051
+ value: function (t, e) {
10052
+ var n = this.key(t, e);
10053
+ return this.markers[n];
10054
+ },
10055
+ },
10056
+ {
10057
+ key: "update_element",
10058
+ value: function (t, e) {
10059
+ t.back_element.style.backgroundColor = e;
10060
+ },
10061
+ },
10062
+ {
10063
+ key: "set_mark",
10064
+ value: function (t, e, n) {
10065
+ this.cm.setBookmark(
10066
+ { line: t, ch: e },
10067
+ { widget: n, handleMouseEvents: !0 }
10068
+ );
10069
+ },
10070
+ },
10071
+ {
10072
+ key: "is_excluded_token",
10073
+ value: function (t, e) {
10074
+ var n = this.cm.getTokenAt({ line: t, ch: e }, !0),
10075
+ i = n.type,
10076
+ r = n.state.state;
10077
+ if (null == i && "block" == r) return !0;
10078
+ if (null == i && "top" == r) return !0;
10079
+ for (
10080
+ var o = 0, s = 0, a = this.excluded_token.length;
10081
+ s < a;
10082
+ s++
10083
+ )
10084
+ if (i === this.excluded_token[s]) {
10085
+ o++;
10086
+ break;
10087
+ }
10088
+ return o > 0;
10089
+ },
10090
+ },
10091
+ {
10092
+ key: "render",
10093
+ value: function (t, e, n, i, r) {
10094
+ var o = n.text.indexOf(i, t.next);
10095
+ if (!0 !== this.is_excluded_token(e, o)) {
10096
+ if (((t.next = o + i.length), this.has_marker(e, o)))
10097
+ return (
10098
+ this.update_element(
10099
+ this.create_marker(e, o),
10100
+ r || i
10101
+ ),
10102
+ void this.set_state(e, o, i, r)
10103
+ );
10104
+ var s = this.create_marker(e, o);
10105
+ this.update_element(s, r || i),
10106
+ this.set_state(e, o, i, r || i),
10107
+ this.set_mark(e, o, s);
10108
+ }
10109
+ },
10110
+ },
10111
+ ]),
10112
+ t
10113
+ );
10114
+ })();
10115
+ try {
10116
+ var ci = t("codemirror");
10117
+ } catch (t) {}
10118
+ function hi() {
10119
+ var t = ci || window.CodeMirror;
10120
+ t &&
10121
+ t.defineOption("colorpicker", !1, function (e, n, i) {
10122
+ i &&
10123
+ i != t.Init &&
10124
+ e.state.colorpicker &&
10125
+ (e.state.colorpicker.destroy(),
10126
+ (e.state.colorpicker = null)),
10127
+ n && (e.state.colorpicker = new li(e, n));
10128
+ });
10129
+ }
10130
+ return hi(), k({}, nn, Xn, { load: hi });
10131
+ }),
10132
+ "object" == typeof n && void 0 !== e
10133
+ ? (e.exports = r())
10134
+ : "function" == typeof define && define.amd
10135
+ ? define(r)
10136
+ : (i["codemirror-colorpicker"] = r());
10137
+ },
10138
+ { codemirror: 13 },
10139
+ ],
10140
+ 4: [
10141
+ function (t, e, n) {
10142
+ var i;
10143
+ (i = function (t) {
10144
+ function e(e, n, i) {
10145
+ var r,
10146
+ o = e.getWrapperElement();
10147
+ return (
10148
+ ((r = o.appendChild(document.createElement("div"))).className = i
10149
+ ? "CodeMirror-dialog CodeMirror-dialog-bottom"
10150
+ : "CodeMirror-dialog CodeMirror-dialog-top"),
10151
+ "string" == typeof n ? (r.innerHTML = n) : r.appendChild(n),
10152
+ t.addClass(o, "dialog-opened"),
10153
+ r
10154
+ );
10155
+ }
10156
+ function n(t, e) {
10157
+ t.state.currentNotificationClose &&
10158
+ t.state.currentNotificationClose(),
10159
+ (t.state.currentNotificationClose = e);
10160
+ }
10161
+ t.defineExtension("openDialog", function (i, r, o) {
10162
+ o || (o = {}), n(this, null);
10163
+ var s = e(this, i, o.bottom),
10164
+ a = !1,
10165
+ l = this;
10166
+ function c(e) {
10167
+ if ("string" == typeof e) u.value = e;
10168
+ else {
10169
+ if (a) return;
10170
+ (a = !0),
10171
+ t.rmClass(s.parentNode, "dialog-opened"),
10172
+ s.parentNode.removeChild(s),
10173
+ l.focus(),
10174
+ o.onClose && o.onClose(s);
10175
+ }
10176
+ }
10177
+ var h,
10178
+ u = s.getElementsByTagName("input")[0];
10179
+ return (
10180
+ u
10181
+ ? (u.focus(),
10182
+ o.value &&
10183
+ ((u.value = o.value),
10184
+ !1 !== o.selectValueOnOpen && u.select()),
10185
+ o.onInput &&
10186
+ t.on(u, "input", function (t) {
10187
+ o.onInput(t, u.value, c);
10188
+ }),
10189
+ o.onKeyUp &&
10190
+ t.on(u, "keyup", function (t) {
10191
+ o.onKeyUp(t, u.value, c);
10192
+ }),
10193
+ t.on(u, "keydown", function (e) {
10194
+ (o && o.onKeyDown && o.onKeyDown(e, u.value, c)) ||
10195
+ ((27 == e.keyCode ||
10196
+ (!1 !== o.closeOnEnter && 13 == e.keyCode)) &&
10197
+ (u.blur(), t.e_stop(e), c()),
10198
+ 13 == e.keyCode && r(u.value, e));
10199
+ }),
10200
+ !1 !== o.closeOnBlur &&
10201
+ t.on(s, "focusout", function (t) {
10202
+ null !== t.relatedTarget && c();
10203
+ }))
10204
+ : (h = s.getElementsByTagName("button")[0]) &&
10205
+ (t.on(h, "click", function () {
10206
+ c(), l.focus();
10207
+ }),
10208
+ !1 !== o.closeOnBlur && t.on(h, "blur", c),
10209
+ h.focus()),
10210
+ c
10211
+ );
10212
+ }),
10213
+ t.defineExtension("openConfirm", function (i, r, o) {
10214
+ n(this, null);
10215
+ var s = e(this, i, o && o.bottom),
10216
+ a = s.getElementsByTagName("button"),
10217
+ l = !1,
10218
+ c = this,
10219
+ h = 1;
10220
+ function u() {
10221
+ l ||
10222
+ ((l = !0),
10223
+ t.rmClass(s.parentNode, "dialog-opened"),
10224
+ s.parentNode.removeChild(s),
10225
+ c.focus());
10226
+ }
10227
+ a[0].focus();
10228
+ for (var f = 0; f < a.length; ++f) {
10229
+ var d = a[f];
10230
+ !(function (e) {
10231
+ t.on(d, "click", function (n) {
10232
+ t.e_preventDefault(n), u(), e && e(c);
10233
+ });
10234
+ })(r[f]),
10235
+ t.on(d, "blur", function () {
10236
+ --h,
10237
+ setTimeout(function () {
10238
+ h <= 0 && u();
10239
+ }, 200);
10240
+ }),
10241
+ t.on(d, "focus", function () {
10242
+ ++h;
10243
+ });
10244
+ }
10245
+ }),
10246
+ t.defineExtension("openNotification", function (i, r) {
10247
+ n(this, c);
10248
+ var o,
10249
+ s = e(this, i, r && r.bottom),
10250
+ a = !1,
10251
+ l = r && void 0 !== r.duration ? r.duration : 5e3;
10252
+ function c() {
10253
+ a ||
10254
+ ((a = !0),
10255
+ clearTimeout(o),
10256
+ t.rmClass(s.parentNode, "dialog-opened"),
10257
+ s.parentNode.removeChild(s));
10258
+ }
10259
+ return (
10260
+ t.on(s, "click", function (e) {
10261
+ t.e_preventDefault(e), c();
10262
+ }),
10263
+ l && (o = setTimeout(c, l)),
10264
+ c
10265
+ );
10266
+ });
10267
+ }),
10268
+ "object" == typeof n && "object" == typeof e
10269
+ ? i(t("../../lib/codemirror"))
10270
+ : "function" == typeof define && define.amd
10271
+ ? define(["../../lib/codemirror"], i)
10272
+ : i(CodeMirror);
10273
+ },
10274
+ { "../../lib/codemirror": 13 },
10275
+ ],
10276
+ 5: [
10277
+ function (t, e, n) {
10278
+ var i;
10279
+ (i = function (t) {
10280
+ var e = {
10281
+ pairs: "()[]{}''\"\"",
10282
+ closeBefore: ")]}'\":;>",
10283
+ triples: "",
10284
+ explode: "[]{}",
10285
+ },
10286
+ n = t.Pos;
10287
+ function i(t, n) {
10288
+ return "pairs" == n && "string" == typeof t
10289
+ ? t
10290
+ : "object" == typeof t && null != t[n]
10291
+ ? t[n]
10292
+ : e[n];
10293
+ }
10294
+ t.defineOption("autoCloseBrackets", !1, function (e, n, s) {
10295
+ s &&
10296
+ s != t.Init &&
10297
+ (e.removeKeyMap(r), (e.state.closeBrackets = null)),
10298
+ n &&
10299
+ (o(i(n, "pairs")), (e.state.closeBrackets = n), e.addKeyMap(r));
10300
+ });
10301
+ var r = {
10302
+ Backspace: function (e) {
10303
+ var r = a(e);
10304
+ if (!r || e.getOption("disableInput")) return t.Pass;
10305
+ for (
10306
+ var o = i(r, "pairs"), s = e.listSelections(), l = 0;
10307
+ l < s.length;
10308
+ l++
10309
+ ) {
10310
+ if (!s[l].empty()) return t.Pass;
10311
+ var c = h(e, s[l].head);
10312
+ if (!c || o.indexOf(c) % 2 != 0) return t.Pass;
10313
+ }
10314
+ for (l = s.length - 1; l >= 0; l--) {
10315
+ var u = s[l].head;
10316
+ e.replaceRange(
10317
+ "",
10318
+ n(u.line, u.ch - 1),
10319
+ n(u.line, u.ch + 1),
10320
+ "+delete"
10321
+ );
10322
+ }
10323
+ },
10324
+ Enter: function (e) {
10325
+ var n = a(e),
10326
+ r = n && i(n, "explode");
10327
+ if (!r || e.getOption("disableInput")) return t.Pass;
10328
+ for (var o = e.listSelections(), s = 0; s < o.length; s++) {
10329
+ if (!o[s].empty()) return t.Pass;
10330
+ var c = h(e, o[s].head);
10331
+ if (!c || r.indexOf(c) % 2 != 0) return t.Pass;
10332
+ }
10333
+ e.operation(function () {
10334
+ var t = e.lineSeparator() || "\n";
10335
+ e.replaceSelection(t + t, null),
10336
+ l(e, -1),
10337
+ (o = e.listSelections());
10338
+ for (var n = 0; n < o.length; n++) {
10339
+ var i = o[n].head.line;
10340
+ e.indentLine(i, null, !0), e.indentLine(i + 1, null, !0);
10341
+ }
10342
+ });
10343
+ },
10344
+ };
10345
+ function o(t) {
10346
+ for (var e = 0; e < t.length; e++) {
10347
+ var n = t.charAt(e),
10348
+ i = "'" + n + "'";
10349
+ r[i] || (r[i] = s(n));
10350
+ }
10351
+ }
10352
+ function s(e) {
10353
+ return function (r) {
10354
+ return (function (e, r) {
10355
+ var o = a(e);
10356
+ if (!o || e.getOption("disableInput")) return t.Pass;
10357
+ var s = i(o, "pairs"),
10358
+ h = s.indexOf(r);
10359
+ if (-1 == h) return t.Pass;
10360
+ for (
10361
+ var f,
10362
+ d = i(o, "closeBefore"),
10363
+ p = i(o, "triples"),
10364
+ g = s.charAt(h + 1) == r,
10365
+ m = e.listSelections(),
10366
+ v = h % 2 == 0,
10367
+ _ = 0;
10368
+ _ < m.length;
10369
+ _++
10370
+ ) {
10371
+ var y,
10372
+ x = m[_],
10373
+ k = x.head,
10374
+ b = e.getRange(k, n(k.line, k.ch + 1));
10375
+ if (v && !x.empty()) y = "surround";
10376
+ else if ((!g && v) || b != r)
10377
+ if (
10378
+ g &&
10379
+ k.ch > 1 &&
10380
+ p.indexOf(r) >= 0 &&
10381
+ e.getRange(n(k.line, k.ch - 2), k) == r + r
10382
+ ) {
10383
+ if (
10384
+ k.ch > 2 &&
10385
+ /\bstring/.test(e.getTokenTypeAt(n(k.line, k.ch - 2)))
10386
+ )
10387
+ return t.Pass;
10388
+ y = "addFour";
10389
+ } else if (g) {
10390
+ var T =
10391
+ 0 == k.ch ? " " : e.getRange(n(k.line, k.ch - 1), k);
10392
+ if (t.isWordChar(b) || T == r || t.isWordChar(T))
10393
+ return t.Pass;
10394
+ y = "both";
10395
+ } else {
10396
+ if (
10397
+ !v ||
10398
+ !(0 === b.length || /\s/.test(b) || d.indexOf(b) > -1)
10399
+ )
10400
+ return t.Pass;
10401
+ y = "both";
10402
+ }
10403
+ else
10404
+ y =
10405
+ g && u(e, k)
10406
+ ? "both"
10407
+ : p.indexOf(r) >= 0 &&
10408
+ e.getRange(k, n(k.line, k.ch + 3)) == r + r + r
10409
+ ? "skipThree"
10410
+ : "skip";
10411
+ if (f) {
10412
+ if (f != y) return t.Pass;
10413
+ } else f = y;
10414
+ }
10415
+ var C = h % 2 ? s.charAt(h - 1) : r,
10416
+ w = h % 2 ? r : s.charAt(h + 1);
10417
+ e.operation(function () {
10418
+ if ("skip" == f) l(e, 1);
10419
+ else if ("skipThree" == f) l(e, 3);
10420
+ else if ("surround" == f) {
10421
+ for (var t = e.getSelections(), n = 0; n < t.length; n++)
10422
+ t[n] = C + t[n] + w;
10423
+ for (
10424
+ e.replaceSelections(t, "around"),
10425
+ t = e.listSelections().slice(),
10426
+ n = 0;
10427
+ n < t.length;
10428
+ n++
10429
+ )
10430
+ t[n] = c(t[n]);
10431
+ e.setSelections(t);
10432
+ } else
10433
+ "both" == f
10434
+ ? (e.replaceSelection(C + w, null),
10435
+ e.triggerElectric(C + w),
10436
+ l(e, -1))
10437
+ : "addFour" == f &&
10438
+ (e.replaceSelection(C + C + C + C, "before"), l(e, 1));
10439
+ });
10440
+ })(r, e);
10441
+ };
10442
+ }
10443
+ function a(t) {
10444
+ var e = t.state.closeBrackets;
10445
+ return !e || e.override
10446
+ ? e
10447
+ : t.getModeAt(t.getCursor()).closeBrackets || e;
10448
+ }
10449
+ function l(t, e) {
10450
+ for (
10451
+ var n = [], i = t.listSelections(), r = 0, o = 0;
10452
+ o < i.length;
10453
+ o++
10454
+ ) {
10455
+ var s = i[o];
10456
+ s.head == t.getCursor() && (r = o);
10457
+ var a =
10458
+ s.head.ch || e > 0
10459
+ ? { line: s.head.line, ch: s.head.ch + e }
10460
+ : { line: s.head.line - 1 };
10461
+ n.push({ anchor: a, head: a });
10462
+ }
10463
+ t.setSelections(n, r);
10464
+ }
10465
+ function c(e) {
10466
+ var i = t.cmpPos(e.anchor, e.head) > 0;
10467
+ return {
10468
+ anchor: new n(e.anchor.line, e.anchor.ch + (i ? -1 : 1)),
10469
+ head: new n(e.head.line, e.head.ch + (i ? 1 : -1)),
10470
+ };
10471
+ }
10472
+ function h(t, e) {
10473
+ var i = t.getRange(n(e.line, e.ch - 1), n(e.line, e.ch + 1));
10474
+ return 2 == i.length ? i : null;
10475
+ }
10476
+ function u(t, e) {
10477
+ var i = t.getTokenAt(n(e.line, e.ch + 1));
10478
+ return (
10479
+ /\bstring/.test(i.type) &&
10480
+ i.start == e.ch &&
10481
+ (0 == e.ch || !/\bstring/.test(t.getTokenTypeAt(e)))
10482
+ );
10483
+ }
10484
+ o(e.pairs + "`");
10485
+ }),
10486
+ "object" == typeof n && "object" == typeof e
10487
+ ? i(t("../../lib/codemirror"))
10488
+ : "function" == typeof define && define.amd
10489
+ ? define(["../../lib/codemirror"], i)
10490
+ : i(CodeMirror);
10491
+ },
10492
+ { "../../lib/codemirror": 13 },
10493
+ ],
10494
+ 6: [
10495
+ function (t, e, n) {
10496
+ var i;
10497
+ (i = function (t) {
10498
+ var e =
10499
+ /MSIE \d/.test(navigator.userAgent) &&
10500
+ (null == document.documentMode || document.documentMode < 8),
10501
+ n = t.Pos,
10502
+ i = {
10503
+ "(": ")>",
10504
+ ")": "(<",
10505
+ "[": "]>",
10506
+ "]": "[<",
10507
+ "{": "}>",
10508
+ "}": "{<",
10509
+ "<": ">>",
10510
+ ">": "<<",
10511
+ };
10512
+ function r(t) {
10513
+ return (t && t.bracketRegex) || /[(){}[\]]/;
10514
+ }
10515
+ function o(t, e, o) {
10516
+ var a = t.getLineHandle(e.line),
10517
+ l = e.ch - 1,
10518
+ c = o && o.afterCursor;
10519
+ null == c &&
10520
+ (c = /(^| )cm-fat-cursor($| )/.test(
10521
+ t.getWrapperElement().className
10522
+ ));
10523
+ var h = r(o),
10524
+ u =
10525
+ (!c &&
10526
+ l >= 0 &&
10527
+ h.test(a.text.charAt(l)) &&
10528
+ i[a.text.charAt(l)]) ||
10529
+ (h.test(a.text.charAt(l + 1)) && i[a.text.charAt(++l)]);
10530
+ if (!u) return null;
10531
+ var f = ">" == u.charAt(1) ? 1 : -1;
10532
+ if (o && o.strict && f > 0 != (l == e.ch)) return null;
10533
+ var d = t.getTokenTypeAt(n(e.line, l + 1)),
10534
+ p = s(t, n(e.line, l + (f > 0 ? 1 : 0)), f, d, o);
10535
+ return null == p
10536
+ ? null
10537
+ : {
10538
+ from: n(e.line, l),
10539
+ to: p && p.pos,
10540
+ match: p && p.ch == u.charAt(0),
10541
+ forward: f > 0,
10542
+ };
10543
+ }
10544
+ function s(t, e, o, s, a) {
10545
+ for (
10546
+ var l = (a && a.maxScanLineLength) || 1e4,
10547
+ c = (a && a.maxScanLines) || 1e3,
10548
+ h = [],
10549
+ u = r(a),
10550
+ f =
10551
+ o > 0
10552
+ ? Math.min(e.line + c, t.lastLine() + 1)
10553
+ : Math.max(t.firstLine() - 1, e.line - c),
10554
+ d = e.line;
10555
+ d != f;
10556
+ d += o
10557
+ ) {
10558
+ var p = t.getLine(d);
10559
+ if (p) {
10560
+ var g = o > 0 ? 0 : p.length - 1,
10561
+ m = o > 0 ? p.length : -1;
10562
+ if (!(p.length > l))
10563
+ for (
10564
+ d == e.line && (g = e.ch - (o < 0 ? 1 : 0));
10565
+ g != m;
10566
+ g += o
10567
+ ) {
10568
+ var v = p.charAt(g);
10569
+ if (
10570
+ u.test(v) &&
10571
+ (void 0 === s ||
10572
+ (t.getTokenTypeAt(n(d, g + 1)) || "") == (s || ""))
10573
+ ) {
10574
+ var _ = i[v];
10575
+ if (_ && (">" == _.charAt(1)) == o > 0) h.push(v);
10576
+ else {
10577
+ if (!h.length) return { pos: n(d, g), ch: v };
10578
+ h.pop();
10579
+ }
10580
+ }
10581
+ }
10582
+ }
10583
+ }
10584
+ return d - o != (o > 0 ? t.lastLine() : t.firstLine()) && null;
10585
+ }
10586
+ function a(t, i, r) {
10587
+ for (
10588
+ var s = t.state.matchBrackets.maxHighlightLineLength || 1e3,
10589
+ a = r && r.highlightNonMatching,
10590
+ l = [],
10591
+ c = t.listSelections(),
10592
+ h = 0;
10593
+ h < c.length;
10594
+ h++
10595
+ ) {
10596
+ var u = c[h].empty() && o(t, c[h].head, r);
10597
+ if (
10598
+ u &&
10599
+ (u.match || !1 !== a) &&
10600
+ t.getLine(u.from.line).length <= s
10601
+ ) {
10602
+ var f = u.match
10603
+ ? "CodeMirror-matchingbracket"
10604
+ : "CodeMirror-nonmatchingbracket";
10605
+ l.push(
10606
+ t.markText(u.from, n(u.from.line, u.from.ch + 1), {
10607
+ className: f,
10608
+ })
10609
+ ),
10610
+ u.to &&
10611
+ t.getLine(u.to.line).length <= s &&
10612
+ l.push(
10613
+ t.markText(u.to, n(u.to.line, u.to.ch + 1), {
10614
+ className: f,
10615
+ })
10616
+ );
10617
+ }
10618
+ }
10619
+ if (l.length) {
10620
+ e && t.state.focused && t.focus();
10621
+ var d = function () {
10622
+ t.operation(function () {
10623
+ for (var t = 0; t < l.length; t++) l[t].clear();
10624
+ });
10625
+ };
10626
+ if (!i) return d;
10627
+ setTimeout(d, 800);
10628
+ }
10629
+ }
10630
+ function l(t) {
10631
+ t.operation(function () {
10632
+ t.state.matchBrackets.currentlyHighlighted &&
10633
+ (t.state.matchBrackets.currentlyHighlighted(),
10634
+ (t.state.matchBrackets.currentlyHighlighted = null)),
10635
+ (t.state.matchBrackets.currentlyHighlighted = a(
10636
+ t,
10637
+ !1,
10638
+ t.state.matchBrackets
10639
+ ));
10640
+ });
10641
+ }
10642
+ function c(t) {
10643
+ t.state.matchBrackets &&
10644
+ t.state.matchBrackets.currentlyHighlighted &&
10645
+ (t.state.matchBrackets.currentlyHighlighted(),
10646
+ (t.state.matchBrackets.currentlyHighlighted = null));
10647
+ }
10648
+ t.defineOption("matchBrackets", !1, function (e, n, i) {
10649
+ i &&
10650
+ i != t.Init &&
10651
+ (e.off("cursorActivity", l),
10652
+ e.off("focus", l),
10653
+ e.off("blur", c),
10654
+ c(e)),
10655
+ n &&
10656
+ ((e.state.matchBrackets = "object" == typeof n ? n : {}),
10657
+ e.on("cursorActivity", l),
10658
+ e.on("focus", l),
10659
+ e.on("blur", c));
10660
+ }),
10661
+ t.defineExtension("matchBrackets", function () {
10662
+ a(this, !0);
10663
+ }),
10664
+ t.defineExtension("findMatchingBracket", function (t, e, n) {
10665
+ return (
10666
+ (n || "boolean" == typeof e) &&
10667
+ (n
10668
+ ? ((n.strict = e), (e = n))
10669
+ : (e = e ? { strict: !0 } : null)),
10670
+ o(this, t, e)
10671
+ );
10672
+ }),
10673
+ t.defineExtension("scanForBracket", function (t, e, n, i) {
10674
+ return s(this, t, e, n, i);
10675
+ });
10676
+ }),
10677
+ "object" == typeof n && "object" == typeof e
10678
+ ? i(t("../../lib/codemirror"))
10679
+ : "function" == typeof define && define.amd
10680
+ ? define(["../../lib/codemirror"], i)
10681
+ : i(CodeMirror);
10682
+ },
10683
+ { "../../lib/codemirror": 13 },
10684
+ ],
10685
+ 7: [
10686
+ function (t, e, n) {
10687
+ var i;
10688
+ (i = function (t) {
10689
+ "use strict";
10690
+ var e = "CodeMirror-lint-markers";
10691
+ function n(t) {
10692
+ t.parentNode && t.parentNode.removeChild(t);
10693
+ }
10694
+ function i(e, i, r, o) {
10695
+ var s = (function (e, n, i) {
10696
+ var r = document.createElement("div");
10697
+ function o(e) {
10698
+ if (!r.parentNode) return t.off(document, "mousemove", o);
10699
+ (r.style.top =
10700
+ Math.max(0, e.clientY - r.offsetHeight - 5) + "px"),
10701
+ (r.style.left = e.clientX + 5 + "px");
10702
+ }
10703
+ return (
10704
+ (r.className =
10705
+ "CodeMirror-lint-tooltip cm-s-" + e.options.theme),
10706
+ r.appendChild(i.cloneNode(!0)),
10707
+ e.state.lint.options.selfContain
10708
+ ? e.getWrapperElement().appendChild(r)
10709
+ : document.body.appendChild(r),
10710
+ t.on(document, "mousemove", o),
10711
+ o(n),
10712
+ null != r.style.opacity && (r.style.opacity = 1),
10713
+ r
10714
+ );
10715
+ })(e, i, r);
10716
+ function a() {
10717
+ var e;
10718
+ t.off(o, "mouseout", a),
10719
+ s &&
10720
+ ((e = s).parentNode &&
10721
+ (null == e.style.opacity && n(e),
10722
+ (e.style.opacity = 0),
10723
+ setTimeout(function () {
10724
+ n(e);
10725
+ }, 600)),
10726
+ (s = null));
10727
+ }
10728
+ var l = setInterval(function () {
10729
+ if (s)
10730
+ for (var t = o; ; t = t.parentNode) {
10731
+ if (
10732
+ (t && 11 == t.nodeType && (t = t.host), t == document.body)
10733
+ )
10734
+ return;
10735
+ if (!t) {
10736
+ a();
10737
+ break;
10738
+ }
10739
+ }
10740
+ if (!s) return clearInterval(l);
10741
+ }, 400);
10742
+ t.on(o, "mouseout", a);
10743
+ }
10744
+ function r(t, e, n) {
10745
+ for (var r in ((this.marked = []),
10746
+ e instanceof Function && (e = { getAnnotations: e }),
10747
+ (e && !0 !== e) || (e = {}),
10748
+ (this.options = {}),
10749
+ (this.linterOptions = e.options || {}),
10750
+ o))
10751
+ this.options[r] = o[r];
10752
+ for (var r in e)
10753
+ o.hasOwnProperty(r)
10754
+ ? null != e[r] && (this.options[r] = e[r])
10755
+ : e.options || (this.linterOptions[r] = e[r]);
10756
+ (this.timeout = null),
10757
+ (this.hasGutter = n),
10758
+ (this.onMouseOver = function (e) {
10759
+ !(function (t, e) {
10760
+ var n = e.target || e.srcElement;
10761
+ if (/\bCodeMirror-lint-mark-/.test(n.className)) {
10762
+ for (
10763
+ var r = n.getBoundingClientRect(),
10764
+ o = (r.left + r.right) / 2,
10765
+ s = (r.top + r.bottom) / 2,
10766
+ a = t.findMarksAt(
10767
+ t.coordsChar({ left: o, top: s }, "client")
10768
+ ),
10769
+ c = [],
10770
+ h = 0;
10771
+ h < a.length;
10772
+ ++h
10773
+ ) {
10774
+ var u = a[h].__annotation;
10775
+ u && c.push(u);
10776
+ }
10777
+ c.length &&
10778
+ (function (t, e, n) {
10779
+ for (
10780
+ var r = n.target || n.srcElement,
10781
+ o = document.createDocumentFragment(),
10782
+ s = 0;
10783
+ s < e.length;
10784
+ s++
10785
+ ) {
10786
+ var a = e[s];
10787
+ o.appendChild(l(a));
10788
+ }
10789
+ i(t, n, o, r);
10790
+ })(t, c, e);
10791
+ }
10792
+ })(t, e);
10793
+ }),
10794
+ (this.waitingFor = 0);
10795
+ }
10796
+ var o = {
10797
+ highlightLines: !1,
10798
+ tooltips: !0,
10799
+ delay: 500,
10800
+ lintOnChange: !0,
10801
+ getAnnotations: null,
10802
+ async: !1,
10803
+ selfContain: null,
10804
+ formatAnnotation: null,
10805
+ onUpdateLinting: null,
10806
+ };
10807
+ function s(t) {
10808
+ var n = t.state.lint;
10809
+ n.hasGutter && t.clearGutter(e),
10810
+ n.options.highlightLines &&
10811
+ (function (t) {
10812
+ t.eachLine(function (e) {
10813
+ var n =
10814
+ e.wrapClass &&
10815
+ /\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass);
10816
+ n && t.removeLineClass(e, "wrap", n[0]);
10817
+ });
10818
+ })(t);
10819
+ for (var i = 0; i < n.marked.length; ++i) n.marked[i].clear();
10820
+ n.marked.length = 0;
10821
+ }
10822
+ function a(e, n, r, o, s) {
10823
+ var a = document.createElement("div"),
10824
+ l = a;
10825
+ return (
10826
+ (a.className =
10827
+ "CodeMirror-lint-marker CodeMirror-lint-marker-" + r),
10828
+ o &&
10829
+ ((l = a.appendChild(document.createElement("div"))).className =
10830
+ "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),
10831
+ 0 != s &&
10832
+ t.on(l, "mouseover", function (t) {
10833
+ i(e, t, n, l);
10834
+ }),
10835
+ a
10836
+ );
10837
+ }
10838
+ function l(t) {
10839
+ var e = t.severity;
10840
+ e || (e = "error");
10841
+ var n = document.createElement("div");
10842
+ return (
10843
+ (n.className =
10844
+ "CodeMirror-lint-message CodeMirror-lint-message-" + e),
10845
+ void 0 !== t.messageHTML
10846
+ ? (n.innerHTML = t.messageHTML)
10847
+ : n.appendChild(document.createTextNode(t.message)),
10848
+ n
10849
+ );
10850
+ }
10851
+ function c(e) {
10852
+ var n = e.state.lint;
10853
+ if (n) {
10854
+ var i = n.options,
10855
+ r = i.getAnnotations || e.getHelper(t.Pos(0, 0), "lint");
10856
+ if (r)
10857
+ if (i.async || r.async)
10858
+ !(function (e, n) {
10859
+ var i = e.state.lint,
10860
+ r = ++i.waitingFor;
10861
+ function o() {
10862
+ (r = -1), e.off("change", o);
10863
+ }
10864
+ e.on("change", o),
10865
+ n(
10866
+ e.getValue(),
10867
+ function (n, s) {
10868
+ e.off("change", o),
10869
+ i.waitingFor == r &&
10870
+ (s && n instanceof t && (n = s),
10871
+ e.operation(function () {
10872
+ h(e, n);
10873
+ }));
10874
+ },
10875
+ i.linterOptions,
10876
+ e
10877
+ );
10878
+ })(e, r);
10879
+ else {
10880
+ var o = r(e.getValue(), n.linterOptions, e);
10881
+ if (!o) return;
10882
+ o.then
10883
+ ? o.then(function (t) {
10884
+ e.operation(function () {
10885
+ h(e, t);
10886
+ });
10887
+ })
10888
+ : e.operation(function () {
10889
+ h(e, o);
10890
+ });
10891
+ }
10892
+ }
10893
+ }
10894
+ function h(t, n) {
10895
+ var i = t.state.lint;
10896
+ if (i) {
10897
+ var r = i.options;
10898
+ s(t);
10899
+ for (
10900
+ var o,
10901
+ c,
10902
+ h = (function (t) {
10903
+ for (var e = [], n = 0; n < t.length; ++n) {
10904
+ var i = t[n],
10905
+ r = i.from.line;
10906
+ (e[r] || (e[r] = [])).push(i);
10907
+ }
10908
+ return e;
10909
+ })(n),
10910
+ u = 0;
10911
+ u < h.length;
10912
+ ++u
10913
+ ) {
10914
+ var f = h[u];
10915
+ if (f) {
10916
+ var d = [];
10917
+ f = f.filter(function (t) {
10918
+ return !(d.indexOf(t.message) > -1) && d.push(t.message);
10919
+ });
10920
+ for (
10921
+ var p = null,
10922
+ g = i.hasGutter && document.createDocumentFragment(),
10923
+ m = 0;
10924
+ m < f.length;
10925
+ ++m
10926
+ ) {
10927
+ var v = f[m],
10928
+ _ = v.severity;
10929
+ _ || (_ = "error"),
10930
+ (c = _),
10931
+ (p = "error" == (o = p) ? o : c),
10932
+ r.formatAnnotation && (v = r.formatAnnotation(v)),
10933
+ i.hasGutter && g.appendChild(l(v)),
10934
+ v.to &&
10935
+ i.marked.push(
10936
+ t.markText(v.from, v.to, {
10937
+ className:
10938
+ "CodeMirror-lint-mark CodeMirror-lint-mark-" + _,
10939
+ __annotation: v,
10940
+ })
10941
+ );
10942
+ }
10943
+ i.hasGutter &&
10944
+ t.setGutterMarker(
10945
+ u,
10946
+ e,
10947
+ a(t, g, p, h[u].length > 1, r.tooltips)
10948
+ ),
10949
+ r.highlightLines &&
10950
+ t.addLineClass(u, "wrap", "CodeMirror-lint-line-" + p);
10951
+ }
10952
+ }
10953
+ r.onUpdateLinting && r.onUpdateLinting(n, h, t);
10954
+ }
10955
+ }
10956
+ function u(t) {
10957
+ var e = t.state.lint;
10958
+ e &&
10959
+ (clearTimeout(e.timeout),
10960
+ (e.timeout = setTimeout(function () {
10961
+ c(t);
10962
+ }, e.options.delay)));
10963
+ }
10964
+ t.defineOption("lint", !1, function (n, i, o) {
10965
+ if (
10966
+ (o &&
10967
+ o != t.Init &&
10968
+ (s(n),
10969
+ !1 !== n.state.lint.options.lintOnChange && n.off("change", u),
10970
+ t.off(
10971
+ n.getWrapperElement(),
10972
+ "mouseover",
10973
+ n.state.lint.onMouseOver
10974
+ ),
10975
+ clearTimeout(n.state.lint.timeout),
10976
+ delete n.state.lint),
10977
+ i)
10978
+ ) {
10979
+ for (
10980
+ var a = n.getOption("gutters"), l = !1, h = 0;
10981
+ h < a.length;
10982
+ ++h
10983
+ )
10984
+ a[h] == e && (l = !0);
10985
+ var f = (n.state.lint = new r(n, i, l));
10986
+ f.options.lintOnChange && n.on("change", u),
10987
+ 0 != f.options.tooltips &&
10988
+ "gutter" != f.options.tooltips &&
10989
+ t.on(n.getWrapperElement(), "mouseover", f.onMouseOver),
10990
+ c(n);
10991
+ }
10992
+ }),
10993
+ t.defineExtension("performLint", function () {
10994
+ c(this);
10995
+ });
10996
+ }),
10997
+ "object" == typeof n && "object" == typeof e
10998
+ ? i(t("../../lib/codemirror"))
10999
+ : "function" == typeof define && define.amd
11000
+ ? define(["../../lib/codemirror"], i)
11001
+ : i(CodeMirror);
11002
+ },
11003
+ { "../../lib/codemirror": 13 },
11004
+ ],
11005
+ 8: [
11006
+ function (t, e, n) {
11007
+ var i;
11008
+ (i = function (t) {
11009
+ "use strict";
11010
+ function e(t, e) {
11011
+ function n(t) {
11012
+ clearTimeout(i.doRedraw),
11013
+ (i.doRedraw = setTimeout(function () {
11014
+ i.redraw();
11015
+ }, t));
11016
+ }
11017
+ (this.cm = t),
11018
+ (this.options = e),
11019
+ (this.buttonHeight =
11020
+ e.scrollButtonHeight || t.getOption("scrollButtonHeight")),
11021
+ (this.annotations = []),
11022
+ (this.doRedraw = this.doUpdate = null),
11023
+ (this.div = t
11024
+ .getWrapperElement()
11025
+ .appendChild(document.createElement("div"))),
11026
+ (this.div.style.cssText =
11027
+ "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none"),
11028
+ this.computeScale();
11029
+ var i = this;
11030
+ t.on(
11031
+ "refresh",
11032
+ (this.resizeHandler = function () {
11033
+ clearTimeout(i.doUpdate),
11034
+ (i.doUpdate = setTimeout(function () {
11035
+ i.computeScale() && n(20);
11036
+ }, 100));
11037
+ })
11038
+ ),
11039
+ t.on("markerAdded", this.resizeHandler),
11040
+ t.on("markerCleared", this.resizeHandler),
11041
+ !1 !== e.listenForChanges &&
11042
+ t.on(
11043
+ "changes",
11044
+ (this.changeHandler = function () {
11045
+ n(250);
11046
+ })
11047
+ );
11048
+ }
11049
+ t.defineExtension("annotateScrollbar", function (t) {
11050
+ return (
11051
+ "string" == typeof t && (t = { className: t }), new e(this, t)
11052
+ );
11053
+ }),
11054
+ t.defineOption("scrollButtonHeight", 0),
11055
+ (e.prototype.computeScale = function () {
11056
+ var t = this.cm,
11057
+ e =
11058
+ (t.getWrapperElement().clientHeight -
11059
+ t.display.barHeight -
11060
+ 2 * this.buttonHeight) /
11061
+ t.getScrollerElement().scrollHeight;
11062
+ if (e != this.hScale) return (this.hScale = e), !0;
11063
+ }),
11064
+ (e.prototype.update = function (t) {
11065
+ (this.annotations = t), this.redraw();
11066
+ }),
11067
+ (e.prototype.redraw = function (t) {
11068
+ !1 !== t && this.computeScale();
11069
+ var e = this.cm,
11070
+ n = this.hScale,
11071
+ i = document.createDocumentFragment(),
11072
+ r = this.annotations,
11073
+ o = e.getOption("lineWrapping"),
11074
+ s = o && 1.5 * e.defaultTextHeight(),
11075
+ a = null,
11076
+ l = null;
11077
+ function c(t, n) {
11078
+ if (a != t.line) {
11079
+ (a = t.line), (l = e.getLineHandle(t.line));
11080
+ var i = e.getLineHandleVisualStart(l);
11081
+ i != l && ((a = e.getLineNumber(i)), (l = i));
11082
+ }
11083
+ return (l.widgets && l.widgets.length) || (o && l.height > s)
11084
+ ? e.charCoords(t, "local")[n ? "top" : "bottom"]
11085
+ : e.heightAtLine(l, "local") + (n ? 0 : l.height);
11086
+ }
11087
+ var h = e.lastLine();
11088
+ if (e.display.barWidth)
11089
+ for (var u, f = 0; f < r.length; f++) {
11090
+ var d = r[f];
11091
+ if (!(d.to.line > h)) {
11092
+ for (
11093
+ var p = u || c(d.from, !0) * n, g = c(d.to, !1) * n;
11094
+ f < r.length - 1 &&
11095
+ !(r[f + 1].to.line > h) &&
11096
+ !((u = c(r[f + 1].from, !0) * n) > g + 0.9);
11097
+
11098
+ )
11099
+ g = c((d = r[++f]).to, !1) * n;
11100
+ if (g != p) {
11101
+ var m = Math.max(g - p, 3),
11102
+ v = i.appendChild(document.createElement("div"));
11103
+ (v.style.cssText =
11104
+ "position: absolute; right: 0px; width: " +
11105
+ Math.max(e.display.barWidth - 1, 2) +
11106
+ "px; top: " +
11107
+ (p + this.buttonHeight) +
11108
+ "px; height: " +
11109
+ m +
11110
+ "px"),
11111
+ (v.className = this.options.className),
11112
+ d.id && v.setAttribute("annotation-id", d.id);
11113
+ }
11114
+ }
11115
+ }
11116
+ (this.div.textContent = ""), this.div.appendChild(i);
11117
+ }),
11118
+ (e.prototype.clear = function () {
11119
+ this.cm.off("refresh", this.resizeHandler),
11120
+ this.cm.off("markerAdded", this.resizeHandler),
11121
+ this.cm.off("markerCleared", this.resizeHandler),
11122
+ this.changeHandler &&
11123
+ this.cm.off("changes", this.changeHandler),
11124
+ this.div.parentNode.removeChild(this.div);
11125
+ });
11126
+ }),
11127
+ "object" == typeof n && "object" == typeof e
11128
+ ? i(t("../../lib/codemirror"))
11129
+ : "function" == typeof define && define.amd
11130
+ ? define(["../../lib/codemirror"], i)
11131
+ : i(CodeMirror);
11132
+ },
11133
+ { "../../lib/codemirror": 13 },
11134
+ ],
11135
+ 9: [
11136
+ function (t, e, n) {
11137
+ var i;
11138
+ (i = function (t) {
11139
+ "use strict";
11140
+ var e = {
11141
+ style: "matchhighlight",
11142
+ minChars: 2,
11143
+ delay: 100,
11144
+ wordsOnly: !1,
11145
+ annotateScrollbar: !1,
11146
+ showToken: !1,
11147
+ trim: !0,
11148
+ };
11149
+ function n(t) {
11150
+ for (var n in ((this.options = {}), e))
11151
+ this.options[n] = (t && t.hasOwnProperty(n) ? t : e)[n];
11152
+ (this.overlay = this.timeout = null),
11153
+ (this.matchesonscroll = null),
11154
+ (this.active = !1);
11155
+ }
11156
+ function i(t) {
11157
+ var e = t.state.matchHighlighter;
11158
+ (e.active || t.hasFocus()) && o(t, e);
11159
+ }
11160
+ function r(t) {
11161
+ var e = t.state.matchHighlighter;
11162
+ e.active || ((e.active = !0), o(t, e));
11163
+ }
11164
+ function o(t, e) {
11165
+ clearTimeout(e.timeout),
11166
+ (e.timeout = setTimeout(function () {
11167
+ l(t);
11168
+ }, e.options.delay));
11169
+ }
11170
+ function s(t, e, n, i) {
11171
+ var r = t.state.matchHighlighter;
11172
+ if (
11173
+ (t.addOverlay(
11174
+ (r.overlay = (function (t, e, n) {
11175
+ return {
11176
+ token: function (i) {
11177
+ if (
11178
+ i.match(t) &&
11179
+ (!e ||
11180
+ (function (t, e) {
11181
+ return !(
11182
+ (t.start &&
11183
+ e.test(t.string.charAt(t.start - 1))) ||
11184
+ (t.pos != t.string.length &&
11185
+ e.test(t.string.charAt(t.pos)))
11186
+ );
11187
+ })(i, e))
11188
+ )
11189
+ return n;
11190
+ i.next(), i.skipTo(t.charAt(0)) || i.skipToEnd();
11191
+ },
11192
+ };
11193
+ })(e, n, i))
11194
+ ),
11195
+ r.options.annotateScrollbar && t.showMatchesOnScrollbar)
11196
+ ) {
11197
+ var o = n
11198
+ ? new RegExp(
11199
+ (/\w/.test(e.charAt(0)) ? "\\b" : "") +
11200
+ e.replace(/[\\\[.+*?(){|^$]/g, "\\$&") +
11201
+ (/\w/.test(e.charAt(e.length - 1)) ? "\\b" : "")
11202
+ )
11203
+ : e;
11204
+ r.matchesonscroll = t.showMatchesOnScrollbar(o, !1, {
11205
+ className: "CodeMirror-selection-highlight-scrollbar",
11206
+ });
11207
+ }
11208
+ }
11209
+ function a(t) {
11210
+ var e = t.state.matchHighlighter;
11211
+ e.overlay &&
11212
+ (t.removeOverlay(e.overlay),
11213
+ (e.overlay = null),
11214
+ e.matchesonscroll &&
11215
+ (e.matchesonscroll.clear(), (e.matchesonscroll = null)));
11216
+ }
11217
+ function l(t) {
11218
+ t.operation(function () {
11219
+ var e = t.state.matchHighlighter;
11220
+ if ((a(t), t.somethingSelected() || !e.options.showToken)) {
11221
+ var n = t.getCursor("from"),
11222
+ i = t.getCursor("to");
11223
+ if (
11224
+ n.line == i.line &&
11225
+ (!e.options.wordsOnly ||
11226
+ (function (t, e, n) {
11227
+ if (null !== t.getRange(e, n).match(/^\w+$/)) {
11228
+ if (e.ch > 0) {
11229
+ var i = { line: e.line, ch: e.ch - 1 };
11230
+ if (null === t.getRange(i, e).match(/\W/)) return !1;
11231
+ }
11232
+ return !(
11233
+ n.ch < t.getLine(e.line).length &&
11234
+ ((i = { line: n.line, ch: n.ch + 1 }),
11235
+ null === t.getRange(n, i).match(/\W/))
11236
+ );
11237
+ }
11238
+ return !1;
11239
+ })(t, n, i))
11240
+ ) {
11241
+ var r = t.getRange(n, i);
11242
+ e.options.trim && (r = r.replace(/^\s+|\s+$/g, "")),
11243
+ r.length >= e.options.minChars &&
11244
+ s(t, r, !1, e.options.style);
11245
+ }
11246
+ } else {
11247
+ for (
11248
+ var o =
11249
+ !0 === e.options.showToken
11250
+ ? /[\w$]/
11251
+ : e.options.showToken,
11252
+ l = t.getCursor(),
11253
+ c = t.getLine(l.line),
11254
+ h = l.ch,
11255
+ u = h;
11256
+ h && o.test(c.charAt(h - 1));
11257
+
11258
+ )
11259
+ --h;
11260
+ for (; u < c.length && o.test(c.charAt(u)); ) ++u;
11261
+ h < u && s(t, c.slice(h, u), o, e.options.style);
11262
+ }
11263
+ });
11264
+ }
11265
+ t.defineOption("highlightSelectionMatches", !1, function (e, o, s) {
11266
+ if (
11267
+ (s &&
11268
+ s != t.Init &&
11269
+ (a(e),
11270
+ clearTimeout(e.state.matchHighlighter.timeout),
11271
+ (e.state.matchHighlighter = null),
11272
+ e.off("cursorActivity", i),
11273
+ e.off("focus", r)),
11274
+ o)
11275
+ ) {
11276
+ var c = (e.state.matchHighlighter = new n(o));
11277
+ e.hasFocus() ? ((c.active = !0), l(e)) : e.on("focus", r),
11278
+ e.on("cursorActivity", i);
11279
+ }
11280
+ });
11281
+ }),
11282
+ "object" == typeof n && "object" == typeof e
11283
+ ? i(t("../../lib/codemirror"), t("./matchesonscrollbar"))
11284
+ : "function" == typeof define && define.amd
11285
+ ? define(["../../lib/codemirror", "./matchesonscrollbar"], i)
11286
+ : i(CodeMirror);
11287
+ },
11288
+ { "../../lib/codemirror": 13, "./matchesonscrollbar": 10 },
11289
+ ],
11290
+ 10: [
11291
+ function (t, e, n) {
11292
+ var i;
11293
+ (i = function (t) {
11294
+ "use strict";
11295
+ function e(t, e, n, i) {
11296
+ (this.cm = t), (this.options = i);
11297
+ var r = { listenForChanges: !1 };
11298
+ for (var o in i) r[o] = i[o];
11299
+ r.className || (r.className = "CodeMirror-search-match"),
11300
+ (this.annotation = t.annotateScrollbar(r)),
11301
+ (this.query = e),
11302
+ (this.caseFold = n),
11303
+ (this.gap = { from: t.firstLine(), to: t.lastLine() + 1 }),
11304
+ (this.matches = []),
11305
+ (this.update = null),
11306
+ this.findMatches(),
11307
+ this.annotation.update(this.matches);
11308
+ var s = this;
11309
+ t.on(
11310
+ "change",
11311
+ (this.changeHandler = function (t, e) {
11312
+ s.onChange(e);
11313
+ })
11314
+ );
11315
+ }
11316
+ function n(t, e, n) {
11317
+ return t <= e ? t : Math.max(e, t + n);
11318
+ }
11319
+ t.defineExtension("showMatchesOnScrollbar", function (t, n, i) {
11320
+ return (
11321
+ "string" == typeof i && (i = { className: i }),
11322
+ i || (i = {}),
11323
+ new e(this, t, n, i)
11324
+ );
11325
+ }),
11326
+ (e.prototype.findMatches = function () {
11327
+ if (this.gap) {
11328
+ for (
11329
+ var e = 0;
11330
+ e < this.matches.length &&
11331
+ !((r = this.matches[e]).from.line >= this.gap.to);
11332
+ e++
11333
+ )
11334
+ r.to.line >= this.gap.from && this.matches.splice(e--, 1);
11335
+ for (
11336
+ var n = this.cm.getSearchCursor(
11337
+ this.query,
11338
+ t.Pos(this.gap.from, 0),
11339
+ {
11340
+ caseFold: this.caseFold,
11341
+ multiline: this.options.multiline,
11342
+ }
11343
+ ),
11344
+ i = (this.options && this.options.maxMatches) || 1e3;
11345
+ n.findNext();
11346
+
11347
+ ) {
11348
+ var r;
11349
+ if (
11350
+ (r = { from: n.from(), to: n.to() }).from.line >=
11351
+ this.gap.to
11352
+ )
11353
+ break;
11354
+ if ((this.matches.splice(e++, 0, r), this.matches.length > i))
11355
+ break;
11356
+ }
11357
+ this.gap = null;
11358
+ }
11359
+ }),
11360
+ (e.prototype.onChange = function (e) {
11361
+ var i = e.from.line,
11362
+ r = t.changeEnd(e).line,
11363
+ o = r - e.to.line;
11364
+ if (
11365
+ (this.gap
11366
+ ? ((this.gap.from = Math.min(
11367
+ n(this.gap.from, i, o),
11368
+ e.from.line
11369
+ )),
11370
+ (this.gap.to = Math.max(n(this.gap.to, i, o), e.from.line)))
11371
+ : (this.gap = { from: e.from.line, to: r + 1 }),
11372
+ o)
11373
+ )
11374
+ for (var s = 0; s < this.matches.length; s++) {
11375
+ var a = this.matches[s],
11376
+ l = n(a.from.line, i, o);
11377
+ l != a.from.line && (a.from = t.Pos(l, a.from.ch));
11378
+ var c = n(a.to.line, i, o);
11379
+ c != a.to.line && (a.to = t.Pos(c, a.to.ch));
11380
+ }
11381
+ clearTimeout(this.update);
11382
+ var h = this;
11383
+ this.update = setTimeout(function () {
11384
+ h.updateAfterChange();
11385
+ }, 250);
11386
+ }),
11387
+ (e.prototype.updateAfterChange = function () {
11388
+ this.findMatches(), this.annotation.update(this.matches);
11389
+ }),
11390
+ (e.prototype.clear = function () {
11391
+ this.cm.off("change", this.changeHandler),
11392
+ this.annotation.clear();
11393
+ });
11394
+ }),
11395
+ "object" == typeof n && "object" == typeof e
11396
+ ? i(
11397
+ t("../../lib/codemirror"),
11398
+ t("./searchcursor"),
11399
+ t("../scroll/annotatescrollbar")
11400
+ )
11401
+ : "function" == typeof define && define.amd
11402
+ ? define(
11403
+ [
11404
+ "../../lib/codemirror",
11405
+ "./searchcursor",
11406
+ "../scroll/annotatescrollbar",
11407
+ ],
11408
+ i
11409
+ )
11410
+ : i(CodeMirror);
11411
+ },
11412
+ {
11413
+ "../../lib/codemirror": 13,
11414
+ "../scroll/annotatescrollbar": 8,
11415
+ "./searchcursor": 12,
11416
+ },
11417
+ ],
11418
+ 11: [
11419
+ function (t, e, n) {
11420
+ var i;
11421
+ (i = function (t) {
11422
+ "use strict";
11423
+ function e() {
11424
+ (this.posFrom = this.posTo = this.lastQuery = this.query = null),
11425
+ (this.overlay = null);
11426
+ }
11427
+ function n(t) {
11428
+ return t.state.search || (t.state.search = new e());
11429
+ }
11430
+ function i(t) {
11431
+ return "string" == typeof t && t == t.toLowerCase();
11432
+ }
11433
+ function r(t, e, n) {
11434
+ return t.getSearchCursor(e, n, { caseFold: i(e), multiline: !0 });
11435
+ }
11436
+ function o(t, e, n, i, r) {
11437
+ t.openDialog
11438
+ ? t.openDialog(e, r, {
11439
+ value: i,
11440
+ selectValueOnOpen: !0,
11441
+ bottom: t.options.search.bottom,
11442
+ })
11443
+ : r(prompt(n, i));
11444
+ }
11445
+ function s(t) {
11446
+ return t.replace(/\\([nrt\\])/g, function (t, e) {
11447
+ return "n" == e
11448
+ ? "\n"
11449
+ : "r" == e
11450
+ ? "\r"
11451
+ : "t" == e
11452
+ ? "\t"
11453
+ : "\\" == e
11454
+ ? "\\"
11455
+ : t;
11456
+ });
11457
+ }
11458
+ function a(t) {
11459
+ var e = t.match(/^\/(.*)\/([a-z]*)$/);
11460
+ if (e)
11461
+ try {
11462
+ t = new RegExp(e[1], -1 == e[2].indexOf("i") ? "" : "i");
11463
+ } catch (t) {}
11464
+ else t = s(t);
11465
+ return (
11466
+ ("string" == typeof t ? "" == t : t.test("")) && (t = /x^/), t
11467
+ );
11468
+ }
11469
+ function l(t, e, n) {
11470
+ (e.queryText = n),
11471
+ (e.query = a(n)),
11472
+ t.removeOverlay(e.overlay, i(e.query)),
11473
+ (e.overlay = (function (t, e) {
11474
+ return (
11475
+ "string" == typeof t
11476
+ ? (t = new RegExp(
11477
+ t.replace(
11478
+ /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
11479
+ "\\$&"
11480
+ ),
11481
+ e ? "gi" : "g"
11482
+ ))
11483
+ : t.global ||
11484
+ (t = new RegExp(t.source, t.ignoreCase ? "gi" : "g")),
11485
+ {
11486
+ token: function (e) {
11487
+ t.lastIndex = e.pos;
11488
+ var n = t.exec(e.string);
11489
+ if (n && n.index == e.pos)
11490
+ return (e.pos += n[0].length || 1), "searching";
11491
+ n ? (e.pos = n.index) : e.skipToEnd();
11492
+ },
11493
+ }
11494
+ );
11495
+ })(e.query, i(e.query))),
11496
+ t.addOverlay(e.overlay),
11497
+ t.showMatchesOnScrollbar &&
11498
+ (e.annotate && (e.annotate.clear(), (e.annotate = null)),
11499
+ (e.annotate = t.showMatchesOnScrollbar(e.query, i(e.query))));
11500
+ }
11501
+ function c(e, i, r, s) {
11502
+ var a = n(e);
11503
+ if (a.query) return h(e, i);
11504
+ var c = e.getSelection() || a.lastQuery;
11505
+ if (
11506
+ (c instanceof RegExp && "x^" == c.source && (c = null),
11507
+ r && e.openDialog)
11508
+ ) {
11509
+ var f = null,
11510
+ p = function (n, i) {
11511
+ t.e_stop(i),
11512
+ n &&
11513
+ (n != a.queryText &&
11514
+ (l(e, a, n), (a.posFrom = a.posTo = e.getCursor())),
11515
+ f && (f.style.opacity = 1),
11516
+ h(e, i.shiftKey, function (t, n) {
11517
+ var i;
11518
+ n.line < 3 &&
11519
+ document.querySelector &&
11520
+ (i =
11521
+ e.display.wrapper.querySelector(
11522
+ ".CodeMirror-dialog"
11523
+ )) &&
11524
+ i.getBoundingClientRect().bottom - 4 >
11525
+ e.cursorCoords(n, "window").top &&
11526
+ ((f = i).style.opacity = 0.4);
11527
+ }));
11528
+ };
11529
+ !(function (t, e, n, i, r) {
11530
+ t.openDialog(e, i, {
11531
+ value: n,
11532
+ selectValueOnOpen: !0,
11533
+ closeOnEnter: !1,
11534
+ onClose: function () {
11535
+ u(t);
11536
+ },
11537
+ onKeyDown: r,
11538
+ bottom: t.options.search.bottom,
11539
+ });
11540
+ })(e, d(e), c, p, function (i, r) {
11541
+ var o = t.keyName(i),
11542
+ s = e.getOption("extraKeys"),
11543
+ a = (s && s[o]) || t.keyMap[e.getOption("keyMap")][o];
11544
+ "findNext" == a ||
11545
+ "findPrev" == a ||
11546
+ "findPersistentNext" == a ||
11547
+ "findPersistentPrev" == a
11548
+ ? (t.e_stop(i), l(e, n(e), r), e.execCommand(a))
11549
+ : ("find" != a && "findPersistent" != a) ||
11550
+ (t.e_stop(i), p(r, i));
11551
+ }),
11552
+ s && c && (l(e, a, c), h(e, i));
11553
+ } else
11554
+ o(e, d(e), "Search for:", c, function (t) {
11555
+ t &&
11556
+ !a.query &&
11557
+ e.operation(function () {
11558
+ l(e, a, t), (a.posFrom = a.posTo = e.getCursor()), h(e, i);
11559
+ });
11560
+ });
11561
+ }
11562
+ function h(e, i, o) {
11563
+ e.operation(function () {
11564
+ var s = n(e),
11565
+ a = r(e, s.query, i ? s.posFrom : s.posTo);
11566
+ (a.find(i) ||
11567
+ (a = r(
11568
+ e,
11569
+ s.query,
11570
+ i ? t.Pos(e.lastLine()) : t.Pos(e.firstLine(), 0)
11571
+ )).find(i)) &&
11572
+ (e.setSelection(a.from(), a.to()),
11573
+ e.scrollIntoView({ from: a.from(), to: a.to() }, 20),
11574
+ (s.posFrom = a.from()),
11575
+ (s.posTo = a.to()),
11576
+ o && o(a.from(), a.to()));
11577
+ });
11578
+ }
11579
+ function u(t) {
11580
+ t.operation(function () {
11581
+ var e = n(t);
11582
+ (e.lastQuery = e.query),
11583
+ e.query &&
11584
+ ((e.query = e.queryText = null),
11585
+ t.removeOverlay(e.overlay),
11586
+ e.annotate && (e.annotate.clear(), (e.annotate = null)));
11587
+ });
11588
+ }
11589
+ function f(t, e) {
11590
+ var n = t
11591
+ ? document.createElement(t)
11592
+ : document.createDocumentFragment();
11593
+ for (var i in e) n[i] = e[i];
11594
+ for (var r = 2; r < arguments.length; r++) {
11595
+ var o = arguments[r];
11596
+ n.appendChild(
11597
+ "string" == typeof o ? document.createTextNode(o) : o
11598
+ );
11599
+ }
11600
+ return n;
11601
+ }
11602
+ function d(t) {
11603
+ return f(
11604
+ "",
11605
+ null,
11606
+ f(
11607
+ "span",
11608
+ { className: "CodeMirror-search-label" },
11609
+ t.phrase("Search:")
11610
+ ),
11611
+ " ",
11612
+ f("input", {
11613
+ type: "text",
11614
+ style: "width: 10em",
11615
+ className: "CodeMirror-search-field",
11616
+ }),
11617
+ " ",
11618
+ f(
11619
+ "span",
11620
+ { style: "color: #888", className: "CodeMirror-search-hint" },
11621
+ t.phrase("(Use /re/ syntax for regexp search)")
11622
+ )
11623
+ );
11624
+ }
11625
+ function p(t, e, n) {
11626
+ t.operation(function () {
11627
+ for (var i = r(t, e); i.findNext(); )
11628
+ if ("string" != typeof e) {
11629
+ var o = t.getRange(i.from(), i.to()).match(e);
11630
+ i.replace(
11631
+ n.replace(/\$(\d)/g, function (t, e) {
11632
+ return o[e];
11633
+ })
11634
+ );
11635
+ } else i.replace(n);
11636
+ });
11637
+ }
11638
+ function g(t, e) {
11639
+ if (!t.getOption("readOnly")) {
11640
+ var i = t.getSelection() || n(t).lastQuery,
11641
+ l = e ? t.phrase("Replace all:") : t.phrase("Replace:"),
11642
+ c = f(
11643
+ "",
11644
+ null,
11645
+ f("span", { className: "CodeMirror-search-label" }, l),
11646
+ (function (t) {
11647
+ return f(
11648
+ "",
11649
+ null,
11650
+ " ",
11651
+ f("input", {
11652
+ type: "text",
11653
+ style: "width: 10em",
11654
+ className: "CodeMirror-search-field",
11655
+ }),
11656
+ " ",
11657
+ f(
11658
+ "span",
11659
+ {
11660
+ style: "color: #888",
11661
+ className: "CodeMirror-search-hint",
11662
+ },
11663
+ t.phrase("(Use /re/ syntax for regexp search)")
11664
+ )
11665
+ );
11666
+ })(t)
11667
+ );
11668
+ o(t, c, l, i, function (n) {
11669
+ n &&
11670
+ ((n = a(n)),
11671
+ o(
11672
+ t,
11673
+ (function (t) {
11674
+ return f(
11675
+ "",
11676
+ null,
11677
+ f(
11678
+ "span",
11679
+ { className: "CodeMirror-search-label" },
11680
+ t.phrase("With:")
11681
+ ),
11682
+ " ",
11683
+ f("input", {
11684
+ type: "text",
11685
+ style: "width: 10em",
11686
+ className: "CodeMirror-search-field",
11687
+ })
11688
+ );
11689
+ })(t),
11690
+ t.phrase("Replace with:"),
11691
+ "",
11692
+ function (i) {
11693
+ if (((i = s(i)), e)) p(t, n, i);
11694
+ else {
11695
+ u(t);
11696
+ var o = r(t, n, t.getCursor("from")),
11697
+ a = function () {
11698
+ var e,
11699
+ s = o.from();
11700
+ (!(e = o.findNext()) &&
11701
+ ((o = r(t, n)),
11702
+ !(e = o.findNext()) ||
11703
+ (s &&
11704
+ o.from().line == s.line &&
11705
+ o.from().ch == s.ch))) ||
11706
+ (t.setSelection(o.from(), o.to()),
11707
+ t.scrollIntoView({ from: o.from(), to: o.to() }),
11708
+ (function (t, e, n, i) {
11709
+ t.openConfirm
11710
+ ? t.openConfirm(e, i)
11711
+ : confirm(n) && i[0]();
11712
+ })(
11713
+ t,
11714
+ (function (t) {
11715
+ return f(
11716
+ "",
11717
+ null,
11718
+ f(
11719
+ "span",
11720
+ { className: "CodeMirror-search-label" },
11721
+ t.phrase("Replace?")
11722
+ ),
11723
+ " ",
11724
+ f("button", {}, t.phrase("Yes")),
11725
+ " ",
11726
+ f("button", {}, t.phrase("No")),
11727
+ " ",
11728
+ f("button", {}, t.phrase("All")),
11729
+ " ",
11730
+ f("button", {}, t.phrase("Stop"))
11731
+ );
11732
+ })(t),
11733
+ t.phrase("Replace?"),
11734
+ [
11735
+ function () {
11736
+ l(e);
11737
+ },
11738
+ a,
11739
+ function () {
11740
+ p(t, n, i);
11741
+ },
11742
+ ]
11743
+ ));
11744
+ },
11745
+ l = function (t) {
11746
+ o.replace(
11747
+ "string" == typeof n
11748
+ ? i
11749
+ : i.replace(/\$(\d)/g, function (e, n) {
11750
+ return t[n];
11751
+ })
11752
+ ),
11753
+ a();
11754
+ };
11755
+ a();
11756
+ }
11757
+ }
11758
+ ));
11759
+ });
11760
+ }
11761
+ }
11762
+ t.defineOption("search", { bottom: !1 }),
11763
+ (t.commands.find = function (t) {
11764
+ u(t), c(t);
11765
+ }),
11766
+ (t.commands.findPersistent = function (t) {
11767
+ u(t), c(t, !1, !0);
11768
+ }),
11769
+ (t.commands.findPersistentNext = function (t) {
11770
+ c(t, !1, !0, !0);
11771
+ }),
11772
+ (t.commands.findPersistentPrev = function (t) {
11773
+ c(t, !0, !0, !0);
11774
+ }),
11775
+ (t.commands.findNext = c),
11776
+ (t.commands.findPrev = function (t) {
11777
+ c(t, !0);
11778
+ }),
11779
+ (t.commands.clearSearch = u),
11780
+ (t.commands.replace = g),
11781
+ (t.commands.replaceAll = function (t) {
11782
+ g(t, !0);
11783
+ });
11784
+ }),
11785
+ "object" == typeof n && "object" == typeof e
11786
+ ? i(
11787
+ t("../../lib/codemirror"),
11788
+ t("./searchcursor"),
11789
+ t("../dialog/dialog")
11790
+ )
11791
+ : "function" == typeof define && define.amd
11792
+ ? define(
11793
+ ["../../lib/codemirror", "./searchcursor", "../dialog/dialog"],
11794
+ i
11795
+ )
11796
+ : i(CodeMirror);
11797
+ },
11798
+ {
11799
+ "../../lib/codemirror": 13,
11800
+ "../dialog/dialog": 4,
11801
+ "./searchcursor": 12,
11802
+ },
11803
+ ],
11804
+ 12: [
11805
+ function (t, e, n) {
11806
+ var i;
11807
+ (i = function (t) {
11808
+ "use strict";
11809
+ var e,
11810
+ n,
11811
+ i = t.Pos;
11812
+ function r(t, e) {
11813
+ for (
11814
+ var n = (function (t) {
11815
+ var e = t.flags;
11816
+ return null != e
11817
+ ? e
11818
+ : (t.ignoreCase ? "i" : "") +
11819
+ (t.global ? "g" : "") +
11820
+ (t.multiline ? "m" : "");
11821
+ })(t),
11822
+ i = n,
11823
+ r = 0;
11824
+ r < e.length;
11825
+ r++
11826
+ )
11827
+ -1 == i.indexOf(e.charAt(r)) && (i += e.charAt(r));
11828
+ return n == i ? t : new RegExp(t.source, i);
11829
+ }
11830
+ function o(t) {
11831
+ return /\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source);
11832
+ }
11833
+ function s(t, e, n) {
11834
+ e = r(e, "g");
11835
+ for (
11836
+ var o = n.line, s = n.ch, a = t.lastLine();
11837
+ o <= a;
11838
+ o++, s = 0
11839
+ ) {
11840
+ e.lastIndex = s;
11841
+ var l = t.getLine(o),
11842
+ c = e.exec(l);
11843
+ if (c)
11844
+ return {
11845
+ from: i(o, c.index),
11846
+ to: i(o, c.index + c[0].length),
11847
+ match: c,
11848
+ };
11849
+ }
11850
+ }
11851
+ function a(t, e, n) {
11852
+ if (!o(e)) return s(t, e, n);
11853
+ e = r(e, "gm");
11854
+ for (var a, l = 1, c = n.line, h = t.lastLine(); c <= h; ) {
11855
+ for (var u = 0; u < l && !(c > h); u++) {
11856
+ var f = t.getLine(c++);
11857
+ a = null == a ? f : a + "\n" + f;
11858
+ }
11859
+ (l *= 2), (e.lastIndex = n.ch);
11860
+ var d = e.exec(a);
11861
+ if (d) {
11862
+ var p = a.slice(0, d.index).split("\n"),
11863
+ g = d[0].split("\n"),
11864
+ m = n.line + p.length - 1,
11865
+ v = p[p.length - 1].length;
11866
+ return {
11867
+ from: i(m, v),
11868
+ to: i(
11869
+ m + g.length - 1,
11870
+ 1 == g.length ? v + g[0].length : g[g.length - 1].length
11871
+ ),
11872
+ match: d,
11873
+ };
11874
+ }
11875
+ }
11876
+ }
11877
+ function l(t, e, n) {
11878
+ for (var i, r = 0; r <= t.length; ) {
11879
+ e.lastIndex = r;
11880
+ var o = e.exec(t);
11881
+ if (!o) break;
11882
+ var s = o.index + o[0].length;
11883
+ if (s > t.length - n) break;
11884
+ (!i || s > i.index + i[0].length) && (i = o), (r = o.index + 1);
11885
+ }
11886
+ return i;
11887
+ }
11888
+ function c(t, e, n) {
11889
+ e = r(e, "g");
11890
+ for (
11891
+ var o = n.line, s = n.ch, a = t.firstLine();
11892
+ o >= a;
11893
+ o--, s = -1
11894
+ ) {
11895
+ var c = t.getLine(o),
11896
+ h = l(c, e, s < 0 ? 0 : c.length - s);
11897
+ if (h)
11898
+ return {
11899
+ from: i(o, h.index),
11900
+ to: i(o, h.index + h[0].length),
11901
+ match: h,
11902
+ };
11903
+ }
11904
+ }
11905
+ function h(t, e, n) {
11906
+ if (!o(e)) return c(t, e, n);
11907
+ e = r(e, "gm");
11908
+ for (
11909
+ var s,
11910
+ a = 1,
11911
+ h = t.getLine(n.line).length - n.ch,
11912
+ u = n.line,
11913
+ f = t.firstLine();
11914
+ u >= f;
11915
+
11916
+ ) {
11917
+ for (var d = 0; d < a && u >= f; d++) {
11918
+ var p = t.getLine(u--);
11919
+ s = null == s ? p : p + "\n" + s;
11920
+ }
11921
+ a *= 2;
11922
+ var g = l(s, e, h);
11923
+ if (g) {
11924
+ var m = s.slice(0, g.index).split("\n"),
11925
+ v = g[0].split("\n"),
11926
+ _ = u + m.length,
11927
+ y = m[m.length - 1].length;
11928
+ return {
11929
+ from: i(_, y),
11930
+ to: i(
11931
+ _ + v.length - 1,
11932
+ 1 == v.length ? y + v[0].length : v[v.length - 1].length
11933
+ ),
11934
+ match: g,
11935
+ };
11936
+ }
11937
+ }
11938
+ }
11939
+ function u(t, e, n, i) {
11940
+ if (t.length == e.length) return n;
11941
+ for (var r = 0, o = n + Math.max(0, t.length - e.length); ; ) {
11942
+ if (r == o) return r;
11943
+ var s = (r + o) >> 1,
11944
+ a = i(t.slice(0, s)).length;
11945
+ if (a == n) return s;
11946
+ a > n ? (o = s) : (r = s + 1);
11947
+ }
11948
+ }
11949
+ function f(t, r, o, s) {
11950
+ if (!r.length) return null;
11951
+ var a = s ? e : n,
11952
+ l = a(r).split(/\r|\n\r?/);
11953
+ t: for (
11954
+ var c = o.line, h = o.ch, f = t.lastLine() + 1 - l.length;
11955
+ c <= f;
11956
+ c++, h = 0
11957
+ ) {
11958
+ var d = t.getLine(c).slice(h),
11959
+ p = a(d);
11960
+ if (1 == l.length) {
11961
+ var g = p.indexOf(l[0]);
11962
+ if (-1 == g) continue t;
11963
+ return (
11964
+ (o = u(d, p, g, a) + h),
11965
+ {
11966
+ from: i(c, u(d, p, g, a) + h),
11967
+ to: i(c, u(d, p, g + l[0].length, a) + h),
11968
+ }
11969
+ );
11970
+ }
11971
+ var m = p.length - l[0].length;
11972
+ if (p.slice(m) == l[0]) {
11973
+ for (var v = 1; v < l.length - 1; v++)
11974
+ if (a(t.getLine(c + v)) != l[v]) continue t;
11975
+ var _ = t.getLine(c + l.length - 1),
11976
+ y = a(_),
11977
+ x = l[l.length - 1];
11978
+ if (y.slice(0, x.length) == x)
11979
+ return {
11980
+ from: i(c, u(d, p, m, a) + h),
11981
+ to: i(c + l.length - 1, u(_, y, x.length, a)),
11982
+ };
11983
+ }
11984
+ }
11985
+ }
11986
+ function d(t, r, o, s) {
11987
+ if (!r.length) return null;
11988
+ var a = s ? e : n,
11989
+ l = a(r).split(/\r|\n\r?/);
11990
+ t: for (
11991
+ var c = o.line, h = o.ch, f = t.firstLine() - 1 + l.length;
11992
+ c >= f;
11993
+ c--, h = -1
11994
+ ) {
11995
+ var d = t.getLine(c);
11996
+ h > -1 && (d = d.slice(0, h));
11997
+ var p = a(d);
11998
+ if (1 == l.length) {
11999
+ var g = p.lastIndexOf(l[0]);
12000
+ if (-1 == g) continue t;
12001
+ return {
12002
+ from: i(c, u(d, p, g, a)),
12003
+ to: i(c, u(d, p, g + l[0].length, a)),
12004
+ };
12005
+ }
12006
+ var m = l[l.length - 1];
12007
+ if (p.slice(0, m.length) == m) {
12008
+ var v = 1;
12009
+ for (o = c - l.length + 1; v < l.length - 1; v++)
12010
+ if (a(t.getLine(o + v)) != l[v]) continue t;
12011
+ var _ = t.getLine(c + 1 - l.length),
12012
+ y = a(_);
12013
+ if (y.slice(y.length - l[0].length) == l[0])
12014
+ return {
12015
+ from: i(
12016
+ c + 1 - l.length,
12017
+ u(_, y, _.length - l[0].length, a)
12018
+ ),
12019
+ to: i(c, u(d, p, m.length, a)),
12020
+ };
12021
+ }
12022
+ }
12023
+ }
12024
+ function p(t, e, n, o) {
12025
+ var l;
12026
+ (this.atOccurrence = !1),
12027
+ (this.doc = t),
12028
+ (n = n ? t.clipPos(n) : i(0, 0)),
12029
+ (this.pos = { from: n, to: n }),
12030
+ "object" == typeof o ? (l = o.caseFold) : ((l = o), (o = null)),
12031
+ "string" == typeof e
12032
+ ? (null == l && (l = !1),
12033
+ (this.matches = function (n, i) {
12034
+ return (n ? d : f)(t, e, i, l);
12035
+ }))
12036
+ : ((e = r(e, "gm")),
12037
+ o && !1 === o.multiline
12038
+ ? (this.matches = function (n, i) {
12039
+ return (n ? c : s)(t, e, i);
12040
+ })
12041
+ : (this.matches = function (n, i) {
12042
+ return (n ? h : a)(t, e, i);
12043
+ }));
12044
+ }
12045
+ String.prototype.normalize
12046
+ ? ((e = function (t) {
12047
+ return t.normalize("NFD").toLowerCase();
12048
+ }),
12049
+ (n = function (t) {
12050
+ return t.normalize("NFD");
12051
+ }))
12052
+ : ((e = function (t) {
12053
+ return t.toLowerCase();
12054
+ }),
12055
+ (n = function (t) {
12056
+ return t;
12057
+ })),
12058
+ (p.prototype = {
12059
+ findNext: function () {
12060
+ return this.find(!1);
12061
+ },
12062
+ findPrevious: function () {
12063
+ return this.find(!0);
12064
+ },
12065
+ find: function (e) {
12066
+ for (
12067
+ var n = this.matches(
12068
+ e,
12069
+ this.doc.clipPos(e ? this.pos.from : this.pos.to)
12070
+ );
12071
+ n && 0 == t.cmpPos(n.from, n.to);
12072
+
12073
+ )
12074
+ e
12075
+ ? n.from.ch
12076
+ ? (n.from = i(n.from.line, n.from.ch - 1))
12077
+ : (n =
12078
+ n.from.line == this.doc.firstLine()
12079
+ ? null
12080
+ : this.matches(
12081
+ e,
12082
+ this.doc.clipPos(i(n.from.line - 1))
12083
+ ))
12084
+ : n.to.ch < this.doc.getLine(n.to.line).length
12085
+ ? (n.to = i(n.to.line, n.to.ch + 1))
12086
+ : (n =
12087
+ n.to.line == this.doc.lastLine()
12088
+ ? null
12089
+ : this.matches(e, i(n.to.line + 1, 0)));
12090
+ if (n)
12091
+ return (
12092
+ (this.pos = n),
12093
+ (this.atOccurrence = !0),
12094
+ this.pos.match || !0
12095
+ );
12096
+ var r = i(
12097
+ e ? this.doc.firstLine() : this.doc.lastLine() + 1,
12098
+ 0
12099
+ );
12100
+ return (
12101
+ (this.pos = { from: r, to: r }), (this.atOccurrence = !1)
12102
+ );
12103
+ },
12104
+ from: function () {
12105
+ if (this.atOccurrence) return this.pos.from;
12106
+ },
12107
+ to: function () {
12108
+ if (this.atOccurrence) return this.pos.to;
12109
+ },
12110
+ replace: function (e, n) {
12111
+ if (this.atOccurrence) {
12112
+ var r = t.splitLines(e);
12113
+ this.doc.replaceRange(r, this.pos.from, this.pos.to, n),
12114
+ (this.pos.to = i(
12115
+ this.pos.from.line + r.length - 1,
12116
+ r[r.length - 1].length +
12117
+ (1 == r.length ? this.pos.from.ch : 0)
12118
+ ));
12119
+ }
12120
+ },
12121
+ }),
12122
+ t.defineExtension("getSearchCursor", function (t, e, n) {
12123
+ return new p(this.doc, t, e, n);
12124
+ }),
12125
+ t.defineDocExtension("getSearchCursor", function (t, e, n) {
12126
+ return new p(this, t, e, n);
12127
+ }),
12128
+ t.defineExtension("selectMatches", function (e, n) {
12129
+ for (
12130
+ var i = [],
12131
+ r = this.getSearchCursor(e, this.getCursor("from"), n);
12132
+ r.findNext() && !(t.cmpPos(r.to(), this.getCursor("to")) > 0);
12133
+
12134
+ )
12135
+ i.push({ anchor: r.from(), head: r.to() });
12136
+ i.length && this.setSelections(i, 0);
12137
+ });
12138
+ }),
12139
+ "object" == typeof n && "object" == typeof e
12140
+ ? i(t("../../lib/codemirror"))
12141
+ : "function" == typeof define && define.amd
12142
+ ? define(["../../lib/codemirror"], i)
12143
+ : i(CodeMirror);
12144
+ },
12145
+ { "../../lib/codemirror": 13 },
12146
+ ],
12147
+ 13: [
12148
+ function (t, e, n) {
12149
+ var i, r;
12150
+ (i = this),
12151
+ (r = function () {
12152
+ "use strict";
12153
+ var t = navigator.userAgent,
12154
+ e = navigator.platform,
12155
+ n = /gecko\/\d/i.test(t),
12156
+ i = /MSIE \d/.test(t),
12157
+ r = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),
12158
+ o = /Edge\/(\d+)/.exec(t),
12159
+ s = i || r || o,
12160
+ a = s && (i ? document.documentMode || 6 : +(o || r)[1]),
12161
+ l = !o && /WebKit\//.test(t),
12162
+ c = l && /Qt\/\d+\.\d+/.test(t),
12163
+ h = !o && /Chrome\//.test(t),
12164
+ u = /Opera\//.test(t),
12165
+ f = /Apple Computer/.test(navigator.vendor),
12166
+ d = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),
12167
+ p = /PhantomJS/.test(t),
12168
+ g = f && (/Mobile\/\w+/.test(t) || navigator.maxTouchPoints > 2),
12169
+ m = /Android/.test(t),
12170
+ v =
12171
+ g ||
12172
+ m ||
12173
+ /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),
12174
+ _ = g || /Mac/.test(e),
12175
+ y = /\bCrOS\b/.test(t),
12176
+ x = /win/i.test(e),
12177
+ k = u && t.match(/Version\/(\d*\.\d*)/);
12178
+ k && (k = Number(k[1])), k && k >= 15 && ((u = !1), (l = !0));
12179
+ var b = _ && (c || (u && (null == k || k < 12.11))),
12180
+ T = n || (s && a >= 9);
12181
+ function C(t) {
12182
+ return new RegExp("(^|\\s)" + t + "(?:$|\\s)\\s*");
12183
+ }
12184
+ var w,
12185
+ E = function (t, e) {
12186
+ var n = t.className,
12187
+ i = C(e).exec(n);
12188
+ if (i) {
12189
+ var r = n.slice(i.index + i[0].length);
12190
+ t.className = n.slice(0, i.index) + (r ? i[1] + r : "");
12191
+ }
12192
+ };
12193
+ function S(t) {
12194
+ for (var e = t.childNodes.length; e > 0; --e)
12195
+ t.removeChild(t.firstChild);
12196
+ return t;
12197
+ }
12198
+ function A(t, e) {
12199
+ return S(t).appendChild(e);
12200
+ }
12201
+ function L(t, e, n, i) {
12202
+ var r = document.createElement(t);
12203
+ if (
12204
+ (n && (r.className = n),
12205
+ i && (r.style.cssText = i),
12206
+ "string" == typeof e)
12207
+ )
12208
+ r.appendChild(document.createTextNode(e));
12209
+ else if (e)
12210
+ for (var o = 0; o < e.length; ++o) r.appendChild(e[o]);
12211
+ return r;
12212
+ }
12213
+ function O(t, e, n, i) {
12214
+ var r = L(t, e, n, i);
12215
+ return r.setAttribute("role", "presentation"), r;
12216
+ }
12217
+ function N(t, e) {
12218
+ if ((3 == e.nodeType && (e = e.parentNode), t.contains))
12219
+ return t.contains(e);
12220
+ do {
12221
+ if ((11 == e.nodeType && (e = e.host), e == t)) return !0;
12222
+ } while ((e = e.parentNode));
12223
+ }
12224
+ function I() {
12225
+ var t;
12226
+ try {
12227
+ t = document.activeElement;
12228
+ } catch (e) {
12229
+ t = document.body || null;
12230
+ }
12231
+ for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
12232
+ t = t.shadowRoot.activeElement;
12233
+ return t;
12234
+ }
12235
+ function M(t, e) {
12236
+ var n = t.className;
12237
+ C(e).test(n) || (t.className += (n ? " " : "") + e);
12238
+ }
12239
+ function $(t, e) {
12240
+ for (var n = t.split(" "), i = 0; i < n.length; i++)
12241
+ n[i] && !C(n[i]).test(e) && (e += " " + n[i]);
12242
+ return e;
12243
+ }
12244
+ w = document.createRange
12245
+ ? function (t, e, n, i) {
12246
+ var r = document.createRange();
12247
+ return r.setEnd(i || t, n), r.setStart(t, e), r;
12248
+ }
12249
+ : function (t, e, n) {
12250
+ var i = document.body.createTextRange();
12251
+ try {
12252
+ i.moveToElementText(t.parentNode);
12253
+ } catch (t) {
12254
+ return i;
12255
+ }
12256
+ return (
12257
+ i.collapse(!0),
12258
+ i.moveEnd("character", n),
12259
+ i.moveStart("character", e),
12260
+ i
12261
+ );
12262
+ };
12263
+ var R = function (t) {
12264
+ t.select();
12265
+ };
12266
+ function D(t) {
12267
+ var e = Array.prototype.slice.call(arguments, 1);
12268
+ return function () {
12269
+ return t.apply(null, e);
12270
+ };
12271
+ }
12272
+ function P(t, e, n) {
12273
+ for (var i in (e || (e = {}), t))
12274
+ !t.hasOwnProperty(i) ||
12275
+ (!1 === n && e.hasOwnProperty(i)) ||
12276
+ (e[i] = t[i]);
12277
+ return e;
12278
+ }
12279
+ function F(t, e, n, i, r) {
12280
+ null == e &&
12281
+ -1 == (e = t.search(/[^\s\u00a0]/)) &&
12282
+ (e = t.length);
12283
+ for (var o = i || 0, s = r || 0; ; ) {
12284
+ var a = t.indexOf("\t", o);
12285
+ if (a < 0 || a >= e) return s + (e - o);
12286
+ (s += a - o), (s += n - (s % n)), (o = a + 1);
12287
+ }
12288
+ }
12289
+ g
12290
+ ? (R = function (t) {
12291
+ (t.selectionStart = 0), (t.selectionEnd = t.value.length);
12292
+ })
12293
+ : s &&
12294
+ (R = function (t) {
12295
+ try {
12296
+ t.select();
12297
+ } catch (t) {}
12298
+ });
12299
+ var B = function () {
12300
+ (this.id = null),
12301
+ (this.f = null),
12302
+ (this.time = 0),
12303
+ (this.handler = D(this.onTimeout, this));
12304
+ };
12305
+ function U(t, e) {
12306
+ for (var n = 0; n < t.length; ++n) if (t[n] == e) return n;
12307
+ return -1;
12308
+ }
12309
+ (B.prototype.onTimeout = function (t) {
12310
+ (t.id = 0),
12311
+ t.time <= +new Date()
12312
+ ? t.f()
12313
+ : setTimeout(t.handler, t.time - +new Date());
12314
+ }),
12315
+ (B.prototype.set = function (t, e) {
12316
+ this.f = e;
12317
+ var n = +new Date() + t;
12318
+ (!this.id || n < this.time) &&
12319
+ (clearTimeout(this.id),
12320
+ (this.id = setTimeout(this.handler, t)),
12321
+ (this.time = n));
12322
+ });
12323
+ var H = {
12324
+ toString: function () {
12325
+ return "CodeMirror.Pass";
12326
+ },
12327
+ },
12328
+ z = { scroll: !1 },
12329
+ W = { origin: "*mouse" },
12330
+ j = { origin: "+move" };
12331
+ function G(t, e, n) {
12332
+ for (var i = 0, r = 0; ; ) {
12333
+ var o = t.indexOf("\t", i);
12334
+ -1 == o && (o = t.length);
12335
+ var s = o - i;
12336
+ if (o == t.length || r + s >= e) return i + Math.min(s, e - r);
12337
+ if (((r += o - i), (i = o + 1), (r += n - (r % n)) >= e))
12338
+ return i;
12339
+ }
12340
+ }
12341
+ var q = [""];
12342
+ function V(t) {
12343
+ for (; q.length <= t; ) q.push(Y(q) + " ");
12344
+ return q[t];
12345
+ }
12346
+ function Y(t) {
12347
+ return t[t.length - 1];
12348
+ }
12349
+ function K(t, e) {
12350
+ for (var n = [], i = 0; i < t.length; i++) n[i] = e(t[i], i);
12351
+ return n;
12352
+ }
12353
+ function X() {}
12354
+ function Q(t, e) {
12355
+ var n;
12356
+ return (
12357
+ Object.create
12358
+ ? (n = Object.create(t))
12359
+ : ((X.prototype = t), (n = new X())),
12360
+ e && P(e, n),
12361
+ n
12362
+ );
12363
+ }
12364
+ var Z =
12365
+ /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
12366
+ function J(t) {
12367
+ return (
12368
+ /\w/.test(t) ||
12369
+ (t > "€" && (t.toUpperCase() != t.toLowerCase() || Z.test(t)))
12370
+ );
12371
+ }
12372
+ function tt(t, e) {
12373
+ return e
12374
+ ? !!(e.source.indexOf("\\w") > -1 && J(t)) || e.test(t)
12375
+ : J(t);
12376
+ }
12377
+ function et(t) {
12378
+ for (var e in t) if (t.hasOwnProperty(e) && t[e]) return !1;
12379
+ return !0;
12380
+ }
12381
+ var nt =
12382
+ /[\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]/;
12383
+ function it(t) {
12384
+ return t.charCodeAt(0) >= 768 && nt.test(t);
12385
+ }
12386
+ function rt(t, e, n) {
12387
+ for (; (n < 0 ? e > 0 : e < t.length) && it(t.charAt(e)); )
12388
+ e += n;
12389
+ return e;
12390
+ }
12391
+ function ot(t, e, n) {
12392
+ for (var i = e > n ? -1 : 1; ; ) {
12393
+ if (e == n) return e;
12394
+ var r = (e + n) / 2,
12395
+ o = i < 0 ? Math.ceil(r) : Math.floor(r);
12396
+ if (o == e) return t(o) ? e : n;
12397
+ t(o) ? (n = o) : (e = o + i);
12398
+ }
12399
+ }
12400
+ var st = null;
12401
+ function at(t, e, n) {
12402
+ var i;
12403
+ st = null;
12404
+ for (var r = 0; r < t.length; ++r) {
12405
+ var o = t[r];
12406
+ if (o.from < e && o.to > e) return r;
12407
+ o.to == e &&
12408
+ (o.from != o.to && "before" == n ? (i = r) : (st = r)),
12409
+ o.from == e &&
12410
+ (o.from != o.to && "before" != n ? (i = r) : (st = r));
12411
+ }
12412
+ return null != i ? i : st;
12413
+ }
12414
+ var lt = (function () {
12415
+ var t = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,
12416
+ e = /[stwN]/,
12417
+ n = /[LRr]/,
12418
+ i = /[Lb1n]/,
12419
+ r = /[1n]/;
12420
+ function o(t, e, n) {
12421
+ (this.level = t), (this.from = e), (this.to = n);
12422
+ }
12423
+ return function (s, a) {
12424
+ var l = "ltr" == a ? "L" : "R";
12425
+ if (0 == s.length || ("ltr" == a && !t.test(s))) return !1;
12426
+ for (var c, h = s.length, u = [], f = 0; f < h; ++f)
12427
+ u.push(
12428
+ (c = s.charCodeAt(f)) <= 247
12429
+ ? "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(
12430
+ c
12431
+ )
12432
+ : 1424 <= c && c <= 1524
12433
+ ? "R"
12434
+ : 1536 <= c && c <= 1785
12435
+ ? "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(
12436
+ c - 1536
12437
+ )
12438
+ : 1774 <= c && c <= 2220
12439
+ ? "r"
12440
+ : 8192 <= c && c <= 8203
12441
+ ? "w"
12442
+ : 8204 == c
12443
+ ? "b"
12444
+ : "L"
12445
+ );
12446
+ for (var d = 0, p = l; d < h; ++d) {
12447
+ var g = u[d];
12448
+ "m" == g ? (u[d] = p) : (p = g);
12449
+ }
12450
+ for (var m = 0, v = l; m < h; ++m) {
12451
+ var _ = u[m];
12452
+ "1" == _ && "r" == v
12453
+ ? (u[m] = "n")
12454
+ : n.test(_) && ((v = _), "r" == _ && (u[m] = "R"));
12455
+ }
12456
+ for (var y = 1, x = u[0]; y < h - 1; ++y) {
12457
+ var k = u[y];
12458
+ "+" == k && "1" == x && "1" == u[y + 1]
12459
+ ? (u[y] = "1")
12460
+ : "," != k ||
12461
+ x != u[y + 1] ||
12462
+ ("1" != x && "n" != x) ||
12463
+ (u[y] = x),
12464
+ (x = k);
12465
+ }
12466
+ for (var b = 0; b < h; ++b) {
12467
+ var T = u[b];
12468
+ if ("," == T) u[b] = "N";
12469
+ else if ("%" == T) {
12470
+ var C = void 0;
12471
+ for (C = b + 1; C < h && "%" == u[C]; ++C);
12472
+ for (
12473
+ var w =
12474
+ (b && "!" == u[b - 1]) || (C < h && "1" == u[C])
12475
+ ? "1"
12476
+ : "N",
12477
+ E = b;
12478
+ E < C;
12479
+ ++E
12480
+ )
12481
+ u[E] = w;
12482
+ b = C - 1;
12483
+ }
12484
+ }
12485
+ for (var S = 0, A = l; S < h; ++S) {
12486
+ var L = u[S];
12487
+ "L" == A && "1" == L ? (u[S] = "L") : n.test(L) && (A = L);
12488
+ }
12489
+ for (var O = 0; O < h; ++O)
12490
+ if (e.test(u[O])) {
12491
+ var N = void 0;
12492
+ for (N = O + 1; N < h && e.test(u[N]); ++N);
12493
+ for (
12494
+ var I = "L" == (O ? u[O - 1] : l),
12495
+ M =
12496
+ I == ("L" == (N < h ? u[N] : l))
12497
+ ? I
12498
+ ? "L"
12499
+ : "R"
12500
+ : l,
12501
+ $ = O;
12502
+ $ < N;
12503
+ ++$
12504
+ )
12505
+ u[$] = M;
12506
+ O = N - 1;
12507
+ }
12508
+ for (var R, D = [], P = 0; P < h; )
12509
+ if (i.test(u[P])) {
12510
+ var F = P;
12511
+ for (++P; P < h && i.test(u[P]); ++P);
12512
+ D.push(new o(0, F, P));
12513
+ } else {
12514
+ var B = P,
12515
+ U = D.length,
12516
+ H = "rtl" == a ? 1 : 0;
12517
+ for (++P; P < h && "L" != u[P]; ++P);
12518
+ for (var z = B; z < P; )
12519
+ if (r.test(u[z])) {
12520
+ B < z && (D.splice(U, 0, new o(1, B, z)), (U += H));
12521
+ var W = z;
12522
+ for (++z; z < P && r.test(u[z]); ++z);
12523
+ D.splice(U, 0, new o(2, W, z)), (U += H), (B = z);
12524
+ } else ++z;
12525
+ B < P && D.splice(U, 0, new o(1, B, P));
12526
+ }
12527
+ return (
12528
+ "ltr" == a &&
12529
+ (1 == D[0].level &&
12530
+ (R = s.match(/^\s+/)) &&
12531
+ ((D[0].from = R[0].length),
12532
+ D.unshift(new o(0, 0, R[0].length))),
12533
+ 1 == Y(D).level &&
12534
+ (R = s.match(/\s+$/)) &&
12535
+ ((Y(D).to -= R[0].length),
12536
+ D.push(new o(0, h - R[0].length, h)))),
12537
+ "rtl" == a ? D.reverse() : D
12538
+ );
12539
+ };
12540
+ })();
12541
+ function ct(t, e) {
12542
+ var n = t.order;
12543
+ return null == n && (n = t.order = lt(t.text, e)), n;
12544
+ }
12545
+ var ht = [],
12546
+ ut = function (t, e, n) {
12547
+ if (t.addEventListener) t.addEventListener(e, n, !1);
12548
+ else if (t.attachEvent) t.attachEvent("on" + e, n);
12549
+ else {
12550
+ var i = t._handlers || (t._handlers = {});
12551
+ i[e] = (i[e] || ht).concat(n);
12552
+ }
12553
+ };
12554
+ function ft(t, e) {
12555
+ return (t._handlers && t._handlers[e]) || ht;
12556
+ }
12557
+ function dt(t, e, n) {
12558
+ if (t.removeEventListener) t.removeEventListener(e, n, !1);
12559
+ else if (t.detachEvent) t.detachEvent("on" + e, n);
12560
+ else {
12561
+ var i = t._handlers,
12562
+ r = i && i[e];
12563
+ if (r) {
12564
+ var o = U(r, n);
12565
+ o > -1 && (i[e] = r.slice(0, o).concat(r.slice(o + 1)));
12566
+ }
12567
+ }
12568
+ }
12569
+ function pt(t, e) {
12570
+ var n = ft(t, e);
12571
+ if (n.length)
12572
+ for (
12573
+ var i = Array.prototype.slice.call(arguments, 2), r = 0;
12574
+ r < n.length;
12575
+ ++r
12576
+ )
12577
+ n[r].apply(null, i);
12578
+ }
12579
+ function gt(t, e, n) {
12580
+ return (
12581
+ "string" == typeof e &&
12582
+ (e = {
12583
+ type: e,
12584
+ preventDefault: function () {
12585
+ this.defaultPrevented = !0;
12586
+ },
12587
+ }),
12588
+ pt(t, n || e.type, t, e),
12589
+ kt(e) || e.codemirrorIgnore
12590
+ );
12591
+ }
12592
+ function mt(t) {
12593
+ var e = t._handlers && t._handlers.cursorActivity;
12594
+ if (e)
12595
+ for (
12596
+ var n =
12597
+ t.curOp.cursorActivityHandlers ||
12598
+ (t.curOp.cursorActivityHandlers = []),
12599
+ i = 0;
12600
+ i < e.length;
12601
+ ++i
12602
+ )
12603
+ -1 == U(n, e[i]) && n.push(e[i]);
12604
+ }
12605
+ function vt(t, e) {
12606
+ return ft(t, e).length > 0;
12607
+ }
12608
+ function _t(t) {
12609
+ (t.prototype.on = function (t, e) {
12610
+ ut(this, t, e);
12611
+ }),
12612
+ (t.prototype.off = function (t, e) {
12613
+ dt(this, t, e);
12614
+ });
12615
+ }
12616
+ function yt(t) {
12617
+ t.preventDefault ? t.preventDefault() : (t.returnValue = !1);
12618
+ }
12619
+ function xt(t) {
12620
+ t.stopPropagation ? t.stopPropagation() : (t.cancelBubble = !0);
12621
+ }
12622
+ function kt(t) {
12623
+ return null != t.defaultPrevented
12624
+ ? t.defaultPrevented
12625
+ : 0 == t.returnValue;
12626
+ }
12627
+ function bt(t) {
12628
+ yt(t), xt(t);
12629
+ }
12630
+ function Tt(t) {
12631
+ return t.target || t.srcElement;
12632
+ }
12633
+ function Ct(t) {
12634
+ var e = t.which;
12635
+ return (
12636
+ null == e &&
12637
+ (1 & t.button
12638
+ ? (e = 1)
12639
+ : 2 & t.button
12640
+ ? (e = 3)
12641
+ : 4 & t.button && (e = 2)),
12642
+ _ && t.ctrlKey && 1 == e && (e = 3),
12643
+ e
12644
+ );
12645
+ }
12646
+ var wt,
12647
+ Et,
12648
+ St = (function () {
12649
+ if (s && a < 9) return !1;
12650
+ var t = L("div");
12651
+ return "draggable" in t || "dragDrop" in t;
12652
+ })();
12653
+ function At(t) {
12654
+ if (null == wt) {
12655
+ var e = L("span", "​");
12656
+ A(t, L("span", [e, document.createTextNode("x")])),
12657
+ 0 != t.firstChild.offsetHeight &&
12658
+ (wt =
12659
+ e.offsetWidth <= 1 &&
12660
+ e.offsetHeight > 2 &&
12661
+ !(s && a < 8));
12662
+ }
12663
+ var n = wt
12664
+ ? L("span", "​")
12665
+ : L(
12666
+ "span",
12667
+ " ",
12668
+ null,
12669
+ "display: inline-block; width: 1px; margin-right: -1px"
12670
+ );
12671
+ return n.setAttribute("cm-text", ""), n;
12672
+ }
12673
+ function Lt(t) {
12674
+ if (null != Et) return Et;
12675
+ var e = A(t, document.createTextNode("AخA")),
12676
+ n = w(e, 0, 1).getBoundingClientRect(),
12677
+ i = w(e, 1, 2).getBoundingClientRect();
12678
+ return (
12679
+ S(t), !(!n || n.left == n.right) && (Et = i.right - n.right < 3)
12680
+ );
12681
+ }
12682
+ var Ot,
12683
+ Nt =
12684
+ 3 != "\n\nb".split(/\n/).length
12685
+ ? function (t) {
12686
+ for (var e = 0, n = [], i = t.length; e <= i; ) {
12687
+ var r = t.indexOf("\n", e);
12688
+ -1 == r && (r = t.length);
12689
+ var o = t.slice(e, "\r" == t.charAt(r - 1) ? r - 1 : r),
12690
+ s = o.indexOf("\r");
12691
+ -1 != s
12692
+ ? (n.push(o.slice(0, s)), (e += s + 1))
12693
+ : (n.push(o), (e = r + 1));
12694
+ }
12695
+ return n;
12696
+ }
12697
+ : function (t) {
12698
+ return t.split(/\r\n?|\n/);
12699
+ },
12700
+ It = window.getSelection
12701
+ ? function (t) {
12702
+ try {
12703
+ return t.selectionStart != t.selectionEnd;
12704
+ } catch (t) {
12705
+ return !1;
12706
+ }
12707
+ }
12708
+ : function (t) {
12709
+ var e;
12710
+ try {
12711
+ e = t.ownerDocument.selection.createRange();
12712
+ } catch (t) {}
12713
+ return (
12714
+ !(!e || e.parentElement() != t) &&
12715
+ 0 != e.compareEndPoints("StartToEnd", e)
12716
+ );
12717
+ },
12718
+ Mt =
12719
+ "oncopy" in (Ot = L("div")) ||
12720
+ (Ot.setAttribute("oncopy", "return;"),
12721
+ "function" == typeof Ot.oncopy),
12722
+ $t = null,
12723
+ Rt = {},
12724
+ Dt = {};
12725
+ function Pt(t, e) {
12726
+ arguments.length > 2 &&
12727
+ (e.dependencies = Array.prototype.slice.call(arguments, 2)),
12728
+ (Rt[t] = e);
12729
+ }
12730
+ function Ft(t) {
12731
+ if ("string" == typeof t && Dt.hasOwnProperty(t)) t = Dt[t];
12732
+ else if (
12733
+ t &&
12734
+ "string" == typeof t.name &&
12735
+ Dt.hasOwnProperty(t.name)
12736
+ ) {
12737
+ var e = Dt[t.name];
12738
+ "string" == typeof e && (e = { name: e }),
12739
+ ((t = Q(e, t)).name = e.name);
12740
+ } else {
12741
+ if ("string" == typeof t && /^[\w\-]+\/[\w\-]+\+xml$/.test(t))
12742
+ return Ft("application/xml");
12743
+ if ("string" == typeof t && /^[\w\-]+\/[\w\-]+\+json$/.test(t))
12744
+ return Ft("application/json");
12745
+ }
12746
+ return "string" == typeof t ? { name: t } : t || { name: "null" };
12747
+ }
12748
+ function Bt(t, e) {
12749
+ e = Ft(e);
12750
+ var n = Rt[e.name];
12751
+ if (!n) return Bt(t, "text/plain");
12752
+ var i = n(t, e);
12753
+ if (Ut.hasOwnProperty(e.name)) {
12754
+ var r = Ut[e.name];
12755
+ for (var o in r)
12756
+ r.hasOwnProperty(o) &&
12757
+ (i.hasOwnProperty(o) && (i["_" + o] = i[o]), (i[o] = r[o]));
12758
+ }
12759
+ if (
12760
+ ((i.name = e.name),
12761
+ e.helperType && (i.helperType = e.helperType),
12762
+ e.modeProps)
12763
+ )
12764
+ for (var s in e.modeProps) i[s] = e.modeProps[s];
12765
+ return i;
12766
+ }
12767
+ var Ut = {};
12768
+ function Ht(t, e) {
12769
+ P(e, Ut.hasOwnProperty(t) ? Ut[t] : (Ut[t] = {}));
12770
+ }
12771
+ function zt(t, e) {
12772
+ if (!0 === e) return e;
12773
+ if (t.copyState) return t.copyState(e);
12774
+ var n = {};
12775
+ for (var i in e) {
12776
+ var r = e[i];
12777
+ r instanceof Array && (r = r.concat([])), (n[i] = r);
12778
+ }
12779
+ return n;
12780
+ }
12781
+ function Wt(t, e) {
12782
+ for (var n; t.innerMode && (n = t.innerMode(e)) && n.mode != t; )
12783
+ (e = n.state), (t = n.mode);
12784
+ return n || { mode: t, state: e };
12785
+ }
12786
+ function jt(t, e, n) {
12787
+ return !t.startState || t.startState(e, n);
12788
+ }
12789
+ var Gt = function (t, e, n) {
12790
+ (this.pos = this.start = 0),
12791
+ (this.string = t),
12792
+ (this.tabSize = e || 8),
12793
+ (this.lastColumnPos = this.lastColumnValue = 0),
12794
+ (this.lineStart = 0),
12795
+ (this.lineOracle = n);
12796
+ };
12797
+ function qt(t, e) {
12798
+ if ((e -= t.first) < 0 || e >= t.size)
12799
+ throw new Error(
12800
+ "There is no line " + (e + t.first) + " in the document."
12801
+ );
12802
+ for (var n = t; !n.lines; )
12803
+ for (var i = 0; ; ++i) {
12804
+ var r = n.children[i],
12805
+ o = r.chunkSize();
12806
+ if (e < o) {
12807
+ n = r;
12808
+ break;
12809
+ }
12810
+ e -= o;
12811
+ }
12812
+ return n.lines[e];
12813
+ }
12814
+ function Vt(t, e, n) {
12815
+ var i = [],
12816
+ r = e.line;
12817
+ return (
12818
+ t.iter(e.line, n.line + 1, function (t) {
12819
+ var o = t.text;
12820
+ r == n.line && (o = o.slice(0, n.ch)),
12821
+ r == e.line && (o = o.slice(e.ch)),
12822
+ i.push(o),
12823
+ ++r;
12824
+ }),
12825
+ i
12826
+ );
12827
+ }
12828
+ function Yt(t, e, n) {
12829
+ var i = [];
12830
+ return (
12831
+ t.iter(e, n, function (t) {
12832
+ i.push(t.text);
12833
+ }),
12834
+ i
12835
+ );
12836
+ }
12837
+ function Kt(t, e) {
12838
+ var n = e - t.height;
12839
+ if (n) for (var i = t; i; i = i.parent) i.height += n;
12840
+ }
12841
+ function Xt(t) {
12842
+ if (null == t.parent) return null;
12843
+ for (
12844
+ var e = t.parent, n = U(e.lines, t), i = e.parent;
12845
+ i;
12846
+ e = i, i = i.parent
12847
+ )
12848
+ for (var r = 0; i.children[r] != e; ++r)
12849
+ n += i.children[r].chunkSize();
12850
+ return n + e.first;
12851
+ }
12852
+ function Qt(t, e) {
12853
+ var n = t.first;
12854
+ t: do {
12855
+ for (var i = 0; i < t.children.length; ++i) {
12856
+ var r = t.children[i],
12857
+ o = r.height;
12858
+ if (e < o) {
12859
+ t = r;
12860
+ continue t;
12861
+ }
12862
+ (e -= o), (n += r.chunkSize());
12863
+ }
12864
+ return n;
12865
+ } while (!t.lines);
12866
+ for (var s = 0; s < t.lines.length; ++s) {
12867
+ var a = t.lines[s].height;
12868
+ if (e < a) break;
12869
+ e -= a;
12870
+ }
12871
+ return n + s;
12872
+ }
12873
+ function Zt(t, e) {
12874
+ return e >= t.first && e < t.first + t.size;
12875
+ }
12876
+ function Jt(t, e) {
12877
+ return String(t.lineNumberFormatter(e + t.firstLineNumber));
12878
+ }
12879
+ function te(t, e, n) {
12880
+ if ((void 0 === n && (n = null), !(this instanceof te)))
12881
+ return new te(t, e, n);
12882
+ (this.line = t), (this.ch = e), (this.sticky = n);
12883
+ }
12884
+ function ee(t, e) {
12885
+ return t.line - e.line || t.ch - e.ch;
12886
+ }
12887
+ function ne(t, e) {
12888
+ return t.sticky == e.sticky && 0 == ee(t, e);
12889
+ }
12890
+ function ie(t) {
12891
+ return te(t.line, t.ch);
12892
+ }
12893
+ function re(t, e) {
12894
+ return ee(t, e) < 0 ? e : t;
12895
+ }
12896
+ function oe(t, e) {
12897
+ return ee(t, e) < 0 ? t : e;
12898
+ }
12899
+ function se(t, e) {
12900
+ return Math.max(t.first, Math.min(e, t.first + t.size - 1));
12901
+ }
12902
+ function ae(t, e) {
12903
+ if (e.line < t.first) return te(t.first, 0);
12904
+ var n = t.first + t.size - 1;
12905
+ return e.line > n
12906
+ ? te(n, qt(t, n).text.length)
12907
+ : (function (t, e) {
12908
+ var n = t.ch;
12909
+ return null == n || n > e
12910
+ ? te(t.line, e)
12911
+ : n < 0
12912
+ ? te(t.line, 0)
12913
+ : t;
12914
+ })(e, qt(t, e.line).text.length);
12915
+ }
12916
+ function le(t, e) {
12917
+ for (var n = [], i = 0; i < e.length; i++) n[i] = ae(t, e[i]);
12918
+ return n;
12919
+ }
12920
+ (Gt.prototype.eol = function () {
12921
+ return this.pos >= this.string.length;
12922
+ }),
12923
+ (Gt.prototype.sol = function () {
12924
+ return this.pos == this.lineStart;
12925
+ }),
12926
+ (Gt.prototype.peek = function () {
12927
+ return this.string.charAt(this.pos) || void 0;
12928
+ }),
12929
+ (Gt.prototype.next = function () {
12930
+ if (this.pos < this.string.length)
12931
+ return this.string.charAt(this.pos++);
12932
+ }),
12933
+ (Gt.prototype.eat = function (t) {
12934
+ var e = this.string.charAt(this.pos);
12935
+ if (
12936
+ "string" == typeof t
12937
+ ? e == t
12938
+ : e && (t.test ? t.test(e) : t(e))
12939
+ )
12940
+ return ++this.pos, e;
12941
+ }),
12942
+ (Gt.prototype.eatWhile = function (t) {
12943
+ for (var e = this.pos; this.eat(t); );
12944
+ return this.pos > e;
12945
+ }),
12946
+ (Gt.prototype.eatSpace = function () {
12947
+ for (
12948
+ var t = this.pos;
12949
+ /[\s\u00a0]/.test(this.string.charAt(this.pos));
12950
+
12951
+ )
12952
+ ++this.pos;
12953
+ return this.pos > t;
12954
+ }),
12955
+ (Gt.prototype.skipToEnd = function () {
12956
+ this.pos = this.string.length;
12957
+ }),
12958
+ (Gt.prototype.skipTo = function (t) {
12959
+ var e = this.string.indexOf(t, this.pos);
12960
+ if (e > -1) return (this.pos = e), !0;
12961
+ }),
12962
+ (Gt.prototype.backUp = function (t) {
12963
+ this.pos -= t;
12964
+ }),
12965
+ (Gt.prototype.column = function () {
12966
+ return (
12967
+ this.lastColumnPos < this.start &&
12968
+ ((this.lastColumnValue = F(
12969
+ this.string,
12970
+ this.start,
12971
+ this.tabSize,
12972
+ this.lastColumnPos,
12973
+ this.lastColumnValue
12974
+ )),
12975
+ (this.lastColumnPos = this.start)),
12976
+ this.lastColumnValue -
12977
+ (this.lineStart
12978
+ ? F(this.string, this.lineStart, this.tabSize)
12979
+ : 0)
12980
+ );
12981
+ }),
12982
+ (Gt.prototype.indentation = function () {
12983
+ return (
12984
+ F(this.string, null, this.tabSize) -
12985
+ (this.lineStart
12986
+ ? F(this.string, this.lineStart, this.tabSize)
12987
+ : 0)
12988
+ );
12989
+ }),
12990
+ (Gt.prototype.match = function (t, e, n) {
12991
+ if ("string" != typeof t) {
12992
+ var i = this.string.slice(this.pos).match(t);
12993
+ return i && i.index > 0
12994
+ ? null
12995
+ : (i && !1 !== e && (this.pos += i[0].length), i);
12996
+ }
12997
+ var r = function (t) {
12998
+ return n ? t.toLowerCase() : t;
12999
+ };
13000
+ if (r(this.string.substr(this.pos, t.length)) == r(t))
13001
+ return !1 !== e && (this.pos += t.length), !0;
13002
+ }),
13003
+ (Gt.prototype.current = function () {
13004
+ return this.string.slice(this.start, this.pos);
13005
+ }),
13006
+ (Gt.prototype.hideFirstChars = function (t, e) {
13007
+ this.lineStart += t;
13008
+ try {
13009
+ return e();
13010
+ } finally {
13011
+ this.lineStart -= t;
13012
+ }
13013
+ }),
13014
+ (Gt.prototype.lookAhead = function (t) {
13015
+ var e = this.lineOracle;
13016
+ return e && e.lookAhead(t);
13017
+ }),
13018
+ (Gt.prototype.baseToken = function () {
13019
+ var t = this.lineOracle;
13020
+ return t && t.baseToken(this.pos);
13021
+ });
13022
+ var ce = function (t, e) {
13023
+ (this.state = t), (this.lookAhead = e);
13024
+ },
13025
+ he = function (t, e, n, i) {
13026
+ (this.state = e),
13027
+ (this.doc = t),
13028
+ (this.line = n),
13029
+ (this.maxLookAhead = i || 0),
13030
+ (this.baseTokens = null),
13031
+ (this.baseTokenPos = 1);
13032
+ };
13033
+ function ue(t, e, n, i) {
13034
+ var r = [t.state.modeGen],
13035
+ o = {};
13036
+ xe(
13037
+ t,
13038
+ e.text,
13039
+ t.doc.mode,
13040
+ n,
13041
+ function (t, e) {
13042
+ return r.push(t, e);
13043
+ },
13044
+ o,
13045
+ i
13046
+ );
13047
+ for (
13048
+ var s = n.state,
13049
+ a = function (i) {
13050
+ n.baseTokens = r;
13051
+ var a = t.state.overlays[i],
13052
+ l = 1,
13053
+ c = 0;
13054
+ (n.state = !0),
13055
+ xe(
13056
+ t,
13057
+ e.text,
13058
+ a.mode,
13059
+ n,
13060
+ function (t, e) {
13061
+ for (var n = l; c < t; ) {
13062
+ var i = r[l];
13063
+ i > t && r.splice(l, 1, t, r[l + 1], i),
13064
+ (l += 2),
13065
+ (c = Math.min(t, i));
13066
+ }
13067
+ if (e)
13068
+ if (a.opaque)
13069
+ r.splice(n, l - n, t, "overlay " + e),
13070
+ (l = n + 2);
13071
+ else
13072
+ for (; n < l; n += 2) {
13073
+ var o = r[n + 1];
13074
+ r[n + 1] = (o ? o + " " : "") + "overlay " + e;
13075
+ }
13076
+ },
13077
+ o
13078
+ ),
13079
+ (n.state = s),
13080
+ (n.baseTokens = null),
13081
+ (n.baseTokenPos = 1);
13082
+ },
13083
+ l = 0;
13084
+ l < t.state.overlays.length;
13085
+ ++l
13086
+ )
13087
+ a(l);
13088
+ return {
13089
+ styles: r,
13090
+ classes: o.bgClass || o.textClass ? o : null,
13091
+ };
13092
+ }
13093
+ function fe(t, e, n) {
13094
+ if (!e.styles || e.styles[0] != t.state.modeGen) {
13095
+ var i = de(t, Xt(e)),
13096
+ r =
13097
+ e.text.length > t.options.maxHighlightLength &&
13098
+ zt(t.doc.mode, i.state),
13099
+ o = ue(t, e, i);
13100
+ r && (i.state = r),
13101
+ (e.stateAfter = i.save(!r)),
13102
+ (e.styles = o.styles),
13103
+ o.classes
13104
+ ? (e.styleClasses = o.classes)
13105
+ : e.styleClasses && (e.styleClasses = null),
13106
+ n === t.doc.highlightFrontier &&
13107
+ (t.doc.modeFrontier = Math.max(
13108
+ t.doc.modeFrontier,
13109
+ ++t.doc.highlightFrontier
13110
+ ));
13111
+ }
13112
+ return e.styles;
13113
+ }
13114
+ function de(t, e, n) {
13115
+ var i = t.doc,
13116
+ r = t.display;
13117
+ if (!i.mode.startState) return new he(i, !0, e);
13118
+ var o = (function (t, e, n) {
13119
+ for (
13120
+ var i,
13121
+ r,
13122
+ o = t.doc,
13123
+ s = n ? -1 : e - (t.doc.mode.innerMode ? 1e3 : 100),
13124
+ a = e;
13125
+ a > s;
13126
+ --a
13127
+ ) {
13128
+ if (a <= o.first) return o.first;
13129
+ var l = qt(o, a - 1),
13130
+ c = l.stateAfter;
13131
+ if (
13132
+ c &&
13133
+ (!n ||
13134
+ a + (c instanceof ce ? c.lookAhead : 0) <=
13135
+ o.modeFrontier)
13136
+ )
13137
+ return a;
13138
+ var h = F(l.text, null, t.options.tabSize);
13139
+ (null == r || i > h) && ((r = a - 1), (i = h));
13140
+ }
13141
+ return r;
13142
+ })(t, e, n),
13143
+ s = o > i.first && qt(i, o - 1).stateAfter,
13144
+ a = s ? he.fromSaved(i, s, o) : new he(i, jt(i.mode), o);
13145
+ return (
13146
+ i.iter(o, e, function (n) {
13147
+ pe(t, n.text, a);
13148
+ var i = a.line;
13149
+ (n.stateAfter =
13150
+ i == e - 1 ||
13151
+ i % 5 == 0 ||
13152
+ (i >= r.viewFrom && i < r.viewTo)
13153
+ ? a.save()
13154
+ : null),
13155
+ a.nextLine();
13156
+ }),
13157
+ n && (i.modeFrontier = a.line),
13158
+ a
13159
+ );
13160
+ }
13161
+ function pe(t, e, n, i) {
13162
+ var r = t.doc.mode,
13163
+ o = new Gt(e, t.options.tabSize, n);
13164
+ for (
13165
+ o.start = o.pos = i || 0, "" == e && ge(r, n.state);
13166
+ !o.eol();
13167
+
13168
+ )
13169
+ me(r, o, n.state), (o.start = o.pos);
13170
+ }
13171
+ function ge(t, e) {
13172
+ if (t.blankLine) return t.blankLine(e);
13173
+ if (t.innerMode) {
13174
+ var n = Wt(t, e);
13175
+ return n.mode.blankLine ? n.mode.blankLine(n.state) : void 0;
13176
+ }
13177
+ }
13178
+ function me(t, e, n, i) {
13179
+ for (var r = 0; r < 10; r++) {
13180
+ i && (i[0] = Wt(t, n).mode);
13181
+ var o = t.token(e, n);
13182
+ if (e.pos > e.start) return o;
13183
+ }
13184
+ throw new Error("Mode " + t.name + " failed to advance stream.");
13185
+ }
13186
+ (he.prototype.lookAhead = function (t) {
13187
+ var e = this.doc.getLine(this.line + t);
13188
+ return (
13189
+ null != e && t > this.maxLookAhead && (this.maxLookAhead = t), e
13190
+ );
13191
+ }),
13192
+ (he.prototype.baseToken = function (t) {
13193
+ if (!this.baseTokens) return null;
13194
+ for (; this.baseTokens[this.baseTokenPos] <= t; )
13195
+ this.baseTokenPos += 2;
13196
+ var e = this.baseTokens[this.baseTokenPos + 1];
13197
+ return {
13198
+ type: e && e.replace(/( |^)overlay .*/, ""),
13199
+ size: this.baseTokens[this.baseTokenPos] - t,
13200
+ };
13201
+ }),
13202
+ (he.prototype.nextLine = function () {
13203
+ this.line++, this.maxLookAhead > 0 && this.maxLookAhead--;
13204
+ }),
13205
+ (he.fromSaved = function (t, e, n) {
13206
+ return e instanceof ce
13207
+ ? new he(t, zt(t.mode, e.state), n, e.lookAhead)
13208
+ : new he(t, zt(t.mode, e), n);
13209
+ }),
13210
+ (he.prototype.save = function (t) {
13211
+ var e = !1 !== t ? zt(this.doc.mode, this.state) : this.state;
13212
+ return this.maxLookAhead > 0 ? new ce(e, this.maxLookAhead) : e;
13213
+ });
13214
+ var ve = function (t, e, n) {
13215
+ (this.start = t.start),
13216
+ (this.end = t.pos),
13217
+ (this.string = t.current()),
13218
+ (this.type = e || null),
13219
+ (this.state = n);
13220
+ };
13221
+ function _e(t, e, n, i) {
13222
+ var r,
13223
+ o,
13224
+ s = t.doc,
13225
+ a = s.mode,
13226
+ l = qt(s, (e = ae(s, e)).line),
13227
+ c = de(t, e.line, n),
13228
+ h = new Gt(l.text, t.options.tabSize, c);
13229
+ for (i && (o = []); (i || h.pos < e.ch) && !h.eol(); )
13230
+ (h.start = h.pos),
13231
+ (r = me(a, h, c.state)),
13232
+ i && o.push(new ve(h, r, zt(s.mode, c.state)));
13233
+ return i ? o : new ve(h, r, c.state);
13234
+ }
13235
+ function ye(t, e) {
13236
+ if (t)
13237
+ for (;;) {
13238
+ var n = t.match(/(?:^|\s+)line-(background-)?(\S+)/);
13239
+ if (!n) break;
13240
+ t = t.slice(0, n.index) + t.slice(n.index + n[0].length);
13241
+ var i = n[1] ? "bgClass" : "textClass";
13242
+ null == e[i]
13243
+ ? (e[i] = n[2])
13244
+ : new RegExp("(?:^|\\s)" + n[2] + "(?:$|\\s)").test(e[i]) ||
13245
+ (e[i] += " " + n[2]);
13246
+ }
13247
+ return t;
13248
+ }
13249
+ function xe(t, e, n, i, r, o, s) {
13250
+ var a = n.flattenSpans;
13251
+ null == a && (a = t.options.flattenSpans);
13252
+ var l,
13253
+ c = 0,
13254
+ h = null,
13255
+ u = new Gt(e, t.options.tabSize, i),
13256
+ f = t.options.addModeClass && [null];
13257
+ for ("" == e && ye(ge(n, i.state), o); !u.eol(); ) {
13258
+ if (
13259
+ (u.pos > t.options.maxHighlightLength
13260
+ ? ((a = !1),
13261
+ s && pe(t, e, i, u.pos),
13262
+ (u.pos = e.length),
13263
+ (l = null))
13264
+ : (l = ye(me(n, u, i.state, f), o)),
13265
+ f)
13266
+ ) {
13267
+ var d = f[0].name;
13268
+ d && (l = "m-" + (l ? d + " " + l : d));
13269
+ }
13270
+ if (!a || h != l) {
13271
+ for (; c < u.start; ) r((c = Math.min(u.start, c + 5e3)), h);
13272
+ h = l;
13273
+ }
13274
+ u.start = u.pos;
13275
+ }
13276
+ for (; c < u.pos; ) {
13277
+ var p = Math.min(u.pos, c + 5e3);
13278
+ r(p, h), (c = p);
13279
+ }
13280
+ }
13281
+ var ke = !1,
13282
+ be = !1;
13283
+ function Te(t, e, n) {
13284
+ (this.marker = t), (this.from = e), (this.to = n);
13285
+ }
13286
+ function Ce(t, e) {
13287
+ if (t)
13288
+ for (var n = 0; n < t.length; ++n) {
13289
+ var i = t[n];
13290
+ if (i.marker == e) return i;
13291
+ }
13292
+ }
13293
+ function we(t, e) {
13294
+ for (var n, i = 0; i < t.length; ++i)
13295
+ t[i] != e && (n || (n = [])).push(t[i]);
13296
+ return n;
13297
+ }
13298
+ function Ee(t, e) {
13299
+ if (e.full) return null;
13300
+ var n = Zt(t, e.from.line) && qt(t, e.from.line).markedSpans,
13301
+ i = Zt(t, e.to.line) && qt(t, e.to.line).markedSpans;
13302
+ if (!n && !i) return null;
13303
+ var r = e.from.ch,
13304
+ o = e.to.ch,
13305
+ s = 0 == ee(e.from, e.to),
13306
+ a = (function (t, e, n) {
13307
+ var i;
13308
+ if (t)
13309
+ for (var r = 0; r < t.length; ++r) {
13310
+ var o = t[r],
13311
+ s = o.marker;
13312
+ if (
13313
+ null == o.from ||
13314
+ (s.inclusiveLeft ? o.from <= e : o.from < e) ||
13315
+ (o.from == e &&
13316
+ "bookmark" == s.type &&
13317
+ (!n || !o.marker.insertLeft))
13318
+ ) {
13319
+ var a =
13320
+ null == o.to ||
13321
+ (s.inclusiveRight ? o.to >= e : o.to > e);
13322
+ (i || (i = [])).push(
13323
+ new Te(s, o.from, a ? null : o.to)
13324
+ );
13325
+ }
13326
+ }
13327
+ return i;
13328
+ })(n, r, s),
13329
+ l = (function (t, e, n) {
13330
+ var i;
13331
+ if (t)
13332
+ for (var r = 0; r < t.length; ++r) {
13333
+ var o = t[r],
13334
+ s = o.marker;
13335
+ if (
13336
+ null == o.to ||
13337
+ (s.inclusiveRight ? o.to >= e : o.to > e) ||
13338
+ (o.from == e &&
13339
+ "bookmark" == s.type &&
13340
+ (!n || o.marker.insertLeft))
13341
+ ) {
13342
+ var a =
13343
+ null == o.from ||
13344
+ (s.inclusiveLeft ? o.from <= e : o.from < e);
13345
+ (i || (i = [])).push(
13346
+ new Te(
13347
+ s,
13348
+ a ? null : o.from - e,
13349
+ null == o.to ? null : o.to - e
13350
+ )
13351
+ );
13352
+ }
13353
+ }
13354
+ return i;
13355
+ })(i, o, s),
13356
+ c = 1 == e.text.length,
13357
+ h = Y(e.text).length + (c ? r : 0);
13358
+ if (a)
13359
+ for (var u = 0; u < a.length; ++u) {
13360
+ var f = a[u];
13361
+ if (null == f.to) {
13362
+ var d = Ce(l, f.marker);
13363
+ d
13364
+ ? c && (f.to = null == d.to ? null : d.to + h)
13365
+ : (f.to = r);
13366
+ }
13367
+ }
13368
+ if (l)
13369
+ for (var p = 0; p < l.length; ++p) {
13370
+ var g = l[p];
13371
+ null != g.to && (g.to += h),
13372
+ null == g.from
13373
+ ? Ce(a, g.marker) ||
13374
+ ((g.from = h), c && (a || (a = [])).push(g))
13375
+ : ((g.from += h), c && (a || (a = [])).push(g));
13376
+ }
13377
+ a && (a = Se(a)), l && l != a && (l = Se(l));
13378
+ var m = [a];
13379
+ if (!c) {
13380
+ var v,
13381
+ _ = e.text.length - 2;
13382
+ if (_ > 0 && a)
13383
+ for (var y = 0; y < a.length; ++y)
13384
+ null == a[y].to &&
13385
+ (v || (v = [])).push(new Te(a[y].marker, null, null));
13386
+ for (var x = 0; x < _; ++x) m.push(v);
13387
+ m.push(l);
13388
+ }
13389
+ return m;
13390
+ }
13391
+ function Se(t) {
13392
+ for (var e = 0; e < t.length; ++e) {
13393
+ var n = t[e];
13394
+ null != n.from &&
13395
+ n.from == n.to &&
13396
+ !1 !== n.marker.clearWhenEmpty &&
13397
+ t.splice(e--, 1);
13398
+ }
13399
+ return t.length ? t : null;
13400
+ }
13401
+ function Ae(t) {
13402
+ var e = t.markedSpans;
13403
+ if (e) {
13404
+ for (var n = 0; n < e.length; ++n) e[n].marker.detachLine(t);
13405
+ t.markedSpans = null;
13406
+ }
13407
+ }
13408
+ function Le(t, e) {
13409
+ if (e) {
13410
+ for (var n = 0; n < e.length; ++n) e[n].marker.attachLine(t);
13411
+ t.markedSpans = e;
13412
+ }
13413
+ }
13414
+ function Oe(t) {
13415
+ return t.inclusiveLeft ? -1 : 0;
13416
+ }
13417
+ function Ne(t) {
13418
+ return t.inclusiveRight ? 1 : 0;
13419
+ }
13420
+ function Ie(t, e) {
13421
+ var n = t.lines.length - e.lines.length;
13422
+ if (0 != n) return n;
13423
+ var i = t.find(),
13424
+ r = e.find(),
13425
+ o = ee(i.from, r.from) || Oe(t) - Oe(e);
13426
+ if (o) return -o;
13427
+ var s = ee(i.to, r.to) || Ne(t) - Ne(e);
13428
+ return s || e.id - t.id;
13429
+ }
13430
+ function Me(t, e) {
13431
+ var n,
13432
+ i = be && t.markedSpans;
13433
+ if (i)
13434
+ for (var r = void 0, o = 0; o < i.length; ++o)
13435
+ (r = i[o]).marker.collapsed &&
13436
+ null == (e ? r.from : r.to) &&
13437
+ (!n || Ie(n, r.marker) < 0) &&
13438
+ (n = r.marker);
13439
+ return n;
13440
+ }
13441
+ function $e(t) {
13442
+ return Me(t, !0);
13443
+ }
13444
+ function Re(t) {
13445
+ return Me(t, !1);
13446
+ }
13447
+ function De(t, e) {
13448
+ var n,
13449
+ i = be && t.markedSpans;
13450
+ if (i)
13451
+ for (var r = 0; r < i.length; ++r) {
13452
+ var o = i[r];
13453
+ o.marker.collapsed &&
13454
+ (null == o.from || o.from < e) &&
13455
+ (null == o.to || o.to > e) &&
13456
+ (!n || Ie(n, o.marker) < 0) &&
13457
+ (n = o.marker);
13458
+ }
13459
+ return n;
13460
+ }
13461
+ function Pe(t, e, n, i, r) {
13462
+ var o = qt(t, e),
13463
+ s = be && o.markedSpans;
13464
+ if (s)
13465
+ for (var a = 0; a < s.length; ++a) {
13466
+ var l = s[a];
13467
+ if (l.marker.collapsed) {
13468
+ var c = l.marker.find(0),
13469
+ h = ee(c.from, n) || Oe(l.marker) - Oe(r),
13470
+ u = ee(c.to, i) || Ne(l.marker) - Ne(r);
13471
+ if (
13472
+ !((h >= 0 && u <= 0) || (h <= 0 && u >= 0)) &&
13473
+ ((h <= 0 &&
13474
+ (l.marker.inclusiveRight && r.inclusiveLeft
13475
+ ? ee(c.to, n) >= 0
13476
+ : ee(c.to, n) > 0)) ||
13477
+ (h >= 0 &&
13478
+ (l.marker.inclusiveRight && r.inclusiveLeft
13479
+ ? ee(c.from, i) <= 0
13480
+ : ee(c.from, i) < 0)))
13481
+ )
13482
+ return !0;
13483
+ }
13484
+ }
13485
+ }
13486
+ function Fe(t) {
13487
+ for (var e; (e = $e(t)); ) t = e.find(-1, !0).line;
13488
+ return t;
13489
+ }
13490
+ function Be(t, e) {
13491
+ var n = qt(t, e),
13492
+ i = Fe(n);
13493
+ return n == i ? e : Xt(i);
13494
+ }
13495
+ function Ue(t, e) {
13496
+ if (e > t.lastLine()) return e;
13497
+ var n,
13498
+ i = qt(t, e);
13499
+ if (!He(t, i)) return e;
13500
+ for (; (n = Re(i)); ) i = n.find(1, !0).line;
13501
+ return Xt(i) + 1;
13502
+ }
13503
+ function He(t, e) {
13504
+ var n = be && e.markedSpans;
13505
+ if (n)
13506
+ for (var i = void 0, r = 0; r < n.length; ++r)
13507
+ if ((i = n[r]).marker.collapsed) {
13508
+ if (null == i.from) return !0;
13509
+ if (
13510
+ !i.marker.widgetNode &&
13511
+ 0 == i.from &&
13512
+ i.marker.inclusiveLeft &&
13513
+ ze(t, e, i)
13514
+ )
13515
+ return !0;
13516
+ }
13517
+ }
13518
+ function ze(t, e, n) {
13519
+ if (null == n.to) {
13520
+ var i = n.marker.find(1, !0);
13521
+ return ze(t, i.line, Ce(i.line.markedSpans, n.marker));
13522
+ }
13523
+ if (n.marker.inclusiveRight && n.to == e.text.length) return !0;
13524
+ for (var r = void 0, o = 0; o < e.markedSpans.length; ++o)
13525
+ if (
13526
+ (r = e.markedSpans[o]).marker.collapsed &&
13527
+ !r.marker.widgetNode &&
13528
+ r.from == n.to &&
13529
+ (null == r.to || r.to != n.from) &&
13530
+ (r.marker.inclusiveLeft || n.marker.inclusiveRight) &&
13531
+ ze(t, e, r)
13532
+ )
13533
+ return !0;
13534
+ }
13535
+ function We(t) {
13536
+ for (
13537
+ var e = 0, n = (t = Fe(t)).parent, i = 0;
13538
+ i < n.lines.length;
13539
+ ++i
13540
+ ) {
13541
+ var r = n.lines[i];
13542
+ if (r == t) break;
13543
+ e += r.height;
13544
+ }
13545
+ for (var o = n.parent; o; o = (n = o).parent)
13546
+ for (var s = 0; s < o.children.length; ++s) {
13547
+ var a = o.children[s];
13548
+ if (a == n) break;
13549
+ e += a.height;
13550
+ }
13551
+ return e;
13552
+ }
13553
+ function je(t) {
13554
+ if (0 == t.height) return 0;
13555
+ for (var e, n = t.text.length, i = t; (e = $e(i)); ) {
13556
+ var r = e.find(0, !0);
13557
+ (i = r.from.line), (n += r.from.ch - r.to.ch);
13558
+ }
13559
+ for (i = t; (e = Re(i)); ) {
13560
+ var o = e.find(0, !0);
13561
+ (n -= i.text.length - o.from.ch),
13562
+ (n += (i = o.to.line).text.length - o.to.ch);
13563
+ }
13564
+ return n;
13565
+ }
13566
+ function Ge(t) {
13567
+ var e = t.display,
13568
+ n = t.doc;
13569
+ (e.maxLine = qt(n, n.first)),
13570
+ (e.maxLineLength = je(e.maxLine)),
13571
+ (e.maxLineChanged = !0),
13572
+ n.iter(function (t) {
13573
+ var n = je(t);
13574
+ n > e.maxLineLength &&
13575
+ ((e.maxLineLength = n), (e.maxLine = t));
13576
+ });
13577
+ }
13578
+ var qe = function (t, e, n) {
13579
+ (this.text = t), Le(this, e), (this.height = n ? n(this) : 1);
13580
+ };
13581
+ function Ve(t) {
13582
+ (t.parent = null), Ae(t);
13583
+ }
13584
+ (qe.prototype.lineNo = function () {
13585
+ return Xt(this);
13586
+ }),
13587
+ _t(qe);
13588
+ var Ye = {},
13589
+ Ke = {};
13590
+ function Xe(t, e) {
13591
+ if (!t || /^\s*$/.test(t)) return null;
13592
+ var n = e.addModeClass ? Ke : Ye;
13593
+ return n[t] || (n[t] = t.replace(/\S+/g, "cm-$&"));
13594
+ }
13595
+ function Qe(t, e) {
13596
+ var n = O("span", null, null, l ? "padding-right: .1px" : null),
13597
+ i = {
13598
+ pre: O("pre", [n], "CodeMirror-line"),
13599
+ content: n,
13600
+ col: 0,
13601
+ pos: 0,
13602
+ cm: t,
13603
+ trailingSpace: !1,
13604
+ splitSpaces: t.getOption("lineWrapping"),
13605
+ };
13606
+ e.measure = {};
13607
+ for (var r = 0; r <= (e.rest ? e.rest.length : 0); r++) {
13608
+ var o = r ? e.rest[r - 1] : e.line,
13609
+ s = void 0;
13610
+ (i.pos = 0),
13611
+ (i.addToken = Je),
13612
+ Lt(t.display.measure) &&
13613
+ (s = ct(o, t.doc.direction)) &&
13614
+ (i.addToken = tn(i.addToken, s)),
13615
+ (i.map = []),
13616
+ nn(o, i, fe(t, o, e != t.display.externalMeasured && Xt(o))),
13617
+ o.styleClasses &&
13618
+ (o.styleClasses.bgClass &&
13619
+ (i.bgClass = $(o.styleClasses.bgClass, i.bgClass || "")),
13620
+ o.styleClasses.textClass &&
13621
+ (i.textClass = $(
13622
+ o.styleClasses.textClass,
13623
+ i.textClass || ""
13624
+ ))),
13625
+ 0 == i.map.length &&
13626
+ i.map.push(
13627
+ 0,
13628
+ 0,
13629
+ i.content.appendChild(At(t.display.measure))
13630
+ ),
13631
+ 0 == r
13632
+ ? ((e.measure.map = i.map), (e.measure.cache = {}))
13633
+ : ((e.measure.maps || (e.measure.maps = [])).push(i.map),
13634
+ (e.measure.caches || (e.measure.caches = [])).push({}));
13635
+ }
13636
+ if (l) {
13637
+ var a = i.content.lastChild;
13638
+ (/\bcm-tab\b/.test(a.className) ||
13639
+ (a.querySelector && a.querySelector(".cm-tab"))) &&
13640
+ (i.content.className = "cm-tab-wrap-hack");
13641
+ }
13642
+ return (
13643
+ pt(t, "renderLine", t, e.line, i.pre),
13644
+ i.pre.className &&
13645
+ (i.textClass = $(i.pre.className, i.textClass || "")),
13646
+ i
13647
+ );
13648
+ }
13649
+ function Ze(t) {
13650
+ var e = L("span", "•", "cm-invalidchar");
13651
+ return (
13652
+ (e.title = "\\u" + t.charCodeAt(0).toString(16)),
13653
+ e.setAttribute("aria-label", e.title),
13654
+ e
13655
+ );
13656
+ }
13657
+ function Je(t, e, n, i, r, o, l) {
13658
+ if (e) {
13659
+ var c,
13660
+ h = t.splitSpaces
13661
+ ? (function (t, e) {
13662
+ if (t.length > 1 && !/ /.test(t)) return t;
13663
+ for (var n = e, i = "", r = 0; r < t.length; r++) {
13664
+ var o = t.charAt(r);
13665
+ " " != o ||
13666
+ !n ||
13667
+ (r != t.length - 1 && 32 != t.charCodeAt(r + 1)) ||
13668
+ (o = " "),
13669
+ (i += o),
13670
+ (n = " " == o);
13671
+ }
13672
+ return i;
13673
+ })(e, t.trailingSpace)
13674
+ : e,
13675
+ u = t.cm.state.specialChars,
13676
+ f = !1;
13677
+ if (u.test(e)) {
13678
+ c = document.createDocumentFragment();
13679
+ for (var d = 0; ; ) {
13680
+ u.lastIndex = d;
13681
+ var p = u.exec(e),
13682
+ g = p ? p.index - d : e.length - d;
13683
+ if (g) {
13684
+ var m = document.createTextNode(h.slice(d, d + g));
13685
+ s && a < 9
13686
+ ? c.appendChild(L("span", [m]))
13687
+ : c.appendChild(m),
13688
+ t.map.push(t.pos, t.pos + g, m),
13689
+ (t.col += g),
13690
+ (t.pos += g);
13691
+ }
13692
+ if (!p) break;
13693
+ d += g + 1;
13694
+ var v = void 0;
13695
+ if ("\t" == p[0]) {
13696
+ var _ = t.cm.options.tabSize,
13697
+ y = _ - (t.col % _);
13698
+ (v = c.appendChild(
13699
+ L("span", V(y), "cm-tab")
13700
+ )).setAttribute("role", "presentation"),
13701
+ v.setAttribute("cm-text", "\t"),
13702
+ (t.col += y);
13703
+ } else
13704
+ "\r" == p[0] || "\n" == p[0]
13705
+ ? ((v = c.appendChild(
13706
+ L(
13707
+ "span",
13708
+ "\r" == p[0] ? "␍" : "␤",
13709
+ "cm-invalidchar"
13710
+ )
13711
+ )).setAttribute("cm-text", p[0]),
13712
+ (t.col += 1))
13713
+ : ((v = t.cm.options.specialCharPlaceholder(
13714
+ p[0]
13715
+ )).setAttribute("cm-text", p[0]),
13716
+ s && a < 9
13717
+ ? c.appendChild(L("span", [v]))
13718
+ : c.appendChild(v),
13719
+ (t.col += 1));
13720
+ t.map.push(t.pos, t.pos + 1, v), t.pos++;
13721
+ }
13722
+ } else
13723
+ (t.col += e.length),
13724
+ (c = document.createTextNode(h)),
13725
+ t.map.push(t.pos, t.pos + e.length, c),
13726
+ s && a < 9 && (f = !0),
13727
+ (t.pos += e.length);
13728
+ if (
13729
+ ((t.trailingSpace = 32 == h.charCodeAt(e.length - 1)),
13730
+ n || i || r || f || o || l)
13731
+ ) {
13732
+ var x = n || "";
13733
+ i && (x += i), r && (x += r);
13734
+ var k = L("span", [c], x, o);
13735
+ if (l)
13736
+ for (var b in l)
13737
+ l.hasOwnProperty(b) &&
13738
+ "style" != b &&
13739
+ "class" != b &&
13740
+ k.setAttribute(b, l[b]);
13741
+ return t.content.appendChild(k);
13742
+ }
13743
+ t.content.appendChild(c);
13744
+ }
13745
+ }
13746
+ function tn(t, e) {
13747
+ return function (n, i, r, o, s, a, l) {
13748
+ r = r ? r + " cm-force-border" : "cm-force-border";
13749
+ for (var c = n.pos, h = c + i.length; ; ) {
13750
+ for (
13751
+ var u = void 0, f = 0;
13752
+ f < e.length && !((u = e[f]).to > c && u.from <= c);
13753
+ f++
13754
+ );
13755
+ if (u.to >= h) return t(n, i, r, o, s, a, l);
13756
+ t(n, i.slice(0, u.to - c), r, o, null, a, l),
13757
+ (o = null),
13758
+ (i = i.slice(u.to - c)),
13759
+ (c = u.to);
13760
+ }
13761
+ };
13762
+ }
13763
+ function en(t, e, n, i) {
13764
+ var r = !i && n.widgetNode;
13765
+ r && t.map.push(t.pos, t.pos + e, r),
13766
+ !i &&
13767
+ t.cm.display.input.needsContentAttribute &&
13768
+ (r ||
13769
+ (r = t.content.appendChild(document.createElement("span"))),
13770
+ r.setAttribute("cm-marker", n.id)),
13771
+ r &&
13772
+ (t.cm.display.input.setUneditable(r),
13773
+ t.content.appendChild(r)),
13774
+ (t.pos += e),
13775
+ (t.trailingSpace = !1);
13776
+ }
13777
+ function nn(t, e, n) {
13778
+ var i = t.markedSpans,
13779
+ r = t.text,
13780
+ o = 0;
13781
+ if (i)
13782
+ for (
13783
+ var s,
13784
+ a,
13785
+ l,
13786
+ c,
13787
+ h,
13788
+ u,
13789
+ f,
13790
+ d = r.length,
13791
+ p = 0,
13792
+ g = 1,
13793
+ m = "",
13794
+ v = 0;
13795
+ ;
13796
+
13797
+ ) {
13798
+ if (v == p) {
13799
+ (l = c = h = a = ""), (f = null), (u = null), (v = 1 / 0);
13800
+ for (var _ = [], y = void 0, x = 0; x < i.length; ++x) {
13801
+ var k = i[x],
13802
+ b = k.marker;
13803
+ if ("bookmark" == b.type && k.from == p && b.widgetNode)
13804
+ _.push(b);
13805
+ else if (
13806
+ k.from <= p &&
13807
+ (null == k.to ||
13808
+ k.to > p ||
13809
+ (b.collapsed && k.to == p && k.from == p))
13810
+ ) {
13811
+ if (
13812
+ (null != k.to &&
13813
+ k.to != p &&
13814
+ v > k.to &&
13815
+ ((v = k.to), (c = "")),
13816
+ b.className && (l += " " + b.className),
13817
+ b.css && (a = (a ? a + ";" : "") + b.css),
13818
+ b.startStyle &&
13819
+ k.from == p &&
13820
+ (h += " " + b.startStyle),
13821
+ b.endStyle &&
13822
+ k.to == v &&
13823
+ (y || (y = [])).push(b.endStyle, k.to),
13824
+ b.title && ((f || (f = {})).title = b.title),
13825
+ b.attributes)
13826
+ )
13827
+ for (var T in b.attributes)
13828
+ (f || (f = {}))[T] = b.attributes[T];
13829
+ b.collapsed && (!u || Ie(u.marker, b) < 0) && (u = k);
13830
+ } else k.from > p && v > k.from && (v = k.from);
13831
+ }
13832
+ if (y)
13833
+ for (var C = 0; C < y.length; C += 2)
13834
+ y[C + 1] == v && (c += " " + y[C]);
13835
+ if (!u || u.from == p)
13836
+ for (var w = 0; w < _.length; ++w) en(e, 0, _[w]);
13837
+ if (u && (u.from || 0) == p) {
13838
+ if (
13839
+ (en(
13840
+ e,
13841
+ (null == u.to ? d + 1 : u.to) - p,
13842
+ u.marker,
13843
+ null == u.from
13844
+ ),
13845
+ null == u.to)
13846
+ )
13847
+ return;
13848
+ u.to == p && (u = !1);
13849
+ }
13850
+ }
13851
+ if (p >= d) break;
13852
+ for (var E = Math.min(d, v); ; ) {
13853
+ if (m) {
13854
+ var S = p + m.length;
13855
+ if (!u) {
13856
+ var A = S > E ? m.slice(0, E - p) : m;
13857
+ e.addToken(
13858
+ e,
13859
+ A,
13860
+ s ? s + l : l,
13861
+ h,
13862
+ p + A.length == v ? c : "",
13863
+ a,
13864
+ f
13865
+ );
13866
+ }
13867
+ if (S >= E) {
13868
+ (m = m.slice(E - p)), (p = E);
13869
+ break;
13870
+ }
13871
+ (p = S), (h = "");
13872
+ }
13873
+ (m = r.slice(o, (o = n[g++]))),
13874
+ (s = Xe(n[g++], e.cm.options));
13875
+ }
13876
+ }
13877
+ else
13878
+ for (var L = 1; L < n.length; L += 2)
13879
+ e.addToken(
13880
+ e,
13881
+ r.slice(o, (o = n[L])),
13882
+ Xe(n[L + 1], e.cm.options)
13883
+ );
13884
+ }
13885
+ function rn(t, e, n) {
13886
+ (this.line = e),
13887
+ (this.rest = (function (t) {
13888
+ for (var e, n; (e = Re(t)); )
13889
+ (t = e.find(1, !0).line), (n || (n = [])).push(t);
13890
+ return n;
13891
+ })(e)),
13892
+ (this.size = this.rest ? Xt(Y(this.rest)) - n + 1 : 1),
13893
+ (this.node = this.text = null),
13894
+ (this.hidden = He(t, e));
13895
+ }
13896
+ function on(t, e, n) {
13897
+ for (var i, r = [], o = e; o < n; o = i) {
13898
+ var s = new rn(t.doc, qt(t.doc, o), o);
13899
+ (i = o + s.size), r.push(s);
13900
+ }
13901
+ return r;
13902
+ }
13903
+ var sn = null,
13904
+ an = null;
13905
+ function ln(t, e) {
13906
+ var n = ft(t, e);
13907
+ if (n.length) {
13908
+ var i,
13909
+ r = Array.prototype.slice.call(arguments, 2);
13910
+ sn
13911
+ ? (i = sn.delayedCallbacks)
13912
+ : an
13913
+ ? (i = an)
13914
+ : ((i = an = []), setTimeout(cn, 0));
13915
+ for (
13916
+ var o = function (t) {
13917
+ i.push(function () {
13918
+ return n[t].apply(null, r);
13919
+ });
13920
+ },
13921
+ s = 0;
13922
+ s < n.length;
13923
+ ++s
13924
+ )
13925
+ o(s);
13926
+ }
13927
+ }
13928
+ function cn() {
13929
+ var t = an;
13930
+ an = null;
13931
+ for (var e = 0; e < t.length; ++e) t[e]();
13932
+ }
13933
+ function hn(t, e, n, i) {
13934
+ for (var r = 0; r < e.changes.length; r++) {
13935
+ var o = e.changes[r];
13936
+ "text" == o
13937
+ ? dn(t, e)
13938
+ : "gutter" == o
13939
+ ? gn(t, e, n, i)
13940
+ : "class" == o
13941
+ ? pn(t, e)
13942
+ : "widget" == o && mn(t, e, i);
13943
+ }
13944
+ e.changes = null;
13945
+ }
13946
+ function un(t) {
13947
+ return (
13948
+ t.node == t.text &&
13949
+ ((t.node = L("div", null, null, "position: relative")),
13950
+ t.text.parentNode &&
13951
+ t.text.parentNode.replaceChild(t.node, t.text),
13952
+ t.node.appendChild(t.text),
13953
+ s && a < 8 && (t.node.style.zIndex = 2)),
13954
+ t.node
13955
+ );
13956
+ }
13957
+ function fn(t, e) {
13958
+ var n = t.display.externalMeasured;
13959
+ return n && n.line == e.line
13960
+ ? ((t.display.externalMeasured = null),
13961
+ (e.measure = n.measure),
13962
+ n.built)
13963
+ : Qe(t, e);
13964
+ }
13965
+ function dn(t, e) {
13966
+ var n = e.text.className,
13967
+ i = fn(t, e);
13968
+ e.text == e.node && (e.node = i.pre),
13969
+ e.text.parentNode.replaceChild(i.pre, e.text),
13970
+ (e.text = i.pre),
13971
+ i.bgClass != e.bgClass || i.textClass != e.textClass
13972
+ ? ((e.bgClass = i.bgClass),
13973
+ (e.textClass = i.textClass),
13974
+ pn(t, e))
13975
+ : n && (e.text.className = n);
13976
+ }
13977
+ function pn(t, e) {
13978
+ !(function (t, e) {
13979
+ var n = e.bgClass
13980
+ ? e.bgClass + " " + (e.line.bgClass || "")
13981
+ : e.line.bgClass;
13982
+ if ((n && (n += " CodeMirror-linebackground"), e.background))
13983
+ n
13984
+ ? (e.background.className = n)
13985
+ : (e.background.parentNode.removeChild(e.background),
13986
+ (e.background = null));
13987
+ else if (n) {
13988
+ var i = un(e);
13989
+ (e.background = i.insertBefore(
13990
+ L("div", null, n),
13991
+ i.firstChild
13992
+ )),
13993
+ t.display.input.setUneditable(e.background);
13994
+ }
13995
+ })(t, e),
13996
+ e.line.wrapClass
13997
+ ? (un(e).className = e.line.wrapClass)
13998
+ : e.node != e.text && (e.node.className = "");
13999
+ var n = e.textClass
14000
+ ? e.textClass + " " + (e.line.textClass || "")
14001
+ : e.line.textClass;
14002
+ e.text.className = n || "";
14003
+ }
14004
+ function gn(t, e, n, i) {
14005
+ if (
14006
+ (e.gutter && (e.node.removeChild(e.gutter), (e.gutter = null)),
14007
+ e.gutterBackground &&
14008
+ (e.node.removeChild(e.gutterBackground),
14009
+ (e.gutterBackground = null)),
14010
+ e.line.gutterClass)
14011
+ ) {
14012
+ var r = un(e);
14013
+ (e.gutterBackground = L(
14014
+ "div",
14015
+ null,
14016
+ "CodeMirror-gutter-background " + e.line.gutterClass,
14017
+ "left: " +
14018
+ (t.options.fixedGutter ? i.fixedPos : -i.gutterTotalWidth) +
14019
+ "px; width: " +
14020
+ i.gutterTotalWidth +
14021
+ "px"
14022
+ )),
14023
+ t.display.input.setUneditable(e.gutterBackground),
14024
+ r.insertBefore(e.gutterBackground, e.text);
14025
+ }
14026
+ var o = e.line.gutterMarkers;
14027
+ if (t.options.lineNumbers || o) {
14028
+ var s = un(e),
14029
+ a = (e.gutter = L(
14030
+ "div",
14031
+ null,
14032
+ "CodeMirror-gutter-wrapper",
14033
+ "left: " +
14034
+ (t.options.fixedGutter
14035
+ ? i.fixedPos
14036
+ : -i.gutterTotalWidth) +
14037
+ "px"
14038
+ ));
14039
+ if (
14040
+ (a.setAttribute("aria-hidden", "true"),
14041
+ t.display.input.setUneditable(a),
14042
+ s.insertBefore(a, e.text),
14043
+ e.line.gutterClass &&
14044
+ (a.className += " " + e.line.gutterClass),
14045
+ !t.options.lineNumbers ||
14046
+ (o && o["CodeMirror-linenumbers"]) ||
14047
+ (e.lineNumber = a.appendChild(
14048
+ L(
14049
+ "div",
14050
+ Jt(t.options, n),
14051
+ "CodeMirror-linenumber CodeMirror-gutter-elt",
14052
+ "left: " +
14053
+ i.gutterLeft["CodeMirror-linenumbers"] +
14054
+ "px; width: " +
14055
+ t.display.lineNumInnerWidth +
14056
+ "px"
14057
+ )
14058
+ )),
14059
+ o)
14060
+ )
14061
+ for (var l = 0; l < t.display.gutterSpecs.length; ++l) {
14062
+ var c = t.display.gutterSpecs[l].className,
14063
+ h = o.hasOwnProperty(c) && o[c];
14064
+ h &&
14065
+ a.appendChild(
14066
+ L(
14067
+ "div",
14068
+ [h],
14069
+ "CodeMirror-gutter-elt",
14070
+ "left: " +
14071
+ i.gutterLeft[c] +
14072
+ "px; width: " +
14073
+ i.gutterWidth[c] +
14074
+ "px"
14075
+ )
14076
+ );
14077
+ }
14078
+ }
14079
+ }
14080
+ function mn(t, e, n) {
14081
+ e.alignable && (e.alignable = null);
14082
+ for (
14083
+ var i = C("CodeMirror-linewidget"),
14084
+ r = e.node.firstChild,
14085
+ o = void 0;
14086
+ r;
14087
+ r = o
14088
+ )
14089
+ (o = r.nextSibling),
14090
+ i.test(r.className) && e.node.removeChild(r);
14091
+ _n(t, e, n);
14092
+ }
14093
+ function vn(t, e, n, i) {
14094
+ var r = fn(t, e);
14095
+ return (
14096
+ (e.text = e.node = r.pre),
14097
+ r.bgClass && (e.bgClass = r.bgClass),
14098
+ r.textClass && (e.textClass = r.textClass),
14099
+ pn(t, e),
14100
+ gn(t, e, n, i),
14101
+ _n(t, e, i),
14102
+ e.node
14103
+ );
14104
+ }
14105
+ function _n(t, e, n) {
14106
+ if ((yn(t, e.line, e, n, !0), e.rest))
14107
+ for (var i = 0; i < e.rest.length; i++)
14108
+ yn(t, e.rest[i], e, n, !1);
14109
+ }
14110
+ function yn(t, e, n, i, r) {
14111
+ if (e.widgets)
14112
+ for (var o = un(n), s = 0, a = e.widgets; s < a.length; ++s) {
14113
+ var l = a[s],
14114
+ c = L(
14115
+ "div",
14116
+ [l.node],
14117
+ "CodeMirror-linewidget" +
14118
+ (l.className ? " " + l.className : "")
14119
+ );
14120
+ l.handleMouseEvents ||
14121
+ c.setAttribute("cm-ignore-events", "true"),
14122
+ xn(l, c, n, i),
14123
+ t.display.input.setUneditable(c),
14124
+ r && l.above
14125
+ ? o.insertBefore(c, n.gutter || n.text)
14126
+ : o.appendChild(c),
14127
+ ln(l, "redraw");
14128
+ }
14129
+ }
14130
+ function xn(t, e, n, i) {
14131
+ if (t.noHScroll) {
14132
+ (n.alignable || (n.alignable = [])).push(e);
14133
+ var r = i.wrapperWidth;
14134
+ (e.style.left = i.fixedPos + "px"),
14135
+ t.coverGutter ||
14136
+ ((r -= i.gutterTotalWidth),
14137
+ (e.style.paddingLeft = i.gutterTotalWidth + "px")),
14138
+ (e.style.width = r + "px");
14139
+ }
14140
+ t.coverGutter &&
14141
+ ((e.style.zIndex = 5),
14142
+ (e.style.position = "relative"),
14143
+ t.noHScroll ||
14144
+ (e.style.marginLeft = -i.gutterTotalWidth + "px"));
14145
+ }
14146
+ function kn(t) {
14147
+ if (null != t.height) return t.height;
14148
+ var e = t.doc.cm;
14149
+ if (!e) return 0;
14150
+ if (!N(document.body, t.node)) {
14151
+ var n = "position: relative;";
14152
+ t.coverGutter &&
14153
+ (n +=
14154
+ "margin-left: -" + e.display.gutters.offsetWidth + "px;"),
14155
+ t.noHScroll &&
14156
+ (n += "width: " + e.display.wrapper.clientWidth + "px;"),
14157
+ A(e.display.measure, L("div", [t.node], null, n));
14158
+ }
14159
+ return (t.height = t.node.parentNode.offsetHeight);
14160
+ }
14161
+ function bn(t, e) {
14162
+ for (var n = Tt(e); n != t.wrapper; n = n.parentNode)
14163
+ if (
14164
+ !n ||
14165
+ (1 == n.nodeType &&
14166
+ "true" == n.getAttribute("cm-ignore-events")) ||
14167
+ (n.parentNode == t.sizer && n != t.mover)
14168
+ )
14169
+ return !0;
14170
+ }
14171
+ function Tn(t) {
14172
+ return t.lineSpace.offsetTop;
14173
+ }
14174
+ function Cn(t) {
14175
+ return t.mover.offsetHeight - t.lineSpace.offsetHeight;
14176
+ }
14177
+ function wn(t) {
14178
+ if (t.cachedPaddingH) return t.cachedPaddingH;
14179
+ var e = A(t.measure, L("pre", "x", "CodeMirror-line-like")),
14180
+ n = window.getComputedStyle
14181
+ ? window.getComputedStyle(e)
14182
+ : e.currentStyle,
14183
+ i = {
14184
+ left: parseInt(n.paddingLeft),
14185
+ right: parseInt(n.paddingRight),
14186
+ };
14187
+ return (
14188
+ isNaN(i.left) || isNaN(i.right) || (t.cachedPaddingH = i), i
14189
+ );
14190
+ }
14191
+ function En(t) {
14192
+ return 50 - t.display.nativeBarWidth;
14193
+ }
14194
+ function Sn(t) {
14195
+ return (
14196
+ t.display.scroller.clientWidth - En(t) - t.display.barWidth
14197
+ );
14198
+ }
14199
+ function An(t) {
14200
+ return (
14201
+ t.display.scroller.clientHeight - En(t) - t.display.barHeight
14202
+ );
14203
+ }
14204
+ function Ln(t, e, n) {
14205
+ if (t.line == e)
14206
+ return { map: t.measure.map, cache: t.measure.cache };
14207
+ for (var i = 0; i < t.rest.length; i++)
14208
+ if (t.rest[i] == e)
14209
+ return { map: t.measure.maps[i], cache: t.measure.caches[i] };
14210
+ for (var r = 0; r < t.rest.length; r++)
14211
+ if (Xt(t.rest[r]) > n)
14212
+ return {
14213
+ map: t.measure.maps[r],
14214
+ cache: t.measure.caches[r],
14215
+ before: !0,
14216
+ };
14217
+ }
14218
+ function On(t, e, n, i) {
14219
+ return Mn(t, In(t, e), n, i);
14220
+ }
14221
+ function Nn(t, e) {
14222
+ if (e >= t.display.viewFrom && e < t.display.viewTo)
14223
+ return t.display.view[hi(t, e)];
14224
+ var n = t.display.externalMeasured;
14225
+ return n && e >= n.lineN && e < n.lineN + n.size ? n : void 0;
14226
+ }
14227
+ function In(t, e) {
14228
+ var n = Xt(e),
14229
+ i = Nn(t, n);
14230
+ i && !i.text
14231
+ ? (i = null)
14232
+ : i &&
14233
+ i.changes &&
14234
+ (hn(t, i, n, oi(t)), (t.curOp.forceUpdate = !0)),
14235
+ i ||
14236
+ (i = (function (t, e) {
14237
+ var n = Xt((e = Fe(e))),
14238
+ i = (t.display.externalMeasured = new rn(t.doc, e, n));
14239
+ i.lineN = n;
14240
+ var r = (i.built = Qe(t, i));
14241
+ return (i.text = r.pre), A(t.display.lineMeasure, r.pre), i;
14242
+ })(t, e));
14243
+ var r = Ln(i, e, n);
14244
+ return {
14245
+ line: e,
14246
+ view: i,
14247
+ rect: null,
14248
+ map: r.map,
14249
+ cache: r.cache,
14250
+ before: r.before,
14251
+ hasHeights: !1,
14252
+ };
14253
+ }
14254
+ function Mn(t, e, n, i, r) {
14255
+ e.before && (n = -1);
14256
+ var o,
14257
+ l = n + (i || "");
14258
+ return (
14259
+ e.cache.hasOwnProperty(l)
14260
+ ? (o = e.cache[l])
14261
+ : (e.rect || (e.rect = e.view.text.getBoundingClientRect()),
14262
+ e.hasHeights ||
14263
+ ((function (t, e, n) {
14264
+ var i = t.options.lineWrapping,
14265
+ r = i && Sn(t);
14266
+ if (!e.measure.heights || (i && e.measure.width != r)) {
14267
+ var o = (e.measure.heights = []);
14268
+ if (i) {
14269
+ e.measure.width = r;
14270
+ for (
14271
+ var s = e.text.firstChild.getClientRects(), a = 0;
14272
+ a < s.length - 1;
14273
+ a++
14274
+ ) {
14275
+ var l = s[a],
14276
+ c = s[a + 1];
14277
+ Math.abs(l.bottom - c.bottom) > 2 &&
14278
+ o.push((l.bottom + c.top) / 2 - n.top);
14279
+ }
14280
+ }
14281
+ o.push(n.bottom - n.top);
14282
+ }
14283
+ })(t, e.view, e.rect),
14284
+ (e.hasHeights = !0)),
14285
+ (o = (function (t, e, n, i) {
14286
+ var r,
14287
+ o = Dn(e.map, n, i),
14288
+ l = o.node,
14289
+ c = o.start,
14290
+ h = o.end,
14291
+ u = o.collapse;
14292
+ if (3 == l.nodeType) {
14293
+ for (var f = 0; f < 4; f++) {
14294
+ for (
14295
+ ;
14296
+ c && it(e.line.text.charAt(o.coverStart + c));
14297
+
14298
+ )
14299
+ --c;
14300
+ for (
14301
+ ;
14302
+ o.coverStart + h < o.coverEnd &&
14303
+ it(e.line.text.charAt(o.coverStart + h));
14304
+
14305
+ )
14306
+ ++h;
14307
+ if (
14308
+ (r =
14309
+ s &&
14310
+ a < 9 &&
14311
+ 0 == c &&
14312
+ h == o.coverEnd - o.coverStart
14313
+ ? l.parentNode.getBoundingClientRect()
14314
+ : Pn(w(l, c, h).getClientRects(), i)).left ||
14315
+ r.right ||
14316
+ 0 == c
14317
+ )
14318
+ break;
14319
+ (h = c), (c -= 1), (u = "right");
14320
+ }
14321
+ s &&
14322
+ a < 11 &&
14323
+ (r = (function (t, e) {
14324
+ if (
14325
+ !window.screen ||
14326
+ null == screen.logicalXDPI ||
14327
+ screen.logicalXDPI == screen.deviceXDPI ||
14328
+ !(function (t) {
14329
+ if (null != $t) return $t;
14330
+ var e = A(t, L("span", "x")),
14331
+ n = e.getBoundingClientRect(),
14332
+ i = w(e, 0, 1).getBoundingClientRect();
14333
+ return ($t = Math.abs(n.left - i.left) > 1);
14334
+ })(t)
14335
+ )
14336
+ return e;
14337
+ var n = screen.logicalXDPI / screen.deviceXDPI,
14338
+ i = screen.logicalYDPI / screen.deviceYDPI;
14339
+ return {
14340
+ left: e.left * n,
14341
+ right: e.right * n,
14342
+ top: e.top * i,
14343
+ bottom: e.bottom * i,
14344
+ };
14345
+ })(t.display.measure, r));
14346
+ } else {
14347
+ var d;
14348
+ c > 0 && (u = i = "right"),
14349
+ (r =
14350
+ t.options.lineWrapping &&
14351
+ (d = l.getClientRects()).length > 1
14352
+ ? d["right" == i ? d.length - 1 : 0]
14353
+ : l.getBoundingClientRect());
14354
+ }
14355
+ if (s && a < 9 && !c && (!r || (!r.left && !r.right))) {
14356
+ var p = l.parentNode.getClientRects()[0];
14357
+ r = p
14358
+ ? {
14359
+ left: p.left,
14360
+ right: p.left + ri(t.display),
14361
+ top: p.top,
14362
+ bottom: p.bottom,
14363
+ }
14364
+ : Rn;
14365
+ }
14366
+ for (
14367
+ var g = r.top - e.rect.top,
14368
+ m = r.bottom - e.rect.top,
14369
+ v = (g + m) / 2,
14370
+ _ = e.view.measure.heights,
14371
+ y = 0;
14372
+ y < _.length - 1 && !(v < _[y]);
14373
+ y++
14374
+ );
14375
+ var x = y ? _[y - 1] : 0,
14376
+ k = _[y],
14377
+ b = {
14378
+ left: ("right" == u ? r.right : r.left) - e.rect.left,
14379
+ right: ("left" == u ? r.left : r.right) - e.rect.left,
14380
+ top: x,
14381
+ bottom: k,
14382
+ };
14383
+ return (
14384
+ r.left || r.right || (b.bogus = !0),
14385
+ t.options.singleCursorHeightPerLine ||
14386
+ ((b.rtop = g), (b.rbottom = m)),
14387
+ b
14388
+ );
14389
+ })(t, e, n, i)).bogus || (e.cache[l] = o)),
14390
+ {
14391
+ left: o.left,
14392
+ right: o.right,
14393
+ top: r ? o.rtop : o.top,
14394
+ bottom: r ? o.rbottom : o.bottom,
14395
+ }
14396
+ );
14397
+ }
14398
+ var $n,
14399
+ Rn = { left: 0, right: 0, top: 0, bottom: 0 };
14400
+ function Dn(t, e, n) {
14401
+ for (var i, r, o, s, a, l, c = 0; c < t.length; c += 3)
14402
+ if (
14403
+ ((a = t[c]),
14404
+ (l = t[c + 1]),
14405
+ e < a
14406
+ ? ((r = 0), (o = 1), (s = "left"))
14407
+ : e < l
14408
+ ? (o = 1 + (r = e - a))
14409
+ : (c == t.length - 3 || (e == l && t[c + 3] > e)) &&
14410
+ ((r = (o = l - a) - 1), e >= l && (s = "right")),
14411
+ null != r)
14412
+ ) {
14413
+ if (
14414
+ ((i = t[c + 2]),
14415
+ a == l && n == (i.insertLeft ? "left" : "right") && (s = n),
14416
+ "left" == n && 0 == r)
14417
+ )
14418
+ for (; c && t[c - 2] == t[c - 3] && t[c - 1].insertLeft; )
14419
+ (i = t[2 + (c -= 3)]), (s = "left");
14420
+ if ("right" == n && r == l - a)
14421
+ for (
14422
+ ;
14423
+ c < t.length - 3 &&
14424
+ t[c + 3] == t[c + 4] &&
14425
+ !t[c + 5].insertLeft;
14426
+
14427
+ )
14428
+ (i = t[(c += 3) + 2]), (s = "right");
14429
+ break;
14430
+ }
14431
+ return {
14432
+ node: i,
14433
+ start: r,
14434
+ end: o,
14435
+ collapse: s,
14436
+ coverStart: a,
14437
+ coverEnd: l,
14438
+ };
14439
+ }
14440
+ function Pn(t, e) {
14441
+ var n = Rn;
14442
+ if ("left" == e)
14443
+ for (
14444
+ var i = 0;
14445
+ i < t.length && (n = t[i]).left == n.right;
14446
+ i++
14447
+ );
14448
+ else
14449
+ for (
14450
+ var r = t.length - 1;
14451
+ r >= 0 && (n = t[r]).left == n.right;
14452
+ r--
14453
+ );
14454
+ return n;
14455
+ }
14456
+ function Fn(t) {
14457
+ if (
14458
+ t.measure &&
14459
+ ((t.measure.cache = {}), (t.measure.heights = null), t.rest)
14460
+ )
14461
+ for (var e = 0; e < t.rest.length; e++)
14462
+ t.measure.caches[e] = {};
14463
+ }
14464
+ function Bn(t) {
14465
+ (t.display.externalMeasure = null), S(t.display.lineMeasure);
14466
+ for (var e = 0; e < t.display.view.length; e++)
14467
+ Fn(t.display.view[e]);
14468
+ }
14469
+ function Un(t) {
14470
+ Bn(t),
14471
+ (t.display.cachedCharWidth =
14472
+ t.display.cachedTextHeight =
14473
+ t.display.cachedPaddingH =
14474
+ null),
14475
+ t.options.lineWrapping || (t.display.maxLineChanged = !0),
14476
+ (t.display.lineNumChars = null);
14477
+ }
14478
+ function Hn() {
14479
+ return h && m
14480
+ ? -(
14481
+ document.body.getBoundingClientRect().left -
14482
+ parseInt(getComputedStyle(document.body).marginLeft)
14483
+ )
14484
+ : window.pageXOffset ||
14485
+ (document.documentElement || document.body).scrollLeft;
14486
+ }
14487
+ function zn() {
14488
+ return h && m
14489
+ ? -(
14490
+ document.body.getBoundingClientRect().top -
14491
+ parseInt(getComputedStyle(document.body).marginTop)
14492
+ )
14493
+ : window.pageYOffset ||
14494
+ (document.documentElement || document.body).scrollTop;
14495
+ }
14496
+ function Wn(t) {
14497
+ var e = 0;
14498
+ if (t.widgets)
14499
+ for (var n = 0; n < t.widgets.length; ++n)
14500
+ t.widgets[n].above && (e += kn(t.widgets[n]));
14501
+ return e;
14502
+ }
14503
+ function jn(t, e, n, i, r) {
14504
+ if (!r) {
14505
+ var o = Wn(e);
14506
+ (n.top += o), (n.bottom += o);
14507
+ }
14508
+ if ("line" == i) return n;
14509
+ i || (i = "local");
14510
+ var s = We(e);
14511
+ if (
14512
+ ("local" == i
14513
+ ? (s += Tn(t.display))
14514
+ : (s -= t.display.viewOffset),
14515
+ "page" == i || "window" == i)
14516
+ ) {
14517
+ var a = t.display.lineSpace.getBoundingClientRect();
14518
+ s += a.top + ("window" == i ? 0 : zn());
14519
+ var l = a.left + ("window" == i ? 0 : Hn());
14520
+ (n.left += l), (n.right += l);
14521
+ }
14522
+ return (n.top += s), (n.bottom += s), n;
14523
+ }
14524
+ function Gn(t, e, n) {
14525
+ if ("div" == n) return e;
14526
+ var i = e.left,
14527
+ r = e.top;
14528
+ if ("page" == n) (i -= Hn()), (r -= zn());
14529
+ else if ("local" == n || !n) {
14530
+ var o = t.display.sizer.getBoundingClientRect();
14531
+ (i += o.left), (r += o.top);
14532
+ }
14533
+ var s = t.display.lineSpace.getBoundingClientRect();
14534
+ return { left: i - s.left, top: r - s.top };
14535
+ }
14536
+ function qn(t, e, n, i, r) {
14537
+ return (
14538
+ i || (i = qt(t.doc, e.line)), jn(t, i, On(t, i, e.ch, r), n)
14539
+ );
14540
+ }
14541
+ function Vn(t, e, n, i, r, o) {
14542
+ function s(e, s) {
14543
+ var a = Mn(t, r, e, s ? "right" : "left", o);
14544
+ return (
14545
+ s ? (a.left = a.right) : (a.right = a.left), jn(t, i, a, n)
14546
+ );
14547
+ }
14548
+ (i = i || qt(t.doc, e.line)), r || (r = In(t, i));
14549
+ var a = ct(i, t.doc.direction),
14550
+ l = e.ch,
14551
+ c = e.sticky;
14552
+ if (
14553
+ (l >= i.text.length
14554
+ ? ((l = i.text.length), (c = "before"))
14555
+ : l <= 0 && ((l = 0), (c = "after")),
14556
+ !a)
14557
+ )
14558
+ return s("before" == c ? l - 1 : l, "before" == c);
14559
+ function h(t, e, n) {
14560
+ return s(n ? t - 1 : t, (1 == a[e].level) != n);
14561
+ }
14562
+ var u = at(a, l, c),
14563
+ f = st,
14564
+ d = h(l, u, "before" == c);
14565
+ return null != f && (d.other = h(l, f, "before" != c)), d;
14566
+ }
14567
+ function Yn(t, e) {
14568
+ var n = 0;
14569
+ (e = ae(t.doc, e)),
14570
+ t.options.lineWrapping || (n = ri(t.display) * e.ch);
14571
+ var i = qt(t.doc, e.line),
14572
+ r = We(i) + Tn(t.display);
14573
+ return { left: n, right: n, top: r, bottom: r + i.height };
14574
+ }
14575
+ function Kn(t, e, n, i, r) {
14576
+ var o = te(t, e, n);
14577
+ return (o.xRel = r), i && (o.outside = i), o;
14578
+ }
14579
+ function Xn(t, e, n) {
14580
+ var i = t.doc;
14581
+ if ((n += t.display.viewOffset) < 0)
14582
+ return Kn(i.first, 0, null, -1, -1);
14583
+ var r = Qt(i, n),
14584
+ o = i.first + i.size - 1;
14585
+ if (r > o)
14586
+ return Kn(
14587
+ i.first + i.size - 1,
14588
+ qt(i, o).text.length,
14589
+ null,
14590
+ 1,
14591
+ 1
14592
+ );
14593
+ e < 0 && (e = 0);
14594
+ for (var s = qt(i, r); ; ) {
14595
+ var a = ti(t, s, r, e, n),
14596
+ l = De(s, a.ch + (a.xRel > 0 || a.outside > 0 ? 1 : 0));
14597
+ if (!l) return a;
14598
+ var c = l.find(1);
14599
+ if (c.line == r) return c;
14600
+ s = qt(i, (r = c.line));
14601
+ }
14602
+ }
14603
+ function Qn(t, e, n, i) {
14604
+ i -= Wn(e);
14605
+ var r = e.text.length,
14606
+ o = ot(
14607
+ function (e) {
14608
+ return Mn(t, n, e - 1).bottom <= i;
14609
+ },
14610
+ r,
14611
+ 0
14612
+ );
14613
+ return {
14614
+ begin: o,
14615
+ end: (r = ot(
14616
+ function (e) {
14617
+ return Mn(t, n, e).top > i;
14618
+ },
14619
+ o,
14620
+ r
14621
+ )),
14622
+ };
14623
+ }
14624
+ function Zn(t, e, n, i) {
14625
+ return (
14626
+ n || (n = In(t, e)),
14627
+ Qn(t, e, n, jn(t, e, Mn(t, n, i), "line").top)
14628
+ );
14629
+ }
14630
+ function Jn(t, e, n, i) {
14631
+ return (
14632
+ !(t.bottom <= n) && (t.top > n || (i ? t.left : t.right) > e)
14633
+ );
14634
+ }
14635
+ function ti(t, e, n, i, r) {
14636
+ r -= We(e);
14637
+ var o = In(t, e),
14638
+ s = Wn(e),
14639
+ a = 0,
14640
+ l = e.text.length,
14641
+ c = !0,
14642
+ h = ct(e, t.doc.direction);
14643
+ if (h) {
14644
+ var u = (t.options.lineWrapping ? ni : ei)(t, e, n, o, h, i, r);
14645
+ (a = (c = 1 != u.level) ? u.from : u.to - 1),
14646
+ (l = c ? u.to : u.from - 1);
14647
+ }
14648
+ var f,
14649
+ d,
14650
+ p = null,
14651
+ g = null,
14652
+ m = ot(
14653
+ function (e) {
14654
+ var n = Mn(t, o, e);
14655
+ return (
14656
+ (n.top += s),
14657
+ (n.bottom += s),
14658
+ !!Jn(n, i, r, !1) &&
14659
+ (n.top <= r && n.left <= i && ((p = e), (g = n)), !0)
14660
+ );
14661
+ },
14662
+ a,
14663
+ l
14664
+ ),
14665
+ v = !1;
14666
+ if (g) {
14667
+ var _ = i - g.left < g.right - i,
14668
+ y = _ == c;
14669
+ (m = p + (y ? 0 : 1)),
14670
+ (d = y ? "after" : "before"),
14671
+ (f = _ ? g.left : g.right);
14672
+ } else {
14673
+ c || (m != l && m != a) || m++,
14674
+ (d =
14675
+ 0 == m
14676
+ ? "after"
14677
+ : m == e.text.length
14678
+ ? "before"
14679
+ : Mn(t, o, m - (c ? 1 : 0)).bottom + s <= r == c
14680
+ ? "after"
14681
+ : "before");
14682
+ var x = Vn(t, te(n, m, d), "line", e, o);
14683
+ (f = x.left), (v = r < x.top ? -1 : r >= x.bottom ? 1 : 0);
14684
+ }
14685
+ return Kn(n, (m = rt(e.text, m, 1)), d, v, i - f);
14686
+ }
14687
+ function ei(t, e, n, i, r, o, s) {
14688
+ var a = ot(
14689
+ function (a) {
14690
+ var l = r[a],
14691
+ c = 1 != l.level;
14692
+ return Jn(
14693
+ Vn(
14694
+ t,
14695
+ te(n, c ? l.to : l.from, c ? "before" : "after"),
14696
+ "line",
14697
+ e,
14698
+ i
14699
+ ),
14700
+ o,
14701
+ s,
14702
+ !0
14703
+ );
14704
+ },
14705
+ 0,
14706
+ r.length - 1
14707
+ ),
14708
+ l = r[a];
14709
+ if (a > 0) {
14710
+ var c = 1 != l.level,
14711
+ h = Vn(
14712
+ t,
14713
+ te(n, c ? l.from : l.to, c ? "after" : "before"),
14714
+ "line",
14715
+ e,
14716
+ i
14717
+ );
14718
+ Jn(h, o, s, !0) && h.top > s && (l = r[a - 1]);
14719
+ }
14720
+ return l;
14721
+ }
14722
+ function ni(t, e, n, i, r, o, s) {
14723
+ var a = Qn(t, e, i, s),
14724
+ l = a.begin,
14725
+ c = a.end;
14726
+ /\s/.test(e.text.charAt(c - 1)) && c--;
14727
+ for (var h = null, u = null, f = 0; f < r.length; f++) {
14728
+ var d = r[f];
14729
+ if (!(d.from >= c || d.to <= l)) {
14730
+ var p = Mn(
14731
+ t,
14732
+ i,
14733
+ 1 != d.level ? Math.min(c, d.to) - 1 : Math.max(l, d.from)
14734
+ ).right,
14735
+ g = p < o ? o - p + 1e9 : p - o;
14736
+ (!h || u > g) && ((h = d), (u = g));
14737
+ }
14738
+ }
14739
+ return (
14740
+ h || (h = r[r.length - 1]),
14741
+ h.from < l && (h = { from: l, to: h.to, level: h.level }),
14742
+ h.to > c && (h = { from: h.from, to: c, level: h.level }),
14743
+ h
14744
+ );
14745
+ }
14746
+ function ii(t) {
14747
+ if (null != t.cachedTextHeight) return t.cachedTextHeight;
14748
+ if (null == $n) {
14749
+ $n = L("pre", null, "CodeMirror-line-like");
14750
+ for (var e = 0; e < 49; ++e)
14751
+ $n.appendChild(document.createTextNode("x")),
14752
+ $n.appendChild(L("br"));
14753
+ $n.appendChild(document.createTextNode("x"));
14754
+ }
14755
+ A(t.measure, $n);
14756
+ var n = $n.offsetHeight / 50;
14757
+ return n > 3 && (t.cachedTextHeight = n), S(t.measure), n || 1;
14758
+ }
14759
+ function ri(t) {
14760
+ if (null != t.cachedCharWidth) return t.cachedCharWidth;
14761
+ var e = L("span", "xxxxxxxxxx"),
14762
+ n = L("pre", [e], "CodeMirror-line-like");
14763
+ A(t.measure, n);
14764
+ var i = e.getBoundingClientRect(),
14765
+ r = (i.right - i.left) / 10;
14766
+ return r > 2 && (t.cachedCharWidth = r), r || 10;
14767
+ }
14768
+ function oi(t) {
14769
+ for (
14770
+ var e = t.display,
14771
+ n = {},
14772
+ i = {},
14773
+ r = e.gutters.clientLeft,
14774
+ o = e.gutters.firstChild,
14775
+ s = 0;
14776
+ o;
14777
+ o = o.nextSibling, ++s
14778
+ ) {
14779
+ var a = t.display.gutterSpecs[s].className;
14780
+ (n[a] = o.offsetLeft + o.clientLeft + r),
14781
+ (i[a] = o.clientWidth);
14782
+ }
14783
+ return {
14784
+ fixedPos: si(e),
14785
+ gutterTotalWidth: e.gutters.offsetWidth,
14786
+ gutterLeft: n,
14787
+ gutterWidth: i,
14788
+ wrapperWidth: e.wrapper.clientWidth,
14789
+ };
14790
+ }
14791
+ function si(t) {
14792
+ return (
14793
+ t.scroller.getBoundingClientRect().left -
14794
+ t.sizer.getBoundingClientRect().left
14795
+ );
14796
+ }
14797
+ function ai(t) {
14798
+ var e = ii(t.display),
14799
+ n = t.options.lineWrapping,
14800
+ i =
14801
+ n &&
14802
+ Math.max(
14803
+ 5,
14804
+ t.display.scroller.clientWidth / ri(t.display) - 3
14805
+ );
14806
+ return function (r) {
14807
+ if (He(t.doc, r)) return 0;
14808
+ var o = 0;
14809
+ if (r.widgets)
14810
+ for (var s = 0; s < r.widgets.length; s++)
14811
+ r.widgets[s].height && (o += r.widgets[s].height);
14812
+ return n ? o + (Math.ceil(r.text.length / i) || 1) * e : o + e;
14813
+ };
14814
+ }
14815
+ function li(t) {
14816
+ var e = t.doc,
14817
+ n = ai(t);
14818
+ e.iter(function (t) {
14819
+ var e = n(t);
14820
+ e != t.height && Kt(t, e);
14821
+ });
14822
+ }
14823
+ function ci(t, e, n, i) {
14824
+ var r = t.display;
14825
+ if (!n && "true" == Tt(e).getAttribute("cm-not-content"))
14826
+ return null;
14827
+ var o,
14828
+ s,
14829
+ a = r.lineSpace.getBoundingClientRect();
14830
+ try {
14831
+ (o = e.clientX - a.left), (s = e.clientY - a.top);
14832
+ } catch (t) {
14833
+ return null;
14834
+ }
14835
+ var l,
14836
+ c = Xn(t, o, s);
14837
+ if (
14838
+ i &&
14839
+ c.xRel > 0 &&
14840
+ (l = qt(t.doc, c.line).text).length == c.ch
14841
+ ) {
14842
+ var h = F(l, l.length, t.options.tabSize) - l.length;
14843
+ c = te(
14844
+ c.line,
14845
+ Math.max(
14846
+ 0,
14847
+ Math.round((o - wn(t.display).left) / ri(t.display)) - h
14848
+ )
14849
+ );
14850
+ }
14851
+ return c;
14852
+ }
14853
+ function hi(t, e) {
14854
+ if (e >= t.display.viewTo) return null;
14855
+ if ((e -= t.display.viewFrom) < 0) return null;
14856
+ for (var n = t.display.view, i = 0; i < n.length; i++)
14857
+ if ((e -= n[i].size) < 0) return i;
14858
+ }
14859
+ function ui(t, e, n, i) {
14860
+ null == e && (e = t.doc.first),
14861
+ null == n && (n = t.doc.first + t.doc.size),
14862
+ i || (i = 0);
14863
+ var r = t.display;
14864
+ if (
14865
+ (i &&
14866
+ n < r.viewTo &&
14867
+ (null == r.updateLineNumbers || r.updateLineNumbers > e) &&
14868
+ (r.updateLineNumbers = e),
14869
+ (t.curOp.viewChanged = !0),
14870
+ e >= r.viewTo)
14871
+ )
14872
+ be && Be(t.doc, e) < r.viewTo && di(t);
14873
+ else if (n <= r.viewFrom)
14874
+ be && Ue(t.doc, n + i) > r.viewFrom
14875
+ ? di(t)
14876
+ : ((r.viewFrom += i), (r.viewTo += i));
14877
+ else if (e <= r.viewFrom && n >= r.viewTo) di(t);
14878
+ else if (e <= r.viewFrom) {
14879
+ var o = pi(t, n, n + i, 1);
14880
+ o
14881
+ ? ((r.view = r.view.slice(o.index)),
14882
+ (r.viewFrom = o.lineN),
14883
+ (r.viewTo += i))
14884
+ : di(t);
14885
+ } else if (n >= r.viewTo) {
14886
+ var s = pi(t, e, e, -1);
14887
+ s
14888
+ ? ((r.view = r.view.slice(0, s.index)), (r.viewTo = s.lineN))
14889
+ : di(t);
14890
+ } else {
14891
+ var a = pi(t, e, e, -1),
14892
+ l = pi(t, n, n + i, 1);
14893
+ a && l
14894
+ ? ((r.view = r.view
14895
+ .slice(0, a.index)
14896
+ .concat(on(t, a.lineN, l.lineN))
14897
+ .concat(r.view.slice(l.index))),
14898
+ (r.viewTo += i))
14899
+ : di(t);
14900
+ }
14901
+ var c = r.externalMeasured;
14902
+ c &&
14903
+ (n < c.lineN
14904
+ ? (c.lineN += i)
14905
+ : e < c.lineN + c.size && (r.externalMeasured = null));
14906
+ }
14907
+ function fi(t, e, n) {
14908
+ t.curOp.viewChanged = !0;
14909
+ var i = t.display,
14910
+ r = t.display.externalMeasured;
14911
+ if (
14912
+ (r &&
14913
+ e >= r.lineN &&
14914
+ e < r.lineN + r.size &&
14915
+ (i.externalMeasured = null),
14916
+ !(e < i.viewFrom || e >= i.viewTo))
14917
+ ) {
14918
+ var o = i.view[hi(t, e)];
14919
+ if (null != o.node) {
14920
+ var s = o.changes || (o.changes = []);
14921
+ -1 == U(s, n) && s.push(n);
14922
+ }
14923
+ }
14924
+ }
14925
+ function di(t) {
14926
+ (t.display.viewFrom = t.display.viewTo = t.doc.first),
14927
+ (t.display.view = []),
14928
+ (t.display.viewOffset = 0);
14929
+ }
14930
+ function pi(t, e, n, i) {
14931
+ var r,
14932
+ o = hi(t, e),
14933
+ s = t.display.view;
14934
+ if (!be || n == t.doc.first + t.doc.size)
14935
+ return { index: o, lineN: n };
14936
+ for (var a = t.display.viewFrom, l = 0; l < o; l++)
14937
+ a += s[l].size;
14938
+ if (a != e) {
14939
+ if (i > 0) {
14940
+ if (o == s.length - 1) return null;
14941
+ (r = a + s[o].size - e), o++;
14942
+ } else r = a - e;
14943
+ (e += r), (n += r);
14944
+ }
14945
+ for (; Be(t.doc, n) != n; ) {
14946
+ if (o == (i < 0 ? 0 : s.length - 1)) return null;
14947
+ (n += i * s[o - (i < 0 ? 1 : 0)].size), (o += i);
14948
+ }
14949
+ return { index: o, lineN: n };
14950
+ }
14951
+ function gi(t) {
14952
+ for (var e = t.display.view, n = 0, i = 0; i < e.length; i++) {
14953
+ var r = e[i];
14954
+ r.hidden || (r.node && !r.changes) || ++n;
14955
+ }
14956
+ return n;
14957
+ }
14958
+ function mi(t) {
14959
+ t.display.input.showSelection(t.display.input.prepareSelection());
14960
+ }
14961
+ function vi(t, e) {
14962
+ void 0 === e && (e = !0);
14963
+ for (
14964
+ var n = t.doc,
14965
+ i = {},
14966
+ r = (i.cursors = document.createDocumentFragment()),
14967
+ o = (i.selection = document.createDocumentFragment()),
14968
+ s = 0;
14969
+ s < n.sel.ranges.length;
14970
+ s++
14971
+ )
14972
+ if (e || s != n.sel.primIndex) {
14973
+ var a = n.sel.ranges[s];
14974
+ if (
14975
+ !(
14976
+ a.from().line >= t.display.viewTo ||
14977
+ a.to().line < t.display.viewFrom
14978
+ )
14979
+ ) {
14980
+ var l = a.empty();
14981
+ (l || t.options.showCursorWhenSelecting) &&
14982
+ _i(t, a.head, r),
14983
+ l || xi(t, a, o);
14984
+ }
14985
+ }
14986
+ return i;
14987
+ }
14988
+ function _i(t, e, n) {
14989
+ var i = Vn(
14990
+ t,
14991
+ e,
14992
+ "div",
14993
+ null,
14994
+ null,
14995
+ !t.options.singleCursorHeightPerLine
14996
+ ),
14997
+ r = n.appendChild(L("div", " ", "CodeMirror-cursor"));
14998
+ if (
14999
+ ((r.style.left = i.left + "px"),
15000
+ (r.style.top = i.top + "px"),
15001
+ (r.style.height =
15002
+ Math.max(0, i.bottom - i.top) * t.options.cursorHeight +
15003
+ "px"),
15004
+ /\bcm-fat-cursor\b/.test(t.getWrapperElement().className))
15005
+ ) {
15006
+ var o = qn(t, e, "div", null, null);
15007
+ r.style.width = Math.max(0, o.right - o.left) + "px";
15008
+ }
15009
+ if (i.other) {
15010
+ var s = n.appendChild(
15011
+ L("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor")
15012
+ );
15013
+ (s.style.display = ""),
15014
+ (s.style.left = i.other.left + "px"),
15015
+ (s.style.top = i.other.top + "px"),
15016
+ (s.style.height =
15017
+ 0.85 * (i.other.bottom - i.other.top) + "px");
15018
+ }
15019
+ }
15020
+ function yi(t, e) {
15021
+ return t.top - e.top || t.left - e.left;
15022
+ }
15023
+ function xi(t, e, n) {
15024
+ var i = t.display,
15025
+ r = t.doc,
15026
+ o = document.createDocumentFragment(),
15027
+ s = wn(t.display),
15028
+ a = s.left,
15029
+ l =
15030
+ Math.max(i.sizerWidth, Sn(t) - i.sizer.offsetLeft) - s.right,
15031
+ c = "ltr" == r.direction;
15032
+ function h(t, e, n, i) {
15033
+ e < 0 && (e = 0),
15034
+ (e = Math.round(e)),
15035
+ (i = Math.round(i)),
15036
+ o.appendChild(
15037
+ L(
15038
+ "div",
15039
+ null,
15040
+ "CodeMirror-selected",
15041
+ "position: absolute; left: " +
15042
+ t +
15043
+ "px;\n top: " +
15044
+ e +
15045
+ "px; width: " +
15046
+ (null == n ? l - t : n) +
15047
+ "px;\n height: " +
15048
+ (i - e) +
15049
+ "px"
15050
+ )
15051
+ );
15052
+ }
15053
+ function u(e, n, i) {
15054
+ var o,
15055
+ s,
15056
+ u = qt(r, e),
15057
+ f = u.text.length;
15058
+ function d(n, i) {
15059
+ return qn(t, te(e, n), "div", u, i);
15060
+ }
15061
+ function p(e, n, i) {
15062
+ var r = Zn(t, u, null, e),
15063
+ o = ("ltr" == n) == ("after" == i) ? "left" : "right";
15064
+ return d(
15065
+ "after" == i
15066
+ ? r.begin
15067
+ : r.end - (/\s/.test(u.text.charAt(r.end - 1)) ? 2 : 1),
15068
+ o
15069
+ )[o];
15070
+ }
15071
+ var g = ct(u, r.direction);
15072
+ return (
15073
+ (function (t, e, n, i) {
15074
+ if (!t) return i(e, n, "ltr", 0);
15075
+ for (var r = !1, o = 0; o < t.length; ++o) {
15076
+ var s = t[o];
15077
+ ((s.from < n && s.to > e) || (e == n && s.to == e)) &&
15078
+ (i(
15079
+ Math.max(s.from, e),
15080
+ Math.min(s.to, n),
15081
+ 1 == s.level ? "rtl" : "ltr",
15082
+ o
15083
+ ),
15084
+ (r = !0));
15085
+ }
15086
+ r || i(e, n, "ltr");
15087
+ })(g, n || 0, null == i ? f : i, function (t, e, r, u) {
15088
+ var m = "ltr" == r,
15089
+ v = d(t, m ? "left" : "right"),
15090
+ _ = d(e - 1, m ? "right" : "left"),
15091
+ y = null == n && 0 == t,
15092
+ x = null == i && e == f,
15093
+ k = 0 == u,
15094
+ b = !g || u == g.length - 1;
15095
+ if (_.top - v.top <= 3) {
15096
+ var T = (c ? x : y) && b,
15097
+ C = (c ? y : x) && k ? a : (m ? v : _).left,
15098
+ w = T ? l : (m ? _ : v).right;
15099
+ h(C, v.top, w - C, v.bottom);
15100
+ } else {
15101
+ var E, S, A, L;
15102
+ m
15103
+ ? ((E = c && y && k ? a : v.left),
15104
+ (S = c ? l : p(t, r, "before")),
15105
+ (A = c ? a : p(e, r, "after")),
15106
+ (L = c && x && b ? l : _.right))
15107
+ : ((E = c ? p(t, r, "before") : a),
15108
+ (S = !c && y && k ? l : v.right),
15109
+ (A = !c && x && b ? a : _.left),
15110
+ (L = c ? p(e, r, "after") : l)),
15111
+ h(E, v.top, S - E, v.bottom),
15112
+ v.bottom < _.top && h(a, v.bottom, null, _.top),
15113
+ h(A, _.top, L - A, _.bottom);
15114
+ }
15115
+ (!o || yi(v, o) < 0) && (o = v),
15116
+ yi(_, o) < 0 && (o = _),
15117
+ (!s || yi(v, s) < 0) && (s = v),
15118
+ yi(_, s) < 0 && (s = _);
15119
+ }),
15120
+ { start: o, end: s }
15121
+ );
15122
+ }
15123
+ var f = e.from(),
15124
+ d = e.to();
15125
+ if (f.line == d.line) u(f.line, f.ch, d.ch);
15126
+ else {
15127
+ var p = qt(r, f.line),
15128
+ g = qt(r, d.line),
15129
+ m = Fe(p) == Fe(g),
15130
+ v = u(f.line, f.ch, m ? p.text.length + 1 : null).end,
15131
+ _ = u(d.line, m ? 0 : null, d.ch).start;
15132
+ m &&
15133
+ (v.top < _.top - 2
15134
+ ? (h(v.right, v.top, null, v.bottom),
15135
+ h(a, _.top, _.left, _.bottom))
15136
+ : h(v.right, v.top, _.left - v.right, v.bottom)),
15137
+ v.bottom < _.top && h(a, v.bottom, null, _.top);
15138
+ }
15139
+ n.appendChild(o);
15140
+ }
15141
+ function ki(t) {
15142
+ if (t.state.focused) {
15143
+ var e = t.display;
15144
+ clearInterval(e.blinker);
15145
+ var n = !0;
15146
+ (e.cursorDiv.style.visibility = ""),
15147
+ t.options.cursorBlinkRate > 0
15148
+ ? (e.blinker = setInterval(function () {
15149
+ t.hasFocus() || wi(t),
15150
+ (e.cursorDiv.style.visibility = (n = !n)
15151
+ ? ""
15152
+ : "hidden");
15153
+ }, t.options.cursorBlinkRate))
15154
+ : t.options.cursorBlinkRate < 0 &&
15155
+ (e.cursorDiv.style.visibility = "hidden");
15156
+ }
15157
+ }
15158
+ function bi(t) {
15159
+ t.hasFocus() ||
15160
+ (t.display.input.focus(), t.state.focused || Ci(t));
15161
+ }
15162
+ function Ti(t) {
15163
+ (t.state.delayingBlurEvent = !0),
15164
+ setTimeout(function () {
15165
+ t.state.delayingBlurEvent &&
15166
+ ((t.state.delayingBlurEvent = !1),
15167
+ t.state.focused && wi(t));
15168
+ }, 100);
15169
+ }
15170
+ function Ci(t, e) {
15171
+ t.state.delayingBlurEvent &&
15172
+ !t.state.draggingText &&
15173
+ (t.state.delayingBlurEvent = !1),
15174
+ "nocursor" != t.options.readOnly &&
15175
+ (t.state.focused ||
15176
+ (pt(t, "focus", t, e),
15177
+ (t.state.focused = !0),
15178
+ M(t.display.wrapper, "CodeMirror-focused"),
15179
+ t.curOp ||
15180
+ t.display.selForContextMenu == t.doc.sel ||
15181
+ (t.display.input.reset(),
15182
+ l &&
15183
+ setTimeout(function () {
15184
+ return t.display.input.reset(!0);
15185
+ }, 20)),
15186
+ t.display.input.receivedFocus()),
15187
+ ki(t));
15188
+ }
15189
+ function wi(t, e) {
15190
+ t.state.delayingBlurEvent ||
15191
+ (t.state.focused &&
15192
+ (pt(t, "blur", t, e),
15193
+ (t.state.focused = !1),
15194
+ E(t.display.wrapper, "CodeMirror-focused")),
15195
+ clearInterval(t.display.blinker),
15196
+ setTimeout(function () {
15197
+ t.state.focused || (t.display.shift = !1);
15198
+ }, 150));
15199
+ }
15200
+ function Ei(t) {
15201
+ for (
15202
+ var e = t.display, n = e.lineDiv.offsetTop, i = 0;
15203
+ i < e.view.length;
15204
+ i++
15205
+ ) {
15206
+ var r = e.view[i],
15207
+ o = t.options.lineWrapping,
15208
+ l = void 0,
15209
+ c = 0;
15210
+ if (!r.hidden) {
15211
+ if (s && a < 8) {
15212
+ var h = r.node.offsetTop + r.node.offsetHeight;
15213
+ (l = h - n), (n = h);
15214
+ } else {
15215
+ var u = r.node.getBoundingClientRect();
15216
+ (l = u.bottom - u.top),
15217
+ !o &&
15218
+ r.text.firstChild &&
15219
+ (c =
15220
+ r.text.firstChild.getBoundingClientRect().right -
15221
+ u.left -
15222
+ 1);
15223
+ }
15224
+ var f = r.line.height - l;
15225
+ if (
15226
+ (f > 0.005 || f < -0.005) &&
15227
+ (Kt(r.line, l), Si(r.line), r.rest)
15228
+ )
15229
+ for (var d = 0; d < r.rest.length; d++) Si(r.rest[d]);
15230
+ if (c > t.display.sizerWidth) {
15231
+ var p = Math.ceil(c / ri(t.display));
15232
+ p > t.display.maxLineLength &&
15233
+ ((t.display.maxLineLength = p),
15234
+ (t.display.maxLine = r.line),
15235
+ (t.display.maxLineChanged = !0));
15236
+ }
15237
+ }
15238
+ }
15239
+ }
15240
+ function Si(t) {
15241
+ if (t.widgets)
15242
+ for (var e = 0; e < t.widgets.length; ++e) {
15243
+ var n = t.widgets[e],
15244
+ i = n.node.parentNode;
15245
+ i && (n.height = i.offsetHeight);
15246
+ }
15247
+ }
15248
+ function Ai(t, e, n) {
15249
+ var i =
15250
+ n && null != n.top ? Math.max(0, n.top) : t.scroller.scrollTop;
15251
+ i = Math.floor(i - Tn(t));
15252
+ var r =
15253
+ n && null != n.bottom ? n.bottom : i + t.wrapper.clientHeight,
15254
+ o = Qt(e, i),
15255
+ s = Qt(e, r);
15256
+ if (n && n.ensure) {
15257
+ var a = n.ensure.from.line,
15258
+ l = n.ensure.to.line;
15259
+ a < o
15260
+ ? ((o = a),
15261
+ (s = Qt(e, We(qt(e, a)) + t.wrapper.clientHeight)))
15262
+ : Math.min(l, e.lastLine()) >= s &&
15263
+ ((o = Qt(e, We(qt(e, l)) - t.wrapper.clientHeight)),
15264
+ (s = l));
15265
+ }
15266
+ return { from: o, to: Math.max(s, o + 1) };
15267
+ }
15268
+ function Li(t, e) {
15269
+ var n = t.display,
15270
+ i = ii(t.display);
15271
+ e.top < 0 && (e.top = 0);
15272
+ var r =
15273
+ t.curOp && null != t.curOp.scrollTop
15274
+ ? t.curOp.scrollTop
15275
+ : n.scroller.scrollTop,
15276
+ o = An(t),
15277
+ s = {};
15278
+ e.bottom - e.top > o && (e.bottom = e.top + o);
15279
+ var a = t.doc.height + Cn(n),
15280
+ l = e.top < i,
15281
+ c = e.bottom > a - i;
15282
+ if (e.top < r) s.scrollTop = l ? 0 : e.top;
15283
+ else if (e.bottom > r + o) {
15284
+ var h = Math.min(e.top, (c ? a : e.bottom) - o);
15285
+ h != r && (s.scrollTop = h);
15286
+ }
15287
+ var u = t.options.fixedGutter ? 0 : n.gutters.offsetWidth,
15288
+ f =
15289
+ t.curOp && null != t.curOp.scrollLeft
15290
+ ? t.curOp.scrollLeft
15291
+ : n.scroller.scrollLeft - u,
15292
+ d = Sn(t) - n.gutters.offsetWidth,
15293
+ p = e.right - e.left > d;
15294
+ return (
15295
+ p && (e.right = e.left + d),
15296
+ e.left < 10
15297
+ ? (s.scrollLeft = 0)
15298
+ : e.left < f
15299
+ ? (s.scrollLeft = Math.max(0, e.left + u - (p ? 0 : 10)))
15300
+ : e.right > d + f - 3 &&
15301
+ (s.scrollLeft = e.right + (p ? 0 : 10) - d),
15302
+ s
15303
+ );
15304
+ }
15305
+ function Oi(t, e) {
15306
+ null != e &&
15307
+ (Mi(t),
15308
+ (t.curOp.scrollTop =
15309
+ (null == t.curOp.scrollTop
15310
+ ? t.doc.scrollTop
15311
+ : t.curOp.scrollTop) + e));
15312
+ }
15313
+ function Ni(t) {
15314
+ Mi(t);
15315
+ var e = t.getCursor();
15316
+ t.curOp.scrollToPos = {
15317
+ from: e,
15318
+ to: e,
15319
+ margin: t.options.cursorScrollMargin,
15320
+ };
15321
+ }
15322
+ function Ii(t, e, n) {
15323
+ (null == e && null == n) || Mi(t),
15324
+ null != e && (t.curOp.scrollLeft = e),
15325
+ null != n && (t.curOp.scrollTop = n);
15326
+ }
15327
+ function Mi(t) {
15328
+ var e = t.curOp.scrollToPos;
15329
+ e &&
15330
+ ((t.curOp.scrollToPos = null),
15331
+ $i(t, Yn(t, e.from), Yn(t, e.to), e.margin));
15332
+ }
15333
+ function $i(t, e, n, i) {
15334
+ var r = Li(t, {
15335
+ left: Math.min(e.left, n.left),
15336
+ top: Math.min(e.top, n.top) - i,
15337
+ right: Math.max(e.right, n.right),
15338
+ bottom: Math.max(e.bottom, n.bottom) + i,
15339
+ });
15340
+ Ii(t, r.scrollLeft, r.scrollTop);
15341
+ }
15342
+ function Ri(t, e) {
15343
+ Math.abs(t.doc.scrollTop - e) < 2 ||
15344
+ (n || lr(t, { top: e }), Di(t, e, !0), n && lr(t), ir(t, 100));
15345
+ }
15346
+ function Di(t, e, n) {
15347
+ (e = Math.max(
15348
+ 0,
15349
+ Math.min(
15350
+ t.display.scroller.scrollHeight -
15351
+ t.display.scroller.clientHeight,
15352
+ e
15353
+ )
15354
+ )),
15355
+ (t.display.scroller.scrollTop != e || n) &&
15356
+ ((t.doc.scrollTop = e),
15357
+ t.display.scrollbars.setScrollTop(e),
15358
+ t.display.scroller.scrollTop != e &&
15359
+ (t.display.scroller.scrollTop = e));
15360
+ }
15361
+ function Pi(t, e, n, i) {
15362
+ (e = Math.max(
15363
+ 0,
15364
+ Math.min(
15365
+ e,
15366
+ t.display.scroller.scrollWidth -
15367
+ t.display.scroller.clientWidth
15368
+ )
15369
+ )),
15370
+ ((n
15371
+ ? e == t.doc.scrollLeft
15372
+ : Math.abs(t.doc.scrollLeft - e) < 2) &&
15373
+ !i) ||
15374
+ ((t.doc.scrollLeft = e),
15375
+ ur(t),
15376
+ t.display.scroller.scrollLeft != e &&
15377
+ (t.display.scroller.scrollLeft = e),
15378
+ t.display.scrollbars.setScrollLeft(e));
15379
+ }
15380
+ function Fi(t) {
15381
+ var e = t.display,
15382
+ n = e.gutters.offsetWidth,
15383
+ i = Math.round(t.doc.height + Cn(t.display));
15384
+ return {
15385
+ clientHeight: e.scroller.clientHeight,
15386
+ viewHeight: e.wrapper.clientHeight,
15387
+ scrollWidth: e.scroller.scrollWidth,
15388
+ clientWidth: e.scroller.clientWidth,
15389
+ viewWidth: e.wrapper.clientWidth,
15390
+ barLeft: t.options.fixedGutter ? n : 0,
15391
+ docHeight: i,
15392
+ scrollHeight: i + En(t) + e.barHeight,
15393
+ nativeBarWidth: e.nativeBarWidth,
15394
+ gutterWidth: n,
15395
+ };
15396
+ }
15397
+ var Bi = function (t, e, n) {
15398
+ this.cm = n;
15399
+ var i = (this.vert = L(
15400
+ "div",
15401
+ [L("div", null, null, "min-width: 1px")],
15402
+ "CodeMirror-vscrollbar"
15403
+ )),
15404
+ r = (this.horiz = L(
15405
+ "div",
15406
+ [L("div", null, null, "height: 100%; min-height: 1px")],
15407
+ "CodeMirror-hscrollbar"
15408
+ ));
15409
+ (i.tabIndex = r.tabIndex = -1),
15410
+ t(i),
15411
+ t(r),
15412
+ ut(i, "scroll", function () {
15413
+ i.clientHeight && e(i.scrollTop, "vertical");
15414
+ }),
15415
+ ut(r, "scroll", function () {
15416
+ r.clientWidth && e(r.scrollLeft, "horizontal");
15417
+ }),
15418
+ (this.checkedZeroWidth = !1),
15419
+ s &&
15420
+ a < 8 &&
15421
+ (this.horiz.style.minHeight = this.vert.style.minWidth =
15422
+ "18px");
15423
+ };
15424
+ (Bi.prototype.update = function (t) {
15425
+ var e = t.scrollWidth > t.clientWidth + 1,
15426
+ n = t.scrollHeight > t.clientHeight + 1,
15427
+ i = t.nativeBarWidth;
15428
+ if (n) {
15429
+ (this.vert.style.display = "block"),
15430
+ (this.vert.style.bottom = e ? i + "px" : "0");
15431
+ var r = t.viewHeight - (e ? i : 0);
15432
+ this.vert.firstChild.style.height =
15433
+ Math.max(0, t.scrollHeight - t.clientHeight + r) + "px";
15434
+ } else
15435
+ (this.vert.style.display = ""),
15436
+ (this.vert.firstChild.style.height = "0");
15437
+ if (e) {
15438
+ (this.horiz.style.display = "block"),
15439
+ (this.horiz.style.right = n ? i + "px" : "0"),
15440
+ (this.horiz.style.left = t.barLeft + "px");
15441
+ var o = t.viewWidth - t.barLeft - (n ? i : 0);
15442
+ this.horiz.firstChild.style.width =
15443
+ Math.max(0, t.scrollWidth - t.clientWidth + o) + "px";
15444
+ } else
15445
+ (this.horiz.style.display = ""),
15446
+ (this.horiz.firstChild.style.width = "0");
15447
+ return (
15448
+ !this.checkedZeroWidth &&
15449
+ t.clientHeight > 0 &&
15450
+ (0 == i && this.zeroWidthHack(),
15451
+ (this.checkedZeroWidth = !0)),
15452
+ { right: n ? i : 0, bottom: e ? i : 0 }
15453
+ );
15454
+ }),
15455
+ (Bi.prototype.setScrollLeft = function (t) {
15456
+ this.horiz.scrollLeft != t && (this.horiz.scrollLeft = t),
15457
+ this.disableHoriz &&
15458
+ this.enableZeroWidthBar(
15459
+ this.horiz,
15460
+ this.disableHoriz,
15461
+ "horiz"
15462
+ );
15463
+ }),
15464
+ (Bi.prototype.setScrollTop = function (t) {
15465
+ this.vert.scrollTop != t && (this.vert.scrollTop = t),
15466
+ this.disableVert &&
15467
+ this.enableZeroWidthBar(
15468
+ this.vert,
15469
+ this.disableVert,
15470
+ "vert"
15471
+ );
15472
+ }),
15473
+ (Bi.prototype.zeroWidthHack = function () {
15474
+ var t = _ && !d ? "12px" : "18px";
15475
+ (this.horiz.style.height = this.vert.style.width = t),
15476
+ (this.horiz.style.pointerEvents =
15477
+ this.vert.style.pointerEvents =
15478
+ "none"),
15479
+ (this.disableHoriz = new B()),
15480
+ (this.disableVert = new B());
15481
+ }),
15482
+ (Bi.prototype.enableZeroWidthBar = function (t, e, n) {
15483
+ (t.style.pointerEvents = "auto"),
15484
+ e.set(1e3, function i() {
15485
+ var r = t.getBoundingClientRect();
15486
+ ("vert" == n
15487
+ ? document.elementFromPoint(
15488
+ r.right - 1,
15489
+ (r.top + r.bottom) / 2
15490
+ )
15491
+ : document.elementFromPoint(
15492
+ (r.right + r.left) / 2,
15493
+ r.bottom - 1
15494
+ )) != t
15495
+ ? (t.style.pointerEvents = "none")
15496
+ : e.set(1e3, i);
15497
+ });
15498
+ }),
15499
+ (Bi.prototype.clear = function () {
15500
+ var t = this.horiz.parentNode;
15501
+ t.removeChild(this.horiz), t.removeChild(this.vert);
15502
+ });
15503
+ var Ui = function () {};
15504
+ function Hi(t, e) {
15505
+ e || (e = Fi(t));
15506
+ var n = t.display.barWidth,
15507
+ i = t.display.barHeight;
15508
+ zi(t, e);
15509
+ for (
15510
+ var r = 0;
15511
+ (r < 4 && n != t.display.barWidth) || i != t.display.barHeight;
15512
+ r++
15513
+ )
15514
+ n != t.display.barWidth && t.options.lineWrapping && Ei(t),
15515
+ zi(t, Fi(t)),
15516
+ (n = t.display.barWidth),
15517
+ (i = t.display.barHeight);
15518
+ }
15519
+ function zi(t, e) {
15520
+ var n = t.display,
15521
+ i = n.scrollbars.update(e);
15522
+ (n.sizer.style.paddingRight = (n.barWidth = i.right) + "px"),
15523
+ (n.sizer.style.paddingBottom = (n.barHeight = i.bottom) + "px"),
15524
+ (n.heightForcer.style.borderBottom =
15525
+ i.bottom + "px solid transparent"),
15526
+ i.right && i.bottom
15527
+ ? ((n.scrollbarFiller.style.display = "block"),
15528
+ (n.scrollbarFiller.style.height = i.bottom + "px"),
15529
+ (n.scrollbarFiller.style.width = i.right + "px"))
15530
+ : (n.scrollbarFiller.style.display = ""),
15531
+ i.bottom &&
15532
+ t.options.coverGutterNextToScrollbar &&
15533
+ t.options.fixedGutter
15534
+ ? ((n.gutterFiller.style.display = "block"),
15535
+ (n.gutterFiller.style.height = i.bottom + "px"),
15536
+ (n.gutterFiller.style.width = e.gutterWidth + "px"))
15537
+ : (n.gutterFiller.style.display = "");
15538
+ }
15539
+ (Ui.prototype.update = function () {
15540
+ return { bottom: 0, right: 0 };
15541
+ }),
15542
+ (Ui.prototype.setScrollLeft = function () {}),
15543
+ (Ui.prototype.setScrollTop = function () {}),
15544
+ (Ui.prototype.clear = function () {});
15545
+ var Wi = { native: Bi, null: Ui };
15546
+ function ji(t) {
15547
+ t.display.scrollbars &&
15548
+ (t.display.scrollbars.clear(),
15549
+ t.display.scrollbars.addClass &&
15550
+ E(t.display.wrapper, t.display.scrollbars.addClass)),
15551
+ (t.display.scrollbars = new Wi[t.options.scrollbarStyle](
15552
+ function (e) {
15553
+ t.display.wrapper.insertBefore(
15554
+ e,
15555
+ t.display.scrollbarFiller
15556
+ ),
15557
+ ut(e, "mousedown", function () {
15558
+ t.state.focused &&
15559
+ setTimeout(function () {
15560
+ return t.display.input.focus();
15561
+ }, 0);
15562
+ }),
15563
+ e.setAttribute("cm-not-content", "true");
15564
+ },
15565
+ function (e, n) {
15566
+ "horizontal" == n ? Pi(t, e) : Ri(t, e);
15567
+ },
15568
+ t
15569
+ )),
15570
+ t.display.scrollbars.addClass &&
15571
+ M(t.display.wrapper, t.display.scrollbars.addClass);
15572
+ }
15573
+ var Gi = 0;
15574
+ function qi(t) {
15575
+ var e;
15576
+ (t.curOp = {
15577
+ cm: t,
15578
+ viewChanged: !1,
15579
+ startHeight: t.doc.height,
15580
+ forceUpdate: !1,
15581
+ updateInput: 0,
15582
+ typing: !1,
15583
+ changeObjs: null,
15584
+ cursorActivityHandlers: null,
15585
+ cursorActivityCalled: 0,
15586
+ selectionChanged: !1,
15587
+ updateMaxLine: !1,
15588
+ scrollLeft: null,
15589
+ scrollTop: null,
15590
+ scrollToPos: null,
15591
+ focus: !1,
15592
+ id: ++Gi,
15593
+ markArrays: null,
15594
+ }),
15595
+ (e = t.curOp),
15596
+ sn
15597
+ ? sn.ops.push(e)
15598
+ : (e.ownsGroup = sn = { ops: [e], delayedCallbacks: [] });
15599
+ }
15600
+ function Vi(t) {
15601
+ var e = t.curOp;
15602
+ e &&
15603
+ (function (t, e) {
15604
+ var n = t.ownsGroup;
15605
+ if (n)
15606
+ try {
15607
+ !(function (t) {
15608
+ var e = t.delayedCallbacks,
15609
+ n = 0;
15610
+ do {
15611
+ for (; n < e.length; n++) e[n].call(null);
15612
+ for (var i = 0; i < t.ops.length; i++) {
15613
+ var r = t.ops[i];
15614
+ if (r.cursorActivityHandlers)
15615
+ for (
15616
+ ;
15617
+ r.cursorActivityCalled <
15618
+ r.cursorActivityHandlers.length;
15619
+
15620
+ )
15621
+ r.cursorActivityHandlers[
15622
+ r.cursorActivityCalled++
15623
+ ].call(null, r.cm);
15624
+ }
15625
+ } while (n < e.length);
15626
+ })(n);
15627
+ } finally {
15628
+ (sn = null), e(n);
15629
+ }
15630
+ })(e, function (t) {
15631
+ for (var e = 0; e < t.ops.length; e++)
15632
+ t.ops[e].cm.curOp = null;
15633
+ !(function (t) {
15634
+ for (var e = t.ops, n = 0; n < e.length; n++) Yi(e[n]);
15635
+ for (var i = 0; i < e.length; i++) Ki(e[i]);
15636
+ for (var r = 0; r < e.length; r++) Xi(e[r]);
15637
+ for (var o = 0; o < e.length; o++) Qi(e[o]);
15638
+ for (var s = 0; s < e.length; s++) Zi(e[s]);
15639
+ })(t);
15640
+ });
15641
+ }
15642
+ function Yi(t) {
15643
+ var e = t.cm,
15644
+ n = e.display;
15645
+ !(function (t) {
15646
+ var e = t.display;
15647
+ !e.scrollbarsClipped &&
15648
+ e.scroller.offsetWidth &&
15649
+ ((e.nativeBarWidth =
15650
+ e.scroller.offsetWidth - e.scroller.clientWidth),
15651
+ (e.heightForcer.style.height = En(t) + "px"),
15652
+ (e.sizer.style.marginBottom = -e.nativeBarWidth + "px"),
15653
+ (e.sizer.style.borderRightWidth = En(t) + "px"),
15654
+ (e.scrollbarsClipped = !0));
15655
+ })(e),
15656
+ t.updateMaxLine && Ge(e),
15657
+ (t.mustUpdate =
15658
+ t.viewChanged ||
15659
+ t.forceUpdate ||
15660
+ null != t.scrollTop ||
15661
+ (t.scrollToPos &&
15662
+ (t.scrollToPos.from.line < n.viewFrom ||
15663
+ t.scrollToPos.to.line >= n.viewTo)) ||
15664
+ (n.maxLineChanged && e.options.lineWrapping)),
15665
+ (t.update =
15666
+ t.mustUpdate &&
15667
+ new or(
15668
+ e,
15669
+ t.mustUpdate && { top: t.scrollTop, ensure: t.scrollToPos },
15670
+ t.forceUpdate
15671
+ ));
15672
+ }
15673
+ function Ki(t) {
15674
+ t.updatedDisplay = t.mustUpdate && sr(t.cm, t.update);
15675
+ }
15676
+ function Xi(t) {
15677
+ var e = t.cm,
15678
+ n = e.display;
15679
+ t.updatedDisplay && Ei(e),
15680
+ (t.barMeasure = Fi(e)),
15681
+ n.maxLineChanged &&
15682
+ !e.options.lineWrapping &&
15683
+ ((t.adjustWidthTo =
15684
+ On(e, n.maxLine, n.maxLine.text.length).left + 3),
15685
+ (e.display.sizerWidth = t.adjustWidthTo),
15686
+ (t.barMeasure.scrollWidth = Math.max(
15687
+ n.scroller.clientWidth,
15688
+ n.sizer.offsetLeft +
15689
+ t.adjustWidthTo +
15690
+ En(e) +
15691
+ e.display.barWidth
15692
+ )),
15693
+ (t.maxScrollLeft = Math.max(
15694
+ 0,
15695
+ n.sizer.offsetLeft + t.adjustWidthTo - Sn(e)
15696
+ ))),
15697
+ (t.updatedDisplay || t.selectionChanged) &&
15698
+ (t.preparedSelection = n.input.prepareSelection());
15699
+ }
15700
+ function Qi(t) {
15701
+ var e = t.cm;
15702
+ null != t.adjustWidthTo &&
15703
+ ((e.display.sizer.style.minWidth = t.adjustWidthTo + "px"),
15704
+ t.maxScrollLeft < e.doc.scrollLeft &&
15705
+ Pi(
15706
+ e,
15707
+ Math.min(e.display.scroller.scrollLeft, t.maxScrollLeft),
15708
+ !0
15709
+ ),
15710
+ (e.display.maxLineChanged = !1));
15711
+ var n = t.focus && t.focus == I();
15712
+ t.preparedSelection &&
15713
+ e.display.input.showSelection(t.preparedSelection, n),
15714
+ (t.updatedDisplay || t.startHeight != e.doc.height) &&
15715
+ Hi(e, t.barMeasure),
15716
+ t.updatedDisplay && hr(e, t.barMeasure),
15717
+ t.selectionChanged && ki(e),
15718
+ e.state.focused &&
15719
+ t.updateInput &&
15720
+ e.display.input.reset(t.typing),
15721
+ n && bi(t.cm);
15722
+ }
15723
+ function Zi(t) {
15724
+ var e = t.cm,
15725
+ n = e.display,
15726
+ i = e.doc;
15727
+ t.updatedDisplay && ar(e, t.update),
15728
+ null == n.wheelStartX ||
15729
+ (null == t.scrollTop &&
15730
+ null == t.scrollLeft &&
15731
+ !t.scrollToPos) ||
15732
+ (n.wheelStartX = n.wheelStartY = null),
15733
+ null != t.scrollTop && Di(e, t.scrollTop, t.forceScroll),
15734
+ null != t.scrollLeft && Pi(e, t.scrollLeft, !0, !0),
15735
+ t.scrollToPos &&
15736
+ (function (t, e) {
15737
+ if (!gt(t, "scrollCursorIntoView")) {
15738
+ var n = t.display,
15739
+ i = n.sizer.getBoundingClientRect(),
15740
+ r = null;
15741
+ if (
15742
+ (e.top + i.top < 0
15743
+ ? (r = !0)
15744
+ : e.bottom + i.top >
15745
+ (window.innerHeight ||
15746
+ document.documentElement.clientHeight) &&
15747
+ (r = !1),
15748
+ null != r && !p)
15749
+ ) {
15750
+ var o = L(
15751
+ "div",
15752
+ "​",
15753
+ null,
15754
+ "position: absolute;\n top: " +
15755
+ (e.top - n.viewOffset - Tn(t.display)) +
15756
+ "px;\n height: " +
15757
+ (e.bottom - e.top + En(t) + n.barHeight) +
15758
+ "px;\n left: " +
15759
+ e.left +
15760
+ "px; width: " +
15761
+ Math.max(2, e.right - e.left) +
15762
+ "px;"
15763
+ );
15764
+ t.display.lineSpace.appendChild(o),
15765
+ o.scrollIntoView(r),
15766
+ t.display.lineSpace.removeChild(o);
15767
+ }
15768
+ }
15769
+ })(
15770
+ e,
15771
+ (function (t, e, n, i) {
15772
+ var r;
15773
+ null == i && (i = 0),
15774
+ t.options.lineWrapping ||
15775
+ e != n ||
15776
+ ((n =
15777
+ "before" == e.sticky
15778
+ ? te(e.line, e.ch + 1, "before")
15779
+ : e),
15780
+ (e = e.ch
15781
+ ? te(
15782
+ e.line,
15783
+ "before" == e.sticky ? e.ch - 1 : e.ch,
15784
+ "after"
15785
+ )
15786
+ : e));
15787
+ for (var o = 0; o < 5; o++) {
15788
+ var s = !1,
15789
+ a = Vn(t, e),
15790
+ l = n && n != e ? Vn(t, n) : a,
15791
+ c = Li(
15792
+ t,
15793
+ (r = {
15794
+ left: Math.min(a.left, l.left),
15795
+ top: Math.min(a.top, l.top) - i,
15796
+ right: Math.max(a.left, l.left),
15797
+ bottom: Math.max(a.bottom, l.bottom) + i,
15798
+ })
15799
+ ),
15800
+ h = t.doc.scrollTop,
15801
+ u = t.doc.scrollLeft;
15802
+ if (
15803
+ (null != c.scrollTop &&
15804
+ (Ri(t, c.scrollTop),
15805
+ Math.abs(t.doc.scrollTop - h) > 1 && (s = !0)),
15806
+ null != c.scrollLeft &&
15807
+ (Pi(t, c.scrollLeft),
15808
+ Math.abs(t.doc.scrollLeft - u) > 1 && (s = !0)),
15809
+ !s)
15810
+ )
15811
+ break;
15812
+ }
15813
+ return r;
15814
+ })(
15815
+ e,
15816
+ ae(i, t.scrollToPos.from),
15817
+ ae(i, t.scrollToPos.to),
15818
+ t.scrollToPos.margin
15819
+ )
15820
+ );
15821
+ var r = t.maybeHiddenMarkers,
15822
+ o = t.maybeUnhiddenMarkers;
15823
+ if (r)
15824
+ for (var s = 0; s < r.length; ++s)
15825
+ r[s].lines.length || pt(r[s], "hide");
15826
+ if (o)
15827
+ for (var a = 0; a < o.length; ++a)
15828
+ o[a].lines.length && pt(o[a], "unhide");
15829
+ n.wrapper.offsetHeight &&
15830
+ (i.scrollTop = e.display.scroller.scrollTop),
15831
+ t.changeObjs && pt(e, "changes", e, t.changeObjs),
15832
+ t.update && t.update.finish();
15833
+ }
15834
+ function Ji(t, e) {
15835
+ if (t.curOp) return e();
15836
+ qi(t);
15837
+ try {
15838
+ return e();
15839
+ } finally {
15840
+ Vi(t);
15841
+ }
15842
+ }
15843
+ function tr(t, e) {
15844
+ return function () {
15845
+ if (t.curOp) return e.apply(t, arguments);
15846
+ qi(t);
15847
+ try {
15848
+ return e.apply(t, arguments);
15849
+ } finally {
15850
+ Vi(t);
15851
+ }
15852
+ };
15853
+ }
15854
+ function er(t) {
15855
+ return function () {
15856
+ if (this.curOp) return t.apply(this, arguments);
15857
+ qi(this);
15858
+ try {
15859
+ return t.apply(this, arguments);
15860
+ } finally {
15861
+ Vi(this);
15862
+ }
15863
+ };
15864
+ }
15865
+ function nr(t) {
15866
+ return function () {
15867
+ var e = this.cm;
15868
+ if (!e || e.curOp) return t.apply(this, arguments);
15869
+ qi(e);
15870
+ try {
15871
+ return t.apply(this, arguments);
15872
+ } finally {
15873
+ Vi(e);
15874
+ }
15875
+ };
15876
+ }
15877
+ function ir(t, e) {
15878
+ t.doc.highlightFrontier < t.display.viewTo &&
15879
+ t.state.highlight.set(e, D(rr, t));
15880
+ }
15881
+ function rr(t) {
15882
+ var e = t.doc;
15883
+ if (!(e.highlightFrontier >= t.display.viewTo)) {
15884
+ var n = +new Date() + t.options.workTime,
15885
+ i = de(t, e.highlightFrontier),
15886
+ r = [];
15887
+ e.iter(
15888
+ i.line,
15889
+ Math.min(e.first + e.size, t.display.viewTo + 500),
15890
+ function (o) {
15891
+ if (i.line >= t.display.viewFrom) {
15892
+ var s = o.styles,
15893
+ a =
15894
+ o.text.length > t.options.maxHighlightLength
15895
+ ? zt(e.mode, i.state)
15896
+ : null,
15897
+ l = ue(t, o, i, !0);
15898
+ a && (i.state = a), (o.styles = l.styles);
15899
+ var c = o.styleClasses,
15900
+ h = l.classes;
15901
+ h ? (o.styleClasses = h) : c && (o.styleClasses = null);
15902
+ for (
15903
+ var u =
15904
+ !s ||
15905
+ s.length != o.styles.length ||
15906
+ (c != h &&
15907
+ (!c ||
15908
+ !h ||
15909
+ c.bgClass != h.bgClass ||
15910
+ c.textClass != h.textClass)),
15911
+ f = 0;
15912
+ !u && f < s.length;
15913
+ ++f
15914
+ )
15915
+ u = s[f] != o.styles[f];
15916
+ u && r.push(i.line),
15917
+ (o.stateAfter = i.save()),
15918
+ i.nextLine();
15919
+ } else
15920
+ o.text.length <= t.options.maxHighlightLength &&
15921
+ pe(t, o.text, i),
15922
+ (o.stateAfter = i.line % 5 == 0 ? i.save() : null),
15923
+ i.nextLine();
15924
+ if (+new Date() > n) return ir(t, t.options.workDelay), !0;
15925
+ }
15926
+ ),
15927
+ (e.highlightFrontier = i.line),
15928
+ (e.modeFrontier = Math.max(e.modeFrontier, i.line)),
15929
+ r.length &&
15930
+ Ji(t, function () {
15931
+ for (var e = 0; e < r.length; e++) fi(t, r[e], "text");
15932
+ });
15933
+ }
15934
+ }
15935
+ var or = function (t, e, n) {
15936
+ var i = t.display;
15937
+ (this.viewport = e),
15938
+ (this.visible = Ai(i, t.doc, e)),
15939
+ (this.editorIsHidden = !i.wrapper.offsetWidth),
15940
+ (this.wrapperHeight = i.wrapper.clientHeight),
15941
+ (this.wrapperWidth = i.wrapper.clientWidth),
15942
+ (this.oldDisplayWidth = Sn(t)),
15943
+ (this.force = n),
15944
+ (this.dims = oi(t)),
15945
+ (this.events = []);
15946
+ };
15947
+ function sr(t, e) {
15948
+ var n = t.display,
15949
+ i = t.doc;
15950
+ if (e.editorIsHidden) return di(t), !1;
15951
+ if (
15952
+ !e.force &&
15953
+ e.visible.from >= n.viewFrom &&
15954
+ e.visible.to <= n.viewTo &&
15955
+ (null == n.updateLineNumbers ||
15956
+ n.updateLineNumbers >= n.viewTo) &&
15957
+ n.renderedView == n.view &&
15958
+ 0 == gi(t)
15959
+ )
15960
+ return !1;
15961
+ fr(t) && (di(t), (e.dims = oi(t)));
15962
+ var r = i.first + i.size,
15963
+ o = Math.max(
15964
+ e.visible.from - t.options.viewportMargin,
15965
+ i.first
15966
+ ),
15967
+ s = Math.min(r, e.visible.to + t.options.viewportMargin);
15968
+ n.viewFrom < o &&
15969
+ o - n.viewFrom < 20 &&
15970
+ (o = Math.max(i.first, n.viewFrom)),
15971
+ n.viewTo > s &&
15972
+ n.viewTo - s < 20 &&
15973
+ (s = Math.min(r, n.viewTo)),
15974
+ be && ((o = Be(t.doc, o)), (s = Ue(t.doc, s)));
15975
+ var a =
15976
+ o != n.viewFrom ||
15977
+ s != n.viewTo ||
15978
+ n.lastWrapHeight != e.wrapperHeight ||
15979
+ n.lastWrapWidth != e.wrapperWidth;
15980
+ !(function (t, e, n) {
15981
+ var i = t.display;
15982
+ 0 == i.view.length || e >= i.viewTo || n <= i.viewFrom
15983
+ ? ((i.view = on(t, e, n)), (i.viewFrom = e))
15984
+ : (i.viewFrom > e
15985
+ ? (i.view = on(t, e, i.viewFrom).concat(i.view))
15986
+ : i.viewFrom < e && (i.view = i.view.slice(hi(t, e))),
15987
+ (i.viewFrom = e),
15988
+ i.viewTo < n
15989
+ ? (i.view = i.view.concat(on(t, i.viewTo, n)))
15990
+ : i.viewTo > n && (i.view = i.view.slice(0, hi(t, n)))),
15991
+ (i.viewTo = n);
15992
+ })(t, o, s),
15993
+ (n.viewOffset = We(qt(t.doc, n.viewFrom))),
15994
+ (t.display.mover.style.top = n.viewOffset + "px");
15995
+ var c = gi(t);
15996
+ if (
15997
+ !a &&
15998
+ 0 == c &&
15999
+ !e.force &&
16000
+ n.renderedView == n.view &&
16001
+ (null == n.updateLineNumbers || n.updateLineNumbers >= n.viewTo)
16002
+ )
16003
+ return !1;
16004
+ var h = (function (t) {
16005
+ if (t.hasFocus()) return null;
16006
+ var e = I();
16007
+ if (!e || !N(t.display.lineDiv, e)) return null;
16008
+ var n = { activeElt: e };
16009
+ if (window.getSelection) {
16010
+ var i = window.getSelection();
16011
+ i.anchorNode &&
16012
+ i.extend &&
16013
+ N(t.display.lineDiv, i.anchorNode) &&
16014
+ ((n.anchorNode = i.anchorNode),
16015
+ (n.anchorOffset = i.anchorOffset),
16016
+ (n.focusNode = i.focusNode),
16017
+ (n.focusOffset = i.focusOffset));
16018
+ }
16019
+ return n;
16020
+ })(t);
16021
+ return (
16022
+ c > 4 && (n.lineDiv.style.display = "none"),
16023
+ (function (t, e, n) {
16024
+ var i = t.display,
16025
+ r = t.options.lineNumbers,
16026
+ o = i.lineDiv,
16027
+ s = o.firstChild;
16028
+ function a(e) {
16029
+ var n = e.nextSibling;
16030
+ return (
16031
+ l && _ && t.display.currentWheelTarget == e
16032
+ ? (e.style.display = "none")
16033
+ : e.parentNode.removeChild(e),
16034
+ n
16035
+ );
16036
+ }
16037
+ for (
16038
+ var c = i.view, h = i.viewFrom, u = 0;
16039
+ u < c.length;
16040
+ u++
16041
+ ) {
16042
+ var f = c[u];
16043
+ if (f.hidden);
16044
+ else if (f.node && f.node.parentNode == o) {
16045
+ for (; s != f.node; ) s = a(s);
16046
+ var d = r && null != e && e <= h && f.lineNumber;
16047
+ f.changes &&
16048
+ (U(f.changes, "gutter") > -1 && (d = !1),
16049
+ hn(t, f, h, n)),
16050
+ d &&
16051
+ (S(f.lineNumber),
16052
+ f.lineNumber.appendChild(
16053
+ document.createTextNode(Jt(t.options, h))
16054
+ )),
16055
+ (s = f.node.nextSibling);
16056
+ } else {
16057
+ var p = vn(t, f, h, n);
16058
+ o.insertBefore(p, s);
16059
+ }
16060
+ h += f.size;
16061
+ }
16062
+ for (; s; ) s = a(s);
16063
+ })(t, n.updateLineNumbers, e.dims),
16064
+ c > 4 && (n.lineDiv.style.display = ""),
16065
+ (n.renderedView = n.view),
16066
+ (function (t) {
16067
+ if (
16068
+ t &&
16069
+ t.activeElt &&
16070
+ t.activeElt != I() &&
16071
+ (t.activeElt.focus(),
16072
+ !/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName) &&
16073
+ t.anchorNode &&
16074
+ N(document.body, t.anchorNode) &&
16075
+ N(document.body, t.focusNode))
16076
+ ) {
16077
+ var e = window.getSelection(),
16078
+ n = document.createRange();
16079
+ n.setEnd(t.anchorNode, t.anchorOffset),
16080
+ n.collapse(!1),
16081
+ e.removeAllRanges(),
16082
+ e.addRange(n),
16083
+ e.extend(t.focusNode, t.focusOffset);
16084
+ }
16085
+ })(h),
16086
+ S(n.cursorDiv),
16087
+ S(n.selectionDiv),
16088
+ (n.gutters.style.height = n.sizer.style.minHeight = 0),
16089
+ a &&
16090
+ ((n.lastWrapHeight = e.wrapperHeight),
16091
+ (n.lastWrapWidth = e.wrapperWidth),
16092
+ ir(t, 400)),
16093
+ (n.updateLineNumbers = null),
16094
+ !0
16095
+ );
16096
+ }
16097
+ function ar(t, e) {
16098
+ for (var n = e.viewport, i = !0; ; i = !1) {
16099
+ if (i && t.options.lineWrapping && e.oldDisplayWidth != Sn(t))
16100
+ i && (e.visible = Ai(t.display, t.doc, n));
16101
+ else if (
16102
+ (n &&
16103
+ null != n.top &&
16104
+ (n = {
16105
+ top: Math.min(
16106
+ t.doc.height + Cn(t.display) - An(t),
16107
+ n.top
16108
+ ),
16109
+ }),
16110
+ (e.visible = Ai(t.display, t.doc, n)),
16111
+ e.visible.from >= t.display.viewFrom &&
16112
+ e.visible.to <= t.display.viewTo)
16113
+ )
16114
+ break;
16115
+ if (!sr(t, e)) break;
16116
+ Ei(t);
16117
+ var r = Fi(t);
16118
+ mi(t), Hi(t, r), hr(t, r), (e.force = !1);
16119
+ }
16120
+ e.signal(t, "update", t),
16121
+ (t.display.viewFrom == t.display.reportedViewFrom &&
16122
+ t.display.viewTo == t.display.reportedViewTo) ||
16123
+ (e.signal(
16124
+ t,
16125
+ "viewportChange",
16126
+ t,
16127
+ t.display.viewFrom,
16128
+ t.display.viewTo
16129
+ ),
16130
+ (t.display.reportedViewFrom = t.display.viewFrom),
16131
+ (t.display.reportedViewTo = t.display.viewTo));
16132
+ }
16133
+ function lr(t, e) {
16134
+ var n = new or(t, e);
16135
+ if (sr(t, n)) {
16136
+ Ei(t), ar(t, n);
16137
+ var i = Fi(t);
16138
+ mi(t), Hi(t, i), hr(t, i), n.finish();
16139
+ }
16140
+ }
16141
+ function cr(t) {
16142
+ var e = t.gutters.offsetWidth;
16143
+ (t.sizer.style.marginLeft = e + "px"), ln(t, "gutterChanged", t);
16144
+ }
16145
+ function hr(t, e) {
16146
+ (t.display.sizer.style.minHeight = e.docHeight + "px"),
16147
+ (t.display.heightForcer.style.top = e.docHeight + "px"),
16148
+ (t.display.gutters.style.height =
16149
+ e.docHeight + t.display.barHeight + En(t) + "px");
16150
+ }
16151
+ function ur(t) {
16152
+ var e = t.display,
16153
+ n = e.view;
16154
+ if (
16155
+ e.alignWidgets ||
16156
+ (e.gutters.firstChild && t.options.fixedGutter)
16157
+ ) {
16158
+ for (
16159
+ var i = si(e) - e.scroller.scrollLeft + t.doc.scrollLeft,
16160
+ r = e.gutters.offsetWidth,
16161
+ o = i + "px",
16162
+ s = 0;
16163
+ s < n.length;
16164
+ s++
16165
+ )
16166
+ if (!n[s].hidden) {
16167
+ t.options.fixedGutter &&
16168
+ (n[s].gutter && (n[s].gutter.style.left = o),
16169
+ n[s].gutterBackground &&
16170
+ (n[s].gutterBackground.style.left = o));
16171
+ var a = n[s].alignable;
16172
+ if (a)
16173
+ for (var l = 0; l < a.length; l++) a[l].style.left = o;
16174
+ }
16175
+ t.options.fixedGutter && (e.gutters.style.left = i + r + "px");
16176
+ }
16177
+ }
16178
+ function fr(t) {
16179
+ if (!t.options.lineNumbers) return !1;
16180
+ var e = t.doc,
16181
+ n = Jt(t.options, e.first + e.size - 1),
16182
+ i = t.display;
16183
+ if (n.length != i.lineNumChars) {
16184
+ var r = i.measure.appendChild(
16185
+ L(
16186
+ "div",
16187
+ [L("div", n)],
16188
+ "CodeMirror-linenumber CodeMirror-gutter-elt"
16189
+ )
16190
+ ),
16191
+ o = r.firstChild.offsetWidth,
16192
+ s = r.offsetWidth - o;
16193
+ return (
16194
+ (i.lineGutter.style.width = ""),
16195
+ (i.lineNumInnerWidth =
16196
+ Math.max(o, i.lineGutter.offsetWidth - s) + 1),
16197
+ (i.lineNumWidth = i.lineNumInnerWidth + s),
16198
+ (i.lineNumChars = i.lineNumInnerWidth ? n.length : -1),
16199
+ (i.lineGutter.style.width = i.lineNumWidth + "px"),
16200
+ cr(t.display),
16201
+ !0
16202
+ );
16203
+ }
16204
+ return !1;
16205
+ }
16206
+ function dr(t, e) {
16207
+ for (var n = [], i = !1, r = 0; r < t.length; r++) {
16208
+ var o = t[r],
16209
+ s = null;
16210
+ if (
16211
+ ("string" != typeof o && ((s = o.style), (o = o.className)),
16212
+ "CodeMirror-linenumbers" == o)
16213
+ ) {
16214
+ if (!e) continue;
16215
+ i = !0;
16216
+ }
16217
+ n.push({ className: o, style: s });
16218
+ }
16219
+ return (
16220
+ e &&
16221
+ !i &&
16222
+ n.push({ className: "CodeMirror-linenumbers", style: null }),
16223
+ n
16224
+ );
16225
+ }
16226
+ function pr(t) {
16227
+ var e = t.gutters,
16228
+ n = t.gutterSpecs;
16229
+ S(e), (t.lineGutter = null);
16230
+ for (var i = 0; i < n.length; ++i) {
16231
+ var r = n[i],
16232
+ o = r.className,
16233
+ s = r.style,
16234
+ a = e.appendChild(L("div", null, "CodeMirror-gutter " + o));
16235
+ s && (a.style.cssText = s),
16236
+ "CodeMirror-linenumbers" == o &&
16237
+ ((t.lineGutter = a),
16238
+ (a.style.width = (t.lineNumWidth || 1) + "px"));
16239
+ }
16240
+ (e.style.display = n.length ? "" : "none"), cr(t);
16241
+ }
16242
+ function gr(t) {
16243
+ pr(t.display), ui(t), ur(t);
16244
+ }
16245
+ function mr(t, e, i, r) {
16246
+ var o = this;
16247
+ (this.input = i),
16248
+ (o.scrollbarFiller = L(
16249
+ "div",
16250
+ null,
16251
+ "CodeMirror-scrollbar-filler"
16252
+ )),
16253
+ o.scrollbarFiller.setAttribute("cm-not-content", "true"),
16254
+ (o.gutterFiller = L("div", null, "CodeMirror-gutter-filler")),
16255
+ o.gutterFiller.setAttribute("cm-not-content", "true"),
16256
+ (o.lineDiv = O("div", null, "CodeMirror-code")),
16257
+ (o.selectionDiv = L(
16258
+ "div",
16259
+ null,
16260
+ null,
16261
+ "position: relative; z-index: 1"
16262
+ )),
16263
+ (o.cursorDiv = L("div", null, "CodeMirror-cursors")),
16264
+ (o.measure = L("div", null, "CodeMirror-measure")),
16265
+ (o.lineMeasure = L("div", null, "CodeMirror-measure")),
16266
+ (o.lineSpace = O(
16267
+ "div",
16268
+ [
16269
+ o.measure,
16270
+ o.lineMeasure,
16271
+ o.selectionDiv,
16272
+ o.cursorDiv,
16273
+ o.lineDiv,
16274
+ ],
16275
+ null,
16276
+ "position: relative; outline: none"
16277
+ ));
16278
+ var c = O("div", [o.lineSpace], "CodeMirror-lines");
16279
+ (o.mover = L("div", [c], null, "position: relative")),
16280
+ (o.sizer = L("div", [o.mover], "CodeMirror-sizer")),
16281
+ (o.sizerWidth = null),
16282
+ (o.heightForcer = L(
16283
+ "div",
16284
+ null,
16285
+ null,
16286
+ "position: absolute; height: 50px; width: 1px;"
16287
+ )),
16288
+ (o.gutters = L("div", null, "CodeMirror-gutters")),
16289
+ (o.lineGutter = null),
16290
+ (o.scroller = L(
16291
+ "div",
16292
+ [o.sizer, o.heightForcer, o.gutters],
16293
+ "CodeMirror-scroll"
16294
+ )),
16295
+ o.scroller.setAttribute("tabIndex", "-1"),
16296
+ (o.wrapper = L(
16297
+ "div",
16298
+ [o.scrollbarFiller, o.gutterFiller, o.scroller],
16299
+ "CodeMirror"
16300
+ )),
16301
+ o.wrapper.setAttribute("translate", "no"),
16302
+ s &&
16303
+ a < 8 &&
16304
+ ((o.gutters.style.zIndex = -1),
16305
+ (o.scroller.style.paddingRight = 0)),
16306
+ l || (n && v) || (o.scroller.draggable = !0),
16307
+ t && (t.appendChild ? t.appendChild(o.wrapper) : t(o.wrapper)),
16308
+ (o.viewFrom = o.viewTo = e.first),
16309
+ (o.reportedViewFrom = o.reportedViewTo = e.first),
16310
+ (o.view = []),
16311
+ (o.renderedView = null),
16312
+ (o.externalMeasured = null),
16313
+ (o.viewOffset = 0),
16314
+ (o.lastWrapHeight = o.lastWrapWidth = 0),
16315
+ (o.updateLineNumbers = null),
16316
+ (o.nativeBarWidth = o.barHeight = o.barWidth = 0),
16317
+ (o.scrollbarsClipped = !1),
16318
+ (o.lineNumWidth = o.lineNumInnerWidth = o.lineNumChars = null),
16319
+ (o.alignWidgets = !1),
16320
+ (o.cachedCharWidth =
16321
+ o.cachedTextHeight =
16322
+ o.cachedPaddingH =
16323
+ null),
16324
+ (o.maxLine = null),
16325
+ (o.maxLineLength = 0),
16326
+ (o.maxLineChanged = !1),
16327
+ (o.wheelDX = o.wheelDY = o.wheelStartX = o.wheelStartY = null),
16328
+ (o.shift = !1),
16329
+ (o.selForContextMenu = null),
16330
+ (o.activeTouch = null),
16331
+ (o.gutterSpecs = dr(r.gutters, r.lineNumbers)),
16332
+ pr(o),
16333
+ i.init(o);
16334
+ }
16335
+ (or.prototype.signal = function (t, e) {
16336
+ vt(t, e) && this.events.push(arguments);
16337
+ }),
16338
+ (or.prototype.finish = function () {
16339
+ for (var t = 0; t < this.events.length; t++)
16340
+ pt.apply(null, this.events[t]);
16341
+ });
16342
+ var vr = 0,
16343
+ _r = null;
16344
+ function yr(t) {
16345
+ var e = t.wheelDeltaX,
16346
+ n = t.wheelDeltaY;
16347
+ return (
16348
+ null == e &&
16349
+ t.detail &&
16350
+ t.axis == t.HORIZONTAL_AXIS &&
16351
+ (e = t.detail),
16352
+ null == n && t.detail && t.axis == t.VERTICAL_AXIS
16353
+ ? (n = t.detail)
16354
+ : null == n && (n = t.wheelDelta),
16355
+ { x: e, y: n }
16356
+ );
16357
+ }
16358
+ function xr(t) {
16359
+ var e = yr(t);
16360
+ return (e.x *= _r), (e.y *= _r), e;
16361
+ }
16362
+ function kr(t, e) {
16363
+ var i = yr(e),
16364
+ r = i.x,
16365
+ o = i.y,
16366
+ s = t.display,
16367
+ a = s.scroller,
16368
+ c = a.scrollWidth > a.clientWidth,
16369
+ h = a.scrollHeight > a.clientHeight;
16370
+ if ((r && c) || (o && h)) {
16371
+ if (o && _ && l)
16372
+ t: for (
16373
+ var f = e.target, d = s.view;
16374
+ f != a;
16375
+ f = f.parentNode
16376
+ )
16377
+ for (var p = 0; p < d.length; p++)
16378
+ if (d[p].node == f) {
16379
+ t.display.currentWheelTarget = f;
16380
+ break t;
16381
+ }
16382
+ if (r && !n && !u && null != _r)
16383
+ return (
16384
+ o && h && Ri(t, Math.max(0, a.scrollTop + o * _r)),
16385
+ Pi(t, Math.max(0, a.scrollLeft + r * _r)),
16386
+ (!o || (o && h)) && yt(e),
16387
+ void (s.wheelStartX = null)
16388
+ );
16389
+ if (o && null != _r) {
16390
+ var g = o * _r,
16391
+ m = t.doc.scrollTop,
16392
+ v = m + s.wrapper.clientHeight;
16393
+ g < 0
16394
+ ? (m = Math.max(0, m + g - 50))
16395
+ : (v = Math.min(t.doc.height, v + g + 50)),
16396
+ lr(t, { top: m, bottom: v });
16397
+ }
16398
+ vr < 20 &&
16399
+ (null == s.wheelStartX
16400
+ ? ((s.wheelStartX = a.scrollLeft),
16401
+ (s.wheelStartY = a.scrollTop),
16402
+ (s.wheelDX = r),
16403
+ (s.wheelDY = o),
16404
+ setTimeout(function () {
16405
+ if (null != s.wheelStartX) {
16406
+ var t = a.scrollLeft - s.wheelStartX,
16407
+ e = a.scrollTop - s.wheelStartY,
16408
+ n =
16409
+ (e && s.wheelDY && e / s.wheelDY) ||
16410
+ (t && s.wheelDX && t / s.wheelDX);
16411
+ (s.wheelStartX = s.wheelStartY = null),
16412
+ n && ((_r = (_r * vr + n) / (vr + 1)), ++vr);
16413
+ }
16414
+ }, 200))
16415
+ : ((s.wheelDX += r), (s.wheelDY += o)));
16416
+ }
16417
+ }
16418
+ s
16419
+ ? (_r = -0.53)
16420
+ : n
16421
+ ? (_r = 15)
16422
+ : h
16423
+ ? (_r = -0.7)
16424
+ : f && (_r = -1 / 3);
16425
+ var br = function (t, e) {
16426
+ (this.ranges = t), (this.primIndex = e);
16427
+ };
16428
+ (br.prototype.primary = function () {
16429
+ return this.ranges[this.primIndex];
16430
+ }),
16431
+ (br.prototype.equals = function (t) {
16432
+ if (t == this) return !0;
16433
+ if (
16434
+ t.primIndex != this.primIndex ||
16435
+ t.ranges.length != this.ranges.length
16436
+ )
16437
+ return !1;
16438
+ for (var e = 0; e < this.ranges.length; e++) {
16439
+ var n = this.ranges[e],
16440
+ i = t.ranges[e];
16441
+ if (!ne(n.anchor, i.anchor) || !ne(n.head, i.head)) return !1;
16442
+ }
16443
+ return !0;
16444
+ }),
16445
+ (br.prototype.deepCopy = function () {
16446
+ for (var t = [], e = 0; e < this.ranges.length; e++)
16447
+ t[e] = new Tr(
16448
+ ie(this.ranges[e].anchor),
16449
+ ie(this.ranges[e].head)
16450
+ );
16451
+ return new br(t, this.primIndex);
16452
+ }),
16453
+ (br.prototype.somethingSelected = function () {
16454
+ for (var t = 0; t < this.ranges.length; t++)
16455
+ if (!this.ranges[t].empty()) return !0;
16456
+ return !1;
16457
+ }),
16458
+ (br.prototype.contains = function (t, e) {
16459
+ e || (e = t);
16460
+ for (var n = 0; n < this.ranges.length; n++) {
16461
+ var i = this.ranges[n];
16462
+ if (ee(e, i.from()) >= 0 && ee(t, i.to()) <= 0) return n;
16463
+ }
16464
+ return -1;
16465
+ });
16466
+ var Tr = function (t, e) {
16467
+ (this.anchor = t), (this.head = e);
16468
+ };
16469
+ function Cr(t, e, n) {
16470
+ var i = t && t.options.selectionsMayTouch,
16471
+ r = e[n];
16472
+ e.sort(function (t, e) {
16473
+ return ee(t.from(), e.from());
16474
+ }),
16475
+ (n = U(e, r));
16476
+ for (var o = 1; o < e.length; o++) {
16477
+ var s = e[o],
16478
+ a = e[o - 1],
16479
+ l = ee(a.to(), s.from());
16480
+ if (i && !s.empty() ? l > 0 : l >= 0) {
16481
+ var c = oe(a.from(), s.from()),
16482
+ h = re(a.to(), s.to()),
16483
+ u = a.empty() ? s.from() == s.head : a.from() == a.head;
16484
+ o <= n && --n, e.splice(--o, 2, new Tr(u ? h : c, u ? c : h));
16485
+ }
16486
+ }
16487
+ return new br(e, n);
16488
+ }
16489
+ function wr(t, e) {
16490
+ return new br([new Tr(t, e || t)], 0);
16491
+ }
16492
+ function Er(t) {
16493
+ return t.text
16494
+ ? te(
16495
+ t.from.line + t.text.length - 1,
16496
+ Y(t.text).length + (1 == t.text.length ? t.from.ch : 0)
16497
+ )
16498
+ : t.to;
16499
+ }
16500
+ function Sr(t, e) {
16501
+ if (ee(t, e.from) < 0) return t;
16502
+ if (ee(t, e.to) <= 0) return Er(e);
16503
+ var n = t.line + e.text.length - (e.to.line - e.from.line) - 1,
16504
+ i = t.ch;
16505
+ return t.line == e.to.line && (i += Er(e).ch - e.to.ch), te(n, i);
16506
+ }
16507
+ function Ar(t, e) {
16508
+ for (var n = [], i = 0; i < t.sel.ranges.length; i++) {
16509
+ var r = t.sel.ranges[i];
16510
+ n.push(new Tr(Sr(r.anchor, e), Sr(r.head, e)));
16511
+ }
16512
+ return Cr(t.cm, n, t.sel.primIndex);
16513
+ }
16514
+ function Lr(t, e, n) {
16515
+ return t.line == e.line
16516
+ ? te(n.line, t.ch - e.ch + n.ch)
16517
+ : te(n.line + (t.line - e.line), t.ch);
16518
+ }
16519
+ function Or(t) {
16520
+ (t.doc.mode = Bt(t.options, t.doc.modeOption)), Nr(t);
16521
+ }
16522
+ function Nr(t) {
16523
+ t.doc.iter(function (t) {
16524
+ t.stateAfter && (t.stateAfter = null),
16525
+ t.styles && (t.styles = null);
16526
+ }),
16527
+ (t.doc.modeFrontier = t.doc.highlightFrontier = t.doc.first),
16528
+ ir(t, 100),
16529
+ t.state.modeGen++,
16530
+ t.curOp && ui(t);
16531
+ }
16532
+ function Ir(t, e) {
16533
+ return (
16534
+ 0 == e.from.ch &&
16535
+ 0 == e.to.ch &&
16536
+ "" == Y(e.text) &&
16537
+ (!t.cm || t.cm.options.wholeLineUpdateBefore)
16538
+ );
16539
+ }
16540
+ function Mr(t, e, n, i) {
16541
+ function r(t) {
16542
+ return n ? n[t] : null;
16543
+ }
16544
+ function o(t, n, r) {
16545
+ !(function (t, e, n, i) {
16546
+ (t.text = e),
16547
+ t.stateAfter && (t.stateAfter = null),
16548
+ t.styles && (t.styles = null),
16549
+ null != t.order && (t.order = null),
16550
+ Ae(t),
16551
+ Le(t, n);
16552
+ var r = i ? i(t) : 1;
16553
+ r != t.height && Kt(t, r);
16554
+ })(t, n, r, i),
16555
+ ln(t, "change", t, e);
16556
+ }
16557
+ function s(t, e) {
16558
+ for (var n = [], o = t; o < e; ++o)
16559
+ n.push(new qe(c[o], r(o), i));
16560
+ return n;
16561
+ }
16562
+ var a = e.from,
16563
+ l = e.to,
16564
+ c = e.text,
16565
+ h = qt(t, a.line),
16566
+ u = qt(t, l.line),
16567
+ f = Y(c),
16568
+ d = r(c.length - 1),
16569
+ p = l.line - a.line;
16570
+ if (e.full)
16571
+ t.insert(0, s(0, c.length)),
16572
+ t.remove(c.length, t.size - c.length);
16573
+ else if (Ir(t, e)) {
16574
+ var g = s(0, c.length - 1);
16575
+ o(u, u.text, d),
16576
+ p && t.remove(a.line, p),
16577
+ g.length && t.insert(a.line, g);
16578
+ } else if (h == u)
16579
+ if (1 == c.length)
16580
+ o(h, h.text.slice(0, a.ch) + f + h.text.slice(l.ch), d);
16581
+ else {
16582
+ var m = s(1, c.length - 1);
16583
+ m.push(new qe(f + h.text.slice(l.ch), d, i)),
16584
+ o(h, h.text.slice(0, a.ch) + c[0], r(0)),
16585
+ t.insert(a.line + 1, m);
16586
+ }
16587
+ else if (1 == c.length)
16588
+ o(h, h.text.slice(0, a.ch) + c[0] + u.text.slice(l.ch), r(0)),
16589
+ t.remove(a.line + 1, p);
16590
+ else {
16591
+ o(h, h.text.slice(0, a.ch) + c[0], r(0)),
16592
+ o(u, f + u.text.slice(l.ch), d);
16593
+ var v = s(1, c.length - 1);
16594
+ p > 1 && t.remove(a.line + 1, p - 1), t.insert(a.line + 1, v);
16595
+ }
16596
+ ln(t, "change", t, e);
16597
+ }
16598
+ function $r(t, e, n) {
16599
+ !(function t(i, r, o) {
16600
+ if (i.linked)
16601
+ for (var s = 0; s < i.linked.length; ++s) {
16602
+ var a = i.linked[s];
16603
+ if (a.doc != r) {
16604
+ var l = o && a.sharedHist;
16605
+ (n && !l) || (e(a.doc, l), t(a.doc, i, l));
16606
+ }
16607
+ }
16608
+ })(t, null, !0);
16609
+ }
16610
+ function Rr(t, e) {
16611
+ if (e.cm) throw new Error("This document is already in use.");
16612
+ (t.doc = e),
16613
+ (e.cm = t),
16614
+ li(t),
16615
+ Or(t),
16616
+ Dr(t),
16617
+ (t.options.direction = e.direction),
16618
+ t.options.lineWrapping || Ge(t),
16619
+ (t.options.mode = e.modeOption),
16620
+ ui(t);
16621
+ }
16622
+ function Dr(t) {
16623
+ ("rtl" == t.doc.direction ? M : E)(
16624
+ t.display.lineDiv,
16625
+ "CodeMirror-rtl"
16626
+ );
16627
+ }
16628
+ function Pr(t) {
16629
+ (this.done = []),
16630
+ (this.undone = []),
16631
+ (this.undoDepth = t ? t.undoDepth : 1 / 0),
16632
+ (this.lastModTime = this.lastSelTime = 0),
16633
+ (this.lastOp = this.lastSelOp = null),
16634
+ (this.lastOrigin = this.lastSelOrigin = null),
16635
+ (this.generation = this.maxGeneration =
16636
+ t ? t.maxGeneration : 1);
16637
+ }
16638
+ function Fr(t, e) {
16639
+ var n = {
16640
+ from: ie(e.from),
16641
+ to: Er(e),
16642
+ text: Vt(t, e.from, e.to),
16643
+ };
16644
+ return (
16645
+ Wr(t, n, e.from.line, e.to.line + 1),
16646
+ $r(
16647
+ t,
16648
+ function (t) {
16649
+ return Wr(t, n, e.from.line, e.to.line + 1);
16650
+ },
16651
+ !0
16652
+ ),
16653
+ n
16654
+ );
16655
+ }
16656
+ function Br(t) {
16657
+ for (; t.length && Y(t).ranges; ) t.pop();
16658
+ }
16659
+ function Ur(t, e, n, i) {
16660
+ var r = t.history;
16661
+ r.undone.length = 0;
16662
+ var o,
16663
+ s,
16664
+ a = +new Date();
16665
+ if (
16666
+ (r.lastOp == i ||
16667
+ (r.lastOrigin == e.origin &&
16668
+ e.origin &&
16669
+ (("+" == e.origin.charAt(0) &&
16670
+ r.lastModTime >
16671
+ a - (t.cm ? t.cm.options.historyEventDelay : 500)) ||
16672
+ "*" == e.origin.charAt(0)))) &&
16673
+ (o = (function (t, e) {
16674
+ return e
16675
+ ? (Br(t.done), Y(t.done))
16676
+ : t.done.length && !Y(t.done).ranges
16677
+ ? Y(t.done)
16678
+ : t.done.length > 1 && !t.done[t.done.length - 2].ranges
16679
+ ? (t.done.pop(), Y(t.done))
16680
+ : void 0;
16681
+ })(r, r.lastOp == i))
16682
+ )
16683
+ (s = Y(o.changes)),
16684
+ 0 == ee(e.from, e.to) && 0 == ee(e.from, s.to)
16685
+ ? (s.to = Er(e))
16686
+ : o.changes.push(Fr(t, e));
16687
+ else {
16688
+ var l = Y(r.done);
16689
+ for (
16690
+ (l && l.ranges) || zr(t.sel, r.done),
16691
+ o = { changes: [Fr(t, e)], generation: r.generation },
16692
+ r.done.push(o);
16693
+ r.done.length > r.undoDepth;
16694
+
16695
+ )
16696
+ r.done.shift(), r.done[0].ranges || r.done.shift();
16697
+ }
16698
+ r.done.push(n),
16699
+ (r.generation = ++r.maxGeneration),
16700
+ (r.lastModTime = r.lastSelTime = a),
16701
+ (r.lastOp = r.lastSelOp = i),
16702
+ (r.lastOrigin = r.lastSelOrigin = e.origin),
16703
+ s || pt(t, "historyAdded");
16704
+ }
16705
+ function Hr(t, e, n, i) {
16706
+ var r = t.history,
16707
+ o = i && i.origin;
16708
+ n == r.lastSelOp ||
16709
+ (o &&
16710
+ r.lastSelOrigin == o &&
16711
+ ((r.lastModTime == r.lastSelTime && r.lastOrigin == o) ||
16712
+ (function (t, e, n, i) {
16713
+ var r = e.charAt(0);
16714
+ return (
16715
+ "*" == r ||
16716
+ ("+" == r &&
16717
+ n.ranges.length == i.ranges.length &&
16718
+ n.somethingSelected() == i.somethingSelected() &&
16719
+ new Date() - t.history.lastSelTime <=
16720
+ (t.cm ? t.cm.options.historyEventDelay : 500))
16721
+ );
16722
+ })(t, o, Y(r.done), e)))
16723
+ ? (r.done[r.done.length - 1] = e)
16724
+ : zr(e, r.done),
16725
+ (r.lastSelTime = +new Date()),
16726
+ (r.lastSelOrigin = o),
16727
+ (r.lastSelOp = n),
16728
+ i && !1 !== i.clearRedo && Br(r.undone);
16729
+ }
16730
+ function zr(t, e) {
16731
+ var n = Y(e);
16732
+ (n && n.ranges && n.equals(t)) || e.push(t);
16733
+ }
16734
+ function Wr(t, e, n, i) {
16735
+ var r = e["spans_" + t.id],
16736
+ o = 0;
16737
+ t.iter(
16738
+ Math.max(t.first, n),
16739
+ Math.min(t.first + t.size, i),
16740
+ function (n) {
16741
+ n.markedSpans &&
16742
+ ((r || (r = e["spans_" + t.id] = {}))[o] = n.markedSpans),
16743
+ ++o;
16744
+ }
16745
+ );
16746
+ }
16747
+ function jr(t) {
16748
+ if (!t) return null;
16749
+ for (var e, n = 0; n < t.length; ++n)
16750
+ t[n].marker.explicitlyCleared
16751
+ ? e || (e = t.slice(0, n))
16752
+ : e && e.push(t[n]);
16753
+ return e ? (e.length ? e : null) : t;
16754
+ }
16755
+ function Gr(t, e) {
16756
+ var n = (function (t, e) {
16757
+ var n = e["spans_" + t.id];
16758
+ if (!n) return null;
16759
+ for (var i = [], r = 0; r < e.text.length; ++r)
16760
+ i.push(jr(n[r]));
16761
+ return i;
16762
+ })(t, e),
16763
+ i = Ee(t, e);
16764
+ if (!n) return i;
16765
+ if (!i) return n;
16766
+ for (var r = 0; r < n.length; ++r) {
16767
+ var o = n[r],
16768
+ s = i[r];
16769
+ if (o && s)
16770
+ t: for (var a = 0; a < s.length; ++a) {
16771
+ for (var l = s[a], c = 0; c < o.length; ++c)
16772
+ if (o[c].marker == l.marker) continue t;
16773
+ o.push(l);
16774
+ }
16775
+ else s && (n[r] = s);
16776
+ }
16777
+ return n;
16778
+ }
16779
+ function qr(t, e, n) {
16780
+ for (var i = [], r = 0; r < t.length; ++r) {
16781
+ var o = t[r];
16782
+ if (o.ranges) i.push(n ? br.prototype.deepCopy.call(o) : o);
16783
+ else {
16784
+ var s = o.changes,
16785
+ a = [];
16786
+ i.push({ changes: a });
16787
+ for (var l = 0; l < s.length; ++l) {
16788
+ var c = s[l],
16789
+ h = void 0;
16790
+ if ((a.push({ from: c.from, to: c.to, text: c.text }), e))
16791
+ for (var u in c)
16792
+ (h = u.match(/^spans_(\d+)$/)) &&
16793
+ U(e, Number(h[1])) > -1 &&
16794
+ ((Y(a)[u] = c[u]), delete c[u]);
16795
+ }
16796
+ }
16797
+ }
16798
+ return i;
16799
+ }
16800
+ function Vr(t, e, n, i) {
16801
+ if (i) {
16802
+ var r = t.anchor;
16803
+ if (n) {
16804
+ var o = ee(e, r) < 0;
16805
+ o != ee(n, r) < 0
16806
+ ? ((r = e), (e = n))
16807
+ : o != ee(e, n) < 0 && (e = n);
16808
+ }
16809
+ return new Tr(r, e);
16810
+ }
16811
+ return new Tr(n || e, e);
16812
+ }
16813
+ function Yr(t, e, n, i, r) {
16814
+ null == r && (r = t.cm && (t.cm.display.shift || t.extend)),
16815
+ Jr(t, new br([Vr(t.sel.primary(), e, n, r)], 0), i);
16816
+ }
16817
+ function Kr(t, e, n) {
16818
+ for (
16819
+ var i = [], r = t.cm && (t.cm.display.shift || t.extend), o = 0;
16820
+ o < t.sel.ranges.length;
16821
+ o++
16822
+ )
16823
+ i[o] = Vr(t.sel.ranges[o], e[o], null, r);
16824
+ Jr(t, Cr(t.cm, i, t.sel.primIndex), n);
16825
+ }
16826
+ function Xr(t, e, n, i) {
16827
+ var r = t.sel.ranges.slice(0);
16828
+ (r[e] = n), Jr(t, Cr(t.cm, r, t.sel.primIndex), i);
16829
+ }
16830
+ function Qr(t, e, n, i) {
16831
+ Jr(t, wr(e, n), i);
16832
+ }
16833
+ function Zr(t, e, n) {
16834
+ var i = t.history.done,
16835
+ r = Y(i);
16836
+ r && r.ranges
16837
+ ? ((i[i.length - 1] = e), to(t, e, n))
16838
+ : Jr(t, e, n);
16839
+ }
16840
+ function Jr(t, e, n) {
16841
+ to(t, e, n), Hr(t, t.sel, t.cm ? t.cm.curOp.id : NaN, n);
16842
+ }
16843
+ function to(t, e, n) {
16844
+ (vt(t, "beforeSelectionChange") ||
16845
+ (t.cm && vt(t.cm, "beforeSelectionChange"))) &&
16846
+ (e = (function (t, e, n) {
16847
+ var i = {
16848
+ ranges: e.ranges,
16849
+ update: function (e) {
16850
+ this.ranges = [];
16851
+ for (var n = 0; n < e.length; n++)
16852
+ this.ranges[n] = new Tr(
16853
+ ae(t, e[n].anchor),
16854
+ ae(t, e[n].head)
16855
+ );
16856
+ },
16857
+ origin: n && n.origin,
16858
+ };
16859
+ return (
16860
+ pt(t, "beforeSelectionChange", t, i),
16861
+ t.cm && pt(t.cm, "beforeSelectionChange", t.cm, i),
16862
+ i.ranges != e.ranges
16863
+ ? Cr(t.cm, i.ranges, i.ranges.length - 1)
16864
+ : e
16865
+ );
16866
+ })(t, e, n));
16867
+ var i =
16868
+ (n && n.bias) ||
16869
+ (ee(e.primary().head, t.sel.primary().head) < 0 ? -1 : 1);
16870
+ eo(t, io(t, e, i, !0)),
16871
+ (n && !1 === n.scroll) ||
16872
+ !t.cm ||
16873
+ "nocursor" == t.cm.getOption("readOnly") ||
16874
+ Ni(t.cm);
16875
+ }
16876
+ function eo(t, e) {
16877
+ e.equals(t.sel) ||
16878
+ ((t.sel = e),
16879
+ t.cm &&
16880
+ ((t.cm.curOp.updateInput = 1),
16881
+ (t.cm.curOp.selectionChanged = !0),
16882
+ mt(t.cm)),
16883
+ ln(t, "cursorActivity", t));
16884
+ }
16885
+ function no(t) {
16886
+ eo(t, io(t, t.sel, null, !1));
16887
+ }
16888
+ function io(t, e, n, i) {
16889
+ for (var r, o = 0; o < e.ranges.length; o++) {
16890
+ var s = e.ranges[o],
16891
+ a = e.ranges.length == t.sel.ranges.length && t.sel.ranges[o],
16892
+ l = oo(t, s.anchor, a && a.anchor, n, i),
16893
+ c = oo(t, s.head, a && a.head, n, i);
16894
+ (r || l != s.anchor || c != s.head) &&
16895
+ (r || (r = e.ranges.slice(0, o)), (r[o] = new Tr(l, c)));
16896
+ }
16897
+ return r ? Cr(t.cm, r, e.primIndex) : e;
16898
+ }
16899
+ function ro(t, e, n, i, r) {
16900
+ var o = qt(t, e.line);
16901
+ if (o.markedSpans)
16902
+ for (var s = 0; s < o.markedSpans.length; ++s) {
16903
+ var a = o.markedSpans[s],
16904
+ l = a.marker,
16905
+ c = "selectLeft" in l ? !l.selectLeft : l.inclusiveLeft,
16906
+ h = "selectRight" in l ? !l.selectRight : l.inclusiveRight;
16907
+ if (
16908
+ (null == a.from || (c ? a.from <= e.ch : a.from < e.ch)) &&
16909
+ (null == a.to || (h ? a.to >= e.ch : a.to > e.ch))
16910
+ ) {
16911
+ if (
16912
+ r &&
16913
+ (pt(l, "beforeCursorEnter"), l.explicitlyCleared)
16914
+ ) {
16915
+ if (o.markedSpans) {
16916
+ --s;
16917
+ continue;
16918
+ }
16919
+ break;
16920
+ }
16921
+ if (!l.atomic) continue;
16922
+ if (n) {
16923
+ var u = l.find(i < 0 ? 1 : -1),
16924
+ f = void 0;
16925
+ if (
16926
+ ((i < 0 ? h : c) &&
16927
+ (u = so(t, u, -i, u && u.line == e.line ? o : null)),
16928
+ u &&
16929
+ u.line == e.line &&
16930
+ (f = ee(u, n)) &&
16931
+ (i < 0 ? f < 0 : f > 0))
16932
+ )
16933
+ return ro(t, u, e, i, r);
16934
+ }
16935
+ var d = l.find(i < 0 ? -1 : 1);
16936
+ return (
16937
+ (i < 0 ? c : h) &&
16938
+ (d = so(t, d, i, d.line == e.line ? o : null)),
16939
+ d ? ro(t, d, e, i, r) : null
16940
+ );
16941
+ }
16942
+ }
16943
+ return e;
16944
+ }
16945
+ function oo(t, e, n, i, r) {
16946
+ var o = i || 1,
16947
+ s =
16948
+ ro(t, e, n, o, r) ||
16949
+ (!r && ro(t, e, n, o, !0)) ||
16950
+ ro(t, e, n, -o, r) ||
16951
+ (!r && ro(t, e, n, -o, !0));
16952
+ return s || ((t.cantEdit = !0), te(t.first, 0));
16953
+ }
16954
+ function so(t, e, n, i) {
16955
+ return n < 0 && 0 == e.ch
16956
+ ? e.line > t.first
16957
+ ? ae(t, te(e.line - 1))
16958
+ : null
16959
+ : n > 0 && e.ch == (i || qt(t, e.line)).text.length
16960
+ ? e.line < t.first + t.size - 1
16961
+ ? te(e.line + 1, 0)
16962
+ : null
16963
+ : new te(e.line, e.ch + n);
16964
+ }
16965
+ function ao(t) {
16966
+ t.setSelection(te(t.firstLine(), 0), te(t.lastLine()), z);
16967
+ }
16968
+ function lo(t, e, n) {
16969
+ var i = {
16970
+ canceled: !1,
16971
+ from: e.from,
16972
+ to: e.to,
16973
+ text: e.text,
16974
+ origin: e.origin,
16975
+ cancel: function () {
16976
+ return (i.canceled = !0);
16977
+ },
16978
+ };
16979
+ return (
16980
+ n &&
16981
+ (i.update = function (e, n, r, o) {
16982
+ e && (i.from = ae(t, e)),
16983
+ n && (i.to = ae(t, n)),
16984
+ r && (i.text = r),
16985
+ void 0 !== o && (i.origin = o);
16986
+ }),
16987
+ pt(t, "beforeChange", t, i),
16988
+ t.cm && pt(t.cm, "beforeChange", t.cm, i),
16989
+ i.canceled
16990
+ ? (t.cm && (t.cm.curOp.updateInput = 2), null)
16991
+ : { from: i.from, to: i.to, text: i.text, origin: i.origin }
16992
+ );
16993
+ }
16994
+ function co(t, e, n) {
16995
+ if (t.cm) {
16996
+ if (!t.cm.curOp) return tr(t.cm, co)(t, e, n);
16997
+ if (t.cm.state.suppressEdits) return;
16998
+ }
16999
+ if (
17000
+ !(
17001
+ vt(t, "beforeChange") ||
17002
+ (t.cm && vt(t.cm, "beforeChange"))
17003
+ ) ||
17004
+ (e = lo(t, e, !0))
17005
+ ) {
17006
+ var i =
17007
+ ke &&
17008
+ !n &&
17009
+ (function (t, e, n) {
17010
+ var i = null;
17011
+ if (
17012
+ (t.iter(e.line, n.line + 1, function (t) {
17013
+ if (t.markedSpans)
17014
+ for (var e = 0; e < t.markedSpans.length; ++e) {
17015
+ var n = t.markedSpans[e].marker;
17016
+ !n.readOnly ||
17017
+ (i && -1 != U(i, n)) ||
17018
+ (i || (i = [])).push(n);
17019
+ }
17020
+ }),
17021
+ !i)
17022
+ )
17023
+ return null;
17024
+ for (var r = [{ from: e, to: n }], o = 0; o < i.length; ++o)
17025
+ for (
17026
+ var s = i[o], a = s.find(0), l = 0;
17027
+ l < r.length;
17028
+ ++l
17029
+ ) {
17030
+ var c = r[l];
17031
+ if (!(ee(c.to, a.from) < 0 || ee(c.from, a.to) > 0)) {
17032
+ var h = [l, 1],
17033
+ u = ee(c.from, a.from),
17034
+ f = ee(c.to, a.to);
17035
+ (u < 0 || (!s.inclusiveLeft && !u)) &&
17036
+ h.push({ from: c.from, to: a.from }),
17037
+ (f > 0 || (!s.inclusiveRight && !f)) &&
17038
+ h.push({ from: a.to, to: c.to }),
17039
+ r.splice.apply(r, h),
17040
+ (l += h.length - 3);
17041
+ }
17042
+ }
17043
+ return r;
17044
+ })(t, e.from, e.to);
17045
+ if (i)
17046
+ for (var r = i.length - 1; r >= 0; --r)
17047
+ ho(t, {
17048
+ from: i[r].from,
17049
+ to: i[r].to,
17050
+ text: r ? [""] : e.text,
17051
+ origin: e.origin,
17052
+ });
17053
+ else ho(t, e);
17054
+ }
17055
+ }
17056
+ function ho(t, e) {
17057
+ if (
17058
+ 1 != e.text.length ||
17059
+ "" != e.text[0] ||
17060
+ 0 != ee(e.from, e.to)
17061
+ ) {
17062
+ var n = Ar(t, e);
17063
+ Ur(t, e, n, t.cm ? t.cm.curOp.id : NaN), po(t, e, n, Ee(t, e));
17064
+ var i = [];
17065
+ $r(t, function (t, n) {
17066
+ n ||
17067
+ -1 != U(i, t.history) ||
17068
+ (_o(t.history, e), i.push(t.history)),
17069
+ po(t, e, null, Ee(t, e));
17070
+ });
17071
+ }
17072
+ }
17073
+ function uo(t, e, n) {
17074
+ var i = t.cm && t.cm.state.suppressEdits;
17075
+ if (!i || n) {
17076
+ for (
17077
+ var r,
17078
+ o = t.history,
17079
+ s = t.sel,
17080
+ a = "undo" == e ? o.done : o.undone,
17081
+ l = "undo" == e ? o.undone : o.done,
17082
+ c = 0;
17083
+ c < a.length &&
17084
+ ((r = a[c]), n ? !r.ranges || r.equals(t.sel) : r.ranges);
17085
+ c++
17086
+ );
17087
+ if (c != a.length) {
17088
+ for (o.lastOrigin = o.lastSelOrigin = null; ; ) {
17089
+ if (!(r = a.pop()).ranges) {
17090
+ if (i) return void a.push(r);
17091
+ break;
17092
+ }
17093
+ if ((zr(r, l), n && !r.equals(t.sel)))
17094
+ return void Jr(t, r, { clearRedo: !1 });
17095
+ s = r;
17096
+ }
17097
+ var h = [];
17098
+ zr(s, l),
17099
+ l.push({ changes: h, generation: o.generation }),
17100
+ (o.generation = r.generation || ++o.maxGeneration);
17101
+ for (
17102
+ var u =
17103
+ vt(t, "beforeChange") ||
17104
+ (t.cm && vt(t.cm, "beforeChange")),
17105
+ f = function (n) {
17106
+ var i = r.changes[n];
17107
+ if (((i.origin = e), u && !lo(t, i, !1)))
17108
+ return (a.length = 0), {};
17109
+ h.push(Fr(t, i));
17110
+ var o = n ? Ar(t, i) : Y(a);
17111
+ po(t, i, o, Gr(t, i)),
17112
+ !n &&
17113
+ t.cm &&
17114
+ t.cm.scrollIntoView({ from: i.from, to: Er(i) });
17115
+ var s = [];
17116
+ $r(t, function (t, e) {
17117
+ e ||
17118
+ -1 != U(s, t.history) ||
17119
+ (_o(t.history, i), s.push(t.history)),
17120
+ po(t, i, null, Gr(t, i));
17121
+ });
17122
+ },
17123
+ d = r.changes.length - 1;
17124
+ d >= 0;
17125
+ --d
17126
+ ) {
17127
+ var p = f(d);
17128
+ if (p) return p.v;
17129
+ }
17130
+ }
17131
+ }
17132
+ }
17133
+ function fo(t, e) {
17134
+ if (
17135
+ 0 != e &&
17136
+ ((t.first += e),
17137
+ (t.sel = new br(
17138
+ K(t.sel.ranges, function (t) {
17139
+ return new Tr(
17140
+ te(t.anchor.line + e, t.anchor.ch),
17141
+ te(t.head.line + e, t.head.ch)
17142
+ );
17143
+ }),
17144
+ t.sel.primIndex
17145
+ )),
17146
+ t.cm)
17147
+ ) {
17148
+ ui(t.cm, t.first, t.first - e, e);
17149
+ for (var n = t.cm.display, i = n.viewFrom; i < n.viewTo; i++)
17150
+ fi(t.cm, i, "gutter");
17151
+ }
17152
+ }
17153
+ function po(t, e, n, i) {
17154
+ if (t.cm && !t.cm.curOp) return tr(t.cm, po)(t, e, n, i);
17155
+ if (e.to.line < t.first)
17156
+ fo(t, e.text.length - 1 - (e.to.line - e.from.line));
17157
+ else if (!(e.from.line > t.lastLine())) {
17158
+ if (e.from.line < t.first) {
17159
+ var r = e.text.length - 1 - (t.first - e.from.line);
17160
+ fo(t, r),
17161
+ (e = {
17162
+ from: te(t.first, 0),
17163
+ to: te(e.to.line + r, e.to.ch),
17164
+ text: [Y(e.text)],
17165
+ origin: e.origin,
17166
+ });
17167
+ }
17168
+ var o = t.lastLine();
17169
+ e.to.line > o &&
17170
+ (e = {
17171
+ from: e.from,
17172
+ to: te(o, qt(t, o).text.length),
17173
+ text: [e.text[0]],
17174
+ origin: e.origin,
17175
+ }),
17176
+ (e.removed = Vt(t, e.from, e.to)),
17177
+ n || (n = Ar(t, e)),
17178
+ t.cm
17179
+ ? (function (t, e, n) {
17180
+ var i = t.doc,
17181
+ r = t.display,
17182
+ o = e.from,
17183
+ s = e.to,
17184
+ a = !1,
17185
+ l = o.line;
17186
+ t.options.lineWrapping ||
17187
+ ((l = Xt(Fe(qt(i, o.line)))),
17188
+ i.iter(l, s.line + 1, function (t) {
17189
+ if (t == r.maxLine) return (a = !0), !0;
17190
+ })),
17191
+ i.sel.contains(e.from, e.to) > -1 && mt(t),
17192
+ Mr(i, e, n, ai(t)),
17193
+ t.options.lineWrapping ||
17194
+ (i.iter(l, o.line + e.text.length, function (t) {
17195
+ var e = je(t);
17196
+ e > r.maxLineLength &&
17197
+ ((r.maxLine = t),
17198
+ (r.maxLineLength = e),
17199
+ (r.maxLineChanged = !0),
17200
+ (a = !1));
17201
+ }),
17202
+ a && (t.curOp.updateMaxLine = !0)),
17203
+ (function (t, e) {
17204
+ if (
17205
+ ((t.modeFrontier = Math.min(t.modeFrontier, e)),
17206
+ !(t.highlightFrontier < e - 10))
17207
+ ) {
17208
+ for (var n = t.first, i = e - 1; i > n; i--) {
17209
+ var r = qt(t, i).stateAfter;
17210
+ if (
17211
+ r &&
17212
+ (!(r instanceof ce) || i + r.lookAhead < e)
17213
+ ) {
17214
+ n = i + 1;
17215
+ break;
17216
+ }
17217
+ }
17218
+ t.highlightFrontier = Math.min(
17219
+ t.highlightFrontier,
17220
+ n
17221
+ );
17222
+ }
17223
+ })(i, o.line),
17224
+ ir(t, 400);
17225
+ var c = e.text.length - (s.line - o.line) - 1;
17226
+ e.full
17227
+ ? ui(t)
17228
+ : o.line != s.line ||
17229
+ 1 != e.text.length ||
17230
+ Ir(t.doc, e)
17231
+ ? ui(t, o.line, s.line + 1, c)
17232
+ : fi(t, o.line, "text");
17233
+ var h = vt(t, "changes"),
17234
+ u = vt(t, "change");
17235
+ if (u || h) {
17236
+ var f = {
17237
+ from: o,
17238
+ to: s,
17239
+ text: e.text,
17240
+ removed: e.removed,
17241
+ origin: e.origin,
17242
+ };
17243
+ u && ln(t, "change", t, f),
17244
+ h &&
17245
+ (
17246
+ t.curOp.changeObjs || (t.curOp.changeObjs = [])
17247
+ ).push(f);
17248
+ }
17249
+ t.display.selForContextMenu = null;
17250
+ })(t.cm, e, i)
17251
+ : Mr(t, e, i),
17252
+ to(t, n, z),
17253
+ t.cantEdit &&
17254
+ oo(t, te(t.firstLine(), 0)) &&
17255
+ (t.cantEdit = !1);
17256
+ }
17257
+ }
17258
+ function go(t, e, n, i, r) {
17259
+ var o;
17260
+ i || (i = n),
17261
+ ee(i, n) < 0 && ((n = (o = [i, n])[0]), (i = o[1])),
17262
+ "string" == typeof e && (e = t.splitLines(e)),
17263
+ co(t, { from: n, to: i, text: e, origin: r });
17264
+ }
17265
+ function mo(t, e, n, i) {
17266
+ n < t.line
17267
+ ? (t.line += i)
17268
+ : e < t.line && ((t.line = e), (t.ch = 0));
17269
+ }
17270
+ function vo(t, e, n, i) {
17271
+ for (var r = 0; r < t.length; ++r) {
17272
+ var o = t[r],
17273
+ s = !0;
17274
+ if (o.ranges) {
17275
+ o.copied || ((o = t[r] = o.deepCopy()).copied = !0);
17276
+ for (var a = 0; a < o.ranges.length; a++)
17277
+ mo(o.ranges[a].anchor, e, n, i),
17278
+ mo(o.ranges[a].head, e, n, i);
17279
+ } else {
17280
+ for (var l = 0; l < o.changes.length; ++l) {
17281
+ var c = o.changes[l];
17282
+ if (n < c.from.line)
17283
+ (c.from = te(c.from.line + i, c.from.ch)),
17284
+ (c.to = te(c.to.line + i, c.to.ch));
17285
+ else if (e <= c.to.line) {
17286
+ s = !1;
17287
+ break;
17288
+ }
17289
+ }
17290
+ s || (t.splice(0, r + 1), (r = 0));
17291
+ }
17292
+ }
17293
+ }
17294
+ function _o(t, e) {
17295
+ var n = e.from.line,
17296
+ i = e.to.line,
17297
+ r = e.text.length - (i - n) - 1;
17298
+ vo(t.done, n, i, r), vo(t.undone, n, i, r);
17299
+ }
17300
+ function yo(t, e, n, i) {
17301
+ var r = e,
17302
+ o = e;
17303
+ return (
17304
+ "number" == typeof e ? (o = qt(t, se(t, e))) : (r = Xt(e)),
17305
+ null == r ? null : (i(o, r) && t.cm && fi(t.cm, r, n), o)
17306
+ );
17307
+ }
17308
+ function xo(t) {
17309
+ (this.lines = t), (this.parent = null);
17310
+ for (var e = 0, n = 0; n < t.length; ++n)
17311
+ (t[n].parent = this), (e += t[n].height);
17312
+ this.height = e;
17313
+ }
17314
+ function ko(t) {
17315
+ this.children = t;
17316
+ for (var e = 0, n = 0, i = 0; i < t.length; ++i) {
17317
+ var r = t[i];
17318
+ (e += r.chunkSize()), (n += r.height), (r.parent = this);
17319
+ }
17320
+ (this.size = e), (this.height = n), (this.parent = null);
17321
+ }
17322
+ (Tr.prototype.from = function () {
17323
+ return oe(this.anchor, this.head);
17324
+ }),
17325
+ (Tr.prototype.to = function () {
17326
+ return re(this.anchor, this.head);
17327
+ }),
17328
+ (Tr.prototype.empty = function () {
17329
+ return (
17330
+ this.head.line == this.anchor.line &&
17331
+ this.head.ch == this.anchor.ch
17332
+ );
17333
+ }),
17334
+ (xo.prototype = {
17335
+ chunkSize: function () {
17336
+ return this.lines.length;
17337
+ },
17338
+ removeInner: function (t, e) {
17339
+ for (var n = t, i = t + e; n < i; ++n) {
17340
+ var r = this.lines[n];
17341
+ (this.height -= r.height), Ve(r), ln(r, "delete");
17342
+ }
17343
+ this.lines.splice(t, e);
17344
+ },
17345
+ collapse: function (t) {
17346
+ t.push.apply(t, this.lines);
17347
+ },
17348
+ insertInner: function (t, e, n) {
17349
+ (this.height += n),
17350
+ (this.lines = this.lines
17351
+ .slice(0, t)
17352
+ .concat(e)
17353
+ .concat(this.lines.slice(t)));
17354
+ for (var i = 0; i < e.length; ++i) e[i].parent = this;
17355
+ },
17356
+ iterN: function (t, e, n) {
17357
+ for (var i = t + e; t < i; ++t)
17358
+ if (n(this.lines[t])) return !0;
17359
+ },
17360
+ }),
17361
+ (ko.prototype = {
17362
+ chunkSize: function () {
17363
+ return this.size;
17364
+ },
17365
+ removeInner: function (t, e) {
17366
+ this.size -= e;
17367
+ for (var n = 0; n < this.children.length; ++n) {
17368
+ var i = this.children[n],
17369
+ r = i.chunkSize();
17370
+ if (t < r) {
17371
+ var o = Math.min(e, r - t),
17372
+ s = i.height;
17373
+ if (
17374
+ (i.removeInner(t, o),
17375
+ (this.height -= s - i.height),
17376
+ r == o &&
17377
+ (this.children.splice(n--, 1), (i.parent = null)),
17378
+ 0 == (e -= o))
17379
+ )
17380
+ break;
17381
+ t = 0;
17382
+ } else t -= r;
17383
+ }
17384
+ if (
17385
+ this.size - e < 25 &&
17386
+ (this.children.length > 1 ||
17387
+ !(this.children[0] instanceof xo))
17388
+ ) {
17389
+ var a = [];
17390
+ this.collapse(a),
17391
+ (this.children = [new xo(a)]),
17392
+ (this.children[0].parent = this);
17393
+ }
17394
+ },
17395
+ collapse: function (t) {
17396
+ for (var e = 0; e < this.children.length; ++e)
17397
+ this.children[e].collapse(t);
17398
+ },
17399
+ insertInner: function (t, e, n) {
17400
+ (this.size += e.length), (this.height += n);
17401
+ for (var i = 0; i < this.children.length; ++i) {
17402
+ var r = this.children[i],
17403
+ o = r.chunkSize();
17404
+ if (t <= o) {
17405
+ if (
17406
+ (r.insertInner(t, e, n), r.lines && r.lines.length > 50)
17407
+ ) {
17408
+ for (
17409
+ var s = (r.lines.length % 25) + 25, a = s;
17410
+ a < r.lines.length;
17411
+
17412
+ ) {
17413
+ var l = new xo(r.lines.slice(a, (a += 25)));
17414
+ (r.height -= l.height),
17415
+ this.children.splice(++i, 0, l),
17416
+ (l.parent = this);
17417
+ }
17418
+ (r.lines = r.lines.slice(0, s)), this.maybeSpill();
17419
+ }
17420
+ break;
17421
+ }
17422
+ t -= o;
17423
+ }
17424
+ },
17425
+ maybeSpill: function () {
17426
+ if (!(this.children.length <= 10)) {
17427
+ var t = this;
17428
+ do {
17429
+ var e = new ko(
17430
+ t.children.splice(t.children.length - 5, 5)
17431
+ );
17432
+ if (t.parent) {
17433
+ (t.size -= e.size), (t.height -= e.height);
17434
+ var n = U(t.parent.children, t);
17435
+ t.parent.children.splice(n + 1, 0, e);
17436
+ } else {
17437
+ var i = new ko(t.children);
17438
+ (i.parent = t), (t.children = [i, e]), (t = i);
17439
+ }
17440
+ e.parent = t.parent;
17441
+ } while (t.children.length > 10);
17442
+ t.parent.maybeSpill();
17443
+ }
17444
+ },
17445
+ iterN: function (t, e, n) {
17446
+ for (var i = 0; i < this.children.length; ++i) {
17447
+ var r = this.children[i],
17448
+ o = r.chunkSize();
17449
+ if (t < o) {
17450
+ var s = Math.min(e, o - t);
17451
+ if (r.iterN(t, s, n)) return !0;
17452
+ if (0 == (e -= s)) break;
17453
+ t = 0;
17454
+ } else t -= o;
17455
+ }
17456
+ },
17457
+ });
17458
+ var bo = function (t, e, n) {
17459
+ if (n) for (var i in n) n.hasOwnProperty(i) && (this[i] = n[i]);
17460
+ (this.doc = t), (this.node = e);
17461
+ };
17462
+ function To(t, e, n) {
17463
+ We(e) < ((t.curOp && t.curOp.scrollTop) || t.doc.scrollTop) &&
17464
+ Oi(t, n);
17465
+ }
17466
+ (bo.prototype.clear = function () {
17467
+ var t = this.doc.cm,
17468
+ e = this.line.widgets,
17469
+ n = this.line,
17470
+ i = Xt(n);
17471
+ if (null != i && e) {
17472
+ for (var r = 0; r < e.length; ++r)
17473
+ e[r] == this && e.splice(r--, 1);
17474
+ e.length || (n.widgets = null);
17475
+ var o = kn(this);
17476
+ Kt(n, Math.max(0, n.height - o)),
17477
+ t &&
17478
+ (Ji(t, function () {
17479
+ To(t, n, -o), fi(t, i, "widget");
17480
+ }),
17481
+ ln(t, "lineWidgetCleared", t, this, i));
17482
+ }
17483
+ }),
17484
+ (bo.prototype.changed = function () {
17485
+ var t = this,
17486
+ e = this.height,
17487
+ n = this.doc.cm,
17488
+ i = this.line;
17489
+ this.height = null;
17490
+ var r = kn(this) - e;
17491
+ r &&
17492
+ (He(this.doc, i) || Kt(i, i.height + r),
17493
+ n &&
17494
+ Ji(n, function () {
17495
+ (n.curOp.forceUpdate = !0),
17496
+ To(n, i, r),
17497
+ ln(n, "lineWidgetChanged", n, t, Xt(i));
17498
+ }));
17499
+ }),
17500
+ _t(bo);
17501
+ var Co = 0,
17502
+ wo = function (t, e) {
17503
+ (this.lines = []),
17504
+ (this.type = e),
17505
+ (this.doc = t),
17506
+ (this.id = ++Co);
17507
+ };
17508
+ function Eo(t, e, n, i, r) {
17509
+ if (i && i.shared)
17510
+ return (function (t, e, n, i, r) {
17511
+ (i = P(i)).shared = !1;
17512
+ var o = [Eo(t, e, n, i, r)],
17513
+ s = o[0],
17514
+ a = i.widgetNode;
17515
+ return (
17516
+ $r(t, function (t) {
17517
+ a && (i.widgetNode = a.cloneNode(!0)),
17518
+ o.push(Eo(t, ae(t, e), ae(t, n), i, r));
17519
+ for (var l = 0; l < t.linked.length; ++l)
17520
+ if (t.linked[l].isParent) return;
17521
+ s = Y(o);
17522
+ }),
17523
+ new So(o, s)
17524
+ );
17525
+ })(t, e, n, i, r);
17526
+ if (t.cm && !t.cm.curOp) return tr(t.cm, Eo)(t, e, n, i, r);
17527
+ var o = new wo(t, r),
17528
+ s = ee(e, n);
17529
+ if (
17530
+ (i && P(i, o, !1), s > 0 || (0 == s && !1 !== o.clearWhenEmpty))
17531
+ )
17532
+ return o;
17533
+ if (
17534
+ (o.replacedWith &&
17535
+ ((o.collapsed = !0),
17536
+ (o.widgetNode = O(
17537
+ "span",
17538
+ [o.replacedWith],
17539
+ "CodeMirror-widget"
17540
+ )),
17541
+ i.handleMouseEvents ||
17542
+ o.widgetNode.setAttribute("cm-ignore-events", "true"),
17543
+ i.insertLeft && (o.widgetNode.insertLeft = !0)),
17544
+ o.collapsed)
17545
+ ) {
17546
+ if (
17547
+ Pe(t, e.line, e, n, o) ||
17548
+ (e.line != n.line && Pe(t, n.line, e, n, o))
17549
+ )
17550
+ throw new Error(
17551
+ "Inserting collapsed marker partially overlapping an existing one"
17552
+ );
17553
+ be = !0;
17554
+ }
17555
+ o.addToHistory &&
17556
+ Ur(t, { from: e, to: n, origin: "markText" }, t.sel, NaN);
17557
+ var a,
17558
+ l = e.line,
17559
+ c = t.cm;
17560
+ if (
17561
+ (t.iter(l, n.line + 1, function (i) {
17562
+ c &&
17563
+ o.collapsed &&
17564
+ !c.options.lineWrapping &&
17565
+ Fe(i) == c.display.maxLine &&
17566
+ (a = !0),
17567
+ o.collapsed && l != e.line && Kt(i, 0),
17568
+ (function (t, e, n) {
17569
+ var i =
17570
+ n &&
17571
+ window.WeakSet &&
17572
+ (n.markedSpans || (n.markedSpans = new WeakSet()));
17573
+ i && i.has(t.markedSpans)
17574
+ ? t.markedSpans.push(e)
17575
+ : ((t.markedSpans = t.markedSpans
17576
+ ? t.markedSpans.concat([e])
17577
+ : [e]),
17578
+ i && i.add(t.markedSpans)),
17579
+ e.marker.attachLine(t);
17580
+ })(
17581
+ i,
17582
+ new Te(
17583
+ o,
17584
+ l == e.line ? e.ch : null,
17585
+ l == n.line ? n.ch : null
17586
+ ),
17587
+ t.cm && t.cm.curOp
17588
+ ),
17589
+ ++l;
17590
+ }),
17591
+ o.collapsed &&
17592
+ t.iter(e.line, n.line + 1, function (e) {
17593
+ He(t, e) && Kt(e, 0);
17594
+ }),
17595
+ o.clearOnEnter &&
17596
+ ut(o, "beforeCursorEnter", function () {
17597
+ return o.clear();
17598
+ }),
17599
+ o.readOnly &&
17600
+ ((ke = !0),
17601
+ (t.history.done.length || t.history.undone.length) &&
17602
+ t.clearHistory()),
17603
+ o.collapsed && ((o.id = ++Co), (o.atomic = !0)),
17604
+ c)
17605
+ ) {
17606
+ if ((a && (c.curOp.updateMaxLine = !0), o.collapsed))
17607
+ ui(c, e.line, n.line + 1);
17608
+ else if (
17609
+ o.className ||
17610
+ o.startStyle ||
17611
+ o.endStyle ||
17612
+ o.css ||
17613
+ o.attributes ||
17614
+ o.title
17615
+ )
17616
+ for (var h = e.line; h <= n.line; h++) fi(c, h, "text");
17617
+ o.atomic && no(c.doc), ln(c, "markerAdded", c, o);
17618
+ }
17619
+ return o;
17620
+ }
17621
+ (wo.prototype.clear = function () {
17622
+ if (!this.explicitlyCleared) {
17623
+ var t = this.doc.cm,
17624
+ e = t && !t.curOp;
17625
+ if ((e && qi(t), vt(this, "clear"))) {
17626
+ var n = this.find();
17627
+ n && ln(this, "clear", n.from, n.to);
17628
+ }
17629
+ for (
17630
+ var i = null, r = null, o = 0;
17631
+ o < this.lines.length;
17632
+ ++o
17633
+ ) {
17634
+ var s = this.lines[o],
17635
+ a = Ce(s.markedSpans, this);
17636
+ t && !this.collapsed
17637
+ ? fi(t, Xt(s), "text")
17638
+ : t &&
17639
+ (null != a.to && (r = Xt(s)),
17640
+ null != a.from && (i = Xt(s))),
17641
+ (s.markedSpans = we(s.markedSpans, a)),
17642
+ null == a.from &&
17643
+ this.collapsed &&
17644
+ !He(this.doc, s) &&
17645
+ t &&
17646
+ Kt(s, ii(t.display));
17647
+ }
17648
+ if (t && this.collapsed && !t.options.lineWrapping)
17649
+ for (var l = 0; l < this.lines.length; ++l) {
17650
+ var c = Fe(this.lines[l]),
17651
+ h = je(c);
17652
+ h > t.display.maxLineLength &&
17653
+ ((t.display.maxLine = c),
17654
+ (t.display.maxLineLength = h),
17655
+ (t.display.maxLineChanged = !0));
17656
+ }
17657
+ null != i && t && this.collapsed && ui(t, i, r + 1),
17658
+ (this.lines.length = 0),
17659
+ (this.explicitlyCleared = !0),
17660
+ this.atomic &&
17661
+ this.doc.cantEdit &&
17662
+ ((this.doc.cantEdit = !1), t && no(t.doc)),
17663
+ t && ln(t, "markerCleared", t, this, i, r),
17664
+ e && Vi(t),
17665
+ this.parent && this.parent.clear();
17666
+ }
17667
+ }),
17668
+ (wo.prototype.find = function (t, e) {
17669
+ var n, i;
17670
+ null == t && "bookmark" == this.type && (t = 1);
17671
+ for (var r = 0; r < this.lines.length; ++r) {
17672
+ var o = this.lines[r],
17673
+ s = Ce(o.markedSpans, this);
17674
+ if (
17675
+ null != s.from &&
17676
+ ((n = te(e ? o : Xt(o), s.from)), -1 == t)
17677
+ )
17678
+ return n;
17679
+ if (null != s.to && ((i = te(e ? o : Xt(o), s.to)), 1 == t))
17680
+ return i;
17681
+ }
17682
+ return n && { from: n, to: i };
17683
+ }),
17684
+ (wo.prototype.changed = function () {
17685
+ var t = this,
17686
+ e = this.find(-1, !0),
17687
+ n = this,
17688
+ i = this.doc.cm;
17689
+ e &&
17690
+ i &&
17691
+ Ji(i, function () {
17692
+ var r = e.line,
17693
+ o = Xt(e.line),
17694
+ s = Nn(i, o);
17695
+ if (
17696
+ (s &&
17697
+ (Fn(s),
17698
+ (i.curOp.selectionChanged = i.curOp.forceUpdate = !0)),
17699
+ (i.curOp.updateMaxLine = !0),
17700
+ !He(n.doc, r) && null != n.height)
17701
+ ) {
17702
+ var a = n.height;
17703
+ n.height = null;
17704
+ var l = kn(n) - a;
17705
+ l && Kt(r, r.height + l);
17706
+ }
17707
+ ln(i, "markerChanged", i, t);
17708
+ });
17709
+ }),
17710
+ (wo.prototype.attachLine = function (t) {
17711
+ if (!this.lines.length && this.doc.cm) {
17712
+ var e = this.doc.cm.curOp;
17713
+ (e.maybeHiddenMarkers &&
17714
+ -1 != U(e.maybeHiddenMarkers, this)) ||
17715
+ (
17716
+ e.maybeUnhiddenMarkers || (e.maybeUnhiddenMarkers = [])
17717
+ ).push(this);
17718
+ }
17719
+ this.lines.push(t);
17720
+ }),
17721
+ (wo.prototype.detachLine = function (t) {
17722
+ if (
17723
+ (this.lines.splice(U(this.lines, t), 1),
17724
+ !this.lines.length && this.doc.cm)
17725
+ ) {
17726
+ var e = this.doc.cm.curOp;
17727
+ (e.maybeHiddenMarkers || (e.maybeHiddenMarkers = [])).push(
17728
+ this
17729
+ );
17730
+ }
17731
+ }),
17732
+ _t(wo);
17733
+ var So = function (t, e) {
17734
+ (this.markers = t), (this.primary = e);
17735
+ for (var n = 0; n < t.length; ++n) t[n].parent = this;
17736
+ };
17737
+ function Ao(t) {
17738
+ return t.findMarks(
17739
+ te(t.first, 0),
17740
+ t.clipPos(te(t.lastLine())),
17741
+ function (t) {
17742
+ return t.parent;
17743
+ }
17744
+ );
17745
+ }
17746
+ function Lo(t) {
17747
+ for (
17748
+ var e = function (e) {
17749
+ var n = t[e],
17750
+ i = [n.primary.doc];
17751
+ $r(n.primary.doc, function (t) {
17752
+ return i.push(t);
17753
+ });
17754
+ for (var r = 0; r < n.markers.length; r++) {
17755
+ var o = n.markers[r];
17756
+ -1 == U(i, o.doc) &&
17757
+ ((o.parent = null), n.markers.splice(r--, 1));
17758
+ }
17759
+ },
17760
+ n = 0;
17761
+ n < t.length;
17762
+ n++
17763
+ )
17764
+ e(n);
17765
+ }
17766
+ (So.prototype.clear = function () {
17767
+ if (!this.explicitlyCleared) {
17768
+ this.explicitlyCleared = !0;
17769
+ for (var t = 0; t < this.markers.length; ++t)
17770
+ this.markers[t].clear();
17771
+ ln(this, "clear");
17772
+ }
17773
+ }),
17774
+ (So.prototype.find = function (t, e) {
17775
+ return this.primary.find(t, e);
17776
+ }),
17777
+ _t(So);
17778
+ var Oo = 0,
17779
+ No = function (t, e, n, i, r) {
17780
+ if (!(this instanceof No)) return new No(t, e, n, i, r);
17781
+ null == n && (n = 0),
17782
+ ko.call(this, [new xo([new qe("", null)])]),
17783
+ (this.first = n),
17784
+ (this.scrollTop = this.scrollLeft = 0),
17785
+ (this.cantEdit = !1),
17786
+ (this.cleanGeneration = 1),
17787
+ (this.modeFrontier = this.highlightFrontier = n);
17788
+ var o = te(n, 0);
17789
+ (this.sel = wr(o)),
17790
+ (this.history = new Pr(null)),
17791
+ (this.id = ++Oo),
17792
+ (this.modeOption = e),
17793
+ (this.lineSep = i),
17794
+ (this.direction = "rtl" == r ? "rtl" : "ltr"),
17795
+ (this.extend = !1),
17796
+ "string" == typeof t && (t = this.splitLines(t)),
17797
+ Mr(this, { from: o, to: o, text: t }),
17798
+ Jr(this, wr(o), z);
17799
+ };
17800
+ (No.prototype = Q(ko.prototype, {
17801
+ constructor: No,
17802
+ iter: function (t, e, n) {
17803
+ n
17804
+ ? this.iterN(t - this.first, e - t, n)
17805
+ : this.iterN(this.first, this.first + this.size, t);
17806
+ },
17807
+ insert: function (t, e) {
17808
+ for (var n = 0, i = 0; i < e.length; ++i) n += e[i].height;
17809
+ this.insertInner(t - this.first, e, n);
17810
+ },
17811
+ remove: function (t, e) {
17812
+ this.removeInner(t - this.first, e);
17813
+ },
17814
+ getValue: function (t) {
17815
+ var e = Yt(this, this.first, this.first + this.size);
17816
+ return !1 === t ? e : e.join(t || this.lineSeparator());
17817
+ },
17818
+ setValue: nr(function (t) {
17819
+ var e = te(this.first, 0),
17820
+ n = this.first + this.size - 1;
17821
+ co(
17822
+ this,
17823
+ {
17824
+ from: e,
17825
+ to: te(n, qt(this, n).text.length),
17826
+ text: this.splitLines(t),
17827
+ origin: "setValue",
17828
+ full: !0,
17829
+ },
17830
+ !0
17831
+ ),
17832
+ this.cm && Ii(this.cm, 0, 0),
17833
+ Jr(this, wr(e), z);
17834
+ }),
17835
+ replaceRange: function (t, e, n, i) {
17836
+ go(this, t, (e = ae(this, e)), (n = n ? ae(this, n) : e), i);
17837
+ },
17838
+ getRange: function (t, e, n) {
17839
+ var i = Vt(this, ae(this, t), ae(this, e));
17840
+ return !1 === n
17841
+ ? i
17842
+ : "" === n
17843
+ ? i.join("")
17844
+ : i.join(n || this.lineSeparator());
17845
+ },
17846
+ getLine: function (t) {
17847
+ var e = this.getLineHandle(t);
17848
+ return e && e.text;
17849
+ },
17850
+ getLineHandle: function (t) {
17851
+ if (Zt(this, t)) return qt(this, t);
17852
+ },
17853
+ getLineNumber: function (t) {
17854
+ return Xt(t);
17855
+ },
17856
+ getLineHandleVisualStart: function (t) {
17857
+ return "number" == typeof t && (t = qt(this, t)), Fe(t);
17858
+ },
17859
+ lineCount: function () {
17860
+ return this.size;
17861
+ },
17862
+ firstLine: function () {
17863
+ return this.first;
17864
+ },
17865
+ lastLine: function () {
17866
+ return this.first + this.size - 1;
17867
+ },
17868
+ clipPos: function (t) {
17869
+ return ae(this, t);
17870
+ },
17871
+ getCursor: function (t) {
17872
+ var e = this.sel.primary();
17873
+ return null == t || "head" == t
17874
+ ? e.head
17875
+ : "anchor" == t
17876
+ ? e.anchor
17877
+ : "end" == t || "to" == t || !1 === t
17878
+ ? e.to()
17879
+ : e.from();
17880
+ },
17881
+ listSelections: function () {
17882
+ return this.sel.ranges;
17883
+ },
17884
+ somethingSelected: function () {
17885
+ return this.sel.somethingSelected();
17886
+ },
17887
+ setCursor: nr(function (t, e, n) {
17888
+ Qr(
17889
+ this,
17890
+ ae(this, "number" == typeof t ? te(t, e || 0) : t),
17891
+ null,
17892
+ n
17893
+ );
17894
+ }),
17895
+ setSelection: nr(function (t, e, n) {
17896
+ Qr(this, ae(this, t), ae(this, e || t), n);
17897
+ }),
17898
+ extendSelection: nr(function (t, e, n) {
17899
+ Yr(this, ae(this, t), e && ae(this, e), n);
17900
+ }),
17901
+ extendSelections: nr(function (t, e) {
17902
+ Kr(this, le(this, t), e);
17903
+ }),
17904
+ extendSelectionsBy: nr(function (t, e) {
17905
+ Kr(this, le(this, K(this.sel.ranges, t)), e);
17906
+ }),
17907
+ setSelections: nr(function (t, e, n) {
17908
+ if (t.length) {
17909
+ for (var i = [], r = 0; r < t.length; r++)
17910
+ i[r] = new Tr(
17911
+ ae(this, t[r].anchor),
17912
+ ae(this, t[r].head || t[r].anchor)
17913
+ );
17914
+ null == e && (e = Math.min(t.length - 1, this.sel.primIndex)),
17915
+ Jr(this, Cr(this.cm, i, e), n);
17916
+ }
17917
+ }),
17918
+ addSelection: nr(function (t, e, n) {
17919
+ var i = this.sel.ranges.slice(0);
17920
+ i.push(new Tr(ae(this, t), ae(this, e || t))),
17921
+ Jr(this, Cr(this.cm, i, i.length - 1), n);
17922
+ }),
17923
+ getSelection: function (t) {
17924
+ for (var e, n = this.sel.ranges, i = 0; i < n.length; i++) {
17925
+ var r = Vt(this, n[i].from(), n[i].to());
17926
+ e = e ? e.concat(r) : r;
17927
+ }
17928
+ return !1 === t ? e : e.join(t || this.lineSeparator());
17929
+ },
17930
+ getSelections: function (t) {
17931
+ for (
17932
+ var e = [], n = this.sel.ranges, i = 0;
17933
+ i < n.length;
17934
+ i++
17935
+ ) {
17936
+ var r = Vt(this, n[i].from(), n[i].to());
17937
+ !1 !== t && (r = r.join(t || this.lineSeparator())),
17938
+ (e[i] = r);
17939
+ }
17940
+ return e;
17941
+ },
17942
+ replaceSelection: function (t, e, n) {
17943
+ for (var i = [], r = 0; r < this.sel.ranges.length; r++)
17944
+ i[r] = t;
17945
+ this.replaceSelections(i, e, n || "+input");
17946
+ },
17947
+ replaceSelections: nr(function (t, e, n) {
17948
+ for (
17949
+ var i = [], r = this.sel, o = 0;
17950
+ o < r.ranges.length;
17951
+ o++
17952
+ ) {
17953
+ var s = r.ranges[o];
17954
+ i[o] = {
17955
+ from: s.from(),
17956
+ to: s.to(),
17957
+ text: this.splitLines(t[o]),
17958
+ origin: n,
17959
+ };
17960
+ }
17961
+ for (
17962
+ var a =
17963
+ e &&
17964
+ "end" != e &&
17965
+ (function (t, e, n) {
17966
+ for (
17967
+ var i = [], r = te(t.first, 0), o = r, s = 0;
17968
+ s < e.length;
17969
+ s++
17970
+ ) {
17971
+ var a = e[s],
17972
+ l = Lr(a.from, r, o),
17973
+ c = Lr(Er(a), r, o);
17974
+ if (((r = a.to), (o = c), "around" == n)) {
17975
+ var h = t.sel.ranges[s],
17976
+ u = ee(h.head, h.anchor) < 0;
17977
+ i[s] = new Tr(u ? c : l, u ? l : c);
17978
+ } else i[s] = new Tr(l, l);
17979
+ }
17980
+ return new br(i, t.sel.primIndex);
17981
+ })(this, i, e),
17982
+ l = i.length - 1;
17983
+ l >= 0;
17984
+ l--
17985
+ )
17986
+ co(this, i[l]);
17987
+ a ? Zr(this, a) : this.cm && Ni(this.cm);
17988
+ }),
17989
+ undo: nr(function () {
17990
+ uo(this, "undo");
17991
+ }),
17992
+ redo: nr(function () {
17993
+ uo(this, "redo");
17994
+ }),
17995
+ undoSelection: nr(function () {
17996
+ uo(this, "undo", !0);
17997
+ }),
17998
+ redoSelection: nr(function () {
17999
+ uo(this, "redo", !0);
18000
+ }),
18001
+ setExtending: function (t) {
18002
+ this.extend = t;
18003
+ },
18004
+ getExtending: function () {
18005
+ return this.extend;
18006
+ },
18007
+ historySize: function () {
18008
+ for (
18009
+ var t = this.history, e = 0, n = 0, i = 0;
18010
+ i < t.done.length;
18011
+ i++
18012
+ )
18013
+ t.done[i].ranges || ++e;
18014
+ for (var r = 0; r < t.undone.length; r++)
18015
+ t.undone[r].ranges || ++n;
18016
+ return { undo: e, redo: n };
18017
+ },
18018
+ clearHistory: function () {
18019
+ var t = this;
18020
+ (this.history = new Pr(this.history)),
18021
+ $r(
18022
+ this,
18023
+ function (e) {
18024
+ return (e.history = t.history);
18025
+ },
18026
+ !0
18027
+ );
18028
+ },
18029
+ markClean: function () {
18030
+ this.cleanGeneration = this.changeGeneration(!0);
18031
+ },
18032
+ changeGeneration: function (t) {
18033
+ return (
18034
+ t &&
18035
+ (this.history.lastOp =
18036
+ this.history.lastSelOp =
18037
+ this.history.lastOrigin =
18038
+ null),
18039
+ this.history.generation
18040
+ );
18041
+ },
18042
+ isClean: function (t) {
18043
+ return this.history.generation == (t || this.cleanGeneration);
18044
+ },
18045
+ getHistory: function () {
18046
+ return {
18047
+ done: qr(this.history.done),
18048
+ undone: qr(this.history.undone),
18049
+ };
18050
+ },
18051
+ setHistory: function (t) {
18052
+ var e = (this.history = new Pr(this.history));
18053
+ (e.done = qr(t.done.slice(0), null, !0)),
18054
+ (e.undone = qr(t.undone.slice(0), null, !0));
18055
+ },
18056
+ setGutterMarker: nr(function (t, e, n) {
18057
+ return yo(this, t, "gutter", function (t) {
18058
+ var i = t.gutterMarkers || (t.gutterMarkers = {});
18059
+ return (
18060
+ (i[e] = n), !n && et(i) && (t.gutterMarkers = null), !0
18061
+ );
18062
+ });
18063
+ }),
18064
+ clearGutter: nr(function (t) {
18065
+ var e = this;
18066
+ this.iter(function (n) {
18067
+ n.gutterMarkers &&
18068
+ n.gutterMarkers[t] &&
18069
+ yo(e, n, "gutter", function () {
18070
+ return (
18071
+ (n.gutterMarkers[t] = null),
18072
+ et(n.gutterMarkers) && (n.gutterMarkers = null),
18073
+ !0
18074
+ );
18075
+ });
18076
+ });
18077
+ }),
18078
+ lineInfo: function (t) {
18079
+ var e;
18080
+ if ("number" == typeof t) {
18081
+ if (!Zt(this, t)) return null;
18082
+ if (((e = t), !(t = qt(this, t)))) return null;
18083
+ } else if (null == (e = Xt(t))) return null;
18084
+ return {
18085
+ line: e,
18086
+ handle: t,
18087
+ text: t.text,
18088
+ gutterMarkers: t.gutterMarkers,
18089
+ textClass: t.textClass,
18090
+ bgClass: t.bgClass,
18091
+ wrapClass: t.wrapClass,
18092
+ widgets: t.widgets,
18093
+ };
18094
+ },
18095
+ addLineClass: nr(function (t, e, n) {
18096
+ return yo(
18097
+ this,
18098
+ t,
18099
+ "gutter" == e ? "gutter" : "class",
18100
+ function (t) {
18101
+ var i =
18102
+ "text" == e
18103
+ ? "textClass"
18104
+ : "background" == e
18105
+ ? "bgClass"
18106
+ : "gutter" == e
18107
+ ? "gutterClass"
18108
+ : "wrapClass";
18109
+ if (t[i]) {
18110
+ if (C(n).test(t[i])) return !1;
18111
+ t[i] += " " + n;
18112
+ } else t[i] = n;
18113
+ return !0;
18114
+ }
18115
+ );
18116
+ }),
18117
+ removeLineClass: nr(function (t, e, n) {
18118
+ return yo(
18119
+ this,
18120
+ t,
18121
+ "gutter" == e ? "gutter" : "class",
18122
+ function (t) {
18123
+ var i =
18124
+ "text" == e
18125
+ ? "textClass"
18126
+ : "background" == e
18127
+ ? "bgClass"
18128
+ : "gutter" == e
18129
+ ? "gutterClass"
18130
+ : "wrapClass",
18131
+ r = t[i];
18132
+ if (!r) return !1;
18133
+ if (null == n) t[i] = null;
18134
+ else {
18135
+ var o = r.match(C(n));
18136
+ if (!o) return !1;
18137
+ var s = o.index + o[0].length;
18138
+ t[i] =
18139
+ r.slice(0, o.index) +
18140
+ (o.index && s != r.length ? " " : "") +
18141
+ r.slice(s) || null;
18142
+ }
18143
+ return !0;
18144
+ }
18145
+ );
18146
+ }),
18147
+ addLineWidget: nr(function (t, e, n) {
18148
+ return (function (t, e, n, i) {
18149
+ var r = new bo(t, n, i),
18150
+ o = t.cm;
18151
+ return (
18152
+ o && r.noHScroll && (o.display.alignWidgets = !0),
18153
+ yo(t, e, "widget", function (e) {
18154
+ var n = e.widgets || (e.widgets = []);
18155
+ if (
18156
+ (null == r.insertAt
18157
+ ? n.push(r)
18158
+ : n.splice(
18159
+ Math.min(n.length, Math.max(0, r.insertAt)),
18160
+ 0,
18161
+ r
18162
+ ),
18163
+ (r.line = e),
18164
+ o && !He(t, e))
18165
+ ) {
18166
+ var i = We(e) < t.scrollTop;
18167
+ Kt(e, e.height + kn(r)),
18168
+ i && Oi(o, r.height),
18169
+ (o.curOp.forceUpdate = !0);
18170
+ }
18171
+ return !0;
18172
+ }),
18173
+ o &&
18174
+ ln(
18175
+ o,
18176
+ "lineWidgetAdded",
18177
+ o,
18178
+ r,
18179
+ "number" == typeof e ? e : Xt(e)
18180
+ ),
18181
+ r
18182
+ );
18183
+ })(this, t, e, n);
18184
+ }),
18185
+ removeLineWidget: function (t) {
18186
+ t.clear();
18187
+ },
18188
+ markText: function (t, e, n) {
18189
+ return Eo(
18190
+ this,
18191
+ ae(this, t),
18192
+ ae(this, e),
18193
+ n,
18194
+ (n && n.type) || "range"
18195
+ );
18196
+ },
18197
+ setBookmark: function (t, e) {
18198
+ var n = {
18199
+ replacedWith: e && (null == e.nodeType ? e.widget : e),
18200
+ insertLeft: e && e.insertLeft,
18201
+ clearWhenEmpty: !1,
18202
+ shared: e && e.shared,
18203
+ handleMouseEvents: e && e.handleMouseEvents,
18204
+ };
18205
+ return Eo(this, (t = ae(this, t)), t, n, "bookmark");
18206
+ },
18207
+ findMarksAt: function (t) {
18208
+ var e = [],
18209
+ n = qt(this, (t = ae(this, t)).line).markedSpans;
18210
+ if (n)
18211
+ for (var i = 0; i < n.length; ++i) {
18212
+ var r = n[i];
18213
+ (null == r.from || r.from <= t.ch) &&
18214
+ (null == r.to || r.to >= t.ch) &&
18215
+ e.push(r.marker.parent || r.marker);
18216
+ }
18217
+ return e;
18218
+ },
18219
+ findMarks: function (t, e, n) {
18220
+ (t = ae(this, t)), (e = ae(this, e));
18221
+ var i = [],
18222
+ r = t.line;
18223
+ return (
18224
+ this.iter(t.line, e.line + 1, function (o) {
18225
+ var s = o.markedSpans;
18226
+ if (s)
18227
+ for (var a = 0; a < s.length; a++) {
18228
+ var l = s[a];
18229
+ (null != l.to && r == t.line && t.ch >= l.to) ||
18230
+ (null == l.from && r != t.line) ||
18231
+ (null != l.from && r == e.line && l.from >= e.ch) ||
18232
+ (n && !n(l.marker)) ||
18233
+ i.push(l.marker.parent || l.marker);
18234
+ }
18235
+ ++r;
18236
+ }),
18237
+ i
18238
+ );
18239
+ },
18240
+ getAllMarks: function () {
18241
+ var t = [];
18242
+ return (
18243
+ this.iter(function (e) {
18244
+ var n = e.markedSpans;
18245
+ if (n)
18246
+ for (var i = 0; i < n.length; ++i)
18247
+ null != n[i].from && t.push(n[i].marker);
18248
+ }),
18249
+ t
18250
+ );
18251
+ },
18252
+ posFromIndex: function (t) {
18253
+ var e,
18254
+ n = this.first,
18255
+ i = this.lineSeparator().length;
18256
+ return (
18257
+ this.iter(function (r) {
18258
+ var o = r.text.length + i;
18259
+ if (o > t) return (e = t), !0;
18260
+ (t -= o), ++n;
18261
+ }),
18262
+ ae(this, te(n, e))
18263
+ );
18264
+ },
18265
+ indexFromPos: function (t) {
18266
+ var e = (t = ae(this, t)).ch;
18267
+ if (t.line < this.first || t.ch < 0) return 0;
18268
+ var n = this.lineSeparator().length;
18269
+ return (
18270
+ this.iter(this.first, t.line, function (t) {
18271
+ e += t.text.length + n;
18272
+ }),
18273
+ e
18274
+ );
18275
+ },
18276
+ copy: function (t) {
18277
+ var e = new No(
18278
+ Yt(this, this.first, this.first + this.size),
18279
+ this.modeOption,
18280
+ this.first,
18281
+ this.lineSep,
18282
+ this.direction
18283
+ );
18284
+ return (
18285
+ (e.scrollTop = this.scrollTop),
18286
+ (e.scrollLeft = this.scrollLeft),
18287
+ (e.sel = this.sel),
18288
+ (e.extend = !1),
18289
+ t &&
18290
+ ((e.history.undoDepth = this.history.undoDepth),
18291
+ e.setHistory(this.getHistory())),
18292
+ e
18293
+ );
18294
+ },
18295
+ linkedDoc: function (t) {
18296
+ t || (t = {});
18297
+ var e = this.first,
18298
+ n = this.first + this.size;
18299
+ null != t.from && t.from > e && (e = t.from),
18300
+ null != t.to && t.to < n && (n = t.to);
18301
+ var i = new No(
18302
+ Yt(this, e, n),
18303
+ t.mode || this.modeOption,
18304
+ e,
18305
+ this.lineSep,
18306
+ this.direction
18307
+ );
18308
+ return (
18309
+ t.sharedHist && (i.history = this.history),
18310
+ (this.linked || (this.linked = [])).push({
18311
+ doc: i,
18312
+ sharedHist: t.sharedHist,
18313
+ }),
18314
+ (i.linked = [
18315
+ { doc: this, isParent: !0, sharedHist: t.sharedHist },
18316
+ ]),
18317
+ (function (t, e) {
18318
+ for (var n = 0; n < e.length; n++) {
18319
+ var i = e[n],
18320
+ r = i.find(),
18321
+ o = t.clipPos(r.from),
18322
+ s = t.clipPos(r.to);
18323
+ if (ee(o, s)) {
18324
+ var a = Eo(t, o, s, i.primary, i.primary.type);
18325
+ i.markers.push(a), (a.parent = i);
18326
+ }
18327
+ }
18328
+ })(i, Ao(this)),
18329
+ i
18330
+ );
18331
+ },
18332
+ unlinkDoc: function (t) {
18333
+ if ((t instanceof Ss && (t = t.doc), this.linked))
18334
+ for (var e = 0; e < this.linked.length; ++e)
18335
+ if (this.linked[e].doc == t) {
18336
+ this.linked.splice(e, 1), t.unlinkDoc(this), Lo(Ao(this));
18337
+ break;
18338
+ }
18339
+ if (t.history == this.history) {
18340
+ var n = [t.id];
18341
+ $r(
18342
+ t,
18343
+ function (t) {
18344
+ return n.push(t.id);
18345
+ },
18346
+ !0
18347
+ ),
18348
+ (t.history = new Pr(null)),
18349
+ (t.history.done = qr(this.history.done, n)),
18350
+ (t.history.undone = qr(this.history.undone, n));
18351
+ }
18352
+ },
18353
+ iterLinkedDocs: function (t) {
18354
+ $r(this, t);
18355
+ },
18356
+ getMode: function () {
18357
+ return this.mode;
18358
+ },
18359
+ getEditor: function () {
18360
+ return this.cm;
18361
+ },
18362
+ splitLines: function (t) {
18363
+ return this.lineSep ? t.split(this.lineSep) : Nt(t);
18364
+ },
18365
+ lineSeparator: function () {
18366
+ return this.lineSep || "\n";
18367
+ },
18368
+ setDirection: nr(function (t) {
18369
+ var e;
18370
+ "rtl" != t && (t = "ltr"),
18371
+ t != this.direction &&
18372
+ ((this.direction = t),
18373
+ this.iter(function (t) {
18374
+ return (t.order = null);
18375
+ }),
18376
+ this.cm &&
18377
+ Ji((e = this.cm), function () {
18378
+ Dr(e), ui(e);
18379
+ }));
18380
+ }),
18381
+ })),
18382
+ (No.prototype.eachLine = No.prototype.iter);
18383
+ var Io = 0;
18384
+ function Mo(t) {
18385
+ var e = this;
18386
+ if (($o(e), !gt(e, t) && !bn(e.display, t))) {
18387
+ yt(t), s && (Io = +new Date());
18388
+ var n = ci(e, t, !0),
18389
+ i = t.dataTransfer.files;
18390
+ if (n && !e.isReadOnly())
18391
+ if (i && i.length && window.FileReader && window.File)
18392
+ for (
18393
+ var r = i.length,
18394
+ o = Array(r),
18395
+ a = 0,
18396
+ l = function () {
18397
+ ++a == r &&
18398
+ tr(e, function () {
18399
+ var t = {
18400
+ from: (n = ae(e.doc, n)),
18401
+ to: n,
18402
+ text: e.doc.splitLines(
18403
+ o
18404
+ .filter(function (t) {
18405
+ return null != t;
18406
+ })
18407
+ .join(e.doc.lineSeparator())
18408
+ ),
18409
+ origin: "paste",
18410
+ };
18411
+ co(e.doc, t),
18412
+ Zr(e.doc, wr(ae(e.doc, n), ae(e.doc, Er(t))));
18413
+ })();
18414
+ },
18415
+ c = function (t, n) {
18416
+ if (
18417
+ e.options.allowDropFileTypes &&
18418
+ -1 == U(e.options.allowDropFileTypes, t.type)
18419
+ )
18420
+ l();
18421
+ else {
18422
+ var i = new FileReader();
18423
+ (i.onerror = function () {
18424
+ return l();
18425
+ }),
18426
+ (i.onload = function () {
18427
+ var t = i.result;
18428
+ /[\x00-\x08\x0e-\x1f]{2}/.test(t) || (o[n] = t),
18429
+ l();
18430
+ }),
18431
+ i.readAsText(t);
18432
+ }
18433
+ },
18434
+ h = 0;
18435
+ h < i.length;
18436
+ h++
18437
+ )
18438
+ c(i[h], h);
18439
+ else {
18440
+ if (e.state.draggingText && e.doc.sel.contains(n) > -1)
18441
+ return (
18442
+ e.state.draggingText(t),
18443
+ void setTimeout(function () {
18444
+ return e.display.input.focus();
18445
+ }, 20)
18446
+ );
18447
+ try {
18448
+ var u = t.dataTransfer.getData("Text");
18449
+ if (u) {
18450
+ var f;
18451
+ if (
18452
+ (e.state.draggingText &&
18453
+ !e.state.draggingText.copy &&
18454
+ (f = e.listSelections()),
18455
+ to(e.doc, wr(n, n)),
18456
+ f)
18457
+ )
18458
+ for (var d = 0; d < f.length; ++d)
18459
+ go(e.doc, "", f[d].anchor, f[d].head, "drag");
18460
+ e.replaceSelection(u, "around", "paste"),
18461
+ e.display.input.focus();
18462
+ }
18463
+ } catch (t) {}
18464
+ }
18465
+ }
18466
+ }
18467
+ function $o(t) {
18468
+ t.display.dragCursor &&
18469
+ (t.display.lineSpace.removeChild(t.display.dragCursor),
18470
+ (t.display.dragCursor = null));
18471
+ }
18472
+ function Ro(t) {
18473
+ if (document.getElementsByClassName) {
18474
+ for (
18475
+ var e = document.getElementsByClassName("CodeMirror"),
18476
+ n = [],
18477
+ i = 0;
18478
+ i < e.length;
18479
+ i++
18480
+ ) {
18481
+ var r = e[i].CodeMirror;
18482
+ r && n.push(r);
18483
+ }
18484
+ n.length &&
18485
+ n[0].operation(function () {
18486
+ for (var e = 0; e < n.length; e++) t(n[e]);
18487
+ });
18488
+ }
18489
+ }
18490
+ var Do = !1;
18491
+ function Po() {
18492
+ var t;
18493
+ Do ||
18494
+ (ut(window, "resize", function () {
18495
+ null == t &&
18496
+ (t = setTimeout(function () {
18497
+ (t = null), Ro(Fo);
18498
+ }, 100));
18499
+ }),
18500
+ ut(window, "blur", function () {
18501
+ return Ro(wi);
18502
+ }),
18503
+ (Do = !0));
18504
+ }
18505
+ function Fo(t) {
18506
+ var e = t.display;
18507
+ (e.cachedCharWidth =
18508
+ e.cachedTextHeight =
18509
+ e.cachedPaddingH =
18510
+ null),
18511
+ (e.scrollbarsClipped = !1),
18512
+ t.setSize();
18513
+ }
18514
+ for (
18515
+ var Bo = {
18516
+ 3: "Pause",
18517
+ 8: "Backspace",
18518
+ 9: "Tab",
18519
+ 13: "Enter",
18520
+ 16: "Shift",
18521
+ 17: "Ctrl",
18522
+ 18: "Alt",
18523
+ 19: "Pause",
18524
+ 20: "CapsLock",
18525
+ 27: "Esc",
18526
+ 32: "Space",
18527
+ 33: "PageUp",
18528
+ 34: "PageDown",
18529
+ 35: "End",
18530
+ 36: "Home",
18531
+ 37: "Left",
18532
+ 38: "Up",
18533
+ 39: "Right",
18534
+ 40: "Down",
18535
+ 44: "PrintScrn",
18536
+ 45: "Insert",
18537
+ 46: "Delete",
18538
+ 59: ";",
18539
+ 61: "=",
18540
+ 91: "Mod",
18541
+ 92: "Mod",
18542
+ 93: "Mod",
18543
+ 106: "*",
18544
+ 107: "=",
18545
+ 109: "-",
18546
+ 110: ".",
18547
+ 111: "/",
18548
+ 145: "ScrollLock",
18549
+ 173: "-",
18550
+ 186: ";",
18551
+ 187: "=",
18552
+ 188: ",",
18553
+ 189: "-",
18554
+ 190: ".",
18555
+ 191: "/",
18556
+ 192: "`",
18557
+ 219: "[",
18558
+ 220: "\\",
18559
+ 221: "]",
18560
+ 222: "'",
18561
+ 224: "Mod",
18562
+ 63232: "Up",
18563
+ 63233: "Down",
18564
+ 63234: "Left",
18565
+ 63235: "Right",
18566
+ 63272: "Delete",
18567
+ 63273: "Home",
18568
+ 63275: "End",
18569
+ 63276: "PageUp",
18570
+ 63277: "PageDown",
18571
+ 63302: "Insert",
18572
+ },
18573
+ Uo = 0;
18574
+ Uo < 10;
18575
+ Uo++
18576
+ )
18577
+ Bo[Uo + 48] = Bo[Uo + 96] = String(Uo);
18578
+ for (var Ho = 65; Ho <= 90; Ho++) Bo[Ho] = String.fromCharCode(Ho);
18579
+ for (var zo = 1; zo <= 12; zo++)
18580
+ Bo[zo + 111] = Bo[zo + 63235] = "F" + zo;
18581
+ var Wo = {};
18582
+ function jo(t) {
18583
+ var e,
18584
+ n,
18585
+ i,
18586
+ r,
18587
+ o = t.split(/-(?!$)/);
18588
+ t = o[o.length - 1];
18589
+ for (var s = 0; s < o.length - 1; s++) {
18590
+ var a = o[s];
18591
+ if (/^(cmd|meta|m)$/i.test(a)) r = !0;
18592
+ else if (/^a(lt)?$/i.test(a)) e = !0;
18593
+ else if (/^(c|ctrl|control)$/i.test(a)) n = !0;
18594
+ else {
18595
+ if (!/^s(hift)?$/i.test(a))
18596
+ throw new Error("Unrecognized modifier name: " + a);
18597
+ i = !0;
18598
+ }
18599
+ }
18600
+ return (
18601
+ e && (t = "Alt-" + t),
18602
+ n && (t = "Ctrl-" + t),
18603
+ r && (t = "Cmd-" + t),
18604
+ i && (t = "Shift-" + t),
18605
+ t
18606
+ );
18607
+ }
18608
+ function Go(t) {
18609
+ var e = {};
18610
+ for (var n in t)
18611
+ if (t.hasOwnProperty(n)) {
18612
+ var i = t[n];
18613
+ if (/^(name|fallthrough|(de|at)tach)$/.test(n)) continue;
18614
+ if ("..." == i) {
18615
+ delete t[n];
18616
+ continue;
18617
+ }
18618
+ for (var r = K(n.split(" "), jo), o = 0; o < r.length; o++) {
18619
+ var s = void 0,
18620
+ a = void 0;
18621
+ o == r.length - 1
18622
+ ? ((a = r.join(" ")), (s = i))
18623
+ : ((a = r.slice(0, o + 1).join(" ")), (s = "..."));
18624
+ var l = e[a];
18625
+ if (l) {
18626
+ if (l != s)
18627
+ throw new Error("Inconsistent bindings for " + a);
18628
+ } else e[a] = s;
18629
+ }
18630
+ delete t[n];
18631
+ }
18632
+ for (var c in e) t[c] = e[c];
18633
+ return t;
18634
+ }
18635
+ function qo(t, e, n, i) {
18636
+ var r = (e = Xo(e)).call ? e.call(t, i) : e[t];
18637
+ if (!1 === r) return "nothing";
18638
+ if ("..." === r) return "multi";
18639
+ if (null != r && n(r)) return "handled";
18640
+ if (e.fallthrough) {
18641
+ if (
18642
+ "[object Array]" !=
18643
+ Object.prototype.toString.call(e.fallthrough)
18644
+ )
18645
+ return qo(t, e.fallthrough, n, i);
18646
+ for (var o = 0; o < e.fallthrough.length; o++) {
18647
+ var s = qo(t, e.fallthrough[o], n, i);
18648
+ if (s) return s;
18649
+ }
18650
+ }
18651
+ }
18652
+ function Vo(t) {
18653
+ var e = "string" == typeof t ? t : Bo[t.keyCode];
18654
+ return "Ctrl" == e || "Alt" == e || "Shift" == e || "Mod" == e;
18655
+ }
18656
+ function Yo(t, e, n) {
18657
+ var i = t;
18658
+ return (
18659
+ e.altKey && "Alt" != i && (t = "Alt-" + t),
18660
+ (b ? e.metaKey : e.ctrlKey) && "Ctrl" != i && (t = "Ctrl-" + t),
18661
+ (b ? e.ctrlKey : e.metaKey) && "Mod" != i && (t = "Cmd-" + t),
18662
+ !n && e.shiftKey && "Shift" != i && (t = "Shift-" + t),
18663
+ t
18664
+ );
18665
+ }
18666
+ function Ko(t, e) {
18667
+ if (u && 34 == t.keyCode && t.char) return !1;
18668
+ var n = Bo[t.keyCode];
18669
+ return (
18670
+ null != n &&
18671
+ !t.altGraphKey &&
18672
+ (3 == t.keyCode && t.code && (n = t.code), Yo(n, t, e))
18673
+ );
18674
+ }
18675
+ function Xo(t) {
18676
+ return "string" == typeof t ? Wo[t] : t;
18677
+ }
18678
+ function Qo(t, e) {
18679
+ for (var n = t.doc.sel.ranges, i = [], r = 0; r < n.length; r++) {
18680
+ for (var o = e(n[r]); i.length && ee(o.from, Y(i).to) <= 0; ) {
18681
+ var s = i.pop();
18682
+ if (ee(s.from, o.from) < 0) {
18683
+ o.from = s.from;
18684
+ break;
18685
+ }
18686
+ }
18687
+ i.push(o);
18688
+ }
18689
+ Ji(t, function () {
18690
+ for (var e = i.length - 1; e >= 0; e--)
18691
+ go(t.doc, "", i[e].from, i[e].to, "+delete");
18692
+ Ni(t);
18693
+ });
18694
+ }
18695
+ function Zo(t, e, n) {
18696
+ var i = rt(t.text, e + n, n);
18697
+ return i < 0 || i > t.text.length ? null : i;
18698
+ }
18699
+ function Jo(t, e, n) {
18700
+ var i = Zo(t, e.ch, n);
18701
+ return null == i
18702
+ ? null
18703
+ : new te(e.line, i, n < 0 ? "after" : "before");
18704
+ }
18705
+ function ts(t, e, n, i, r) {
18706
+ if (t) {
18707
+ "rtl" == e.doc.direction && (r = -r);
18708
+ var o = ct(n, e.doc.direction);
18709
+ if (o) {
18710
+ var s,
18711
+ a = r < 0 ? Y(o) : o[0],
18712
+ l = r < 0 == (1 == a.level) ? "after" : "before";
18713
+ if (a.level > 0 || "rtl" == e.doc.direction) {
18714
+ var c = In(e, n);
18715
+ s = r < 0 ? n.text.length - 1 : 0;
18716
+ var h = Mn(e, c, s).top;
18717
+ (s = ot(
18718
+ function (t) {
18719
+ return Mn(e, c, t).top == h;
18720
+ },
18721
+ r < 0 == (1 == a.level) ? a.from : a.to - 1,
18722
+ s
18723
+ )),
18724
+ "before" == l && (s = Zo(n, s, 1));
18725
+ } else s = r < 0 ? a.to : a.from;
18726
+ return new te(i, s, l);
18727
+ }
18728
+ }
18729
+ return new te(
18730
+ i,
18731
+ r < 0 ? n.text.length : 0,
18732
+ r < 0 ? "before" : "after"
18733
+ );
18734
+ }
18735
+ (Wo.basic = {
18736
+ Left: "goCharLeft",
18737
+ Right: "goCharRight",
18738
+ Up: "goLineUp",
18739
+ Down: "goLineDown",
18740
+ End: "goLineEnd",
18741
+ Home: "goLineStartSmart",
18742
+ PageUp: "goPageUp",
18743
+ PageDown: "goPageDown",
18744
+ Delete: "delCharAfter",
18745
+ Backspace: "delCharBefore",
18746
+ "Shift-Backspace": "delCharBefore",
18747
+ Tab: "defaultTab",
18748
+ "Shift-Tab": "indentAuto",
18749
+ Enter: "newlineAndIndent",
18750
+ Insert: "toggleOverwrite",
18751
+ Esc: "singleSelection",
18752
+ }),
18753
+ (Wo.pcDefault = {
18754
+ "Ctrl-A": "selectAll",
18755
+ "Ctrl-D": "deleteLine",
18756
+ "Ctrl-Z": "undo",
18757
+ "Shift-Ctrl-Z": "redo",
18758
+ "Ctrl-Y": "redo",
18759
+ "Ctrl-Home": "goDocStart",
18760
+ "Ctrl-End": "goDocEnd",
18761
+ "Ctrl-Up": "goLineUp",
18762
+ "Ctrl-Down": "goLineDown",
18763
+ "Ctrl-Left": "goGroupLeft",
18764
+ "Ctrl-Right": "goGroupRight",
18765
+ "Alt-Left": "goLineStart",
18766
+ "Alt-Right": "goLineEnd",
18767
+ "Ctrl-Backspace": "delGroupBefore",
18768
+ "Ctrl-Delete": "delGroupAfter",
18769
+ "Ctrl-S": "save",
18770
+ "Ctrl-F": "find",
18771
+ "Ctrl-G": "findNext",
18772
+ "Shift-Ctrl-G": "findPrev",
18773
+ "Shift-Ctrl-F": "replace",
18774
+ "Shift-Ctrl-R": "replaceAll",
18775
+ "Ctrl-[": "indentLess",
18776
+ "Ctrl-]": "indentMore",
18777
+ "Ctrl-U": "undoSelection",
18778
+ "Shift-Ctrl-U": "redoSelection",
18779
+ "Alt-U": "redoSelection",
18780
+ fallthrough: "basic",
18781
+ }),
18782
+ (Wo.emacsy = {
18783
+ "Ctrl-F": "goCharRight",
18784
+ "Ctrl-B": "goCharLeft",
18785
+ "Ctrl-P": "goLineUp",
18786
+ "Ctrl-N": "goLineDown",
18787
+ "Ctrl-A": "goLineStart",
18788
+ "Ctrl-E": "goLineEnd",
18789
+ "Ctrl-V": "goPageDown",
18790
+ "Shift-Ctrl-V": "goPageUp",
18791
+ "Ctrl-D": "delCharAfter",
18792
+ "Ctrl-H": "delCharBefore",
18793
+ "Alt-Backspace": "delWordBefore",
18794
+ "Ctrl-K": "killLine",
18795
+ "Ctrl-T": "transposeChars",
18796
+ "Ctrl-O": "openLine",
18797
+ }),
18798
+ (Wo.macDefault = {
18799
+ "Cmd-A": "selectAll",
18800
+ "Cmd-D": "deleteLine",
18801
+ "Cmd-Z": "undo",
18802
+ "Shift-Cmd-Z": "redo",
18803
+ "Cmd-Y": "redo",
18804
+ "Cmd-Home": "goDocStart",
18805
+ "Cmd-Up": "goDocStart",
18806
+ "Cmd-End": "goDocEnd",
18807
+ "Cmd-Down": "goDocEnd",
18808
+ "Alt-Left": "goGroupLeft",
18809
+ "Alt-Right": "goGroupRight",
18810
+ "Cmd-Left": "goLineLeft",
18811
+ "Cmd-Right": "goLineRight",
18812
+ "Alt-Backspace": "delGroupBefore",
18813
+ "Ctrl-Alt-Backspace": "delGroupAfter",
18814
+ "Alt-Delete": "delGroupAfter",
18815
+ "Cmd-S": "save",
18816
+ "Cmd-F": "find",
18817
+ "Cmd-G": "findNext",
18818
+ "Shift-Cmd-G": "findPrev",
18819
+ "Cmd-Alt-F": "replace",
18820
+ "Shift-Cmd-Alt-F": "replaceAll",
18821
+ "Cmd-[": "indentLess",
18822
+ "Cmd-]": "indentMore",
18823
+ "Cmd-Backspace": "delWrappedLineLeft",
18824
+ "Cmd-Delete": "delWrappedLineRight",
18825
+ "Cmd-U": "undoSelection",
18826
+ "Shift-Cmd-U": "redoSelection",
18827
+ "Ctrl-Up": "goDocStart",
18828
+ "Ctrl-Down": "goDocEnd",
18829
+ fallthrough: ["basic", "emacsy"],
18830
+ }),
18831
+ (Wo.default = _ ? Wo.macDefault : Wo.pcDefault);
18832
+ var es = {
18833
+ selectAll: ao,
18834
+ singleSelection: function (t) {
18835
+ return t.setSelection(
18836
+ t.getCursor("anchor"),
18837
+ t.getCursor("head"),
18838
+ z
18839
+ );
18840
+ },
18841
+ killLine: function (t) {
18842
+ return Qo(t, function (e) {
18843
+ if (e.empty()) {
18844
+ var n = qt(t.doc, e.head.line).text.length;
18845
+ return e.head.ch == n && e.head.line < t.lastLine()
18846
+ ? { from: e.head, to: te(e.head.line + 1, 0) }
18847
+ : { from: e.head, to: te(e.head.line, n) };
18848
+ }
18849
+ return { from: e.from(), to: e.to() };
18850
+ });
18851
+ },
18852
+ deleteLine: function (t) {
18853
+ return Qo(t, function (e) {
18854
+ return {
18855
+ from: te(e.from().line, 0),
18856
+ to: ae(t.doc, te(e.to().line + 1, 0)),
18857
+ };
18858
+ });
18859
+ },
18860
+ delLineLeft: function (t) {
18861
+ return Qo(t, function (t) {
18862
+ return { from: te(t.from().line, 0), to: t.from() };
18863
+ });
18864
+ },
18865
+ delWrappedLineLeft: function (t) {
18866
+ return Qo(t, function (e) {
18867
+ var n = t.charCoords(e.head, "div").top + 5;
18868
+ return {
18869
+ from: t.coordsChar({ left: 0, top: n }, "div"),
18870
+ to: e.from(),
18871
+ };
18872
+ });
18873
+ },
18874
+ delWrappedLineRight: function (t) {
18875
+ return Qo(t, function (e) {
18876
+ var n = t.charCoords(e.head, "div").top + 5,
18877
+ i = t.coordsChar(
18878
+ { left: t.display.lineDiv.offsetWidth + 100, top: n },
18879
+ "div"
18880
+ );
18881
+ return { from: e.from(), to: i };
18882
+ });
18883
+ },
18884
+ undo: function (t) {
18885
+ return t.undo();
18886
+ },
18887
+ redo: function (t) {
18888
+ return t.redo();
18889
+ },
18890
+ undoSelection: function (t) {
18891
+ return t.undoSelection();
18892
+ },
18893
+ redoSelection: function (t) {
18894
+ return t.redoSelection();
18895
+ },
18896
+ goDocStart: function (t) {
18897
+ return t.extendSelection(te(t.firstLine(), 0));
18898
+ },
18899
+ goDocEnd: function (t) {
18900
+ return t.extendSelection(te(t.lastLine()));
18901
+ },
18902
+ goLineStart: function (t) {
18903
+ return t.extendSelectionsBy(
18904
+ function (e) {
18905
+ return ns(t, e.head.line);
18906
+ },
18907
+ { origin: "+move", bias: 1 }
18908
+ );
18909
+ },
18910
+ goLineStartSmart: function (t) {
18911
+ return t.extendSelectionsBy(
18912
+ function (e) {
18913
+ return is(t, e.head);
18914
+ },
18915
+ { origin: "+move", bias: 1 }
18916
+ );
18917
+ },
18918
+ goLineEnd: function (t) {
18919
+ return t.extendSelectionsBy(
18920
+ function (e) {
18921
+ return (function (t, e) {
18922
+ var n = qt(t.doc, e),
18923
+ i = (function (t) {
18924
+ for (var e; (e = Re(t)); ) t = e.find(1, !0).line;
18925
+ return t;
18926
+ })(n);
18927
+ return i != n && (e = Xt(i)), ts(!0, t, n, e, -1);
18928
+ })(t, e.head.line);
18929
+ },
18930
+ { origin: "+move", bias: -1 }
18931
+ );
18932
+ },
18933
+ goLineRight: function (t) {
18934
+ return t.extendSelectionsBy(function (e) {
18935
+ var n = t.cursorCoords(e.head, "div").top + 5;
18936
+ return t.coordsChar(
18937
+ { left: t.display.lineDiv.offsetWidth + 100, top: n },
18938
+ "div"
18939
+ );
18940
+ }, j);
18941
+ },
18942
+ goLineLeft: function (t) {
18943
+ return t.extendSelectionsBy(function (e) {
18944
+ var n = t.cursorCoords(e.head, "div").top + 5;
18945
+ return t.coordsChar({ left: 0, top: n }, "div");
18946
+ }, j);
18947
+ },
18948
+ goLineLeftSmart: function (t) {
18949
+ return t.extendSelectionsBy(function (e) {
18950
+ var n = t.cursorCoords(e.head, "div").top + 5,
18951
+ i = t.coordsChar({ left: 0, top: n }, "div");
18952
+ return i.ch < t.getLine(i.line).search(/\S/)
18953
+ ? is(t, e.head)
18954
+ : i;
18955
+ }, j);
18956
+ },
18957
+ goLineUp: function (t) {
18958
+ return t.moveV(-1, "line");
18959
+ },
18960
+ goLineDown: function (t) {
18961
+ return t.moveV(1, "line");
18962
+ },
18963
+ goPageUp: function (t) {
18964
+ return t.moveV(-1, "page");
18965
+ },
18966
+ goPageDown: function (t) {
18967
+ return t.moveV(1, "page");
18968
+ },
18969
+ goCharLeft: function (t) {
18970
+ return t.moveH(-1, "char");
18971
+ },
18972
+ goCharRight: function (t) {
18973
+ return t.moveH(1, "char");
18974
+ },
18975
+ goColumnLeft: function (t) {
18976
+ return t.moveH(-1, "column");
18977
+ },
18978
+ goColumnRight: function (t) {
18979
+ return t.moveH(1, "column");
18980
+ },
18981
+ goWordLeft: function (t) {
18982
+ return t.moveH(-1, "word");
18983
+ },
18984
+ goGroupRight: function (t) {
18985
+ return t.moveH(1, "group");
18986
+ },
18987
+ goGroupLeft: function (t) {
18988
+ return t.moveH(-1, "group");
18989
+ },
18990
+ goWordRight: function (t) {
18991
+ return t.moveH(1, "word");
18992
+ },
18993
+ delCharBefore: function (t) {
18994
+ return t.deleteH(-1, "codepoint");
18995
+ },
18996
+ delCharAfter: function (t) {
18997
+ return t.deleteH(1, "char");
18998
+ },
18999
+ delWordBefore: function (t) {
19000
+ return t.deleteH(-1, "word");
19001
+ },
19002
+ delWordAfter: function (t) {
19003
+ return t.deleteH(1, "word");
19004
+ },
19005
+ delGroupBefore: function (t) {
19006
+ return t.deleteH(-1, "group");
19007
+ },
19008
+ delGroupAfter: function (t) {
19009
+ return t.deleteH(1, "group");
19010
+ },
19011
+ indentAuto: function (t) {
19012
+ return t.indentSelection("smart");
19013
+ },
19014
+ indentMore: function (t) {
19015
+ return t.indentSelection("add");
19016
+ },
19017
+ indentLess: function (t) {
19018
+ return t.indentSelection("subtract");
19019
+ },
19020
+ insertTab: function (t) {
19021
+ return t.replaceSelection("\t");
19022
+ },
19023
+ insertSoftTab: function (t) {
19024
+ for (
19025
+ var e = [],
19026
+ n = t.listSelections(),
19027
+ i = t.options.tabSize,
19028
+ r = 0;
19029
+ r < n.length;
19030
+ r++
19031
+ ) {
19032
+ var o = n[r].from(),
19033
+ s = F(t.getLine(o.line), o.ch, i);
19034
+ e.push(V(i - (s % i)));
19035
+ }
19036
+ t.replaceSelections(e);
19037
+ },
19038
+ defaultTab: function (t) {
19039
+ t.somethingSelected()
19040
+ ? t.indentSelection("add")
19041
+ : t.execCommand("insertTab");
19042
+ },
19043
+ transposeChars: function (t) {
19044
+ return Ji(t, function () {
19045
+ for (
19046
+ var e = t.listSelections(), n = [], i = 0;
19047
+ i < e.length;
19048
+ i++
19049
+ )
19050
+ if (e[i].empty()) {
19051
+ var r = e[i].head,
19052
+ o = qt(t.doc, r.line).text;
19053
+ if (o)
19054
+ if (
19055
+ (r.ch == o.length && (r = new te(r.line, r.ch - 1)),
19056
+ r.ch > 0)
19057
+ )
19058
+ (r = new te(r.line, r.ch + 1)),
19059
+ t.replaceRange(
19060
+ o.charAt(r.ch - 1) + o.charAt(r.ch - 2),
19061
+ te(r.line, r.ch - 2),
19062
+ r,
19063
+ "+transpose"
19064
+ );
19065
+ else if (r.line > t.doc.first) {
19066
+ var s = qt(t.doc, r.line - 1).text;
19067
+ s &&
19068
+ ((r = new te(r.line, 1)),
19069
+ t.replaceRange(
19070
+ o.charAt(0) +
19071
+ t.doc.lineSeparator() +
19072
+ s.charAt(s.length - 1),
19073
+ te(r.line - 1, s.length - 1),
19074
+ r,
19075
+ "+transpose"
19076
+ ));
19077
+ }
19078
+ n.push(new Tr(r, r));
19079
+ }
19080
+ t.setSelections(n);
19081
+ });
19082
+ },
19083
+ newlineAndIndent: function (t) {
19084
+ return Ji(t, function () {
19085
+ for (
19086
+ var e = t.listSelections(), n = e.length - 1;
19087
+ n >= 0;
19088
+ n--
19089
+ )
19090
+ t.replaceRange(
19091
+ t.doc.lineSeparator(),
19092
+ e[n].anchor,
19093
+ e[n].head,
19094
+ "+input"
19095
+ );
19096
+ e = t.listSelections();
19097
+ for (var i = 0; i < e.length; i++)
19098
+ t.indentLine(e[i].from().line, null, !0);
19099
+ Ni(t);
19100
+ });
19101
+ },
19102
+ openLine: function (t) {
19103
+ return t.replaceSelection("\n", "start");
19104
+ },
19105
+ toggleOverwrite: function (t) {
19106
+ return t.toggleOverwrite();
19107
+ },
19108
+ };
19109
+ function ns(t, e) {
19110
+ var n = qt(t.doc, e),
19111
+ i = Fe(n);
19112
+ return i != n && (e = Xt(i)), ts(!0, t, i, e, 1);
19113
+ }
19114
+ function is(t, e) {
19115
+ var n = ns(t, e.line),
19116
+ i = qt(t.doc, n.line),
19117
+ r = ct(i, t.doc.direction);
19118
+ if (!r || 0 == r[0].level) {
19119
+ var o = Math.max(n.ch, i.text.search(/\S/)),
19120
+ s = e.line == n.line && e.ch <= o && e.ch;
19121
+ return te(n.line, s ? 0 : o, n.sticky);
19122
+ }
19123
+ return n;
19124
+ }
19125
+ function rs(t, e, n) {
19126
+ if ("string" == typeof e && !(e = es[e])) return !1;
19127
+ t.display.input.ensurePolled();
19128
+ var i = t.display.shift,
19129
+ r = !1;
19130
+ try {
19131
+ t.isReadOnly() && (t.state.suppressEdits = !0),
19132
+ n && (t.display.shift = !1),
19133
+ (r = e(t) != H);
19134
+ } finally {
19135
+ (t.display.shift = i), (t.state.suppressEdits = !1);
19136
+ }
19137
+ return r;
19138
+ }
19139
+ var os = new B();
19140
+ function ss(t, e, n, i) {
19141
+ var r = t.state.keySeq;
19142
+ if (r) {
19143
+ if (Vo(e)) return "handled";
19144
+ if (
19145
+ (/\'$/.test(e)
19146
+ ? (t.state.keySeq = null)
19147
+ : os.set(50, function () {
19148
+ t.state.keySeq == r &&
19149
+ ((t.state.keySeq = null), t.display.input.reset());
19150
+ }),
19151
+ as(t, r + " " + e, n, i))
19152
+ )
19153
+ return !0;
19154
+ }
19155
+ return as(t, e, n, i);
19156
+ }
19157
+ function as(t, e, n, i) {
19158
+ var r = (function (t, e, n) {
19159
+ for (var i = 0; i < t.state.keyMaps.length; i++) {
19160
+ var r = qo(e, t.state.keyMaps[i], n, t);
19161
+ if (r) return r;
19162
+ }
19163
+ return (
19164
+ (t.options.extraKeys && qo(e, t.options.extraKeys, n, t)) ||
19165
+ qo(e, t.options.keyMap, n, t)
19166
+ );
19167
+ })(t, e, i);
19168
+ return (
19169
+ "multi" == r && (t.state.keySeq = e),
19170
+ "handled" == r && ln(t, "keyHandled", t, e, n),
19171
+ ("handled" != r && "multi" != r) || (yt(n), ki(t)),
19172
+ !!r
19173
+ );
19174
+ }
19175
+ function ls(t, e) {
19176
+ var n = Ko(e, !0);
19177
+ return (
19178
+ !!n &&
19179
+ (e.shiftKey && !t.state.keySeq
19180
+ ? ss(t, "Shift-" + n, e, function (e) {
19181
+ return rs(t, e, !0);
19182
+ }) ||
19183
+ ss(t, n, e, function (e) {
19184
+ if ("string" == typeof e ? /^go[A-Z]/.test(e) : e.motion)
19185
+ return rs(t, e);
19186
+ })
19187
+ : ss(t, n, e, function (e) {
19188
+ return rs(t, e);
19189
+ }))
19190
+ );
19191
+ }
19192
+ var cs = null;
19193
+ function hs(t) {
19194
+ var e = this;
19195
+ if (
19196
+ !(
19197
+ (t.target && t.target != e.display.input.getField()) ||
19198
+ ((e.curOp.focus = I()), gt(e, t))
19199
+ )
19200
+ ) {
19201
+ s && a < 11 && 27 == t.keyCode && (t.returnValue = !1);
19202
+ var i = t.keyCode;
19203
+ e.display.shift = 16 == i || t.shiftKey;
19204
+ var r = ls(e, t);
19205
+ u &&
19206
+ ((cs = r ? i : null),
19207
+ r ||
19208
+ 88 != i ||
19209
+ Mt ||
19210
+ !(_ ? t.metaKey : t.ctrlKey) ||
19211
+ e.replaceSelection("", null, "cut")),
19212
+ n &&
19213
+ !_ &&
19214
+ !r &&
19215
+ 46 == i &&
19216
+ t.shiftKey &&
19217
+ !t.ctrlKey &&
19218
+ document.execCommand &&
19219
+ document.execCommand("cut"),
19220
+ 18 != i ||
19221
+ /\bCodeMirror-crosshair\b/.test(
19222
+ e.display.lineDiv.className
19223
+ ) ||
19224
+ (function (t) {
19225
+ var e = t.display.lineDiv;
19226
+ function n(t) {
19227
+ (18 != t.keyCode && t.altKey) ||
19228
+ (E(e, "CodeMirror-crosshair"),
19229
+ dt(document, "keyup", n),
19230
+ dt(document, "mouseover", n));
19231
+ }
19232
+ M(e, "CodeMirror-crosshair"),
19233
+ ut(document, "keyup", n),
19234
+ ut(document, "mouseover", n);
19235
+ })(e);
19236
+ }
19237
+ }
19238
+ function us(t) {
19239
+ 16 == t.keyCode && (this.doc.sel.shift = !1), gt(this, t);
19240
+ }
19241
+ function fs(t) {
19242
+ var e = this;
19243
+ if (
19244
+ !(
19245
+ (t.target && t.target != e.display.input.getField()) ||
19246
+ bn(e.display, t) ||
19247
+ gt(e, t) ||
19248
+ (t.ctrlKey && !t.altKey) ||
19249
+ (_ && t.metaKey)
19250
+ )
19251
+ ) {
19252
+ var n = t.keyCode,
19253
+ i = t.charCode;
19254
+ if (u && n == cs) return (cs = null), void yt(t);
19255
+ if (!u || (t.which && !(t.which < 10)) || !ls(e, t)) {
19256
+ var r = String.fromCharCode(null == i ? n : i);
19257
+ "\b" != r &&
19258
+ ((function (t, e, n) {
19259
+ return ss(t, "'" + n + "'", e, function (e) {
19260
+ return rs(t, e, !0);
19261
+ });
19262
+ })(e, t, r) ||
19263
+ e.display.input.onKeyPress(t));
19264
+ }
19265
+ }
19266
+ }
19267
+ var ds,
19268
+ ps,
19269
+ gs = function (t, e, n) {
19270
+ (this.time = t), (this.pos = e), (this.button = n);
19271
+ };
19272
+ function ms(t) {
19273
+ var e = this,
19274
+ n = e.display;
19275
+ if (!(gt(e, t) || (n.activeTouch && n.input.supportsTouch())))
19276
+ if ((n.input.ensurePolled(), (n.shift = t.shiftKey), bn(n, t)))
19277
+ l ||
19278
+ ((n.scroller.draggable = !1),
19279
+ setTimeout(function () {
19280
+ return (n.scroller.draggable = !0);
19281
+ }, 100));
19282
+ else if (!ys(e, t)) {
19283
+ var i = ci(e, t),
19284
+ r = Ct(t),
19285
+ o = i
19286
+ ? (function (t, e) {
19287
+ var n = +new Date();
19288
+ return ps && ps.compare(n, t, e)
19289
+ ? ((ds = ps = null), "triple")
19290
+ : ds && ds.compare(n, t, e)
19291
+ ? ((ps = new gs(n, t, e)), (ds = null), "double")
19292
+ : ((ds = new gs(n, t, e)), (ps = null), "single");
19293
+ })(i, r)
19294
+ : "single";
19295
+ window.focus(),
19296
+ 1 == r && e.state.selectingText && e.state.selectingText(t),
19297
+ (i &&
19298
+ (function (t, e, n, i, r) {
19299
+ var o = "Click";
19300
+ return (
19301
+ "double" == i
19302
+ ? (o = "Double" + o)
19303
+ : "triple" == i && (o = "Triple" + o),
19304
+ ss(
19305
+ t,
19306
+ Yo(
19307
+ (o =
19308
+ (1 == e
19309
+ ? "Left"
19310
+ : 2 == e
19311
+ ? "Middle"
19312
+ : "Right") + o),
19313
+ r
19314
+ ),
19315
+ r,
19316
+ function (e) {
19317
+ if (("string" == typeof e && (e = es[e]), !e))
19318
+ return !1;
19319
+ var i = !1;
19320
+ try {
19321
+ t.isReadOnly() && (t.state.suppressEdits = !0),
19322
+ (i = e(t, n) != H);
19323
+ } finally {
19324
+ t.state.suppressEdits = !1;
19325
+ }
19326
+ return i;
19327
+ }
19328
+ )
19329
+ );
19330
+ })(e, r, i, o, t)) ||
19331
+ (1 == r
19332
+ ? i
19333
+ ? (function (t, e, n, i) {
19334
+ s
19335
+ ? setTimeout(D(bi, t), 0)
19336
+ : (t.curOp.focus = I());
19337
+ var r,
19338
+ o = (function (t, e, n) {
19339
+ var i = t.getOption("configureMouse"),
19340
+ r = i ? i(t, e, n) : {};
19341
+ if (null == r.unit) {
19342
+ var o = y
19343
+ ? n.shiftKey && n.metaKey
19344
+ : n.altKey;
19345
+ r.unit = o
19346
+ ? "rectangle"
19347
+ : "single" == e
19348
+ ? "char"
19349
+ : "double" == e
19350
+ ? "word"
19351
+ : "line";
19352
+ }
19353
+ return (
19354
+ (null == r.extend || t.doc.extend) &&
19355
+ (r.extend = t.doc.extend || n.shiftKey),
19356
+ null == r.addNew &&
19357
+ (r.addNew = _ ? n.metaKey : n.ctrlKey),
19358
+ null == r.moveOnDrag &&
19359
+ (r.moveOnDrag = !(_
19360
+ ? n.altKey
19361
+ : n.ctrlKey)),
19362
+ r
19363
+ );
19364
+ })(t, n, i),
19365
+ c = t.doc.sel;
19366
+ t.options.dragDrop &&
19367
+ St &&
19368
+ !t.isReadOnly() &&
19369
+ "single" == n &&
19370
+ (r = c.contains(e)) > -1 &&
19371
+ (ee((r = c.ranges[r]).from(), e) < 0 ||
19372
+ e.xRel > 0) &&
19373
+ (ee(r.to(), e) > 0 || e.xRel < 0)
19374
+ ? (function (t, e, n, i) {
19375
+ var r = t.display,
19376
+ o = !1,
19377
+ c = tr(t, function (e) {
19378
+ l && (r.scroller.draggable = !1),
19379
+ (t.state.draggingText = !1),
19380
+ t.state.delayingBlurEvent &&
19381
+ (t.hasFocus()
19382
+ ? (t.state.delayingBlurEvent = !1)
19383
+ : Ti(t)),
19384
+ dt(
19385
+ r.wrapper.ownerDocument,
19386
+ "mouseup",
19387
+ c
19388
+ ),
19389
+ dt(
19390
+ r.wrapper.ownerDocument,
19391
+ "mousemove",
19392
+ h
19393
+ ),
19394
+ dt(r.scroller, "dragstart", u),
19395
+ dt(r.scroller, "drop", c),
19396
+ o ||
19397
+ (yt(e),
19398
+ i.addNew ||
19399
+ Yr(
19400
+ t.doc,
19401
+ n,
19402
+ null,
19403
+ null,
19404
+ i.extend
19405
+ ),
19406
+ (l && !f) || (s && 9 == a)
19407
+ ? setTimeout(function () {
19408
+ r.wrapper.ownerDocument.body.focus(
19409
+ { preventScroll: !0 }
19410
+ ),
19411
+ r.input.focus();
19412
+ }, 20)
19413
+ : r.input.focus());
19414
+ }),
19415
+ h = function (t) {
19416
+ o =
19417
+ o ||
19418
+ Math.abs(e.clientX - t.clientX) +
19419
+ Math.abs(e.clientY - t.clientY) >=
19420
+ 10;
19421
+ },
19422
+ u = function () {
19423
+ return (o = !0);
19424
+ };
19425
+ l && (r.scroller.draggable = !0),
19426
+ (t.state.draggingText = c),
19427
+ (c.copy = !i.moveOnDrag),
19428
+ ut(r.wrapper.ownerDocument, "mouseup", c),
19429
+ ut(
19430
+ r.wrapper.ownerDocument,
19431
+ "mousemove",
19432
+ h
19433
+ ),
19434
+ ut(r.scroller, "dragstart", u),
19435
+ ut(r.scroller, "drop", c),
19436
+ (t.state.delayingBlurEvent = !0),
19437
+ setTimeout(function () {
19438
+ return r.input.focus();
19439
+ }, 20),
19440
+ r.scroller.dragDrop &&
19441
+ r.scroller.dragDrop();
19442
+ })(t, i, e, o)
19443
+ : (function (t, e, n, i) {
19444
+ s && Ti(t);
19445
+ var r = t.display,
19446
+ o = t.doc;
19447
+ yt(e);
19448
+ var a,
19449
+ l,
19450
+ c = o.sel,
19451
+ h = c.ranges;
19452
+ if (
19453
+ (i.addNew && !i.extend
19454
+ ? ((l = o.sel.contains(n)),
19455
+ (a = l > -1 ? h[l] : new Tr(n, n)))
19456
+ : ((a = o.sel.primary()),
19457
+ (l = o.sel.primIndex)),
19458
+ "rectangle" == i.unit)
19459
+ )
19460
+ i.addNew || (a = new Tr(n, n)),
19461
+ (n = ci(t, e, !0, !0)),
19462
+ (l = -1);
19463
+ else {
19464
+ var u = vs(t, n, i.unit);
19465
+ a = i.extend
19466
+ ? Vr(a, u.anchor, u.head, i.extend)
19467
+ : u;
19468
+ }
19469
+ i.addNew
19470
+ ? -1 == l
19471
+ ? ((l = h.length),
19472
+ Jr(o, Cr(t, h.concat([a]), l), {
19473
+ scroll: !1,
19474
+ origin: "*mouse",
19475
+ }))
19476
+ : h.length > 1 &&
19477
+ h[l].empty() &&
19478
+ "char" == i.unit &&
19479
+ !i.extend
19480
+ ? (Jr(
19481
+ o,
19482
+ Cr(
19483
+ t,
19484
+ h
19485
+ .slice(0, l)
19486
+ .concat(h.slice(l + 1)),
19487
+ 0
19488
+ ),
19489
+ { scroll: !1, origin: "*mouse" }
19490
+ ),
19491
+ (c = o.sel))
19492
+ : Xr(o, l, a, W)
19493
+ : ((l = 0),
19494
+ Jr(o, new br([a], 0), W),
19495
+ (c = o.sel));
19496
+ var f = n;
19497
+ function d(e) {
19498
+ if (0 != ee(f, e))
19499
+ if (((f = e), "rectangle" == i.unit)) {
19500
+ for (
19501
+ var r = [],
19502
+ s = t.options.tabSize,
19503
+ h = F(
19504
+ qt(o, n.line).text,
19505
+ n.ch,
19506
+ s
19507
+ ),
19508
+ u = F(
19509
+ qt(o, e.line).text,
19510
+ e.ch,
19511
+ s
19512
+ ),
19513
+ d = Math.min(h, u),
19514
+ p = Math.max(h, u),
19515
+ g = Math.min(n.line, e.line),
19516
+ m = Math.min(
19517
+ t.lastLine(),
19518
+ Math.max(n.line, e.line)
19519
+ );
19520
+ g <= m;
19521
+ g++
19522
+ ) {
19523
+ var v = qt(o, g).text,
19524
+ _ = G(v, d, s);
19525
+ d == p
19526
+ ? r.push(
19527
+ new Tr(te(g, _), te(g, _))
19528
+ )
19529
+ : v.length > _ &&
19530
+ r.push(
19531
+ new Tr(
19532
+ te(g, _),
19533
+ te(g, G(v, p, s))
19534
+ )
19535
+ );
19536
+ }
19537
+ r.length || r.push(new Tr(n, n)),
19538
+ Jr(
19539
+ o,
19540
+ Cr(
19541
+ t,
19542
+ c.ranges.slice(0, l).concat(r),
19543
+ l
19544
+ ),
19545
+ { origin: "*mouse", scroll: !1 }
19546
+ ),
19547
+ t.scrollIntoView(e);
19548
+ } else {
19549
+ var y,
19550
+ x = a,
19551
+ k = vs(t, e, i.unit),
19552
+ b = x.anchor;
19553
+ ee(k.anchor, b) > 0
19554
+ ? ((y = k.head),
19555
+ (b = oe(x.from(), k.anchor)))
19556
+ : ((y = k.anchor),
19557
+ (b = re(x.to(), k.head)));
19558
+ var T = c.ranges.slice(0);
19559
+ (T[l] = (function (t, e) {
19560
+ var n = e.anchor,
19561
+ i = e.head,
19562
+ r = qt(t.doc, n.line);
19563
+ if (
19564
+ 0 == ee(n, i) &&
19565
+ n.sticky == i.sticky
19566
+ )
19567
+ return e;
19568
+ var o = ct(r);
19569
+ if (!o) return e;
19570
+ var s = at(o, n.ch, n.sticky),
19571
+ a = o[s];
19572
+ if (a.from != n.ch && a.to != n.ch)
19573
+ return e;
19574
+ var l,
19575
+ c =
19576
+ s +
19577
+ ((a.from == n.ch) ==
19578
+ (1 != a.level)
19579
+ ? 0
19580
+ : 1);
19581
+ if (0 == c || c == o.length)
19582
+ return e;
19583
+ if (i.line != n.line)
19584
+ l =
19585
+ (i.line - n.line) *
19586
+ ("ltr" == t.doc.direction
19587
+ ? 1
19588
+ : -1) >
19589
+ 0;
19590
+ else {
19591
+ var h = at(o, i.ch, i.sticky),
19592
+ u =
19593
+ h - s ||
19594
+ (i.ch - n.ch) *
19595
+ (1 == a.level ? -1 : 1);
19596
+ l =
19597
+ h == c - 1 || h == c
19598
+ ? u < 0
19599
+ : u > 0;
19600
+ }
19601
+ var f = o[c + (l ? -1 : 0)],
19602
+ d = l == (1 == f.level),
19603
+ p = d ? f.from : f.to,
19604
+ g = d ? "after" : "before";
19605
+ return n.ch == p && n.sticky == g
19606
+ ? e
19607
+ : new Tr(new te(n.line, p, g), i);
19608
+ })(t, new Tr(ae(o, b), y))),
19609
+ Jr(o, Cr(t, T, l), W);
19610
+ }
19611
+ }
19612
+ var p = r.wrapper.getBoundingClientRect(),
19613
+ g = 0;
19614
+ function m(e) {
19615
+ var n = ++g,
19616
+ s = ci(t, e, !0, "rectangle" == i.unit);
19617
+ if (s)
19618
+ if (0 != ee(s, f)) {
19619
+ (t.curOp.focus = I()), d(s);
19620
+ var a = Ai(r, o);
19621
+ (s.line >= a.to || s.line < a.from) &&
19622
+ setTimeout(
19623
+ tr(t, function () {
19624
+ g == n && m(e);
19625
+ }),
19626
+ 150
19627
+ );
19628
+ } else {
19629
+ var l =
19630
+ e.clientY < p.top
19631
+ ? -20
19632
+ : e.clientY > p.bottom
19633
+ ? 20
19634
+ : 0;
19635
+ l &&
19636
+ setTimeout(
19637
+ tr(t, function () {
19638
+ g == n &&
19639
+ ((r.scroller.scrollTop += l),
19640
+ m(e));
19641
+ }),
19642
+ 50
19643
+ );
19644
+ }
19645
+ }
19646
+ function v(e) {
19647
+ (t.state.selectingText = !1),
19648
+ (g = 1 / 0),
19649
+ e && (yt(e), r.input.focus()),
19650
+ dt(
19651
+ r.wrapper.ownerDocument,
19652
+ "mousemove",
19653
+ _
19654
+ ),
19655
+ dt(
19656
+ r.wrapper.ownerDocument,
19657
+ "mouseup",
19658
+ y
19659
+ ),
19660
+ (o.history.lastSelOrigin = null);
19661
+ }
19662
+ var _ = tr(t, function (t) {
19663
+ 0 !== t.buttons && Ct(t) ? m(t) : v(t);
19664
+ }),
19665
+ y = tr(t, v);
19666
+ (t.state.selectingText = y),
19667
+ ut(
19668
+ r.wrapper.ownerDocument,
19669
+ "mousemove",
19670
+ _
19671
+ ),
19672
+ ut(r.wrapper.ownerDocument, "mouseup", y);
19673
+ })(t, i, e, o);
19674
+ })(e, i, o, t)
19675
+ : Tt(t) == n.scroller && yt(t)
19676
+ : 2 == r
19677
+ ? (i && Yr(e.doc, i),
19678
+ setTimeout(function () {
19679
+ return n.input.focus();
19680
+ }, 20))
19681
+ : 3 == r &&
19682
+ (T ? e.display.input.onContextMenu(t) : Ti(e)));
19683
+ }
19684
+ }
19685
+ function vs(t, e, n) {
19686
+ if ("char" == n) return new Tr(e, e);
19687
+ if ("word" == n) return t.findWordAt(e);
19688
+ if ("line" == n)
19689
+ return new Tr(te(e.line, 0), ae(t.doc, te(e.line + 1, 0)));
19690
+ var i = n(t, e);
19691
+ return new Tr(i.from, i.to);
19692
+ }
19693
+ function _s(t, e, n, i) {
19694
+ var r, o;
19695
+ if (e.touches)
19696
+ (r = e.touches[0].clientX), (o = e.touches[0].clientY);
19697
+ else
19698
+ try {
19699
+ (r = e.clientX), (o = e.clientY);
19700
+ } catch (t) {
19701
+ return !1;
19702
+ }
19703
+ if (
19704
+ r >= Math.floor(t.display.gutters.getBoundingClientRect().right)
19705
+ )
19706
+ return !1;
19707
+ i && yt(e);
19708
+ var s = t.display,
19709
+ a = s.lineDiv.getBoundingClientRect();
19710
+ if (o > a.bottom || !vt(t, n)) return kt(e);
19711
+ o -= a.top - s.viewOffset;
19712
+ for (var l = 0; l < t.display.gutterSpecs.length; ++l) {
19713
+ var c = s.gutters.childNodes[l];
19714
+ if (c && c.getBoundingClientRect().right >= r)
19715
+ return (
19716
+ pt(
19717
+ t,
19718
+ n,
19719
+ t,
19720
+ Qt(t.doc, o),
19721
+ t.display.gutterSpecs[l].className,
19722
+ e
19723
+ ),
19724
+ kt(e)
19725
+ );
19726
+ }
19727
+ }
19728
+ function ys(t, e) {
19729
+ return _s(t, e, "gutterClick", !0);
19730
+ }
19731
+ function xs(t, e) {
19732
+ bn(t.display, e) ||
19733
+ (function (t, e) {
19734
+ return (
19735
+ !!vt(t, "gutterContextMenu") &&
19736
+ _s(t, e, "gutterContextMenu", !1)
19737
+ );
19738
+ })(t, e) ||
19739
+ gt(t, e, "contextmenu") ||
19740
+ T ||
19741
+ t.display.input.onContextMenu(e);
19742
+ }
19743
+ function ks(t) {
19744
+ (t.display.wrapper.className =
19745
+ t.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
19746
+ t.options.theme.replace(/(^|\s)\s*/g, " cm-s-")),
19747
+ Un(t);
19748
+ }
19749
+ gs.prototype.compare = function (t, e, n) {
19750
+ return (
19751
+ this.time + 400 > t && 0 == ee(e, this.pos) && n == this.button
19752
+ );
19753
+ };
19754
+ var bs = {
19755
+ toString: function () {
19756
+ return "CodeMirror.Init";
19757
+ },
19758
+ },
19759
+ Ts = {},
19760
+ Cs = {};
19761
+ function ws(t, e, n) {
19762
+ if (!e != !(n && n != bs)) {
19763
+ var i = t.display.dragFunctions,
19764
+ r = e ? ut : dt;
19765
+ r(t.display.scroller, "dragstart", i.start),
19766
+ r(t.display.scroller, "dragenter", i.enter),
19767
+ r(t.display.scroller, "dragover", i.over),
19768
+ r(t.display.scroller, "dragleave", i.leave),
19769
+ r(t.display.scroller, "drop", i.drop);
19770
+ }
19771
+ }
19772
+ function Es(t) {
19773
+ t.options.lineWrapping
19774
+ ? (M(t.display.wrapper, "CodeMirror-wrap"),
19775
+ (t.display.sizer.style.minWidth = ""),
19776
+ (t.display.sizerWidth = null))
19777
+ : (E(t.display.wrapper, "CodeMirror-wrap"), Ge(t)),
19778
+ li(t),
19779
+ ui(t),
19780
+ Un(t),
19781
+ setTimeout(function () {
19782
+ return Hi(t);
19783
+ }, 100);
19784
+ }
19785
+ function Ss(t, e) {
19786
+ var n = this;
19787
+ if (!(this instanceof Ss)) return new Ss(t, e);
19788
+ (this.options = e = e ? P(e) : {}), P(Ts, e, !1);
19789
+ var i = e.value;
19790
+ "string" == typeof i
19791
+ ? (i = new No(i, e.mode, null, e.lineSeparator, e.direction))
19792
+ : e.mode && (i.modeOption = e.mode),
19793
+ (this.doc = i);
19794
+ var r = new Ss.inputStyles[e.inputStyle](this),
19795
+ o = (this.display = new mr(t, i, r, e));
19796
+ for (var c in ((o.wrapper.CodeMirror = this),
19797
+ ks(this),
19798
+ e.lineWrapping &&
19799
+ (this.display.wrapper.className += " CodeMirror-wrap"),
19800
+ ji(this),
19801
+ (this.state = {
19802
+ keyMaps: [],
19803
+ overlays: [],
19804
+ modeGen: 0,
19805
+ overwrite: !1,
19806
+ delayingBlurEvent: !1,
19807
+ focused: !1,
19808
+ suppressEdits: !1,
19809
+ pasteIncoming: -1,
19810
+ cutIncoming: -1,
19811
+ selectingText: !1,
19812
+ draggingText: !1,
19813
+ highlight: new B(),
19814
+ keySeq: null,
19815
+ specialChars: null,
19816
+ }),
19817
+ e.autofocus && !v && o.input.focus(),
19818
+ s &&
19819
+ a < 11 &&
19820
+ setTimeout(function () {
19821
+ return n.display.input.reset(!0);
19822
+ }, 20),
19823
+ (function (t) {
19824
+ var e = t.display;
19825
+ ut(e.scroller, "mousedown", tr(t, ms)),
19826
+ ut(
19827
+ e.scroller,
19828
+ "dblclick",
19829
+ s && a < 11
19830
+ ? tr(t, function (e) {
19831
+ if (!gt(t, e)) {
19832
+ var n = ci(t, e);
19833
+ if (n && !ys(t, e) && !bn(t.display, e)) {
19834
+ yt(e);
19835
+ var i = t.findWordAt(n);
19836
+ Yr(t.doc, i.anchor, i.head);
19837
+ }
19838
+ }
19839
+ })
19840
+ : function (e) {
19841
+ return gt(t, e) || yt(e);
19842
+ }
19843
+ ),
19844
+ ut(e.scroller, "contextmenu", function (e) {
19845
+ return xs(t, e);
19846
+ }),
19847
+ ut(e.input.getField(), "contextmenu", function (n) {
19848
+ e.scroller.contains(n.target) || xs(t, n);
19849
+ });
19850
+ var n,
19851
+ i = { end: 0 };
19852
+ function r() {
19853
+ e.activeTouch &&
19854
+ ((n = setTimeout(function () {
19855
+ return (e.activeTouch = null);
19856
+ }, 1e3)),
19857
+ ((i = e.activeTouch).end = +new Date()));
19858
+ }
19859
+ function o(t) {
19860
+ if (1 != t.touches.length) return !1;
19861
+ var e = t.touches[0];
19862
+ return e.radiusX <= 1 && e.radiusY <= 1;
19863
+ }
19864
+ function l(t, e) {
19865
+ if (null == e.left) return !0;
19866
+ var n = e.left - t.left,
19867
+ i = e.top - t.top;
19868
+ return n * n + i * i > 400;
19869
+ }
19870
+ ut(e.scroller, "touchstart", function (r) {
19871
+ if (!gt(t, r) && !o(r) && !ys(t, r)) {
19872
+ e.input.ensurePolled(), clearTimeout(n);
19873
+ var s = +new Date();
19874
+ (e.activeTouch = {
19875
+ start: s,
19876
+ moved: !1,
19877
+ prev: s - i.end <= 300 ? i : null,
19878
+ }),
19879
+ 1 == r.touches.length &&
19880
+ ((e.activeTouch.left = r.touches[0].pageX),
19881
+ (e.activeTouch.top = r.touches[0].pageY));
19882
+ }
19883
+ }),
19884
+ ut(e.scroller, "touchmove", function () {
19885
+ e.activeTouch && (e.activeTouch.moved = !0);
19886
+ }),
19887
+ ut(e.scroller, "touchend", function (n) {
19888
+ var i = e.activeTouch;
19889
+ if (
19890
+ i &&
19891
+ !bn(e, n) &&
19892
+ null != i.left &&
19893
+ !i.moved &&
19894
+ new Date() - i.start < 300
19895
+ ) {
19896
+ var o,
19897
+ s = t.coordsChar(e.activeTouch, "page");
19898
+ (o =
19899
+ !i.prev || l(i, i.prev)
19900
+ ? new Tr(s, s)
19901
+ : !i.prev.prev || l(i, i.prev.prev)
19902
+ ? t.findWordAt(s)
19903
+ : new Tr(
19904
+ te(s.line, 0),
19905
+ ae(t.doc, te(s.line + 1, 0))
19906
+ )),
19907
+ t.setSelection(o.anchor, o.head),
19908
+ t.focus(),
19909
+ yt(n);
19910
+ }
19911
+ r();
19912
+ }),
19913
+ ut(e.scroller, "touchcancel", r),
19914
+ ut(e.scroller, "scroll", function () {
19915
+ e.scroller.clientHeight &&
19916
+ (Ri(t, e.scroller.scrollTop),
19917
+ Pi(t, e.scroller.scrollLeft, !0),
19918
+ pt(t, "scroll", t));
19919
+ }),
19920
+ ut(e.scroller, "mousewheel", function (e) {
19921
+ return kr(t, e);
19922
+ }),
19923
+ ut(e.scroller, "DOMMouseScroll", function (e) {
19924
+ return kr(t, e);
19925
+ }),
19926
+ ut(e.wrapper, "scroll", function () {
19927
+ return (e.wrapper.scrollTop = e.wrapper.scrollLeft = 0);
19928
+ }),
19929
+ (e.dragFunctions = {
19930
+ enter: function (e) {
19931
+ gt(t, e) || bt(e);
19932
+ },
19933
+ over: function (e) {
19934
+ gt(t, e) ||
19935
+ ((function (t, e) {
19936
+ var n = ci(t, e);
19937
+ if (n) {
19938
+ var i = document.createDocumentFragment();
19939
+ _i(t, n, i),
19940
+ t.display.dragCursor ||
19941
+ ((t.display.dragCursor = L(
19942
+ "div",
19943
+ null,
19944
+ "CodeMirror-cursors CodeMirror-dragcursors"
19945
+ )),
19946
+ t.display.lineSpace.insertBefore(
19947
+ t.display.dragCursor,
19948
+ t.display.cursorDiv
19949
+ )),
19950
+ A(t.display.dragCursor, i);
19951
+ }
19952
+ })(t, e),
19953
+ bt(e));
19954
+ },
19955
+ start: function (e) {
19956
+ return (function (t, e) {
19957
+ if (
19958
+ s &&
19959
+ (!t.state.draggingText || +new Date() - Io < 100)
19960
+ )
19961
+ bt(e);
19962
+ else if (
19963
+ !gt(t, e) &&
19964
+ !bn(t.display, e) &&
19965
+ (e.dataTransfer.setData("Text", t.getSelection()),
19966
+ (e.dataTransfer.effectAllowed = "copyMove"),
19967
+ e.dataTransfer.setDragImage && !f)
19968
+ ) {
19969
+ var n = L(
19970
+ "img",
19971
+ null,
19972
+ null,
19973
+ "position: fixed; left: 0; top: 0;"
19974
+ );
19975
+ (n.src =
19976
+ "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),
19977
+ u &&
19978
+ ((n.width = n.height = 1),
19979
+ t.display.wrapper.appendChild(n),
19980
+ (n._top = n.offsetTop)),
19981
+ e.dataTransfer.setDragImage(n, 0, 0),
19982
+ u && n.parentNode.removeChild(n);
19983
+ }
19984
+ })(t, e);
19985
+ },
19986
+ drop: tr(t, Mo),
19987
+ leave: function (e) {
19988
+ gt(t, e) || $o(t);
19989
+ },
19990
+ });
19991
+ var c = e.input.getField();
19992
+ ut(c, "keyup", function (e) {
19993
+ return us.call(t, e);
19994
+ }),
19995
+ ut(c, "keydown", tr(t, hs)),
19996
+ ut(c, "keypress", tr(t, fs)),
19997
+ ut(c, "focus", function (e) {
19998
+ return Ci(t, e);
19999
+ }),
20000
+ ut(c, "blur", function (e) {
20001
+ return wi(t, e);
20002
+ });
20003
+ })(this),
20004
+ Po(),
20005
+ qi(this),
20006
+ (this.curOp.forceUpdate = !0),
20007
+ Rr(this, i),
20008
+ (e.autofocus && !v) || this.hasFocus()
20009
+ ? setTimeout(function () {
20010
+ n.hasFocus() && !n.state.focused && Ci(n);
20011
+ }, 20)
20012
+ : wi(this),
20013
+ Cs))
20014
+ Cs.hasOwnProperty(c) && Cs[c](this, e[c], bs);
20015
+ fr(this), e.finishInit && e.finishInit(this);
20016
+ for (var h = 0; h < As.length; ++h) As[h](this);
20017
+ Vi(this),
20018
+ l &&
20019
+ e.lineWrapping &&
20020
+ "optimizelegibility" ==
20021
+ getComputedStyle(o.lineDiv).textRendering &&
20022
+ (o.lineDiv.style.textRendering = "auto");
20023
+ }
20024
+ (Ss.defaults = Ts), (Ss.optionHandlers = Cs);
20025
+ var As = [];
20026
+ function Ls(t, e, n, i) {
20027
+ var r,
20028
+ o = t.doc;
20029
+ null == n && (n = "add"),
20030
+ "smart" == n &&
20031
+ (o.mode.indent ? (r = de(t, e).state) : (n = "prev"));
20032
+ var s = t.options.tabSize,
20033
+ a = qt(o, e),
20034
+ l = F(a.text, null, s);
20035
+ a.stateAfter && (a.stateAfter = null);
20036
+ var c,
20037
+ h = a.text.match(/^\s*/)[0];
20038
+ if (i || /\S/.test(a.text)) {
20039
+ if (
20040
+ "smart" == n &&
20041
+ ((c = o.mode.indent(r, a.text.slice(h.length), a.text)) ==
20042
+ H ||
20043
+ c > 150)
20044
+ ) {
20045
+ if (!i) return;
20046
+ n = "prev";
20047
+ }
20048
+ } else (c = 0), (n = "not");
20049
+ "prev" == n
20050
+ ? (c = e > o.first ? F(qt(o, e - 1).text, null, s) : 0)
20051
+ : "add" == n
20052
+ ? (c = l + t.options.indentUnit)
20053
+ : "subtract" == n
20054
+ ? (c = l - t.options.indentUnit)
20055
+ : "number" == typeof n && (c = l + n),
20056
+ (c = Math.max(0, c));
20057
+ var u = "",
20058
+ f = 0;
20059
+ if (t.options.indentWithTabs)
20060
+ for (var d = Math.floor(c / s); d; --d) (f += s), (u += "\t");
20061
+ if ((f < c && (u += V(c - f)), u != h))
20062
+ return (
20063
+ go(o, u, te(e, 0), te(e, h.length), "+input"),
20064
+ (a.stateAfter = null),
20065
+ !0
20066
+ );
20067
+ for (var p = 0; p < o.sel.ranges.length; p++) {
20068
+ var g = o.sel.ranges[p];
20069
+ if (g.head.line == e && g.head.ch < h.length) {
20070
+ var m = te(e, h.length);
20071
+ Xr(o, p, new Tr(m, m));
20072
+ break;
20073
+ }
20074
+ }
20075
+ }
20076
+ Ss.defineInitHook = function (t) {
20077
+ return As.push(t);
20078
+ };
20079
+ var Os = null;
20080
+ function Ns(t) {
20081
+ Os = t;
20082
+ }
20083
+ function Is(t, e, n, i, r) {
20084
+ var o = t.doc;
20085
+ (t.display.shift = !1), i || (i = o.sel);
20086
+ var s = +new Date() - 200,
20087
+ a = "paste" == r || t.state.pasteIncoming > s,
20088
+ l = Nt(e),
20089
+ c = null;
20090
+ if (a && i.ranges.length > 1)
20091
+ if (Os && Os.text.join("\n") == e) {
20092
+ if (i.ranges.length % Os.text.length == 0) {
20093
+ c = [];
20094
+ for (var h = 0; h < Os.text.length; h++)
20095
+ c.push(o.splitLines(Os.text[h]));
20096
+ }
20097
+ } else
20098
+ l.length == i.ranges.length &&
20099
+ t.options.pasteLinesPerSelection &&
20100
+ (c = K(l, function (t) {
20101
+ return [t];
20102
+ }));
20103
+ for (
20104
+ var u = t.curOp.updateInput, f = i.ranges.length - 1;
20105
+ f >= 0;
20106
+ f--
20107
+ ) {
20108
+ var d = i.ranges[f],
20109
+ p = d.from(),
20110
+ g = d.to();
20111
+ d.empty() &&
20112
+ (n && n > 0
20113
+ ? (p = te(p.line, p.ch - n))
20114
+ : t.state.overwrite && !a
20115
+ ? (g = te(
20116
+ g.line,
20117
+ Math.min(qt(o, g.line).text.length, g.ch + Y(l).length)
20118
+ ))
20119
+ : a &&
20120
+ Os &&
20121
+ Os.lineWise &&
20122
+ Os.text.join("\n") == l.join("\n") &&
20123
+ (p = g = te(p.line, 0)));
20124
+ var m = {
20125
+ from: p,
20126
+ to: g,
20127
+ text: c ? c[f % c.length] : l,
20128
+ origin:
20129
+ r ||
20130
+ (a ? "paste" : t.state.cutIncoming > s ? "cut" : "+input"),
20131
+ };
20132
+ co(t.doc, m), ln(t, "inputRead", t, m);
20133
+ }
20134
+ e && !a && $s(t, e),
20135
+ Ni(t),
20136
+ t.curOp.updateInput < 2 && (t.curOp.updateInput = u),
20137
+ (t.curOp.typing = !0),
20138
+ (t.state.pasteIncoming = t.state.cutIncoming = -1);
20139
+ }
20140
+ function Ms(t, e) {
20141
+ var n = t.clipboardData && t.clipboardData.getData("Text");
20142
+ if (n)
20143
+ return (
20144
+ t.preventDefault(),
20145
+ e.isReadOnly() ||
20146
+ e.options.disableInput ||
20147
+ Ji(e, function () {
20148
+ return Is(e, n, 0, null, "paste");
20149
+ }),
20150
+ !0
20151
+ );
20152
+ }
20153
+ function $s(t, e) {
20154
+ if (t.options.electricChars && t.options.smartIndent)
20155
+ for (var n = t.doc.sel, i = n.ranges.length - 1; i >= 0; i--) {
20156
+ var r = n.ranges[i];
20157
+ if (
20158
+ !(
20159
+ r.head.ch > 100 ||
20160
+ (i && n.ranges[i - 1].head.line == r.head.line)
20161
+ )
20162
+ ) {
20163
+ var o = t.getModeAt(r.head),
20164
+ s = !1;
20165
+ if (o.electricChars) {
20166
+ for (var a = 0; a < o.electricChars.length; a++)
20167
+ if (e.indexOf(o.electricChars.charAt(a)) > -1) {
20168
+ s = Ls(t, r.head.line, "smart");
20169
+ break;
20170
+ }
20171
+ } else
20172
+ o.electricInput &&
20173
+ o.electricInput.test(
20174
+ qt(t.doc, r.head.line).text.slice(0, r.head.ch)
20175
+ ) &&
20176
+ (s = Ls(t, r.head.line, "smart"));
20177
+ s && ln(t, "electricInput", t, r.head.line);
20178
+ }
20179
+ }
20180
+ }
20181
+ function Rs(t) {
20182
+ for (
20183
+ var e = [], n = [], i = 0;
20184
+ i < t.doc.sel.ranges.length;
20185
+ i++
20186
+ ) {
20187
+ var r = t.doc.sel.ranges[i].head.line,
20188
+ o = { anchor: te(r, 0), head: te(r + 1, 0) };
20189
+ n.push(o), e.push(t.getRange(o.anchor, o.head));
20190
+ }
20191
+ return { text: e, ranges: n };
20192
+ }
20193
+ function Ds(t, e, n, i) {
20194
+ t.setAttribute("autocorrect", n ? "" : "off"),
20195
+ t.setAttribute("autocapitalize", i ? "" : "off"),
20196
+ t.setAttribute("spellcheck", !!e);
20197
+ }
20198
+ function Ps() {
20199
+ var t = L(
20200
+ "textarea",
20201
+ null,
20202
+ null,
20203
+ "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"
20204
+ ),
20205
+ e = L(
20206
+ "div",
20207
+ [t],
20208
+ null,
20209
+ "overflow: hidden; position: relative; width: 3px; height: 0px;"
20210
+ );
20211
+ return (
20212
+ l ? (t.style.width = "1000px") : t.setAttribute("wrap", "off"),
20213
+ g && (t.style.border = "1px solid black"),
20214
+ Ds(t),
20215
+ e
20216
+ );
20217
+ }
20218
+ function Fs(t, e, n, i, r) {
20219
+ var o = e,
20220
+ s = n,
20221
+ a = qt(t, e.line),
20222
+ l = r && "rtl" == t.direction ? -n : n;
20223
+ function c(o) {
20224
+ var s, c;
20225
+ if ("codepoint" == i) {
20226
+ var h = a.text.charCodeAt(e.ch + (n > 0 ? 0 : -1));
20227
+ if (isNaN(h)) s = null;
20228
+ else {
20229
+ var u =
20230
+ n > 0 ? h >= 55296 && h < 56320 : h >= 56320 && h < 57343;
20231
+ s = new te(
20232
+ e.line,
20233
+ Math.max(
20234
+ 0,
20235
+ Math.min(a.text.length, e.ch + n * (u ? 2 : 1))
20236
+ ),
20237
+ -n
20238
+ );
20239
+ }
20240
+ } else
20241
+ s = r
20242
+ ? (function (t, e, n, i) {
20243
+ var r = ct(e, t.doc.direction);
20244
+ if (!r) return Jo(e, n, i);
20245
+ n.ch >= e.text.length
20246
+ ? ((n.ch = e.text.length), (n.sticky = "before"))
20247
+ : n.ch <= 0 && ((n.ch = 0), (n.sticky = "after"));
20248
+ var o = at(r, n.ch, n.sticky),
20249
+ s = r[o];
20250
+ if (
20251
+ "ltr" == t.doc.direction &&
20252
+ s.level % 2 == 0 &&
20253
+ (i > 0 ? s.to > n.ch : s.from < n.ch)
20254
+ )
20255
+ return Jo(e, n, i);
20256
+ var a,
20257
+ l = function (t, n) {
20258
+ return Zo(e, t instanceof te ? t.ch : t, n);
20259
+ },
20260
+ c = function (n) {
20261
+ return t.options.lineWrapping
20262
+ ? ((a = a || In(t, e)), Zn(t, e, a, n))
20263
+ : { begin: 0, end: e.text.length };
20264
+ },
20265
+ h = c("before" == n.sticky ? l(n, -1) : n.ch);
20266
+ if ("rtl" == t.doc.direction || 1 == s.level) {
20267
+ var u = (1 == s.level) == i < 0,
20268
+ f = l(n, u ? 1 : -1);
20269
+ if (
20270
+ null != f &&
20271
+ (u
20272
+ ? f <= s.to && f <= h.end
20273
+ : f >= s.from && f >= h.begin)
20274
+ ) {
20275
+ var d = u ? "before" : "after";
20276
+ return new te(n.line, f, d);
20277
+ }
20278
+ }
20279
+ var p = function (t, e, i) {
20280
+ for (
20281
+ var o = function (t, e) {
20282
+ return e
20283
+ ? new te(n.line, l(t, 1), "before")
20284
+ : new te(n.line, t, "after");
20285
+ };
20286
+ t >= 0 && t < r.length;
20287
+ t += e
20288
+ ) {
20289
+ var s = r[t],
20290
+ a = e > 0 == (1 != s.level),
20291
+ c = a ? i.begin : l(i.end, -1);
20292
+ if (s.from <= c && c < s.to) return o(c, a);
20293
+ if (
20294
+ ((c = a ? s.from : l(s.to, -1)),
20295
+ i.begin <= c && c < i.end)
20296
+ )
20297
+ return o(c, a);
20298
+ }
20299
+ },
20300
+ g = p(o + i, i, h);
20301
+ if (g) return g;
20302
+ var m = i > 0 ? h.end : l(h.begin, -1);
20303
+ return null == m ||
20304
+ (i > 0 && m == e.text.length) ||
20305
+ !(g = p(i > 0 ? 0 : r.length - 1, i, c(m)))
20306
+ ? null
20307
+ : g;
20308
+ })(t.cm, a, e, n)
20309
+ : Jo(a, e, n);
20310
+ if (null == s) {
20311
+ if (
20312
+ o ||
20313
+ (c = e.line + l) < t.first ||
20314
+ c >= t.first + t.size ||
20315
+ ((e = new te(c, e.ch, e.sticky)), !(a = qt(t, c)))
20316
+ )
20317
+ return !1;
20318
+ e = ts(r, t.cm, a, e.line, l);
20319
+ } else e = s;
20320
+ return !0;
20321
+ }
20322
+ if ("char" == i || "codepoint" == i) c();
20323
+ else if ("column" == i) c(!0);
20324
+ else if ("word" == i || "group" == i)
20325
+ for (
20326
+ var h = null,
20327
+ u = "group" == i,
20328
+ f = t.cm && t.cm.getHelper(e, "wordChars"),
20329
+ d = !0;
20330
+ !(n < 0) || c(!d);
20331
+ d = !1
20332
+ ) {
20333
+ var p = a.text.charAt(e.ch) || "\n",
20334
+ g = tt(p, f)
20335
+ ? "w"
20336
+ : u && "\n" == p
20337
+ ? "n"
20338
+ : !u || /\s/.test(p)
20339
+ ? null
20340
+ : "p";
20341
+ if ((!u || d || g || (g = "s"), h && h != g)) {
20342
+ n < 0 && ((n = 1), c(), (e.sticky = "after"));
20343
+ break;
20344
+ }
20345
+ if ((g && (h = g), n > 0 && !c(!d))) break;
20346
+ }
20347
+ var m = oo(t, e, o, s, !0);
20348
+ return ne(o, m) && (m.hitSide = !0), m;
20349
+ }
20350
+ function Bs(t, e, n, i) {
20351
+ var r,
20352
+ o,
20353
+ s = t.doc,
20354
+ a = e.left;
20355
+ if ("page" == i) {
20356
+ var l = Math.min(
20357
+ t.display.wrapper.clientHeight,
20358
+ window.innerHeight || document.documentElement.clientHeight
20359
+ ),
20360
+ c = Math.max(l - 0.5 * ii(t.display), 3);
20361
+ r = (n > 0 ? e.bottom : e.top) + n * c;
20362
+ } else "line" == i && (r = n > 0 ? e.bottom + 3 : e.top - 3);
20363
+ for (; (o = Xn(t, a, r)).outside; ) {
20364
+ if (n < 0 ? r <= 0 : r >= s.height) {
20365
+ o.hitSide = !0;
20366
+ break;
20367
+ }
20368
+ r += 5 * n;
20369
+ }
20370
+ return o;
20371
+ }
20372
+ var Us = function (t) {
20373
+ (this.cm = t),
20374
+ (this.lastAnchorNode =
20375
+ this.lastAnchorOffset =
20376
+ this.lastFocusNode =
20377
+ this.lastFocusOffset =
20378
+ null),
20379
+ (this.polling = new B()),
20380
+ (this.composing = null),
20381
+ (this.gracePeriod = !1),
20382
+ (this.readDOMTimeout = null);
20383
+ };
20384
+ function Hs(t, e) {
20385
+ var n = Nn(t, e.line);
20386
+ if (!n || n.hidden) return null;
20387
+ var i = qt(t.doc, e.line),
20388
+ r = Ln(n, i, e.line),
20389
+ o = ct(i, t.doc.direction),
20390
+ s = "left";
20391
+ o && (s = at(o, e.ch) % 2 ? "right" : "left");
20392
+ var a = Dn(r.map, e.ch, s);
20393
+ return (a.offset = "right" == a.collapse ? a.end : a.start), a;
20394
+ }
20395
+ function zs(t, e) {
20396
+ return e && (t.bad = !0), t;
20397
+ }
20398
+ function Ws(t, e, n) {
20399
+ var i;
20400
+ if (e == t.display.lineDiv) {
20401
+ if (!(i = t.display.lineDiv.childNodes[n]))
20402
+ return zs(t.clipPos(te(t.display.viewTo - 1)), !0);
20403
+ (e = null), (n = 0);
20404
+ } else
20405
+ for (i = e; ; i = i.parentNode) {
20406
+ if (!i || i == t.display.lineDiv) return null;
20407
+ if (i.parentNode && i.parentNode == t.display.lineDiv) break;
20408
+ }
20409
+ for (var r = 0; r < t.display.view.length; r++) {
20410
+ var o = t.display.view[r];
20411
+ if (o.node == i) return js(o, e, n);
20412
+ }
20413
+ }
20414
+ function js(t, e, n) {
20415
+ var i = t.text.firstChild,
20416
+ r = !1;
20417
+ if (!e || !N(i, e)) return zs(te(Xt(t.line), 0), !0);
20418
+ if (e == i && ((r = !0), (e = i.childNodes[n]), (n = 0), !e)) {
20419
+ var o = t.rest ? Y(t.rest) : t.line;
20420
+ return zs(te(Xt(o), o.text.length), r);
20421
+ }
20422
+ var s = 3 == e.nodeType ? e : null,
20423
+ a = e;
20424
+ for (
20425
+ s ||
20426
+ 1 != e.childNodes.length ||
20427
+ 3 != e.firstChild.nodeType ||
20428
+ ((s = e.firstChild), n && (n = s.nodeValue.length));
20429
+ a.parentNode != i;
20430
+
20431
+ )
20432
+ a = a.parentNode;
20433
+ var l = t.measure,
20434
+ c = l.maps;
20435
+ function h(e, n, i) {
20436
+ for (var r = -1; r < (c ? c.length : 0); r++)
20437
+ for (
20438
+ var o = r < 0 ? l.map : c[r], s = 0;
20439
+ s < o.length;
20440
+ s += 3
20441
+ ) {
20442
+ var a = o[s + 2];
20443
+ if (a == e || a == n) {
20444
+ var h = Xt(r < 0 ? t.line : t.rest[r]),
20445
+ u = o[s] + i;
20446
+ return (
20447
+ (i < 0 || a != e) && (u = o[s + (i ? 1 : 0)]), te(h, u)
20448
+ );
20449
+ }
20450
+ }
20451
+ }
20452
+ var u = h(s, a, n);
20453
+ if (u) return zs(u, r);
20454
+ for (
20455
+ var f = a.nextSibling, d = s ? s.nodeValue.length - n : 0;
20456
+ f;
20457
+ f = f.nextSibling
20458
+ ) {
20459
+ if ((u = h(f, f.firstChild, 0)))
20460
+ return zs(te(u.line, u.ch - d), r);
20461
+ d += f.textContent.length;
20462
+ }
20463
+ for (var p = a.previousSibling, g = n; p; p = p.previousSibling) {
20464
+ if ((u = h(p, p.firstChild, -1)))
20465
+ return zs(te(u.line, u.ch + g), r);
20466
+ g += p.textContent.length;
20467
+ }
20468
+ }
20469
+ (Us.prototype.init = function (t) {
20470
+ var e = this,
20471
+ n = this,
20472
+ i = n.cm,
20473
+ r = (n.div = t.lineDiv);
20474
+ function o(t) {
20475
+ for (var e = t.target; e; e = e.parentNode) {
20476
+ if (e == r) return !0;
20477
+ if (/\bCodeMirror-(?:line)?widget\b/.test(e.className)) break;
20478
+ }
20479
+ return !1;
20480
+ }
20481
+ function s(t) {
20482
+ if (o(t) && !gt(i, t)) {
20483
+ if (i.somethingSelected())
20484
+ Ns({ lineWise: !1, text: i.getSelections() }),
20485
+ "cut" == t.type && i.replaceSelection("", null, "cut");
20486
+ else {
20487
+ if (!i.options.lineWiseCopyCut) return;
20488
+ var e = Rs(i);
20489
+ Ns({ lineWise: !0, text: e.text }),
20490
+ "cut" == t.type &&
20491
+ i.operation(function () {
20492
+ i.setSelections(e.ranges, 0, z),
20493
+ i.replaceSelection("", null, "cut");
20494
+ });
20495
+ }
20496
+ if (t.clipboardData) {
20497
+ t.clipboardData.clearData();
20498
+ var s = Os.text.join("\n");
20499
+ if (
20500
+ (t.clipboardData.setData("Text", s),
20501
+ t.clipboardData.getData("Text") == s)
20502
+ )
20503
+ return void t.preventDefault();
20504
+ }
20505
+ var a = Ps(),
20506
+ l = a.firstChild;
20507
+ i.display.lineSpace.insertBefore(
20508
+ a,
20509
+ i.display.lineSpace.firstChild
20510
+ ),
20511
+ (l.value = Os.text.join("\n"));
20512
+ var c = I();
20513
+ R(l),
20514
+ setTimeout(function () {
20515
+ i.display.lineSpace.removeChild(a),
20516
+ c.focus(),
20517
+ c == r && n.showPrimarySelection();
20518
+ }, 50);
20519
+ }
20520
+ }
20521
+ (r.contentEditable = !0),
20522
+ Ds(
20523
+ r,
20524
+ i.options.spellcheck,
20525
+ i.options.autocorrect,
20526
+ i.options.autocapitalize
20527
+ ),
20528
+ ut(r, "paste", function (t) {
20529
+ !o(t) ||
20530
+ gt(i, t) ||
20531
+ Ms(t, i) ||
20532
+ (a <= 11 &&
20533
+ setTimeout(
20534
+ tr(i, function () {
20535
+ return e.updateFromDOM();
20536
+ }),
20537
+ 20
20538
+ ));
20539
+ }),
20540
+ ut(r, "compositionstart", function (t) {
20541
+ e.composing = { data: t.data, done: !1 };
20542
+ }),
20543
+ ut(r, "compositionupdate", function (t) {
20544
+ e.composing || (e.composing = { data: t.data, done: !1 });
20545
+ }),
20546
+ ut(r, "compositionend", function (t) {
20547
+ e.composing &&
20548
+ (t.data != e.composing.data && e.readFromDOMSoon(),
20549
+ (e.composing.done = !0));
20550
+ }),
20551
+ ut(r, "touchstart", function () {
20552
+ return n.forceCompositionEnd();
20553
+ }),
20554
+ ut(r, "input", function () {
20555
+ e.composing || e.readFromDOMSoon();
20556
+ }),
20557
+ ut(r, "copy", s),
20558
+ ut(r, "cut", s);
20559
+ }),
20560
+ (Us.prototype.screenReaderLabelChanged = function (t) {
20561
+ t
20562
+ ? this.div.setAttribute("aria-label", t)
20563
+ : this.div.removeAttribute("aria-label");
20564
+ }),
20565
+ (Us.prototype.prepareSelection = function () {
20566
+ var t = vi(this.cm, !1);
20567
+ return (t.focus = I() == this.div), t;
20568
+ }),
20569
+ (Us.prototype.showSelection = function (t, e) {
20570
+ t &&
20571
+ this.cm.display.view.length &&
20572
+ ((t.focus || e) && this.showPrimarySelection(),
20573
+ this.showMultipleSelections(t));
20574
+ }),
20575
+ (Us.prototype.getSelection = function () {
20576
+ return this.cm.display.wrapper.ownerDocument.getSelection();
20577
+ }),
20578
+ (Us.prototype.showPrimarySelection = function () {
20579
+ var t = this.getSelection(),
20580
+ e = this.cm,
20581
+ i = e.doc.sel.primary(),
20582
+ r = i.from(),
20583
+ o = i.to();
20584
+ if (
20585
+ e.display.viewTo == e.display.viewFrom ||
20586
+ r.line >= e.display.viewTo ||
20587
+ o.line < e.display.viewFrom
20588
+ )
20589
+ t.removeAllRanges();
20590
+ else {
20591
+ var s = Ws(e, t.anchorNode, t.anchorOffset),
20592
+ a = Ws(e, t.focusNode, t.focusOffset);
20593
+ if (
20594
+ !s ||
20595
+ s.bad ||
20596
+ !a ||
20597
+ a.bad ||
20598
+ 0 != ee(oe(s, a), r) ||
20599
+ 0 != ee(re(s, a), o)
20600
+ ) {
20601
+ var l = e.display.view,
20602
+ c = (r.line >= e.display.viewFrom && Hs(e, r)) || {
20603
+ node: l[0].measure.map[2],
20604
+ offset: 0,
20605
+ },
20606
+ h = o.line < e.display.viewTo && Hs(e, o);
20607
+ if (!h) {
20608
+ var u = l[l.length - 1].measure,
20609
+ f = u.maps ? u.maps[u.maps.length - 1] : u.map;
20610
+ h = {
20611
+ node: f[f.length - 1],
20612
+ offset: f[f.length - 2] - f[f.length - 3],
20613
+ };
20614
+ }
20615
+ if (c && h) {
20616
+ var d,
20617
+ p = t.rangeCount && t.getRangeAt(0);
20618
+ try {
20619
+ d = w(c.node, c.offset, h.offset, h.node);
20620
+ } catch (t) {}
20621
+ d &&
20622
+ (!n && e.state.focused
20623
+ ? (t.collapse(c.node, c.offset),
20624
+ d.collapsed || (t.removeAllRanges(), t.addRange(d)))
20625
+ : (t.removeAllRanges(), t.addRange(d)),
20626
+ p && null == t.anchorNode
20627
+ ? t.addRange(p)
20628
+ : n && this.startGracePeriod()),
20629
+ this.rememberSelection();
20630
+ } else t.removeAllRanges();
20631
+ }
20632
+ }
20633
+ }),
20634
+ (Us.prototype.startGracePeriod = function () {
20635
+ var t = this;
20636
+ clearTimeout(this.gracePeriod),
20637
+ (this.gracePeriod = setTimeout(function () {
20638
+ (t.gracePeriod = !1),
20639
+ t.selectionChanged() &&
20640
+ t.cm.operation(function () {
20641
+ return (t.cm.curOp.selectionChanged = !0);
20642
+ });
20643
+ }, 20));
20644
+ }),
20645
+ (Us.prototype.showMultipleSelections = function (t) {
20646
+ A(this.cm.display.cursorDiv, t.cursors),
20647
+ A(this.cm.display.selectionDiv, t.selection);
20648
+ }),
20649
+ (Us.prototype.rememberSelection = function () {
20650
+ var t = this.getSelection();
20651
+ (this.lastAnchorNode = t.anchorNode),
20652
+ (this.lastAnchorOffset = t.anchorOffset),
20653
+ (this.lastFocusNode = t.focusNode),
20654
+ (this.lastFocusOffset = t.focusOffset);
20655
+ }),
20656
+ (Us.prototype.selectionInEditor = function () {
20657
+ var t = this.getSelection();
20658
+ if (!t.rangeCount) return !1;
20659
+ var e = t.getRangeAt(0).commonAncestorContainer;
20660
+ return N(this.div, e);
20661
+ }),
20662
+ (Us.prototype.focus = function () {
20663
+ "nocursor" != this.cm.options.readOnly &&
20664
+ ((this.selectionInEditor() && I() == this.div) ||
20665
+ this.showSelection(this.prepareSelection(), !0),
20666
+ this.div.focus());
20667
+ }),
20668
+ (Us.prototype.blur = function () {
20669
+ this.div.blur();
20670
+ }),
20671
+ (Us.prototype.getField = function () {
20672
+ return this.div;
20673
+ }),
20674
+ (Us.prototype.supportsTouch = function () {
20675
+ return !0;
20676
+ }),
20677
+ (Us.prototype.receivedFocus = function () {
20678
+ var t = this;
20679
+ this.selectionInEditor()
20680
+ ? this.pollSelection()
20681
+ : Ji(this.cm, function () {
20682
+ return (t.cm.curOp.selectionChanged = !0);
20683
+ }),
20684
+ this.polling.set(this.cm.options.pollInterval, function e() {
20685
+ t.cm.state.focused &&
20686
+ (t.pollSelection(),
20687
+ t.polling.set(t.cm.options.pollInterval, e));
20688
+ });
20689
+ }),
20690
+ (Us.prototype.selectionChanged = function () {
20691
+ var t = this.getSelection();
20692
+ return (
20693
+ t.anchorNode != this.lastAnchorNode ||
20694
+ t.anchorOffset != this.lastAnchorOffset ||
20695
+ t.focusNode != this.lastFocusNode ||
20696
+ t.focusOffset != this.lastFocusOffset
20697
+ );
20698
+ }),
20699
+ (Us.prototype.pollSelection = function () {
20700
+ if (
20701
+ null == this.readDOMTimeout &&
20702
+ !this.gracePeriod &&
20703
+ this.selectionChanged()
20704
+ ) {
20705
+ var t = this.getSelection(),
20706
+ e = this.cm;
20707
+ if (
20708
+ m &&
20709
+ h &&
20710
+ this.cm.display.gutterSpecs.length &&
20711
+ (function (t) {
20712
+ for (var e = t; e; e = e.parentNode)
20713
+ if (/CodeMirror-gutter-wrapper/.test(e.className))
20714
+ return !0;
20715
+ return !1;
20716
+ })(t.anchorNode)
20717
+ )
20718
+ return (
20719
+ this.cm.triggerOnKeyDown({
20720
+ type: "keydown",
20721
+ keyCode: 8,
20722
+ preventDefault: Math.abs,
20723
+ }),
20724
+ this.blur(),
20725
+ void this.focus()
20726
+ );
20727
+ if (!this.composing) {
20728
+ this.rememberSelection();
20729
+ var n = Ws(e, t.anchorNode, t.anchorOffset),
20730
+ i = Ws(e, t.focusNode, t.focusOffset);
20731
+ n &&
20732
+ i &&
20733
+ Ji(e, function () {
20734
+ Jr(e.doc, wr(n, i), z),
20735
+ (n.bad || i.bad) && (e.curOp.selectionChanged = !0);
20736
+ });
20737
+ }
20738
+ }
20739
+ }),
20740
+ (Us.prototype.pollContent = function () {
20741
+ null != this.readDOMTimeout &&
20742
+ (clearTimeout(this.readDOMTimeout),
20743
+ (this.readDOMTimeout = null));
20744
+ var t,
20745
+ e,
20746
+ n,
20747
+ i = this.cm,
20748
+ r = i.display,
20749
+ o = i.doc.sel.primary(),
20750
+ s = o.from(),
20751
+ a = o.to();
20752
+ if (
20753
+ (0 == s.ch &&
20754
+ s.line > i.firstLine() &&
20755
+ (s = te(s.line - 1, qt(i.doc, s.line - 1).length)),
20756
+ a.ch == qt(i.doc, a.line).text.length &&
20757
+ a.line < i.lastLine() &&
20758
+ (a = te(a.line + 1, 0)),
20759
+ s.line < r.viewFrom || a.line > r.viewTo - 1)
20760
+ )
20761
+ return !1;
20762
+ s.line == r.viewFrom || 0 == (t = hi(i, s.line))
20763
+ ? ((e = Xt(r.view[0].line)), (n = r.view[0].node))
20764
+ : ((e = Xt(r.view[t].line)),
20765
+ (n = r.view[t - 1].node.nextSibling));
20766
+ var l,
20767
+ c,
20768
+ h = hi(i, a.line);
20769
+ if (
20770
+ (h == r.view.length - 1
20771
+ ? ((l = r.viewTo - 1), (c = r.lineDiv.lastChild))
20772
+ : ((l = Xt(r.view[h + 1].line) - 1),
20773
+ (c = r.view[h + 1].node.previousSibling)),
20774
+ !n)
20775
+ )
20776
+ return !1;
20777
+ for (
20778
+ var u = i.doc.splitLines(
20779
+ (function (t, e, n, i, r) {
20780
+ var o = "",
20781
+ s = !1,
20782
+ a = t.doc.lineSeparator(),
20783
+ l = !1;
20784
+ function c(t) {
20785
+ return function (e) {
20786
+ return e.id == t;
20787
+ };
20788
+ }
20789
+ function h() {
20790
+ s && ((o += a), l && (o += a), (s = l = !1));
20791
+ }
20792
+ function u(t) {
20793
+ t && (h(), (o += t));
20794
+ }
20795
+ function f(e) {
20796
+ if (1 == e.nodeType) {
20797
+ var n = e.getAttribute("cm-text");
20798
+ if (n) return void u(n);
20799
+ var o,
20800
+ d = e.getAttribute("cm-marker");
20801
+ if (d) {
20802
+ var p = t.findMarks(
20803
+ te(i, 0),
20804
+ te(r + 1, 0),
20805
+ c(+d)
20806
+ );
20807
+ return void (
20808
+ p.length &&
20809
+ (o = p[0].find(0)) &&
20810
+ u(Vt(t.doc, o.from, o.to).join(a))
20811
+ );
20812
+ }
20813
+ if ("false" == e.getAttribute("contenteditable"))
20814
+ return;
20815
+ var g = /^(pre|div|p|li|table|br)$/i.test(
20816
+ e.nodeName
20817
+ );
20818
+ if (
20819
+ !/^br$/i.test(e.nodeName) &&
20820
+ 0 == e.textContent.length
20821
+ )
20822
+ return;
20823
+ g && h();
20824
+ for (var m = 0; m < e.childNodes.length; m++)
20825
+ f(e.childNodes[m]);
20826
+ /^(pre|p)$/i.test(e.nodeName) && (l = !0),
20827
+ g && (s = !0);
20828
+ } else
20829
+ 3 == e.nodeType &&
20830
+ u(
20831
+ e.nodeValue
20832
+ .replace(/\u200b/g, "")
20833
+ .replace(/\u00a0/g, " ")
20834
+ );
20835
+ }
20836
+ for (; f(e), e != n; ) (e = e.nextSibling), (l = !1);
20837
+ return o;
20838
+ })(i, n, c, e, l)
20839
+ ),
20840
+ f = Vt(i.doc, te(e, 0), te(l, qt(i.doc, l).text.length));
20841
+ u.length > 1 && f.length > 1;
20842
+
20843
+ )
20844
+ if (Y(u) == Y(f)) u.pop(), f.pop(), l--;
20845
+ else {
20846
+ if (u[0] != f[0]) break;
20847
+ u.shift(), f.shift(), e++;
20848
+ }
20849
+ for (
20850
+ var d = 0,
20851
+ p = 0,
20852
+ g = u[0],
20853
+ m = f[0],
20854
+ v = Math.min(g.length, m.length);
20855
+ d < v && g.charCodeAt(d) == m.charCodeAt(d);
20856
+
20857
+ )
20858
+ ++d;
20859
+ for (
20860
+ var _ = Y(u),
20861
+ y = Y(f),
20862
+ x = Math.min(
20863
+ _.length - (1 == u.length ? d : 0),
20864
+ y.length - (1 == f.length ? d : 0)
20865
+ );
20866
+ p < x &&
20867
+ _.charCodeAt(_.length - p - 1) ==
20868
+ y.charCodeAt(y.length - p - 1);
20869
+
20870
+ )
20871
+ ++p;
20872
+ if (1 == u.length && 1 == f.length && e == s.line)
20873
+ for (
20874
+ ;
20875
+ d &&
20876
+ d > s.ch &&
20877
+ _.charCodeAt(_.length - p - 1) ==
20878
+ y.charCodeAt(y.length - p - 1);
20879
+
20880
+ )
20881
+ d--, p++;
20882
+ (u[u.length - 1] = _.slice(0, _.length - p).replace(
20883
+ /^\u200b+/,
20884
+ ""
20885
+ )),
20886
+ (u[0] = u[0].slice(d).replace(/\u200b+$/, ""));
20887
+ var k = te(e, d),
20888
+ b = te(l, f.length ? Y(f).length - p : 0);
20889
+ return u.length > 1 || u[0] || ee(k, b)
20890
+ ? (go(i.doc, u, k, b, "+input"), !0)
20891
+ : void 0;
20892
+ }),
20893
+ (Us.prototype.ensurePolled = function () {
20894
+ this.forceCompositionEnd();
20895
+ }),
20896
+ (Us.prototype.reset = function () {
20897
+ this.forceCompositionEnd();
20898
+ }),
20899
+ (Us.prototype.forceCompositionEnd = function () {
20900
+ this.composing &&
20901
+ (clearTimeout(this.readDOMTimeout),
20902
+ (this.composing = null),
20903
+ this.updateFromDOM(),
20904
+ this.div.blur(),
20905
+ this.div.focus());
20906
+ }),
20907
+ (Us.prototype.readFromDOMSoon = function () {
20908
+ var t = this;
20909
+ null == this.readDOMTimeout &&
20910
+ (this.readDOMTimeout = setTimeout(function () {
20911
+ if (((t.readDOMTimeout = null), t.composing)) {
20912
+ if (!t.composing.done) return;
20913
+ t.composing = null;
20914
+ }
20915
+ t.updateFromDOM();
20916
+ }, 80));
20917
+ }),
20918
+ (Us.prototype.updateFromDOM = function () {
20919
+ var t = this;
20920
+ (!this.cm.isReadOnly() && this.pollContent()) ||
20921
+ Ji(this.cm, function () {
20922
+ return ui(t.cm);
20923
+ });
20924
+ }),
20925
+ (Us.prototype.setUneditable = function (t) {
20926
+ t.contentEditable = "false";
20927
+ }),
20928
+ (Us.prototype.onKeyPress = function (t) {
20929
+ 0 == t.charCode ||
20930
+ this.composing ||
20931
+ (t.preventDefault(),
20932
+ this.cm.isReadOnly() ||
20933
+ tr(this.cm, Is)(
20934
+ this.cm,
20935
+ String.fromCharCode(
20936
+ null == t.charCode ? t.keyCode : t.charCode
20937
+ ),
20938
+ 0
20939
+ ));
20940
+ }),
20941
+ (Us.prototype.readOnlyChanged = function (t) {
20942
+ this.div.contentEditable = String("nocursor" != t);
20943
+ }),
20944
+ (Us.prototype.onContextMenu = function () {}),
20945
+ (Us.prototype.resetPosition = function () {}),
20946
+ (Us.prototype.needsContentAttribute = !0);
20947
+ var Gs = function (t) {
20948
+ (this.cm = t),
20949
+ (this.prevInput = ""),
20950
+ (this.pollingFast = !1),
20951
+ (this.polling = new B()),
20952
+ (this.hasSelection = !1),
20953
+ (this.composing = null);
20954
+ };
20955
+ (Gs.prototype.init = function (t) {
20956
+ var e = this,
20957
+ n = this,
20958
+ i = this.cm;
20959
+ this.createField(t);
20960
+ var r = this.textarea;
20961
+ function o(t) {
20962
+ if (!gt(i, t)) {
20963
+ if (i.somethingSelected())
20964
+ Ns({ lineWise: !1, text: i.getSelections() });
20965
+ else {
20966
+ if (!i.options.lineWiseCopyCut) return;
20967
+ var e = Rs(i);
20968
+ Ns({ lineWise: !0, text: e.text }),
20969
+ "cut" == t.type
20970
+ ? i.setSelections(e.ranges, null, z)
20971
+ : ((n.prevInput = ""),
20972
+ (r.value = e.text.join("\n")),
20973
+ R(r));
20974
+ }
20975
+ "cut" == t.type && (i.state.cutIncoming = +new Date());
20976
+ }
20977
+ }
20978
+ t.wrapper.insertBefore(this.wrapper, t.wrapper.firstChild),
20979
+ g && (r.style.width = "0px"),
20980
+ ut(r, "input", function () {
20981
+ s && a >= 9 && e.hasSelection && (e.hasSelection = null),
20982
+ n.poll();
20983
+ }),
20984
+ ut(r, "paste", function (t) {
20985
+ gt(i, t) ||
20986
+ Ms(t, i) ||
20987
+ ((i.state.pasteIncoming = +new Date()), n.fastPoll());
20988
+ }),
20989
+ ut(r, "cut", o),
20990
+ ut(r, "copy", o),
20991
+ ut(t.scroller, "paste", function (e) {
20992
+ if (!bn(t, e) && !gt(i, e)) {
20993
+ if (!r.dispatchEvent)
20994
+ return (
20995
+ (i.state.pasteIncoming = +new Date()), void n.focus()
20996
+ );
20997
+ var o = new Event("paste");
20998
+ (o.clipboardData = e.clipboardData), r.dispatchEvent(o);
20999
+ }
21000
+ }),
21001
+ ut(t.lineSpace, "selectstart", function (e) {
21002
+ bn(t, e) || yt(e);
21003
+ }),
21004
+ ut(r, "compositionstart", function () {
21005
+ var t = i.getCursor("from");
21006
+ n.composing && n.composing.range.clear(),
21007
+ (n.composing = {
21008
+ start: t,
21009
+ range: i.markText(t, i.getCursor("to"), {
21010
+ className: "CodeMirror-composing",
21011
+ }),
21012
+ });
21013
+ }),
21014
+ ut(r, "compositionend", function () {
21015
+ n.composing &&
21016
+ (n.poll(), n.composing.range.clear(), (n.composing = null));
21017
+ });
21018
+ }),
21019
+ (Gs.prototype.createField = function (t) {
21020
+ (this.wrapper = Ps()),
21021
+ (this.textarea = this.wrapper.firstChild);
21022
+ }),
21023
+ (Gs.prototype.screenReaderLabelChanged = function (t) {
21024
+ t
21025
+ ? this.textarea.setAttribute("aria-label", t)
21026
+ : this.textarea.removeAttribute("aria-label");
21027
+ }),
21028
+ (Gs.prototype.prepareSelection = function () {
21029
+ var t = this.cm,
21030
+ e = t.display,
21031
+ n = t.doc,
21032
+ i = vi(t);
21033
+ if (t.options.moveInputWithCursor) {
21034
+ var r = Vn(t, n.sel.primary().head, "div"),
21035
+ o = e.wrapper.getBoundingClientRect(),
21036
+ s = e.lineDiv.getBoundingClientRect();
21037
+ (i.teTop = Math.max(
21038
+ 0,
21039
+ Math.min(e.wrapper.clientHeight - 10, r.top + s.top - o.top)
21040
+ )),
21041
+ (i.teLeft = Math.max(
21042
+ 0,
21043
+ Math.min(
21044
+ e.wrapper.clientWidth - 10,
21045
+ r.left + s.left - o.left
21046
+ )
21047
+ ));
21048
+ }
21049
+ return i;
21050
+ }),
21051
+ (Gs.prototype.showSelection = function (t) {
21052
+ var e = this.cm.display;
21053
+ A(e.cursorDiv, t.cursors),
21054
+ A(e.selectionDiv, t.selection),
21055
+ null != t.teTop &&
21056
+ ((this.wrapper.style.top = t.teTop + "px"),
21057
+ (this.wrapper.style.left = t.teLeft + "px"));
21058
+ }),
21059
+ (Gs.prototype.reset = function (t) {
21060
+ if (!this.contextMenuPending && !this.composing) {
21061
+ var e = this.cm;
21062
+ if (e.somethingSelected()) {
21063
+ this.prevInput = "";
21064
+ var n = e.getSelection();
21065
+ (this.textarea.value = n),
21066
+ e.state.focused && R(this.textarea),
21067
+ s && a >= 9 && (this.hasSelection = n);
21068
+ } else
21069
+ t ||
21070
+ ((this.prevInput = this.textarea.value = ""),
21071
+ s && a >= 9 && (this.hasSelection = null));
21072
+ }
21073
+ }),
21074
+ (Gs.prototype.getField = function () {
21075
+ return this.textarea;
21076
+ }),
21077
+ (Gs.prototype.supportsTouch = function () {
21078
+ return !1;
21079
+ }),
21080
+ (Gs.prototype.focus = function () {
21081
+ if (
21082
+ "nocursor" != this.cm.options.readOnly &&
21083
+ (!v || I() != this.textarea)
21084
+ )
21085
+ try {
21086
+ this.textarea.focus();
21087
+ } catch (t) {}
21088
+ }),
21089
+ (Gs.prototype.blur = function () {
21090
+ this.textarea.blur();
21091
+ }),
21092
+ (Gs.prototype.resetPosition = function () {
21093
+ this.wrapper.style.top = this.wrapper.style.left = 0;
21094
+ }),
21095
+ (Gs.prototype.receivedFocus = function () {
21096
+ this.slowPoll();
21097
+ }),
21098
+ (Gs.prototype.slowPoll = function () {
21099
+ var t = this;
21100
+ this.pollingFast ||
21101
+ this.polling.set(this.cm.options.pollInterval, function () {
21102
+ t.poll(), t.cm.state.focused && t.slowPoll();
21103
+ });
21104
+ }),
21105
+ (Gs.prototype.fastPoll = function () {
21106
+ var t = !1,
21107
+ e = this;
21108
+ (e.pollingFast = !0),
21109
+ e.polling.set(20, function n() {
21110
+ e.poll() || t
21111
+ ? ((e.pollingFast = !1), e.slowPoll())
21112
+ : ((t = !0), e.polling.set(60, n));
21113
+ });
21114
+ }),
21115
+ (Gs.prototype.poll = function () {
21116
+ var t = this,
21117
+ e = this.cm,
21118
+ n = this.textarea,
21119
+ i = this.prevInput;
21120
+ if (
21121
+ this.contextMenuPending ||
21122
+ !e.state.focused ||
21123
+ (It(n) && !i && !this.composing) ||
21124
+ e.isReadOnly() ||
21125
+ e.options.disableInput ||
21126
+ e.state.keySeq
21127
+ )
21128
+ return !1;
21129
+ var r = n.value;
21130
+ if (r == i && !e.somethingSelected()) return !1;
21131
+ if (
21132
+ (s && a >= 9 && this.hasSelection === r) ||
21133
+ (_ && /[\uf700-\uf7ff]/.test(r))
21134
+ )
21135
+ return e.display.input.reset(), !1;
21136
+ if (e.doc.sel == e.display.selForContextMenu) {
21137
+ var o = r.charCodeAt(0);
21138
+ if ((8203 != o || i || (i = "​"), 8666 == o))
21139
+ return this.reset(), this.cm.execCommand("undo");
21140
+ }
21141
+ for (
21142
+ var l = 0, c = Math.min(i.length, r.length);
21143
+ l < c && i.charCodeAt(l) == r.charCodeAt(l);
21144
+
21145
+ )
21146
+ ++l;
21147
+ return (
21148
+ Ji(e, function () {
21149
+ Is(
21150
+ e,
21151
+ r.slice(l),
21152
+ i.length - l,
21153
+ null,
21154
+ t.composing ? "*compose" : null
21155
+ ),
21156
+ r.length > 1e3 || r.indexOf("\n") > -1
21157
+ ? (n.value = t.prevInput = "")
21158
+ : (t.prevInput = r),
21159
+ t.composing &&
21160
+ (t.composing.range.clear(),
21161
+ (t.composing.range = e.markText(
21162
+ t.composing.start,
21163
+ e.getCursor("to"),
21164
+ { className: "CodeMirror-composing" }
21165
+ )));
21166
+ }),
21167
+ !0
21168
+ );
21169
+ }),
21170
+ (Gs.prototype.ensurePolled = function () {
21171
+ this.pollingFast && this.poll() && (this.pollingFast = !1);
21172
+ }),
21173
+ (Gs.prototype.onKeyPress = function () {
21174
+ s && a >= 9 && (this.hasSelection = null), this.fastPoll();
21175
+ }),
21176
+ (Gs.prototype.onContextMenu = function (t) {
21177
+ var e = this,
21178
+ n = e.cm,
21179
+ i = n.display,
21180
+ r = e.textarea;
21181
+ e.contextMenuPending && e.contextMenuPending();
21182
+ var o = ci(n, t),
21183
+ c = i.scroller.scrollTop;
21184
+ if (o && !u) {
21185
+ n.options.resetSelectionOnContextMenu &&
21186
+ -1 == n.doc.sel.contains(o) &&
21187
+ tr(n, Jr)(n.doc, wr(o), z);
21188
+ var h,
21189
+ f = r.style.cssText,
21190
+ d = e.wrapper.style.cssText,
21191
+ p = e.wrapper.offsetParent.getBoundingClientRect();
21192
+ if (
21193
+ ((e.wrapper.style.cssText = "position: static"),
21194
+ (r.style.cssText =
21195
+ "position: absolute; width: 30px; height: 30px;\n top: " +
21196
+ (t.clientY - p.top - 5) +
21197
+ "px; left: " +
21198
+ (t.clientX - p.left - 5) +
21199
+ "px;\n z-index: 1000; background: " +
21200
+ (s ? "rgba(255, 255, 255, .05)" : "transparent") +
21201
+ ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"),
21202
+ l && (h = window.scrollY),
21203
+ i.input.focus(),
21204
+ l && window.scrollTo(null, h),
21205
+ i.input.reset(),
21206
+ n.somethingSelected() || (r.value = e.prevInput = " "),
21207
+ (e.contextMenuPending = v),
21208
+ (i.selForContextMenu = n.doc.sel),
21209
+ clearTimeout(i.detectingSelectAll),
21210
+ s && a >= 9 && m(),
21211
+ T)
21212
+ ) {
21213
+ bt(t);
21214
+ var g = function () {
21215
+ dt(window, "mouseup", g), setTimeout(v, 20);
21216
+ };
21217
+ ut(window, "mouseup", g);
21218
+ } else setTimeout(v, 50);
21219
+ }
21220
+ function m() {
21221
+ if (null != r.selectionStart) {
21222
+ var t = n.somethingSelected(),
21223
+ o = "​" + (t ? r.value : "");
21224
+ (r.value = "⇚"),
21225
+ (r.value = o),
21226
+ (e.prevInput = t ? "" : "​"),
21227
+ (r.selectionStart = 1),
21228
+ (r.selectionEnd = o.length),
21229
+ (i.selForContextMenu = n.doc.sel);
21230
+ }
21231
+ }
21232
+ function v() {
21233
+ if (
21234
+ e.contextMenuPending == v &&
21235
+ ((e.contextMenuPending = !1),
21236
+ (e.wrapper.style.cssText = d),
21237
+ (r.style.cssText = f),
21238
+ s &&
21239
+ a < 9 &&
21240
+ i.scrollbars.setScrollTop((i.scroller.scrollTop = c)),
21241
+ null != r.selectionStart)
21242
+ ) {
21243
+ (!s || (s && a < 9)) && m();
21244
+ var t = 0,
21245
+ o = function () {
21246
+ i.selForContextMenu == n.doc.sel &&
21247
+ 0 == r.selectionStart &&
21248
+ r.selectionEnd > 0 &&
21249
+ "​" == e.prevInput
21250
+ ? tr(n, ao)(n)
21251
+ : t++ < 10
21252
+ ? (i.detectingSelectAll = setTimeout(o, 500))
21253
+ : ((i.selForContextMenu = null), i.input.reset());
21254
+ };
21255
+ i.detectingSelectAll = setTimeout(o, 200);
21256
+ }
21257
+ }
21258
+ }),
21259
+ (Gs.prototype.readOnlyChanged = function (t) {
21260
+ t || this.reset(),
21261
+ (this.textarea.disabled = "nocursor" == t),
21262
+ (this.textarea.readOnly = !!t);
21263
+ }),
21264
+ (Gs.prototype.setUneditable = function () {}),
21265
+ (Gs.prototype.needsContentAttribute = !1),
21266
+ (function (t) {
21267
+ var e = t.optionHandlers;
21268
+ function n(n, i, r, o) {
21269
+ (t.defaults[n] = i),
21270
+ r &&
21271
+ (e[n] = o
21272
+ ? function (t, e, n) {
21273
+ n != bs && r(t, e, n);
21274
+ }
21275
+ : r);
21276
+ }
21277
+ (t.defineOption = n),
21278
+ (t.Init = bs),
21279
+ n(
21280
+ "value",
21281
+ "",
21282
+ function (t, e) {
21283
+ return t.setValue(e);
21284
+ },
21285
+ !0
21286
+ ),
21287
+ n(
21288
+ "mode",
21289
+ null,
21290
+ function (t, e) {
21291
+ (t.doc.modeOption = e), Or(t);
21292
+ },
21293
+ !0
21294
+ ),
21295
+ n("indentUnit", 2, Or, !0),
21296
+ n("indentWithTabs", !1),
21297
+ n("smartIndent", !0),
21298
+ n(
21299
+ "tabSize",
21300
+ 4,
21301
+ function (t) {
21302
+ Nr(t), Un(t), ui(t);
21303
+ },
21304
+ !0
21305
+ ),
21306
+ n("lineSeparator", null, function (t, e) {
21307
+ if (((t.doc.lineSep = e), e)) {
21308
+ var n = [],
21309
+ i = t.doc.first;
21310
+ t.doc.iter(function (t) {
21311
+ for (var r = 0; ; ) {
21312
+ var o = t.text.indexOf(e, r);
21313
+ if (-1 == o) break;
21314
+ (r = o + e.length), n.push(te(i, o));
21315
+ }
21316
+ i++;
21317
+ });
21318
+ for (var r = n.length - 1; r >= 0; r--)
21319
+ go(t.doc, e, n[r], te(n[r].line, n[r].ch + e.length));
21320
+ }
21321
+ }),
21322
+ n(
21323
+ "specialChars",
21324
+ /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,
21325
+ function (t, e, n) {
21326
+ (t.state.specialChars = new RegExp(
21327
+ e.source + (e.test("\t") ? "" : "|\t"),
21328
+ "g"
21329
+ )),
21330
+ n != bs && t.refresh();
21331
+ }
21332
+ ),
21333
+ n(
21334
+ "specialCharPlaceholder",
21335
+ Ze,
21336
+ function (t) {
21337
+ return t.refresh();
21338
+ },
21339
+ !0
21340
+ ),
21341
+ n("electricChars", !0),
21342
+ n(
21343
+ "inputStyle",
21344
+ v ? "contenteditable" : "textarea",
21345
+ function () {
21346
+ throw new Error(
21347
+ "inputStyle can not (yet) be changed in a running editor"
21348
+ );
21349
+ },
21350
+ !0
21351
+ ),
21352
+ n(
21353
+ "spellcheck",
21354
+ !1,
21355
+ function (t, e) {
21356
+ return (t.getInputField().spellcheck = e);
21357
+ },
21358
+ !0
21359
+ ),
21360
+ n(
21361
+ "autocorrect",
21362
+ !1,
21363
+ function (t, e) {
21364
+ return (t.getInputField().autocorrect = e);
21365
+ },
21366
+ !0
21367
+ ),
21368
+ n(
21369
+ "autocapitalize",
21370
+ !1,
21371
+ function (t, e) {
21372
+ return (t.getInputField().autocapitalize = e);
21373
+ },
21374
+ !0
21375
+ ),
21376
+ n("rtlMoveVisually", !x),
21377
+ n("wholeLineUpdateBefore", !0),
21378
+ n(
21379
+ "theme",
21380
+ "default",
21381
+ function (t) {
21382
+ ks(t), gr(t);
21383
+ },
21384
+ !0
21385
+ ),
21386
+ n("keyMap", "default", function (t, e, n) {
21387
+ var i = Xo(e),
21388
+ r = n != bs && Xo(n);
21389
+ r && r.detach && r.detach(t, i),
21390
+ i.attach && i.attach(t, r || null);
21391
+ }),
21392
+ n("extraKeys", null),
21393
+ n("configureMouse", null),
21394
+ n("lineWrapping", !1, Es, !0),
21395
+ n(
21396
+ "gutters",
21397
+ [],
21398
+ function (t, e) {
21399
+ (t.display.gutterSpecs = dr(e, t.options.lineNumbers)),
21400
+ gr(t);
21401
+ },
21402
+ !0
21403
+ ),
21404
+ n(
21405
+ "fixedGutter",
21406
+ !0,
21407
+ function (t, e) {
21408
+ (t.display.gutters.style.left = e
21409
+ ? si(t.display) + "px"
21410
+ : "0"),
21411
+ t.refresh();
21412
+ },
21413
+ !0
21414
+ ),
21415
+ n(
21416
+ "coverGutterNextToScrollbar",
21417
+ !1,
21418
+ function (t) {
21419
+ return Hi(t);
21420
+ },
21421
+ !0
21422
+ ),
21423
+ n(
21424
+ "scrollbarStyle",
21425
+ "native",
21426
+ function (t) {
21427
+ ji(t),
21428
+ Hi(t),
21429
+ t.display.scrollbars.setScrollTop(t.doc.scrollTop),
21430
+ t.display.scrollbars.setScrollLeft(t.doc.scrollLeft);
21431
+ },
21432
+ !0
21433
+ ),
21434
+ n(
21435
+ "lineNumbers",
21436
+ !1,
21437
+ function (t, e) {
21438
+ (t.display.gutterSpecs = dr(t.options.gutters, e)), gr(t);
21439
+ },
21440
+ !0
21441
+ ),
21442
+ n("firstLineNumber", 1, gr, !0),
21443
+ n(
21444
+ "lineNumberFormatter",
21445
+ function (t) {
21446
+ return t;
21447
+ },
21448
+ gr,
21449
+ !0
21450
+ ),
21451
+ n("showCursorWhenSelecting", !1, mi, !0),
21452
+ n("resetSelectionOnContextMenu", !0),
21453
+ n("lineWiseCopyCut", !0),
21454
+ n("pasteLinesPerSelection", !0),
21455
+ n("selectionsMayTouch", !1),
21456
+ n("readOnly", !1, function (t, e) {
21457
+ "nocursor" == e && (wi(t), t.display.input.blur()),
21458
+ t.display.input.readOnlyChanged(e);
21459
+ }),
21460
+ n("screenReaderLabel", null, function (t, e) {
21461
+ (e = "" === e ? null : e),
21462
+ t.display.input.screenReaderLabelChanged(e);
21463
+ }),
21464
+ n(
21465
+ "disableInput",
21466
+ !1,
21467
+ function (t, e) {
21468
+ e || t.display.input.reset();
21469
+ },
21470
+ !0
21471
+ ),
21472
+ n("dragDrop", !0, ws),
21473
+ n("allowDropFileTypes", null),
21474
+ n("cursorBlinkRate", 530),
21475
+ n("cursorScrollMargin", 0),
21476
+ n("cursorHeight", 1, mi, !0),
21477
+ n("singleCursorHeightPerLine", !0, mi, !0),
21478
+ n("workTime", 100),
21479
+ n("workDelay", 100),
21480
+ n("flattenSpans", !0, Nr, !0),
21481
+ n("addModeClass", !1, Nr, !0),
21482
+ n("pollInterval", 100),
21483
+ n("undoDepth", 200, function (t, e) {
21484
+ return (t.doc.history.undoDepth = e);
21485
+ }),
21486
+ n("historyEventDelay", 1250),
21487
+ n(
21488
+ "viewportMargin",
21489
+ 10,
21490
+ function (t) {
21491
+ return t.refresh();
21492
+ },
21493
+ !0
21494
+ ),
21495
+ n("maxHighlightLength", 1e4, Nr, !0),
21496
+ n("moveInputWithCursor", !0, function (t, e) {
21497
+ e || t.display.input.resetPosition();
21498
+ }),
21499
+ n("tabindex", null, function (t, e) {
21500
+ return (t.display.input.getField().tabIndex = e || "");
21501
+ }),
21502
+ n("autofocus", null),
21503
+ n(
21504
+ "direction",
21505
+ "ltr",
21506
+ function (t, e) {
21507
+ return t.doc.setDirection(e);
21508
+ },
21509
+ !0
21510
+ ),
21511
+ n("phrases", null);
21512
+ })(Ss),
21513
+ (function (t) {
21514
+ var e = t.optionHandlers,
21515
+ n = (t.helpers = {});
21516
+ (t.prototype = {
21517
+ constructor: t,
21518
+ focus: function () {
21519
+ window.focus(), this.display.input.focus();
21520
+ },
21521
+ setOption: function (t, n) {
21522
+ var i = this.options,
21523
+ r = i[t];
21524
+ (i[t] == n && "mode" != t) ||
21525
+ ((i[t] = n),
21526
+ e.hasOwnProperty(t) && tr(this, e[t])(this, n, r),
21527
+ pt(this, "optionChange", this, t));
21528
+ },
21529
+ getOption: function (t) {
21530
+ return this.options[t];
21531
+ },
21532
+ getDoc: function () {
21533
+ return this.doc;
21534
+ },
21535
+ addKeyMap: function (t, e) {
21536
+ this.state.keyMaps[e ? "push" : "unshift"](Xo(t));
21537
+ },
21538
+ removeKeyMap: function (t) {
21539
+ for (var e = this.state.keyMaps, n = 0; n < e.length; ++n)
21540
+ if (e[n] == t || e[n].name == t)
21541
+ return e.splice(n, 1), !0;
21542
+ },
21543
+ addOverlay: er(function (e, n) {
21544
+ var i = e.token ? e : t.getMode(this.options, e);
21545
+ if (i.startState)
21546
+ throw new Error("Overlays may not be stateful.");
21547
+ !(function (t, e, n) {
21548
+ for (var i = 0, r = n(e); i < t.length && n(t[i]) <= r; )
21549
+ i++;
21550
+ t.splice(i, 0, e);
21551
+ })(
21552
+ this.state.overlays,
21553
+ {
21554
+ mode: i,
21555
+ modeSpec: e,
21556
+ opaque: n && n.opaque,
21557
+ priority: (n && n.priority) || 0,
21558
+ },
21559
+ function (t) {
21560
+ return t.priority;
21561
+ }
21562
+ ),
21563
+ this.state.modeGen++,
21564
+ ui(this);
21565
+ }),
21566
+ removeOverlay: er(function (t) {
21567
+ for (
21568
+ var e = this.state.overlays, n = 0;
21569
+ n < e.length;
21570
+ ++n
21571
+ ) {
21572
+ var i = e[n].modeSpec;
21573
+ if (i == t || ("string" == typeof t && i.name == t))
21574
+ return (
21575
+ e.splice(n, 1), this.state.modeGen++, void ui(this)
21576
+ );
21577
+ }
21578
+ }),
21579
+ indentLine: er(function (t, e, n) {
21580
+ "string" != typeof e &&
21581
+ "number" != typeof e &&
21582
+ (e =
21583
+ null == e
21584
+ ? this.options.smartIndent
21585
+ ? "smart"
21586
+ : "prev"
21587
+ : e
21588
+ ? "add"
21589
+ : "subtract"),
21590
+ Zt(this.doc, t) && Ls(this, t, e, n);
21591
+ }),
21592
+ indentSelection: er(function (t) {
21593
+ for (
21594
+ var e = this.doc.sel.ranges, n = -1, i = 0;
21595
+ i < e.length;
21596
+ i++
21597
+ ) {
21598
+ var r = e[i];
21599
+ if (r.empty())
21600
+ r.head.line > n &&
21601
+ (Ls(this, r.head.line, t, !0),
21602
+ (n = r.head.line),
21603
+ i == this.doc.sel.primIndex && Ni(this));
21604
+ else {
21605
+ var o = r.from(),
21606
+ s = r.to(),
21607
+ a = Math.max(n, o.line);
21608
+ n =
21609
+ Math.min(this.lastLine(), s.line - (s.ch ? 0 : 1)) +
21610
+ 1;
21611
+ for (var l = a; l < n; ++l) Ls(this, l, t);
21612
+ var c = this.doc.sel.ranges;
21613
+ 0 == o.ch &&
21614
+ e.length == c.length &&
21615
+ c[i].from().ch > 0 &&
21616
+ Xr(this.doc, i, new Tr(o, c[i].to()), z);
21617
+ }
21618
+ }
21619
+ }),
21620
+ getTokenAt: function (t, e) {
21621
+ return _e(this, t, e);
21622
+ },
21623
+ getLineTokens: function (t, e) {
21624
+ return _e(this, te(t), e, !0);
21625
+ },
21626
+ getTokenTypeAt: function (t) {
21627
+ t = ae(this.doc, t);
21628
+ var e,
21629
+ n = fe(this, qt(this.doc, t.line)),
21630
+ i = 0,
21631
+ r = (n.length - 1) / 2,
21632
+ o = t.ch;
21633
+ if (0 == o) e = n[2];
21634
+ else
21635
+ for (;;) {
21636
+ var s = (i + r) >> 1;
21637
+ if ((s ? n[2 * s - 1] : 0) >= o) r = s;
21638
+ else {
21639
+ if (!(n[2 * s + 1] < o)) {
21640
+ e = n[2 * s + 2];
21641
+ break;
21642
+ }
21643
+ i = s + 1;
21644
+ }
21645
+ }
21646
+ var a = e ? e.indexOf("overlay ") : -1;
21647
+ return a < 0 ? e : 0 == a ? null : e.slice(0, a - 1);
21648
+ },
21649
+ getModeAt: function (e) {
21650
+ var n = this.doc.mode;
21651
+ return n.innerMode
21652
+ ? t.innerMode(n, this.getTokenAt(e).state).mode
21653
+ : n;
21654
+ },
21655
+ getHelper: function (t, e) {
21656
+ return this.getHelpers(t, e)[0];
21657
+ },
21658
+ getHelpers: function (t, e) {
21659
+ var i = [];
21660
+ if (!n.hasOwnProperty(e)) return i;
21661
+ var r = n[e],
21662
+ o = this.getModeAt(t);
21663
+ if ("string" == typeof o[e]) r[o[e]] && i.push(r[o[e]]);
21664
+ else if (o[e])
21665
+ for (var s = 0; s < o[e].length; s++) {
21666
+ var a = r[o[e][s]];
21667
+ a && i.push(a);
21668
+ }
21669
+ else
21670
+ o.helperType && r[o.helperType]
21671
+ ? i.push(r[o.helperType])
21672
+ : r[o.name] && i.push(r[o.name]);
21673
+ for (var l = 0; l < r._global.length; l++) {
21674
+ var c = r._global[l];
21675
+ c.pred(o, this) && -1 == U(i, c.val) && i.push(c.val);
21676
+ }
21677
+ return i;
21678
+ },
21679
+ getStateAfter: function (t, e) {
21680
+ var n = this.doc;
21681
+ return de(
21682
+ this,
21683
+ (t = se(n, null == t ? n.first + n.size - 1 : t)) + 1,
21684
+ e
21685
+ ).state;
21686
+ },
21687
+ cursorCoords: function (t, e) {
21688
+ var n = this.doc.sel.primary();
21689
+ return Vn(
21690
+ this,
21691
+ null == t
21692
+ ? n.head
21693
+ : "object" == typeof t
21694
+ ? ae(this.doc, t)
21695
+ : t
21696
+ ? n.from()
21697
+ : n.to(),
21698
+ e || "page"
21699
+ );
21700
+ },
21701
+ charCoords: function (t, e) {
21702
+ return qn(this, ae(this.doc, t), e || "page");
21703
+ },
21704
+ coordsChar: function (t, e) {
21705
+ return Xn(this, (t = Gn(this, t, e || "page")).left, t.top);
21706
+ },
21707
+ lineAtHeight: function (t, e) {
21708
+ return (
21709
+ (t = Gn(this, { top: t, left: 0 }, e || "page").top),
21710
+ Qt(this.doc, t + this.display.viewOffset)
21711
+ );
21712
+ },
21713
+ heightAtLine: function (t, e, n) {
21714
+ var i,
21715
+ r = !1;
21716
+ if ("number" == typeof t) {
21717
+ var o = this.doc.first + this.doc.size - 1;
21718
+ t < this.doc.first
21719
+ ? (t = this.doc.first)
21720
+ : t > o && ((t = o), (r = !0)),
21721
+ (i = qt(this.doc, t));
21722
+ } else i = t;
21723
+ return (
21724
+ jn(this, i, { top: 0, left: 0 }, e || "page", n || r)
21725
+ .top + (r ? this.doc.height - We(i) : 0)
21726
+ );
21727
+ },
21728
+ defaultTextHeight: function () {
21729
+ return ii(this.display);
21730
+ },
21731
+ defaultCharWidth: function () {
21732
+ return ri(this.display);
21733
+ },
21734
+ getViewport: function () {
21735
+ return {
21736
+ from: this.display.viewFrom,
21737
+ to: this.display.viewTo,
21738
+ };
21739
+ },
21740
+ addWidget: function (t, e, n, i, r) {
21741
+ var o,
21742
+ s,
21743
+ a,
21744
+ l = this.display,
21745
+ c = (t = Vn(this, ae(this.doc, t))).bottom,
21746
+ h = t.left;
21747
+ if (
21748
+ ((e.style.position = "absolute"),
21749
+ e.setAttribute("cm-ignore-events", "true"),
21750
+ this.display.input.setUneditable(e),
21751
+ l.sizer.appendChild(e),
21752
+ "over" == i)
21753
+ )
21754
+ c = t.top;
21755
+ else if ("above" == i || "near" == i) {
21756
+ var u = Math.max(l.wrapper.clientHeight, this.doc.height),
21757
+ f = Math.max(
21758
+ l.sizer.clientWidth,
21759
+ l.lineSpace.clientWidth
21760
+ );
21761
+ ("above" == i || t.bottom + e.offsetHeight > u) &&
21762
+ t.top > e.offsetHeight
21763
+ ? (c = t.top - e.offsetHeight)
21764
+ : t.bottom + e.offsetHeight <= u && (c = t.bottom),
21765
+ h + e.offsetWidth > f && (h = f - e.offsetWidth);
21766
+ }
21767
+ (e.style.top = c + "px"),
21768
+ (e.style.left = e.style.right = ""),
21769
+ "right" == r
21770
+ ? ((h = l.sizer.clientWidth - e.offsetWidth),
21771
+ (e.style.right = "0px"))
21772
+ : ("left" == r
21773
+ ? (h = 0)
21774
+ : "middle" == r &&
21775
+ (h = (l.sizer.clientWidth - e.offsetWidth) / 2),
21776
+ (e.style.left = h + "px")),
21777
+ n &&
21778
+ ((o = this),
21779
+ (s = {
21780
+ left: h,
21781
+ top: c,
21782
+ right: h + e.offsetWidth,
21783
+ bottom: c + e.offsetHeight,
21784
+ }),
21785
+ null != (a = Li(o, s)).scrollTop && Ri(o, a.scrollTop),
21786
+ null != a.scrollLeft && Pi(o, a.scrollLeft));
21787
+ },
21788
+ triggerOnKeyDown: er(hs),
21789
+ triggerOnKeyPress: er(fs),
21790
+ triggerOnKeyUp: us,
21791
+ triggerOnMouseDown: er(ms),
21792
+ execCommand: function (t) {
21793
+ if (es.hasOwnProperty(t)) return es[t].call(null, this);
21794
+ },
21795
+ triggerElectric: er(function (t) {
21796
+ $s(this, t);
21797
+ }),
21798
+ findPosH: function (t, e, n, i) {
21799
+ var r = 1;
21800
+ e < 0 && ((r = -1), (e = -e));
21801
+ for (
21802
+ var o = ae(this.doc, t), s = 0;
21803
+ s < e && !(o = Fs(this.doc, o, r, n, i)).hitSide;
21804
+ ++s
21805
+ );
21806
+ return o;
21807
+ },
21808
+ moveH: er(function (t, e) {
21809
+ var n = this;
21810
+ this.extendSelectionsBy(function (i) {
21811
+ return n.display.shift || n.doc.extend || i.empty()
21812
+ ? Fs(n.doc, i.head, t, e, n.options.rtlMoveVisually)
21813
+ : t < 0
21814
+ ? i.from()
21815
+ : i.to();
21816
+ }, j);
21817
+ }),
21818
+ deleteH: er(function (t, e) {
21819
+ var n = this.doc.sel,
21820
+ i = this.doc;
21821
+ n.somethingSelected()
21822
+ ? i.replaceSelection("", null, "+delete")
21823
+ : Qo(this, function (n) {
21824
+ var r = Fs(i, n.head, t, e, !1);
21825
+ return t < 0
21826
+ ? { from: r, to: n.head }
21827
+ : { from: n.head, to: r };
21828
+ });
21829
+ }),
21830
+ findPosV: function (t, e, n, i) {
21831
+ var r = 1,
21832
+ o = i;
21833
+ e < 0 && ((r = -1), (e = -e));
21834
+ for (var s = ae(this.doc, t), a = 0; a < e; ++a) {
21835
+ var l = Vn(this, s, "div");
21836
+ if (
21837
+ (null == o ? (o = l.left) : (l.left = o),
21838
+ (s = Bs(this, l, r, n)).hitSide)
21839
+ )
21840
+ break;
21841
+ }
21842
+ return s;
21843
+ },
21844
+ moveV: er(function (t, e) {
21845
+ var n = this,
21846
+ i = this.doc,
21847
+ r = [],
21848
+ o =
21849
+ !this.display.shift &&
21850
+ !i.extend &&
21851
+ i.sel.somethingSelected();
21852
+ if (
21853
+ (i.extendSelectionsBy(function (s) {
21854
+ if (o) return t < 0 ? s.from() : s.to();
21855
+ var a = Vn(n, s.head, "div");
21856
+ null != s.goalColumn && (a.left = s.goalColumn),
21857
+ r.push(a.left);
21858
+ var l = Bs(n, a, t, e);
21859
+ return (
21860
+ "page" == e &&
21861
+ s == i.sel.primary() &&
21862
+ Oi(n, qn(n, l, "div").top - a.top),
21863
+ l
21864
+ );
21865
+ }, j),
21866
+ r.length)
21867
+ )
21868
+ for (var s = 0; s < i.sel.ranges.length; s++)
21869
+ i.sel.ranges[s].goalColumn = r[s];
21870
+ }),
21871
+ findWordAt: function (t) {
21872
+ var e = qt(this.doc, t.line).text,
21873
+ n = t.ch,
21874
+ i = t.ch;
21875
+ if (e) {
21876
+ var r = this.getHelper(t, "wordChars");
21877
+ ("before" != t.sticky && i != e.length) || !n ? ++i : --n;
21878
+ for (
21879
+ var o = e.charAt(n),
21880
+ s = tt(o, r)
21881
+ ? function (t) {
21882
+ return tt(t, r);
21883
+ }
21884
+ : /\s/.test(o)
21885
+ ? function (t) {
21886
+ return /\s/.test(t);
21887
+ }
21888
+ : function (t) {
21889
+ return !/\s/.test(t) && !tt(t);
21890
+ };
21891
+ n > 0 && s(e.charAt(n - 1));
21892
+
21893
+ )
21894
+ --n;
21895
+ for (; i < e.length && s(e.charAt(i)); ) ++i;
21896
+ }
21897
+ return new Tr(te(t.line, n), te(t.line, i));
21898
+ },
21899
+ toggleOverwrite: function (t) {
21900
+ (null != t && t == this.state.overwrite) ||
21901
+ ((this.state.overwrite = !this.state.overwrite)
21902
+ ? M(this.display.cursorDiv, "CodeMirror-overwrite")
21903
+ : E(this.display.cursorDiv, "CodeMirror-overwrite"),
21904
+ pt(this, "overwriteToggle", this, this.state.overwrite));
21905
+ },
21906
+ hasFocus: function () {
21907
+ return this.display.input.getField() == I();
21908
+ },
21909
+ isReadOnly: function () {
21910
+ return !(!this.options.readOnly && !this.doc.cantEdit);
21911
+ },
21912
+ scrollTo: er(function (t, e) {
21913
+ Ii(this, t, e);
21914
+ }),
21915
+ getScrollInfo: function () {
21916
+ var t = this.display.scroller;
21917
+ return {
21918
+ left: t.scrollLeft,
21919
+ top: t.scrollTop,
21920
+ height:
21921
+ t.scrollHeight - En(this) - this.display.barHeight,
21922
+ width: t.scrollWidth - En(this) - this.display.barWidth,
21923
+ clientHeight: An(this),
21924
+ clientWidth: Sn(this),
21925
+ };
21926
+ },
21927
+ scrollIntoView: er(function (t, e) {
21928
+ null == t
21929
+ ? ((t = { from: this.doc.sel.primary().head, to: null }),
21930
+ null == e && (e = this.options.cursorScrollMargin))
21931
+ : "number" == typeof t
21932
+ ? (t = { from: te(t, 0), to: null })
21933
+ : null == t.from && (t = { from: t, to: null }),
21934
+ t.to || (t.to = t.from),
21935
+ (t.margin = e || 0),
21936
+ null != t.from.line
21937
+ ? (function (t, e) {
21938
+ Mi(t), (t.curOp.scrollToPos = e);
21939
+ })(this, t)
21940
+ : $i(this, t.from, t.to, t.margin);
21941
+ }),
21942
+ setSize: er(function (t, e) {
21943
+ var n = this,
21944
+ i = function (t) {
21945
+ return "number" == typeof t || /^\d+$/.test(String(t))
21946
+ ? t + "px"
21947
+ : t;
21948
+ };
21949
+ null != t && (this.display.wrapper.style.width = i(t)),
21950
+ null != e && (this.display.wrapper.style.height = i(e)),
21951
+ this.options.lineWrapping && Bn(this);
21952
+ var r = this.display.viewFrom;
21953
+ this.doc.iter(r, this.display.viewTo, function (t) {
21954
+ if (t.widgets)
21955
+ for (var e = 0; e < t.widgets.length; e++)
21956
+ if (t.widgets[e].noHScroll) {
21957
+ fi(n, r, "widget");
21958
+ break;
21959
+ }
21960
+ ++r;
21961
+ }),
21962
+ (this.curOp.forceUpdate = !0),
21963
+ pt(this, "refresh", this);
21964
+ }),
21965
+ operation: function (t) {
21966
+ return Ji(this, t);
21967
+ },
21968
+ startOperation: function () {
21969
+ return qi(this);
21970
+ },
21971
+ endOperation: function () {
21972
+ return Vi(this);
21973
+ },
21974
+ refresh: er(function () {
21975
+ var t = this.display.cachedTextHeight;
21976
+ ui(this),
21977
+ (this.curOp.forceUpdate = !0),
21978
+ Un(this),
21979
+ Ii(this, this.doc.scrollLeft, this.doc.scrollTop),
21980
+ cr(this.display),
21981
+ (null == t ||
21982
+ Math.abs(t - ii(this.display)) > 0.5 ||
21983
+ this.options.lineWrapping) &&
21984
+ li(this),
21985
+ pt(this, "refresh", this);
21986
+ }),
21987
+ swapDoc: er(function (t) {
21988
+ var e = this.doc;
21989
+ return (
21990
+ (e.cm = null),
21991
+ this.state.selectingText && this.state.selectingText(),
21992
+ Rr(this, t),
21993
+ Un(this),
21994
+ this.display.input.reset(),
21995
+ Ii(this, t.scrollLeft, t.scrollTop),
21996
+ (this.curOp.forceScroll = !0),
21997
+ ln(this, "swapDoc", this, e),
21998
+ e
21999
+ );
22000
+ }),
22001
+ phrase: function (t) {
22002
+ var e = this.options.phrases;
22003
+ return e && Object.prototype.hasOwnProperty.call(e, t)
22004
+ ? e[t]
22005
+ : t;
22006
+ },
22007
+ getInputField: function () {
22008
+ return this.display.input.getField();
22009
+ },
22010
+ getWrapperElement: function () {
22011
+ return this.display.wrapper;
22012
+ },
22013
+ getScrollerElement: function () {
22014
+ return this.display.scroller;
22015
+ },
22016
+ getGutterElement: function () {
22017
+ return this.display.gutters;
22018
+ },
22019
+ }),
22020
+ _t(t),
22021
+ (t.registerHelper = function (e, i, r) {
22022
+ n.hasOwnProperty(e) || (n[e] = t[e] = { _global: [] }),
22023
+ (n[e][i] = r);
22024
+ }),
22025
+ (t.registerGlobalHelper = function (e, i, r, o) {
22026
+ t.registerHelper(e, i, o),
22027
+ n[e]._global.push({ pred: r, val: o });
22028
+ });
22029
+ })(Ss);
22030
+ var qs = "iter insert remove copy getEditor constructor".split(" ");
22031
+ for (var Vs in No.prototype)
22032
+ No.prototype.hasOwnProperty(Vs) &&
22033
+ U(qs, Vs) < 0 &&
22034
+ (Ss.prototype[Vs] = (function (t) {
22035
+ return function () {
22036
+ return t.apply(this.doc, arguments);
22037
+ };
22038
+ })(No.prototype[Vs]));
22039
+ return (
22040
+ _t(No),
22041
+ (Ss.inputStyles = { textarea: Gs, contenteditable: Us }),
22042
+ (Ss.defineMode = function (t) {
22043
+ Ss.defaults.mode || "null" == t || (Ss.defaults.mode = t),
22044
+ Pt.apply(this, arguments);
22045
+ }),
22046
+ (Ss.defineMIME = function (t, e) {
22047
+ Dt[t] = e;
22048
+ }),
22049
+ Ss.defineMode("null", function () {
22050
+ return {
22051
+ token: function (t) {
22052
+ return t.skipToEnd();
22053
+ },
22054
+ };
22055
+ }),
22056
+ Ss.defineMIME("text/plain", "null"),
22057
+ (Ss.defineExtension = function (t, e) {
22058
+ Ss.prototype[t] = e;
22059
+ }),
22060
+ (Ss.defineDocExtension = function (t, e) {
22061
+ No.prototype[t] = e;
22062
+ }),
22063
+ (Ss.fromTextArea = function (t, e) {
22064
+ if (
22065
+ (((e = e ? P(e) : {}).value = t.value),
22066
+ !e.tabindex && t.tabIndex && (e.tabindex = t.tabIndex),
22067
+ !e.placeholder &&
22068
+ t.placeholder &&
22069
+ (e.placeholder = t.placeholder),
22070
+ null == e.autofocus)
22071
+ ) {
22072
+ var n = I();
22073
+ e.autofocus =
22074
+ n == t ||
22075
+ (null != t.getAttribute("autofocus") && n == document.body);
22076
+ }
22077
+ function i() {
22078
+ t.value = a.getValue();
22079
+ }
22080
+ var r;
22081
+ if (
22082
+ t.form &&
22083
+ (ut(t.form, "submit", i), !e.leaveSubmitMethodAlone)
22084
+ ) {
22085
+ var o = t.form;
22086
+ r = o.submit;
22087
+ try {
22088
+ var s = (o.submit = function () {
22089
+ i(), (o.submit = r), o.submit(), (o.submit = s);
22090
+ });
22091
+ } catch (t) {}
22092
+ }
22093
+ (e.finishInit = function (n) {
22094
+ (n.save = i),
22095
+ (n.getTextArea = function () {
22096
+ return t;
22097
+ }),
22098
+ (n.toTextArea = function () {
22099
+ (n.toTextArea = isNaN),
22100
+ i(),
22101
+ t.parentNode.removeChild(n.getWrapperElement()),
22102
+ (t.style.display = ""),
22103
+ t.form &&
22104
+ (dt(t.form, "submit", i),
22105
+ e.leaveSubmitMethodAlone ||
22106
+ "function" != typeof t.form.submit ||
22107
+ (t.form.submit = r));
22108
+ });
22109
+ }),
22110
+ (t.style.display = "none");
22111
+ var a = Ss(function (e) {
22112
+ return t.parentNode.insertBefore(e, t.nextSibling);
22113
+ }, e);
22114
+ return a;
22115
+ }),
22116
+ (function (t) {
22117
+ (t.off = dt),
22118
+ (t.on = ut),
22119
+ (t.wheelEventPixels = xr),
22120
+ (t.Doc = No),
22121
+ (t.splitLines = Nt),
22122
+ (t.countColumn = F),
22123
+ (t.findColumn = G),
22124
+ (t.isWordChar = J),
22125
+ (t.Pass = H),
22126
+ (t.signal = pt),
22127
+ (t.Line = qe),
22128
+ (t.changeEnd = Er),
22129
+ (t.scrollbarModel = Wi),
22130
+ (t.Pos = te),
22131
+ (t.cmpPos = ee),
22132
+ (t.modes = Rt),
22133
+ (t.mimeModes = Dt),
22134
+ (t.resolveMode = Ft),
22135
+ (t.getMode = Bt),
22136
+ (t.modeExtensions = Ut),
22137
+ (t.extendMode = Ht),
22138
+ (t.copyState = zt),
22139
+ (t.startState = jt),
22140
+ (t.innerMode = Wt),
22141
+ (t.commands = es),
22142
+ (t.keyMap = Wo),
22143
+ (t.keyName = Ko),
22144
+ (t.isModifierKey = Vo),
22145
+ (t.lookupKey = qo),
22146
+ (t.normalizeKeyMap = Go),
22147
+ (t.StringStream = Gt),
22148
+ (t.SharedTextMarker = So),
22149
+ (t.TextMarker = wo),
22150
+ (t.LineWidget = bo),
22151
+ (t.e_preventDefault = yt),
22152
+ (t.e_stopPropagation = xt),
22153
+ (t.e_stop = bt),
22154
+ (t.addClass = M),
22155
+ (t.contains = N),
22156
+ (t.rmClass = E),
22157
+ (t.keyNames = Bo);
22158
+ })(Ss),
22159
+ (Ss.version = "5.62.3"),
22160
+ Ss
22161
+ );
22162
+ }),
22163
+ "object" == typeof n && void 0 !== e
22164
+ ? (e.exports = r())
22165
+ : "function" == typeof define && define.amd
22166
+ ? define(r)
22167
+ : ((i = i || self).CodeMirror = r());
22168
+ },
22169
+ {},
22170
+ ],
22171
+ 14: [
22172
+ function (t, e, n) {
22173
+ var i;
22174
+ (i = function (t) {
22175
+ "use strict";
22176
+ function e(t, e, n, i, r, o) {
22177
+ (this.indented = t),
22178
+ (this.column = e),
22179
+ (this.type = n),
22180
+ (this.info = i),
22181
+ (this.align = r),
22182
+ (this.prev = o);
22183
+ }
22184
+ function n(t, n, i, r) {
22185
+ var o = t.indented;
22186
+ return (
22187
+ t.context &&
22188
+ "statement" == t.context.type &&
22189
+ "statement" != i &&
22190
+ (o = t.context.indented),
22191
+ (t.context = new e(o, n, i, r, null, t.context))
22192
+ );
22193
+ }
22194
+ function i(t) {
22195
+ var e = t.context.type;
22196
+ return (
22197
+ (")" != e && "]" != e && "}" != e) ||
22198
+ (t.indented = t.context.indented),
22199
+ (t.context = t.context.prev)
22200
+ );
22201
+ }
22202
+ function r(t, e, n) {
22203
+ return (
22204
+ "variable" == e.prevToken ||
22205
+ "type" == e.prevToken ||
22206
+ !!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(t.string.slice(0, n)) ||
22207
+ !(!e.typeAtEndOfLine || t.column() != t.indentation()) ||
22208
+ void 0
22209
+ );
22210
+ }
22211
+ function o(t) {
22212
+ for (;;) {
22213
+ if (!t || "top" == t.type) return !0;
22214
+ if ("}" == t.type && "namespace" != t.prev.info) return !1;
22215
+ t = t.prev;
22216
+ }
22217
+ }
22218
+ function s(t) {
22219
+ for (var e = {}, n = t.split(" "), i = 0; i < n.length; ++i)
22220
+ e[n[i]] = !0;
22221
+ return e;
22222
+ }
22223
+ function a(t, e) {
22224
+ return "function" == typeof t ? t(e) : t.propertyIsEnumerable(e);
22225
+ }
22226
+ t.defineMode("clike", function (s, l) {
22227
+ var c,
22228
+ h,
22229
+ u = s.indentUnit,
22230
+ f = l.statementIndentUnit || u,
22231
+ d = l.dontAlignCalls,
22232
+ p = l.keywords || {},
22233
+ g = l.types || {},
22234
+ m = l.builtin || {},
22235
+ v = l.blockKeywords || {},
22236
+ _ = l.defKeywords || {},
22237
+ y = l.atoms || {},
22238
+ x = l.hooks || {},
22239
+ k = l.multiLineStrings,
22240
+ b = !1 !== l.indentStatements,
22241
+ T = !1 !== l.indentSwitch,
22242
+ C = l.namespaceSeparator,
22243
+ w = l.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
22244
+ E = l.numberStart || /[\d\.]/,
22245
+ S =
22246
+ l.number ||
22247
+ /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
22248
+ A = l.isOperatorChar || /[+\-*&%=<>!?|\/]/,
22249
+ L = l.isIdentifierChar || /[\w\$_\xa1-\uffff]/,
22250
+ O = l.isReservedIdentifier || !1;
22251
+ function N(t, e) {
22252
+ var n,
22253
+ i = t.next();
22254
+ if (x[i]) {
22255
+ var r = x[i](t, e);
22256
+ if (!1 !== r) return r;
22257
+ }
22258
+ if ('"' == i || "'" == i)
22259
+ return (
22260
+ (e.tokenize =
22261
+ ((n = i),
22262
+ function (t, e) {
22263
+ for (var i, r = !1, o = !1; null != (i = t.next()); ) {
22264
+ if (i == n && !r) {
22265
+ o = !0;
22266
+ break;
22267
+ }
22268
+ r = !r && "\\" == i;
22269
+ }
22270
+ return (o || (!r && !k)) && (e.tokenize = null), "string";
22271
+ })),
22272
+ e.tokenize(t, e)
22273
+ );
22274
+ if (E.test(i)) {
22275
+ if ((t.backUp(1), t.match(S))) return "number";
22276
+ t.next();
22277
+ }
22278
+ if (w.test(i)) return (c = i), null;
22279
+ if ("/" == i) {
22280
+ if (t.eat("*")) return (e.tokenize = I), I(t, e);
22281
+ if (t.eat("/")) return t.skipToEnd(), "comment";
22282
+ }
22283
+ if (A.test(i)) {
22284
+ for (; !t.match(/^\/[\/*]/, !1) && t.eat(A); );
22285
+ return "operator";
22286
+ }
22287
+ if ((t.eatWhile(L), C)) for (; t.match(C); ) t.eatWhile(L);
22288
+ var o = t.current();
22289
+ return a(p, o)
22290
+ ? (a(v, o) && (c = "newstatement"),
22291
+ a(_, o) && (h = !0),
22292
+ "keyword")
22293
+ : a(g, o)
22294
+ ? "type"
22295
+ : a(m, o) || (O && O(o))
22296
+ ? (a(v, o) && (c = "newstatement"), "builtin")
22297
+ : a(y, o)
22298
+ ? "atom"
22299
+ : "variable";
22300
+ }
22301
+ function I(t, e) {
22302
+ for (var n, i = !1; (n = t.next()); ) {
22303
+ if ("/" == n && i) {
22304
+ e.tokenize = null;
22305
+ break;
22306
+ }
22307
+ i = "*" == n;
22308
+ }
22309
+ return "comment";
22310
+ }
22311
+ function M(t, e) {
22312
+ l.typeFirstDefinitions &&
22313
+ t.eol() &&
22314
+ o(e.context) &&
22315
+ (e.typeAtEndOfLine = r(t, e, t.pos));
22316
+ }
22317
+ return {
22318
+ startState: function (t) {
22319
+ return {
22320
+ tokenize: null,
22321
+ context: new e((t || 0) - u, 0, "top", null, !1),
22322
+ indented: 0,
22323
+ startOfLine: !0,
22324
+ prevToken: null,
22325
+ };
22326
+ },
22327
+ token: function (t, e) {
22328
+ var s = e.context;
22329
+ if (
22330
+ (t.sol() &&
22331
+ (null == s.align && (s.align = !1),
22332
+ (e.indented = t.indentation()),
22333
+ (e.startOfLine = !0)),
22334
+ t.eatSpace())
22335
+ )
22336
+ return M(t, e), null;
22337
+ c = h = null;
22338
+ var a = (e.tokenize || N)(t, e);
22339
+ if ("comment" == a || "meta" == a) return a;
22340
+ if (
22341
+ (null == s.align && (s.align = !0),
22342
+ ";" == c ||
22343
+ ":" == c ||
22344
+ ("," == c && t.match(/^\s*(?:\/\/.*)?$/, !1)))
22345
+ )
22346
+ for (; "statement" == e.context.type; ) i(e);
22347
+ else if ("{" == c) n(e, t.column(), "}");
22348
+ else if ("[" == c) n(e, t.column(), "]");
22349
+ else if ("(" == c) n(e, t.column(), ")");
22350
+ else if ("}" == c) {
22351
+ for (; "statement" == s.type; ) s = i(e);
22352
+ for ("}" == s.type && (s = i(e)); "statement" == s.type; )
22353
+ s = i(e);
22354
+ } else
22355
+ c == s.type
22356
+ ? i(e)
22357
+ : b &&
22358
+ ((("}" == s.type || "top" == s.type) && ";" != c) ||
22359
+ ("statement" == s.type && "newstatement" == c)) &&
22360
+ n(e, t.column(), "statement", t.current());
22361
+ if (
22362
+ ("variable" == a &&
22363
+ ("def" == e.prevToken ||
22364
+ (l.typeFirstDefinitions &&
22365
+ r(t, e, t.start) &&
22366
+ o(e.context) &&
22367
+ t.match(/^\s*\(/, !1))) &&
22368
+ (a = "def"),
22369
+ x.token)
22370
+ ) {
22371
+ var u = x.token(t, e, a);
22372
+ void 0 !== u && (a = u);
22373
+ }
22374
+ return (
22375
+ "def" == a && !1 === l.styleDefs && (a = "variable"),
22376
+ (e.startOfLine = !1),
22377
+ (e.prevToken = h ? "def" : a || c),
22378
+ M(t, e),
22379
+ a
22380
+ );
22381
+ },
22382
+ indent: function (e, n) {
22383
+ if (
22384
+ (e.tokenize != N && null != e.tokenize) ||
22385
+ e.typeAtEndOfLine
22386
+ )
22387
+ return t.Pass;
22388
+ var i = e.context,
22389
+ r = n && n.charAt(0),
22390
+ o = r == i.type;
22391
+ if (
22392
+ ("statement" == i.type && "}" == r && (i = i.prev),
22393
+ l.dontIndentStatements)
22394
+ )
22395
+ for (
22396
+ ;
22397
+ "statement" == i.type &&
22398
+ l.dontIndentStatements.test(i.info);
22399
+
22400
+ )
22401
+ i = i.prev;
22402
+ if (x.indent) {
22403
+ var s = x.indent(e, i, n, u);
22404
+ if ("number" == typeof s) return s;
22405
+ }
22406
+ var a = i.prev && "switch" == i.prev.info;
22407
+ if (l.allmanIndentation && /[{(]/.test(r)) {
22408
+ for (; "top" != i.type && "}" != i.type; ) i = i.prev;
22409
+ return i.indented;
22410
+ }
22411
+ return "statement" == i.type
22412
+ ? i.indented + ("{" == r ? 0 : f)
22413
+ : !i.align || (d && ")" == i.type)
22414
+ ? ")" != i.type || o
22415
+ ? i.indented +
22416
+ (o ? 0 : u) +
22417
+ (o || !a || /^(?:case|default)\b/.test(n) ? 0 : u)
22418
+ : i.indented + f
22419
+ : i.column + (o ? 0 : 1);
22420
+ },
22421
+ electricInput: T
22422
+ ? /^\s*(?:case .*?:|default:|\{\}?|\})$/
22423
+ : /^\s*[{}]$/,
22424
+ blockCommentStart: "/*",
22425
+ blockCommentEnd: "*/",
22426
+ blockCommentContinue: " * ",
22427
+ lineComment: "//",
22428
+ fold: "brace",
22429
+ };
22430
+ });
22431
+ var l =
22432
+ "auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",
22433
+ c =
22434
+ "alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",
22435
+ h =
22436
+ "bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",
22437
+ u =
22438
+ "FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",
22439
+ f = s("int long char short double float unsigned signed void bool"),
22440
+ d = s("SEL instancetype id Class Protocol BOOL");
22441
+ function p(t) {
22442
+ return a(f, t) || /.+_t$/.test(t);
22443
+ }
22444
+ function g(t) {
22445
+ return p(t) || a(d, t);
22446
+ }
22447
+ var m = "case do else for if switch while struct enum union",
22448
+ v = "struct enum union";
22449
+ function _(t, e) {
22450
+ if (!e.startOfLine) return !1;
22451
+ for (var n, i = null; (n = t.peek()); ) {
22452
+ if ("\\" == n && t.match(/^.$/)) {
22453
+ i = _;
22454
+ break;
22455
+ }
22456
+ if ("/" == n && t.match(/^\/[\/\*]/, !1)) break;
22457
+ t.next();
22458
+ }
22459
+ return (e.tokenize = i), "meta";
22460
+ }
22461
+ function y(t, e) {
22462
+ return "type" == e.prevToken && "type";
22463
+ }
22464
+ function x(t) {
22465
+ return !(
22466
+ !t ||
22467
+ t.length < 2 ||
22468
+ "_" != t[0] ||
22469
+ ("_" != t[1] && t[1] === t[1].toLowerCase())
22470
+ );
22471
+ }
22472
+ function k(t) {
22473
+ return t.eatWhile(/[\w\.']/), "number";
22474
+ }
22475
+ function b(t, e) {
22476
+ if ((t.backUp(1), t.match(/^(?:R|u8R|uR|UR|LR)/))) {
22477
+ var n = t.match(/^"([^\s\\()]{0,16})\(/);
22478
+ return (
22479
+ !!n &&
22480
+ ((e.cpp11RawStringDelim = n[1]), (e.tokenize = w), w(t, e))
22481
+ );
22482
+ }
22483
+ return t.match(/^(?:u8|u|U|L)/)
22484
+ ? !!t.match(/^["']/, !1) && "string"
22485
+ : (t.next(), !1);
22486
+ }
22487
+ function T(t) {
22488
+ var e = /(\w+)::~?(\w+)$/.exec(t);
22489
+ return e && e[1] == e[2];
22490
+ }
22491
+ function C(t, e) {
22492
+ for (var n; null != (n = t.next()); )
22493
+ if ('"' == n && !t.eat('"')) {
22494
+ e.tokenize = null;
22495
+ break;
22496
+ }
22497
+ return "string";
22498
+ }
22499
+ function w(t, e) {
22500
+ var n = e.cpp11RawStringDelim.replace(/[^\w\s]/g, "\\$&");
22501
+ return (
22502
+ t.match(new RegExp(".*?\\)" + n + '"'))
22503
+ ? (e.tokenize = null)
22504
+ : t.skipToEnd(),
22505
+ "string"
22506
+ );
22507
+ }
22508
+ function E(e, n) {
22509
+ "string" == typeof e && (e = [e]);
22510
+ var i = [];
22511
+ function r(t) {
22512
+ if (t) for (var e in t) t.hasOwnProperty(e) && i.push(e);
22513
+ }
22514
+ r(n.keywords),
22515
+ r(n.types),
22516
+ r(n.builtin),
22517
+ r(n.atoms),
22518
+ i.length &&
22519
+ ((n.helperType = e[0]), t.registerHelper("hintWords", e[0], i));
22520
+ for (var o = 0; o < e.length; ++o) t.defineMIME(e[o], n);
22521
+ }
22522
+ function S(t, e) {
22523
+ for (var n = !1; !t.eol(); ) {
22524
+ if (!n && t.match('"""')) {
22525
+ e.tokenize = null;
22526
+ break;
22527
+ }
22528
+ n = "\\" == t.next() && !n;
22529
+ }
22530
+ return "string";
22531
+ }
22532
+ function A(t) {
22533
+ return function (e, n) {
22534
+ for (var i; (i = e.next()); ) {
22535
+ if ("*" == i && e.eat("/")) {
22536
+ if (1 == t) {
22537
+ n.tokenize = null;
22538
+ break;
22539
+ }
22540
+ return (n.tokenize = A(t - 1)), n.tokenize(e, n);
22541
+ }
22542
+ if ("/" == i && e.eat("*"))
22543
+ return (n.tokenize = A(t + 1)), n.tokenize(e, n);
22544
+ }
22545
+ return "comment";
22546
+ };
22547
+ }
22548
+ E(["text/x-csrc", "text/x-c", "text/x-chdr"], {
22549
+ name: "clike",
22550
+ keywords: s(l),
22551
+ types: p,
22552
+ blockKeywords: s(m),
22553
+ defKeywords: s(v),
22554
+ typeFirstDefinitions: !0,
22555
+ atoms: s("NULL true false"),
22556
+ isReservedIdentifier: x,
22557
+ hooks: { "#": _, "*": y },
22558
+ modeProps: { fold: ["brace", "include"] },
22559
+ }),
22560
+ E(["text/x-c++src", "text/x-c++hdr"], {
22561
+ name: "clike",
22562
+ keywords: s(l + " " + c),
22563
+ types: p,
22564
+ blockKeywords: s(m + " class try catch"),
22565
+ defKeywords: s(v + " class namespace"),
22566
+ typeFirstDefinitions: !0,
22567
+ atoms: s("true false NULL nullptr"),
22568
+ dontIndentStatements: /^template$/,
22569
+ isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
22570
+ isReservedIdentifier: x,
22571
+ hooks: {
22572
+ "#": _,
22573
+ "*": y,
22574
+ u: b,
22575
+ U: b,
22576
+ L: b,
22577
+ R: b,
22578
+ 0: k,
22579
+ 1: k,
22580
+ 2: k,
22581
+ 3: k,
22582
+ 4: k,
22583
+ 5: k,
22584
+ 6: k,
22585
+ 7: k,
22586
+ 8: k,
22587
+ 9: k,
22588
+ token: function (t, e, n) {
22589
+ if (
22590
+ "variable" == n &&
22591
+ "(" == t.peek() &&
22592
+ (";" == e.prevToken ||
22593
+ null == e.prevToken ||
22594
+ "}" == e.prevToken) &&
22595
+ T(t.current())
22596
+ )
22597
+ return "def";
22598
+ },
22599
+ },
22600
+ namespaceSeparator: "::",
22601
+ modeProps: { fold: ["brace", "include"] },
22602
+ }),
22603
+ E("text/x-java", {
22604
+ name: "clike",
22605
+ keywords: s(
22606
+ "abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"
22607
+ ),
22608
+ types: s(
22609
+ "var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"
22610
+ ),
22611
+ blockKeywords: s(
22612
+ "catch class do else finally for if switch try while"
22613
+ ),
22614
+ defKeywords: s("class interface enum @interface"),
22615
+ typeFirstDefinitions: !0,
22616
+ atoms: s("true false null"),
22617
+ number:
22618
+ /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
22619
+ hooks: {
22620
+ "@": function (t) {
22621
+ return (
22622
+ !t.match("interface", !1) && (t.eatWhile(/[\w\$_]/), "meta")
22623
+ );
22624
+ },
22625
+ },
22626
+ modeProps: { fold: ["brace", "import"] },
22627
+ }),
22628
+ E("text/x-csharp", {
22629
+ name: "clike",
22630
+ keywords: s(
22631
+ "abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"
22632
+ ),
22633
+ types: s(
22634
+ "Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"
22635
+ ),
22636
+ blockKeywords: s(
22637
+ "catch class do else finally for foreach if struct switch try while"
22638
+ ),
22639
+ defKeywords: s("class interface namespace struct var"),
22640
+ typeFirstDefinitions: !0,
22641
+ atoms: s("true false null"),
22642
+ hooks: {
22643
+ "@": function (t, e) {
22644
+ return t.eat('"')
22645
+ ? ((e.tokenize = C), C(t, e))
22646
+ : (t.eatWhile(/[\w\$_]/), "meta");
22647
+ },
22648
+ },
22649
+ }),
22650
+ E("text/x-scala", {
22651
+ name: "clike",
22652
+ keywords: s(
22653
+ "abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"
22654
+ ),
22655
+ types: s(
22656
+ "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
22657
+ ),
22658
+ multiLineStrings: !0,
22659
+ blockKeywords: s(
22660
+ "catch class enum do else finally for forSome if match switch try while"
22661
+ ),
22662
+ defKeywords: s(
22663
+ "class enum def object package trait type val var"
22664
+ ),
22665
+ atoms: s("true false null"),
22666
+ indentStatements: !1,
22667
+ indentSwitch: !1,
22668
+ isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
22669
+ hooks: {
22670
+ "@": function (t) {
22671
+ return t.eatWhile(/[\w\$_]/), "meta";
22672
+ },
22673
+ '"': function (t, e) {
22674
+ return (
22675
+ !!t.match('""') && ((e.tokenize = S), e.tokenize(t, e))
22676
+ );
22677
+ },
22678
+ "'": function (t) {
22679
+ return t.eatWhile(/[\w\$_\xa1-\uffff]/), "atom";
22680
+ },
22681
+ "=": function (t, n) {
22682
+ var i = n.context;
22683
+ return (
22684
+ !("}" != i.type || !i.align || !t.eat(">")) &&
22685
+ ((n.context = new e(
22686
+ i.indented,
22687
+ i.column,
22688
+ i.type,
22689
+ i.info,
22690
+ null,
22691
+ i.prev
22692
+ )),
22693
+ "operator")
22694
+ );
22695
+ },
22696
+ "/": function (t, e) {
22697
+ return (
22698
+ !!t.eat("*") && ((e.tokenize = A(1)), e.tokenize(t, e))
22699
+ );
22700
+ },
22701
+ },
22702
+ modeProps: { closeBrackets: { pairs: '()[]{}""', triples: '"' } },
22703
+ }),
22704
+ E("text/x-kotlin", {
22705
+ name: "clike",
22706
+ keywords: s(
22707
+ "package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"
22708
+ ),
22709
+ types: s(
22710
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
22711
+ ),
22712
+ intendSwitch: !1,
22713
+ indentStatements: !1,
22714
+ multiLineStrings: !0,
22715
+ number:
22716
+ /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
22717
+ blockKeywords: s(
22718
+ "catch class do else finally for if where try while enum"
22719
+ ),
22720
+ defKeywords: s("class val var object interface fun"),
22721
+ atoms: s("true false null this"),
22722
+ hooks: {
22723
+ "@": function (t) {
22724
+ return t.eatWhile(/[\w\$_]/), "meta";
22725
+ },
22726
+ "*": function (t, e) {
22727
+ return "." == e.prevToken ? "variable" : "operator";
22728
+ },
22729
+ '"': function (t, e) {
22730
+ var n;
22731
+ return (
22732
+ (e.tokenize =
22733
+ ((n = t.match('""')),
22734
+ function (t, e) {
22735
+ for (var i, r = !1, o = !1; !t.eol(); ) {
22736
+ if (!n && !r && t.match('"')) {
22737
+ o = !0;
22738
+ break;
22739
+ }
22740
+ if (n && t.match('"""')) {
22741
+ o = !0;
22742
+ break;
22743
+ }
22744
+ (i = t.next()),
22745
+ !r && "$" == i && t.match("{") && t.skipTo("}"),
22746
+ (r = !r && "\\" == i && !n);
22747
+ }
22748
+ return (!o && n) || (e.tokenize = null), "string";
22749
+ })),
22750
+ e.tokenize(t, e)
22751
+ );
22752
+ },
22753
+ "/": function (t, e) {
22754
+ return (
22755
+ !!t.eat("*") && ((e.tokenize = A(1)), e.tokenize(t, e))
22756
+ );
22757
+ },
22758
+ indent: function (t, e, n, i) {
22759
+ var r = n && n.charAt(0);
22760
+ return ("}" != t.prevToken && ")" != t.prevToken) || "" != n
22761
+ ? ("operator" == t.prevToken &&
22762
+ "}" != n &&
22763
+ "}" != t.context.type) ||
22764
+ ("variable" == t.prevToken && "." == r) ||
22765
+ (("}" == t.prevToken || ")" == t.prevToken) && "." == r)
22766
+ ? 2 * i + e.indented
22767
+ : e.align && "}" == e.type
22768
+ ? e.indented +
22769
+ (t.context.type == (n || "").charAt(0) ? 0 : i)
22770
+ : void 0
22771
+ : t.indented;
22772
+ },
22773
+ },
22774
+ modeProps: { closeBrackets: { triples: '"' } },
22775
+ }),
22776
+ E(["x-shader/x-vertex", "x-shader/x-fragment"], {
22777
+ name: "clike",
22778
+ keywords: s(
22779
+ "sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"
22780
+ ),
22781
+ types: s(
22782
+ "float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"
22783
+ ),
22784
+ blockKeywords: s("for while do if else struct"),
22785
+ builtin: s(
22786
+ "radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"
22787
+ ),
22788
+ atoms: s(
22789
+ "true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"
22790
+ ),
22791
+ indentSwitch: !1,
22792
+ hooks: { "#": _ },
22793
+ modeProps: { fold: ["brace", "include"] },
22794
+ }),
22795
+ E("text/x-nesc", {
22796
+ name: "clike",
22797
+ keywords: s(
22798
+ l +
22799
+ " as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"
22800
+ ),
22801
+ types: p,
22802
+ blockKeywords: s(m),
22803
+ atoms: s("null true false"),
22804
+ hooks: { "#": _ },
22805
+ modeProps: { fold: ["brace", "include"] },
22806
+ }),
22807
+ E("text/x-objectivec", {
22808
+ name: "clike",
22809
+ keywords: s(l + " " + h),
22810
+ types: g,
22811
+ builtin: s(u),
22812
+ blockKeywords: s(
22813
+ m +
22814
+ " @synthesize @try @catch @finally @autoreleasepool @synchronized"
22815
+ ),
22816
+ defKeywords: s(
22817
+ v + " @interface @implementation @protocol @class"
22818
+ ),
22819
+ dontIndentStatements: /^@.*$/,
22820
+ typeFirstDefinitions: !0,
22821
+ atoms: s("YES NO NULL Nil nil true false nullptr"),
22822
+ isReservedIdentifier: x,
22823
+ hooks: { "#": _, "*": y },
22824
+ modeProps: { fold: ["brace", "include"] },
22825
+ }),
22826
+ E("text/x-objectivec++", {
22827
+ name: "clike",
22828
+ keywords: s(l + " " + h + " " + c),
22829
+ types: g,
22830
+ builtin: s(u),
22831
+ blockKeywords: s(
22832
+ m +
22833
+ " @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"
22834
+ ),
22835
+ defKeywords: s(
22836
+ v +
22837
+ " @interface @implementation @protocol @class class namespace"
22838
+ ),
22839
+ dontIndentStatements: /^@.*$|^template$/,
22840
+ typeFirstDefinitions: !0,
22841
+ atoms: s("YES NO NULL Nil nil true false nullptr"),
22842
+ isReservedIdentifier: x,
22843
+ hooks: {
22844
+ "#": _,
22845
+ "*": y,
22846
+ u: b,
22847
+ U: b,
22848
+ L: b,
22849
+ R: b,
22850
+ 0: k,
22851
+ 1: k,
22852
+ 2: k,
22853
+ 3: k,
22854
+ 4: k,
22855
+ 5: k,
22856
+ 6: k,
22857
+ 7: k,
22858
+ 8: k,
22859
+ 9: k,
22860
+ token: function (t, e, n) {
22861
+ if (
22862
+ "variable" == n &&
22863
+ "(" == t.peek() &&
22864
+ (";" == e.prevToken ||
22865
+ null == e.prevToken ||
22866
+ "}" == e.prevToken) &&
22867
+ T(t.current())
22868
+ )
22869
+ return "def";
22870
+ },
22871
+ },
22872
+ namespaceSeparator: "::",
22873
+ modeProps: { fold: ["brace", "include"] },
22874
+ }),
22875
+ E("text/x-squirrel", {
22876
+ name: "clike",
22877
+ keywords: s(
22878
+ "base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"
22879
+ ),
22880
+ types: p,
22881
+ blockKeywords: s(
22882
+ "case catch class else for foreach if switch try while"
22883
+ ),
22884
+ defKeywords: s("function local class"),
22885
+ typeFirstDefinitions: !0,
22886
+ atoms: s("true false null"),
22887
+ hooks: { "#": _ },
22888
+ modeProps: { fold: ["brace", "include"] },
22889
+ });
22890
+ var L = null;
22891
+ function O(t) {
22892
+ return function (e, n) {
22893
+ for (var i, r = !1, o = !1; !e.eol(); ) {
22894
+ if (!r && e.match('"') && ("single" == t || e.match('""'))) {
22895
+ o = !0;
22896
+ break;
22897
+ }
22898
+ if (!r && e.match("``")) {
22899
+ (L = O(t)), (o = !0);
22900
+ break;
22901
+ }
22902
+ (i = e.next()), (r = "single" == t && !r && "\\" == i);
22903
+ }
22904
+ return o && (n.tokenize = null), "string";
22905
+ };
22906
+ }
22907
+ E("text/x-ceylon", {
22908
+ name: "clike",
22909
+ keywords: s(
22910
+ "abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"
22911
+ ),
22912
+ types: function (t) {
22913
+ var e = t.charAt(0);
22914
+ return e === e.toUpperCase() && e !== e.toLowerCase();
22915
+ },
22916
+ blockKeywords: s(
22917
+ "case catch class dynamic else finally for function if interface module new object switch try while"
22918
+ ),
22919
+ defKeywords: s(
22920
+ "class dynamic function interface module object package value"
22921
+ ),
22922
+ builtin: s(
22923
+ "abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"
22924
+ ),
22925
+ isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
22926
+ isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
22927
+ numberStart: /[\d#$]/,
22928
+ number:
22929
+ /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
22930
+ multiLineStrings: !0,
22931
+ typeFirstDefinitions: !0,
22932
+ atoms: s("true false null larger smaller equal empty finished"),
22933
+ indentSwitch: !1,
22934
+ styleDefs: !1,
22935
+ hooks: {
22936
+ "@": function (t) {
22937
+ return t.eatWhile(/[\w\$_]/), "meta";
22938
+ },
22939
+ '"': function (t, e) {
22940
+ return (
22941
+ (e.tokenize = O(t.match('""') ? "triple" : "single")),
22942
+ e.tokenize(t, e)
22943
+ );
22944
+ },
22945
+ "`": function (t, e) {
22946
+ return (
22947
+ !(!L || !t.match("`")) &&
22948
+ ((e.tokenize = L), (L = null), e.tokenize(t, e))
22949
+ );
22950
+ },
22951
+ "'": function (t) {
22952
+ return t.eatWhile(/[\w\$_\xa1-\uffff]/), "atom";
22953
+ },
22954
+ token: function (t, e, n) {
22955
+ if (("variable" == n || "type" == n) && "." == e.prevToken)
22956
+ return "variable-2";
22957
+ },
22958
+ },
22959
+ modeProps: {
22960
+ fold: ["brace", "import"],
22961
+ closeBrackets: { triples: '"' },
22962
+ },
22963
+ });
22964
+ }),
22965
+ "object" == typeof n && "object" == typeof e
22966
+ ? i(t("../../lib/codemirror"))
22967
+ : "function" == typeof define && define.amd
22968
+ ? define(["../../lib/codemirror"], i)
22969
+ : i(CodeMirror);
22970
+ },
22971
+ { "../../lib/codemirror": 13 },
22972
+ ],
22973
+ 15: [
22974
+ function (t, e, n) {
22975
+ var i;
22976
+ (i = function (t) {
22977
+ "use strict";
22978
+ function e(t) {
22979
+ for (var e = {}, n = 0; n < t.length; ++n)
22980
+ e[t[n].toLowerCase()] = !0;
22981
+ return e;
22982
+ }
22983
+ t.defineMode("css", function (e, n) {
22984
+ var i = n.inline;
22985
+ n.propertyKeywords || (n = t.resolveMode("text/css"));
22986
+ var r,
22987
+ o,
22988
+ s = e.indentUnit,
22989
+ a = n.tokenHooks,
22990
+ l = n.documentTypes || {},
22991
+ c = n.mediaTypes || {},
22992
+ h = n.mediaFeatures || {},
22993
+ u = n.mediaValueKeywords || {},
22994
+ f = n.propertyKeywords || {},
22995
+ d = n.nonStandardPropertyKeywords || {},
22996
+ p = n.fontProperties || {},
22997
+ g = n.counterDescriptors || {},
22998
+ m = n.colorKeywords || {},
22999
+ v = n.valueKeywords || {},
23000
+ _ = n.allowNested,
23001
+ y = n.lineComment,
23002
+ x = !0 === n.supportsAtComponent,
23003
+ k = !1 !== e.highlightNonStandardPropertyKeywords;
23004
+ function b(t, e) {
23005
+ return (r = e), t;
23006
+ }
23007
+ function T(t, e) {
23008
+ var n = t.next();
23009
+ if (a[n]) {
23010
+ var i = a[n](t, e);
23011
+ if (!1 !== i) return i;
23012
+ }
23013
+ return "@" == n
23014
+ ? (t.eatWhile(/[\w\\\-]/), b("def", t.current()))
23015
+ : "=" == n || (("~" == n || "|" == n) && t.eat("="))
23016
+ ? b(null, "compare")
23017
+ : '"' == n || "'" == n
23018
+ ? ((e.tokenize = C(n)), e.tokenize(t, e))
23019
+ : "#" == n
23020
+ ? (t.eatWhile(/[\w\\\-]/), b("atom", "hash"))
23021
+ : "!" == n
23022
+ ? (t.match(/^\s*\w*/), b("keyword", "important"))
23023
+ : /\d/.test(n) || ("." == n && t.eat(/\d/))
23024
+ ? (t.eatWhile(/[\w.%]/), b("number", "unit"))
23025
+ : "-" !== n
23026
+ ? /[,+>*\/]/.test(n)
23027
+ ? b(null, "select-op")
23028
+ : "." == n && t.match(/^-?[_a-z][_a-z0-9-]*/i)
23029
+ ? b("qualifier", "qualifier")
23030
+ : /[:;{}\[\]\(\)]/.test(n)
23031
+ ? b(null, n)
23032
+ : t.match(/^[\w-.]+(?=\()/)
23033
+ ? (/^(url(-prefix)?|domain|regexp)$/i.test(t.current()) &&
23034
+ (e.tokenize = w),
23035
+ b("variable callee", "variable"))
23036
+ : /[\w\\\-]/.test(n)
23037
+ ? (t.eatWhile(/[\w\\\-]/), b("property", "word"))
23038
+ : b(null, null)
23039
+ : /[\d.]/.test(t.peek())
23040
+ ? (t.eatWhile(/[\w.%]/), b("number", "unit"))
23041
+ : t.match(/^-[\w\\\-]*/)
23042
+ ? (t.eatWhile(/[\w\\\-]/),
23043
+ t.match(/^\s*:/, !1)
23044
+ ? b("variable-2", "variable-definition")
23045
+ : b("variable-2", "variable"))
23046
+ : t.match(/^\w+-/)
23047
+ ? b("meta", "meta")
23048
+ : void 0;
23049
+ }
23050
+ function C(t) {
23051
+ return function (e, n) {
23052
+ for (var i, r = !1; null != (i = e.next()); ) {
23053
+ if (i == t && !r) {
23054
+ ")" == t && e.backUp(1);
23055
+ break;
23056
+ }
23057
+ r = !r && "\\" == i;
23058
+ }
23059
+ return (
23060
+ (i == t || (!r && ")" != t)) && (n.tokenize = null),
23061
+ b("string", "string")
23062
+ );
23063
+ };
23064
+ }
23065
+ function w(t, e) {
23066
+ return (
23067
+ t.next(),
23068
+ t.match(/^\s*[\"\')]/, !1)
23069
+ ? (e.tokenize = null)
23070
+ : (e.tokenize = C(")")),
23071
+ b(null, "(")
23072
+ );
23073
+ }
23074
+ function E(t, e, n) {
23075
+ (this.type = t), (this.indent = e), (this.prev = n);
23076
+ }
23077
+ function S(t, e, n, i) {
23078
+ return (
23079
+ (t.context = new E(
23080
+ n,
23081
+ e.indentation() + (!1 === i ? 0 : s),
23082
+ t.context
23083
+ )),
23084
+ n
23085
+ );
23086
+ }
23087
+ function A(t) {
23088
+ return (
23089
+ t.context.prev && (t.context = t.context.prev), t.context.type
23090
+ );
23091
+ }
23092
+ function L(t, e, n) {
23093
+ return I[n.context.type](t, e, n);
23094
+ }
23095
+ function O(t, e, n, i) {
23096
+ for (var r = i || 1; r > 0; r--) n.context = n.context.prev;
23097
+ return L(t, e, n);
23098
+ }
23099
+ function N(t) {
23100
+ var e = t.current().toLowerCase();
23101
+ o = v.hasOwnProperty(e)
23102
+ ? "atom"
23103
+ : m.hasOwnProperty(e)
23104
+ ? "keyword"
23105
+ : "variable";
23106
+ }
23107
+ var I = {
23108
+ top: function (t, e, n) {
23109
+ if ("{" == t) return S(n, e, "block");
23110
+ if ("}" == t && n.context.prev) return A(n);
23111
+ if (x && /@component/i.test(t))
23112
+ return S(n, e, "atComponentBlock");
23113
+ if (/^@(-moz-)?document$/i.test(t))
23114
+ return S(n, e, "documentTypes");
23115
+ if (/^@(media|supports|(-moz-)?document|import)$/i.test(t))
23116
+ return S(n, e, "atBlock");
23117
+ if (/^@(font-face|counter-style)/i.test(t))
23118
+ return (n.stateArg = t), "restricted_atBlock_before";
23119
+ if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))
23120
+ return "keyframes";
23121
+ if (t && "@" == t.charAt(0)) return S(n, e, "at");
23122
+ if ("hash" == t) o = "builtin";
23123
+ else if ("word" == t) o = "tag";
23124
+ else {
23125
+ if ("variable-definition" == t) return "maybeprop";
23126
+ if ("interpolation" == t) return S(n, e, "interpolation");
23127
+ if (":" == t) return "pseudo";
23128
+ if (_ && "(" == t) return S(n, e, "parens");
23129
+ }
23130
+ return n.context.type;
23131
+ },
23132
+ block: function (t, e, n) {
23133
+ if ("word" == t) {
23134
+ var i = e.current().toLowerCase();
23135
+ return f.hasOwnProperty(i)
23136
+ ? ((o = "property"), "maybeprop")
23137
+ : d.hasOwnProperty(i)
23138
+ ? ((o = k ? "string-2" : "property"), "maybeprop")
23139
+ : _
23140
+ ? ((o = e.match(/^\s*:(?:\s|$)/, !1) ? "property" : "tag"),
23141
+ "block")
23142
+ : ((o += " error"), "maybeprop");
23143
+ }
23144
+ return "meta" == t
23145
+ ? "block"
23146
+ : _ || ("hash" != t && "qualifier" != t)
23147
+ ? I.top(t, e, n)
23148
+ : ((o = "error"), "block");
23149
+ },
23150
+ maybeprop: function (t, e, n) {
23151
+ return ":" == t ? S(n, e, "prop") : L(t, e, n);
23152
+ },
23153
+ prop: function (t, e, n) {
23154
+ if (";" == t) return A(n);
23155
+ if ("{" == t && _) return S(n, e, "propBlock");
23156
+ if ("}" == t || "{" == t) return O(t, e, n);
23157
+ if ("(" == t) return S(n, e, "parens");
23158
+ if (
23159
+ "hash" != t ||
23160
+ /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(
23161
+ e.current()
23162
+ )
23163
+ ) {
23164
+ if ("word" == t) N(e);
23165
+ else if ("interpolation" == t)
23166
+ return S(n, e, "interpolation");
23167
+ } else o += " error";
23168
+ return "prop";
23169
+ },
23170
+ propBlock: function (t, e, n) {
23171
+ return "}" == t
23172
+ ? A(n)
23173
+ : "word" == t
23174
+ ? ((o = "property"), "maybeprop")
23175
+ : n.context.type;
23176
+ },
23177
+ parens: function (t, e, n) {
23178
+ return "{" == t || "}" == t
23179
+ ? O(t, e, n)
23180
+ : ")" == t
23181
+ ? A(n)
23182
+ : "(" == t
23183
+ ? S(n, e, "parens")
23184
+ : "interpolation" == t
23185
+ ? S(n, e, "interpolation")
23186
+ : ("word" == t && N(e), "parens");
23187
+ },
23188
+ pseudo: function (t, e, n) {
23189
+ return "meta" == t
23190
+ ? "pseudo"
23191
+ : "word" == t
23192
+ ? ((o = "variable-3"), n.context.type)
23193
+ : L(t, e, n);
23194
+ },
23195
+ documentTypes: function (t, e, n) {
23196
+ return "word" == t && l.hasOwnProperty(e.current())
23197
+ ? ((o = "tag"), n.context.type)
23198
+ : I.atBlock(t, e, n);
23199
+ },
23200
+ atBlock: function (t, e, n) {
23201
+ if ("(" == t) return S(n, e, "atBlock_parens");
23202
+ if ("}" == t || ";" == t) return O(t, e, n);
23203
+ if ("{" == t) return A(n) && S(n, e, _ ? "block" : "top");
23204
+ if ("interpolation" == t) return S(n, e, "interpolation");
23205
+ if ("word" == t) {
23206
+ var i = e.current().toLowerCase();
23207
+ o =
23208
+ "only" == i || "not" == i || "and" == i || "or" == i
23209
+ ? "keyword"
23210
+ : c.hasOwnProperty(i)
23211
+ ? "attribute"
23212
+ : h.hasOwnProperty(i)
23213
+ ? "property"
23214
+ : u.hasOwnProperty(i)
23215
+ ? "keyword"
23216
+ : f.hasOwnProperty(i)
23217
+ ? "property"
23218
+ : d.hasOwnProperty(i)
23219
+ ? k
23220
+ ? "string-2"
23221
+ : "property"
23222
+ : v.hasOwnProperty(i)
23223
+ ? "atom"
23224
+ : m.hasOwnProperty(i)
23225
+ ? "keyword"
23226
+ : "error";
23227
+ }
23228
+ return n.context.type;
23229
+ },
23230
+ atComponentBlock: function (t, e, n) {
23231
+ return "}" == t
23232
+ ? O(t, e, n)
23233
+ : "{" == t
23234
+ ? A(n) && S(n, e, _ ? "block" : "top", !1)
23235
+ : ("word" == t && (o = "error"), n.context.type);
23236
+ },
23237
+ atBlock_parens: function (t, e, n) {
23238
+ return ")" == t
23239
+ ? A(n)
23240
+ : "{" == t || "}" == t
23241
+ ? O(t, e, n, 2)
23242
+ : I.atBlock(t, e, n);
23243
+ },
23244
+ restricted_atBlock_before: function (t, e, n) {
23245
+ return "{" == t
23246
+ ? S(n, e, "restricted_atBlock")
23247
+ : "word" == t && "@counter-style" == n.stateArg
23248
+ ? ((o = "variable"), "restricted_atBlock_before")
23249
+ : L(t, e, n);
23250
+ },
23251
+ restricted_atBlock: function (t, e, n) {
23252
+ return "}" == t
23253
+ ? ((n.stateArg = null), A(n))
23254
+ : "word" == t
23255
+ ? ((o =
23256
+ ("@font-face" == n.stateArg &&
23257
+ !p.hasOwnProperty(e.current().toLowerCase())) ||
23258
+ ("@counter-style" == n.stateArg &&
23259
+ !g.hasOwnProperty(e.current().toLowerCase()))
23260
+ ? "error"
23261
+ : "property"),
23262
+ "maybeprop")
23263
+ : "restricted_atBlock";
23264
+ },
23265
+ keyframes: function (t, e, n) {
23266
+ return "word" == t
23267
+ ? ((o = "variable"), "keyframes")
23268
+ : "{" == t
23269
+ ? S(n, e, "top")
23270
+ : L(t, e, n);
23271
+ },
23272
+ at: function (t, e, n) {
23273
+ return ";" == t
23274
+ ? A(n)
23275
+ : "{" == t || "}" == t
23276
+ ? O(t, e, n)
23277
+ : ("word" == t ? (o = "tag") : "hash" == t && (o = "builtin"),
23278
+ "at");
23279
+ },
23280
+ interpolation: function (t, e, n) {
23281
+ return "}" == t
23282
+ ? A(n)
23283
+ : "{" == t || ";" == t
23284
+ ? O(t, e, n)
23285
+ : ("word" == t
23286
+ ? (o = "variable")
23287
+ : "variable" != t &&
23288
+ "(" != t &&
23289
+ ")" != t &&
23290
+ (o = "error"),
23291
+ "interpolation");
23292
+ },
23293
+ };
23294
+ return {
23295
+ startState: function (t) {
23296
+ return {
23297
+ tokenize: null,
23298
+ state: i ? "block" : "top",
23299
+ stateArg: null,
23300
+ context: new E(i ? "block" : "top", t || 0, null),
23301
+ };
23302
+ },
23303
+ token: function (t, e) {
23304
+ if (!e.tokenize && t.eatSpace()) return null;
23305
+ var n = (e.tokenize || T)(t, e);
23306
+ return (
23307
+ n && "object" == typeof n && ((r = n[1]), (n = n[0])),
23308
+ (o = n),
23309
+ "comment" != r && (e.state = I[e.state](r, t, e)),
23310
+ o
23311
+ );
23312
+ },
23313
+ indent: function (t, e) {
23314
+ var n = t.context,
23315
+ i = e && e.charAt(0),
23316
+ r = n.indent;
23317
+ return (
23318
+ "prop" != n.type || ("}" != i && ")" != i) || (n = n.prev),
23319
+ n.prev &&
23320
+ ("}" != i ||
23321
+ ("block" != n.type &&
23322
+ "top" != n.type &&
23323
+ "interpolation" != n.type &&
23324
+ "restricted_atBlock" != n.type)
23325
+ ? ((")" != i ||
23326
+ ("parens" != n.type && "atBlock_parens" != n.type)) &&
23327
+ ("{" != i ||
23328
+ ("at" != n.type && "atBlock" != n.type))) ||
23329
+ (r = Math.max(0, n.indent - s))
23330
+ : (r = (n = n.prev).indent)),
23331
+ r
23332
+ );
23333
+ },
23334
+ electricChars: "}",
23335
+ blockCommentStart: "/*",
23336
+ blockCommentEnd: "*/",
23337
+ blockCommentContinue: " * ",
23338
+ lineComment: y,
23339
+ fold: "brace",
23340
+ };
23341
+ });
23342
+ var n = ["domain", "regexp", "url", "url-prefix"],
23343
+ i = e(n),
23344
+ r = [
23345
+ "all",
23346
+ "aural",
23347
+ "braille",
23348
+ "handheld",
23349
+ "print",
23350
+ "projection",
23351
+ "screen",
23352
+ "tty",
23353
+ "tv",
23354
+ "embossed",
23355
+ ],
23356
+ o = e(r),
23357
+ s = [
23358
+ "width",
23359
+ "min-width",
23360
+ "max-width",
23361
+ "height",
23362
+ "min-height",
23363
+ "max-height",
23364
+ "device-width",
23365
+ "min-device-width",
23366
+ "max-device-width",
23367
+ "device-height",
23368
+ "min-device-height",
23369
+ "max-device-height",
23370
+ "aspect-ratio",
23371
+ "min-aspect-ratio",
23372
+ "max-aspect-ratio",
23373
+ "device-aspect-ratio",
23374
+ "min-device-aspect-ratio",
23375
+ "max-device-aspect-ratio",
23376
+ "color",
23377
+ "min-color",
23378
+ "max-color",
23379
+ "color-index",
23380
+ "min-color-index",
23381
+ "max-color-index",
23382
+ "monochrome",
23383
+ "min-monochrome",
23384
+ "max-monochrome",
23385
+ "resolution",
23386
+ "min-resolution",
23387
+ "max-resolution",
23388
+ "scan",
23389
+ "grid",
23390
+ "orientation",
23391
+ "device-pixel-ratio",
23392
+ "min-device-pixel-ratio",
23393
+ "max-device-pixel-ratio",
23394
+ "pointer",
23395
+ "any-pointer",
23396
+ "hover",
23397
+ "any-hover",
23398
+ "prefers-color-scheme",
23399
+ ],
23400
+ a = e(s),
23401
+ l = [
23402
+ "landscape",
23403
+ "portrait",
23404
+ "none",
23405
+ "coarse",
23406
+ "fine",
23407
+ "on-demand",
23408
+ "hover",
23409
+ "interlace",
23410
+ "progressive",
23411
+ "dark",
23412
+ "light",
23413
+ ],
23414
+ c = e(l),
23415
+ h = [
23416
+ "align-content",
23417
+ "align-items",
23418
+ "align-self",
23419
+ "alignment-adjust",
23420
+ "alignment-baseline",
23421
+ "all",
23422
+ "anchor-point",
23423
+ "animation",
23424
+ "animation-delay",
23425
+ "animation-direction",
23426
+ "animation-duration",
23427
+ "animation-fill-mode",
23428
+ "animation-iteration-count",
23429
+ "animation-name",
23430
+ "animation-play-state",
23431
+ "animation-timing-function",
23432
+ "appearance",
23433
+ "azimuth",
23434
+ "backdrop-filter",
23435
+ "backface-visibility",
23436
+ "background",
23437
+ "background-attachment",
23438
+ "background-blend-mode",
23439
+ "background-clip",
23440
+ "background-color",
23441
+ "background-image",
23442
+ "background-origin",
23443
+ "background-position",
23444
+ "background-position-x",
23445
+ "background-position-y",
23446
+ "background-repeat",
23447
+ "background-size",
23448
+ "baseline-shift",
23449
+ "binding",
23450
+ "bleed",
23451
+ "block-size",
23452
+ "bookmark-label",
23453
+ "bookmark-level",
23454
+ "bookmark-state",
23455
+ "bookmark-target",
23456
+ "border",
23457
+ "border-bottom",
23458
+ "border-bottom-color",
23459
+ "border-bottom-left-radius",
23460
+ "border-bottom-right-radius",
23461
+ "border-bottom-style",
23462
+ "border-bottom-width",
23463
+ "border-collapse",
23464
+ "border-color",
23465
+ "border-image",
23466
+ "border-image-outset",
23467
+ "border-image-repeat",
23468
+ "border-image-slice",
23469
+ "border-image-source",
23470
+ "border-image-width",
23471
+ "border-left",
23472
+ "border-left-color",
23473
+ "border-left-style",
23474
+ "border-left-width",
23475
+ "border-radius",
23476
+ "border-right",
23477
+ "border-right-color",
23478
+ "border-right-style",
23479
+ "border-right-width",
23480
+ "border-spacing",
23481
+ "border-style",
23482
+ "border-top",
23483
+ "border-top-color",
23484
+ "border-top-left-radius",
23485
+ "border-top-right-radius",
23486
+ "border-top-style",
23487
+ "border-top-width",
23488
+ "border-width",
23489
+ "bottom",
23490
+ "box-decoration-break",
23491
+ "box-shadow",
23492
+ "box-sizing",
23493
+ "break-after",
23494
+ "break-before",
23495
+ "break-inside",
23496
+ "caption-side",
23497
+ "caret-color",
23498
+ "clear",
23499
+ "clip",
23500
+ "color",
23501
+ "color-profile",
23502
+ "column-count",
23503
+ "column-fill",
23504
+ "column-gap",
23505
+ "column-rule",
23506
+ "column-rule-color",
23507
+ "column-rule-style",
23508
+ "column-rule-width",
23509
+ "column-span",
23510
+ "column-width",
23511
+ "columns",
23512
+ "contain",
23513
+ "content",
23514
+ "counter-increment",
23515
+ "counter-reset",
23516
+ "crop",
23517
+ "cue",
23518
+ "cue-after",
23519
+ "cue-before",
23520
+ "cursor",
23521
+ "direction",
23522
+ "display",
23523
+ "dominant-baseline",
23524
+ "drop-initial-after-adjust",
23525
+ "drop-initial-after-align",
23526
+ "drop-initial-before-adjust",
23527
+ "drop-initial-before-align",
23528
+ "drop-initial-size",
23529
+ "drop-initial-value",
23530
+ "elevation",
23531
+ "empty-cells",
23532
+ "fit",
23533
+ "fit-content",
23534
+ "fit-position",
23535
+ "flex",
23536
+ "flex-basis",
23537
+ "flex-direction",
23538
+ "flex-flow",
23539
+ "flex-grow",
23540
+ "flex-shrink",
23541
+ "flex-wrap",
23542
+ "float",
23543
+ "float-offset",
23544
+ "flow-from",
23545
+ "flow-into",
23546
+ "font",
23547
+ "font-family",
23548
+ "font-feature-settings",
23549
+ "font-kerning",
23550
+ "font-language-override",
23551
+ "font-optical-sizing",
23552
+ "font-size",
23553
+ "font-size-adjust",
23554
+ "font-stretch",
23555
+ "font-style",
23556
+ "font-synthesis",
23557
+ "font-variant",
23558
+ "font-variant-alternates",
23559
+ "font-variant-caps",
23560
+ "font-variant-east-asian",
23561
+ "font-variant-ligatures",
23562
+ "font-variant-numeric",
23563
+ "font-variant-position",
23564
+ "font-variation-settings",
23565
+ "font-weight",
23566
+ "gap",
23567
+ "grid",
23568
+ "grid-area",
23569
+ "grid-auto-columns",
23570
+ "grid-auto-flow",
23571
+ "grid-auto-rows",
23572
+ "grid-column",
23573
+ "grid-column-end",
23574
+ "grid-column-gap",
23575
+ "grid-column-start",
23576
+ "grid-gap",
23577
+ "grid-row",
23578
+ "grid-row-end",
23579
+ "grid-row-gap",
23580
+ "grid-row-start",
23581
+ "grid-template",
23582
+ "grid-template-areas",
23583
+ "grid-template-columns",
23584
+ "grid-template-rows",
23585
+ "hanging-punctuation",
23586
+ "height",
23587
+ "hyphens",
23588
+ "icon",
23589
+ "image-orientation",
23590
+ "image-rendering",
23591
+ "image-resolution",
23592
+ "inline-box-align",
23593
+ "inset",
23594
+ "inset-block",
23595
+ "inset-block-end",
23596
+ "inset-block-start",
23597
+ "inset-inline",
23598
+ "inset-inline-end",
23599
+ "inset-inline-start",
23600
+ "isolation",
23601
+ "justify-content",
23602
+ "justify-items",
23603
+ "justify-self",
23604
+ "left",
23605
+ "letter-spacing",
23606
+ "line-break",
23607
+ "line-height",
23608
+ "line-height-step",
23609
+ "line-stacking",
23610
+ "line-stacking-ruby",
23611
+ "line-stacking-shift",
23612
+ "line-stacking-strategy",
23613
+ "list-style",
23614
+ "list-style-image",
23615
+ "list-style-position",
23616
+ "list-style-type",
23617
+ "margin",
23618
+ "margin-bottom",
23619
+ "margin-left",
23620
+ "margin-right",
23621
+ "margin-top",
23622
+ "marks",
23623
+ "marquee-direction",
23624
+ "marquee-loop",
23625
+ "marquee-play-count",
23626
+ "marquee-speed",
23627
+ "marquee-style",
23628
+ "mask-clip",
23629
+ "mask-composite",
23630
+ "mask-image",
23631
+ "mask-mode",
23632
+ "mask-origin",
23633
+ "mask-position",
23634
+ "mask-repeat",
23635
+ "mask-size",
23636
+ "mask-type",
23637
+ "max-block-size",
23638
+ "max-height",
23639
+ "max-inline-size",
23640
+ "max-width",
23641
+ "min-block-size",
23642
+ "min-height",
23643
+ "min-inline-size",
23644
+ "min-width",
23645
+ "mix-blend-mode",
23646
+ "move-to",
23647
+ "nav-down",
23648
+ "nav-index",
23649
+ "nav-left",
23650
+ "nav-right",
23651
+ "nav-up",
23652
+ "object-fit",
23653
+ "object-position",
23654
+ "offset",
23655
+ "offset-anchor",
23656
+ "offset-distance",
23657
+ "offset-path",
23658
+ "offset-position",
23659
+ "offset-rotate",
23660
+ "opacity",
23661
+ "order",
23662
+ "orphans",
23663
+ "outline",
23664
+ "outline-color",
23665
+ "outline-offset",
23666
+ "outline-style",
23667
+ "outline-width",
23668
+ "overflow",
23669
+ "overflow-style",
23670
+ "overflow-wrap",
23671
+ "overflow-x",
23672
+ "overflow-y",
23673
+ "padding",
23674
+ "padding-bottom",
23675
+ "padding-left",
23676
+ "padding-right",
23677
+ "padding-top",
23678
+ "page",
23679
+ "page-break-after",
23680
+ "page-break-before",
23681
+ "page-break-inside",
23682
+ "page-policy",
23683
+ "pause",
23684
+ "pause-after",
23685
+ "pause-before",
23686
+ "perspective",
23687
+ "perspective-origin",
23688
+ "pitch",
23689
+ "pitch-range",
23690
+ "place-content",
23691
+ "place-items",
23692
+ "place-self",
23693
+ "play-during",
23694
+ "position",
23695
+ "presentation-level",
23696
+ "punctuation-trim",
23697
+ "quotes",
23698
+ "region-break-after",
23699
+ "region-break-before",
23700
+ "region-break-inside",
23701
+ "region-fragment",
23702
+ "rendering-intent",
23703
+ "resize",
23704
+ "rest",
23705
+ "rest-after",
23706
+ "rest-before",
23707
+ "richness",
23708
+ "right",
23709
+ "rotate",
23710
+ "rotation",
23711
+ "rotation-point",
23712
+ "row-gap",
23713
+ "ruby-align",
23714
+ "ruby-overhang",
23715
+ "ruby-position",
23716
+ "ruby-span",
23717
+ "scale",
23718
+ "scroll-behavior",
23719
+ "scroll-margin",
23720
+ "scroll-margin-block",
23721
+ "scroll-margin-block-end",
23722
+ "scroll-margin-block-start",
23723
+ "scroll-margin-bottom",
23724
+ "scroll-margin-inline",
23725
+ "scroll-margin-inline-end",
23726
+ "scroll-margin-inline-start",
23727
+ "scroll-margin-left",
23728
+ "scroll-margin-right",
23729
+ "scroll-margin-top",
23730
+ "scroll-padding",
23731
+ "scroll-padding-block",
23732
+ "scroll-padding-block-end",
23733
+ "scroll-padding-block-start",
23734
+ "scroll-padding-bottom",
23735
+ "scroll-padding-inline",
23736
+ "scroll-padding-inline-end",
23737
+ "scroll-padding-inline-start",
23738
+ "scroll-padding-left",
23739
+ "scroll-padding-right",
23740
+ "scroll-padding-top",
23741
+ "scroll-snap-align",
23742
+ "scroll-snap-type",
23743
+ "shape-image-threshold",
23744
+ "shape-inside",
23745
+ "shape-margin",
23746
+ "shape-outside",
23747
+ "size",
23748
+ "speak",
23749
+ "speak-as",
23750
+ "speak-header",
23751
+ "speak-numeral",
23752
+ "speak-punctuation",
23753
+ "speech-rate",
23754
+ "stress",
23755
+ "string-set",
23756
+ "tab-size",
23757
+ "table-layout",
23758
+ "target",
23759
+ "target-name",
23760
+ "target-new",
23761
+ "target-position",
23762
+ "text-align",
23763
+ "text-align-last",
23764
+ "text-combine-upright",
23765
+ "text-decoration",
23766
+ "text-decoration-color",
23767
+ "text-decoration-line",
23768
+ "text-decoration-skip",
23769
+ "text-decoration-skip-ink",
23770
+ "text-decoration-style",
23771
+ "text-emphasis",
23772
+ "text-emphasis-color",
23773
+ "text-emphasis-position",
23774
+ "text-emphasis-style",
23775
+ "text-height",
23776
+ "text-indent",
23777
+ "text-justify",
23778
+ "text-orientation",
23779
+ "text-outline",
23780
+ "text-overflow",
23781
+ "text-rendering",
23782
+ "text-shadow",
23783
+ "text-size-adjust",
23784
+ "text-space-collapse",
23785
+ "text-transform",
23786
+ "text-underline-position",
23787
+ "text-wrap",
23788
+ "top",
23789
+ "touch-action",
23790
+ "transform",
23791
+ "transform-origin",
23792
+ "transform-style",
23793
+ "transition",
23794
+ "transition-delay",
23795
+ "transition-duration",
23796
+ "transition-property",
23797
+ "transition-timing-function",
23798
+ "translate",
23799
+ "unicode-bidi",
23800
+ "user-select",
23801
+ "vertical-align",
23802
+ "visibility",
23803
+ "voice-balance",
23804
+ "voice-duration",
23805
+ "voice-family",
23806
+ "voice-pitch",
23807
+ "voice-range",
23808
+ "voice-rate",
23809
+ "voice-stress",
23810
+ "voice-volume",
23811
+ "volume",
23812
+ "white-space",
23813
+ "widows",
23814
+ "width",
23815
+ "will-change",
23816
+ "word-break",
23817
+ "word-spacing",
23818
+ "word-wrap",
23819
+ "writing-mode",
23820
+ "z-index",
23821
+ "clip-path",
23822
+ "clip-rule",
23823
+ "mask",
23824
+ "enable-background",
23825
+ "filter",
23826
+ "flood-color",
23827
+ "flood-opacity",
23828
+ "lighting-color",
23829
+ "stop-color",
23830
+ "stop-opacity",
23831
+ "pointer-events",
23832
+ "color-interpolation",
23833
+ "color-interpolation-filters",
23834
+ "color-rendering",
23835
+ "fill",
23836
+ "fill-opacity",
23837
+ "fill-rule",
23838
+ "image-rendering",
23839
+ "marker",
23840
+ "marker-end",
23841
+ "marker-mid",
23842
+ "marker-start",
23843
+ "paint-order",
23844
+ "shape-rendering",
23845
+ "stroke",
23846
+ "stroke-dasharray",
23847
+ "stroke-dashoffset",
23848
+ "stroke-linecap",
23849
+ "stroke-linejoin",
23850
+ "stroke-miterlimit",
23851
+ "stroke-opacity",
23852
+ "stroke-width",
23853
+ "text-rendering",
23854
+ "baseline-shift",
23855
+ "dominant-baseline",
23856
+ "glyph-orientation-horizontal",
23857
+ "glyph-orientation-vertical",
23858
+ "text-anchor",
23859
+ "writing-mode",
23860
+ ],
23861
+ u = e(h),
23862
+ f = [
23863
+ "accent-color",
23864
+ "aspect-ratio",
23865
+ "border-block",
23866
+ "border-block-color",
23867
+ "border-block-end",
23868
+ "border-block-end-color",
23869
+ "border-block-end-style",
23870
+ "border-block-end-width",
23871
+ "border-block-start",
23872
+ "border-block-start-color",
23873
+ "border-block-start-style",
23874
+ "border-block-start-width",
23875
+ "border-block-style",
23876
+ "border-block-width",
23877
+ "border-inline",
23878
+ "border-inline-color",
23879
+ "border-inline-end",
23880
+ "border-inline-end-color",
23881
+ "border-inline-end-style",
23882
+ "border-inline-end-width",
23883
+ "border-inline-start",
23884
+ "border-inline-start-color",
23885
+ "border-inline-start-style",
23886
+ "border-inline-start-width",
23887
+ "border-inline-style",
23888
+ "border-inline-width",
23889
+ "content-visibility",
23890
+ "margin-block",
23891
+ "margin-block-end",
23892
+ "margin-block-start",
23893
+ "margin-inline",
23894
+ "margin-inline-end",
23895
+ "margin-inline-start",
23896
+ "overflow-anchor",
23897
+ "overscroll-behavior",
23898
+ "padding-block",
23899
+ "padding-block-end",
23900
+ "padding-block-start",
23901
+ "padding-inline",
23902
+ "padding-inline-end",
23903
+ "padding-inline-start",
23904
+ "scroll-snap-stop",
23905
+ "scrollbar-3d-light-color",
23906
+ "scrollbar-arrow-color",
23907
+ "scrollbar-base-color",
23908
+ "scrollbar-dark-shadow-color",
23909
+ "scrollbar-face-color",
23910
+ "scrollbar-highlight-color",
23911
+ "scrollbar-shadow-color",
23912
+ "scrollbar-track-color",
23913
+ "searchfield-cancel-button",
23914
+ "searchfield-decoration",
23915
+ "searchfield-results-button",
23916
+ "searchfield-results-decoration",
23917
+ "shape-inside",
23918
+ "zoom",
23919
+ ],
23920
+ d = e(f),
23921
+ p = e([
23922
+ "font-display",
23923
+ "font-family",
23924
+ "src",
23925
+ "unicode-range",
23926
+ "font-variant",
23927
+ "font-feature-settings",
23928
+ "font-stretch",
23929
+ "font-weight",
23930
+ "font-style",
23931
+ ]),
23932
+ g = e([
23933
+ "additive-symbols",
23934
+ "fallback",
23935
+ "negative",
23936
+ "pad",
23937
+ "prefix",
23938
+ "range",
23939
+ "speak-as",
23940
+ "suffix",
23941
+ "symbols",
23942
+ "system",
23943
+ ]),
23944
+ m = [
23945
+ "aliceblue",
23946
+ "antiquewhite",
23947
+ "aqua",
23948
+ "aquamarine",
23949
+ "azure",
23950
+ "beige",
23951
+ "bisque",
23952
+ "black",
23953
+ "blanchedalmond",
23954
+ "blue",
23955
+ "blueviolet",
23956
+ "brown",
23957
+ "burlywood",
23958
+ "cadetblue",
23959
+ "chartreuse",
23960
+ "chocolate",
23961
+ "coral",
23962
+ "cornflowerblue",
23963
+ "cornsilk",
23964
+ "crimson",
23965
+ "cyan",
23966
+ "darkblue",
23967
+ "darkcyan",
23968
+ "darkgoldenrod",
23969
+ "darkgray",
23970
+ "darkgreen",
23971
+ "darkgrey",
23972
+ "darkkhaki",
23973
+ "darkmagenta",
23974
+ "darkolivegreen",
23975
+ "darkorange",
23976
+ "darkorchid",
23977
+ "darkred",
23978
+ "darksalmon",
23979
+ "darkseagreen",
23980
+ "darkslateblue",
23981
+ "darkslategray",
23982
+ "darkslategrey",
23983
+ "darkturquoise",
23984
+ "darkviolet",
23985
+ "deeppink",
23986
+ "deepskyblue",
23987
+ "dimgray",
23988
+ "dimgrey",
23989
+ "dodgerblue",
23990
+ "firebrick",
23991
+ "floralwhite",
23992
+ "forestgreen",
23993
+ "fuchsia",
23994
+ "gainsboro",
23995
+ "ghostwhite",
23996
+ "gold",
23997
+ "goldenrod",
23998
+ "gray",
23999
+ "grey",
24000
+ "green",
24001
+ "greenyellow",
24002
+ "honeydew",
24003
+ "hotpink",
24004
+ "indianred",
24005
+ "indigo",
24006
+ "ivory",
24007
+ "khaki",
24008
+ "lavender",
24009
+ "lavenderblush",
24010
+ "lawngreen",
24011
+ "lemonchiffon",
24012
+ "lightblue",
24013
+ "lightcoral",
24014
+ "lightcyan",
24015
+ "lightgoldenrodyellow",
24016
+ "lightgray",
24017
+ "lightgreen",
24018
+ "lightgrey",
24019
+ "lightpink",
24020
+ "lightsalmon",
24021
+ "lightseagreen",
24022
+ "lightskyblue",
24023
+ "lightslategray",
24024
+ "lightslategrey",
24025
+ "lightsteelblue",
24026
+ "lightyellow",
24027
+ "lime",
24028
+ "limegreen",
24029
+ "linen",
24030
+ "magenta",
24031
+ "maroon",
24032
+ "mediumaquamarine",
24033
+ "mediumblue",
24034
+ "mediumorchid",
24035
+ "mediumpurple",
24036
+ "mediumseagreen",
24037
+ "mediumslateblue",
24038
+ "mediumspringgreen",
24039
+ "mediumturquoise",
24040
+ "mediumvioletred",
24041
+ "midnightblue",
24042
+ "mintcream",
24043
+ "mistyrose",
24044
+ "moccasin",
24045
+ "navajowhite",
24046
+ "navy",
24047
+ "oldlace",
24048
+ "olive",
24049
+ "olivedrab",
24050
+ "orange",
24051
+ "orangered",
24052
+ "orchid",
24053
+ "palegoldenrod",
24054
+ "palegreen",
24055
+ "paleturquoise",
24056
+ "palevioletred",
24057
+ "papayawhip",
24058
+ "peachpuff",
24059
+ "peru",
24060
+ "pink",
24061
+ "plum",
24062
+ "powderblue",
24063
+ "purple",
24064
+ "rebeccapurple",
24065
+ "red",
24066
+ "rosybrown",
24067
+ "royalblue",
24068
+ "saddlebrown",
24069
+ "salmon",
24070
+ "sandybrown",
24071
+ "seagreen",
24072
+ "seashell",
24073
+ "sienna",
24074
+ "silver",
24075
+ "skyblue",
24076
+ "slateblue",
24077
+ "slategray",
24078
+ "slategrey",
24079
+ "snow",
24080
+ "springgreen",
24081
+ "steelblue",
24082
+ "tan",
24083
+ "teal",
24084
+ "thistle",
24085
+ "tomato",
24086
+ "turquoise",
24087
+ "violet",
24088
+ "wheat",
24089
+ "white",
24090
+ "whitesmoke",
24091
+ "yellow",
24092
+ "yellowgreen",
24093
+ ],
24094
+ v = e(m),
24095
+ _ = [
24096
+ "above",
24097
+ "absolute",
24098
+ "activeborder",
24099
+ "additive",
24100
+ "activecaption",
24101
+ "afar",
24102
+ "after-white-space",
24103
+ "ahead",
24104
+ "alias",
24105
+ "all",
24106
+ "all-scroll",
24107
+ "alphabetic",
24108
+ "alternate",
24109
+ "always",
24110
+ "amharic",
24111
+ "amharic-abegede",
24112
+ "antialiased",
24113
+ "appworkspace",
24114
+ "arabic-indic",
24115
+ "armenian",
24116
+ "asterisks",
24117
+ "attr",
24118
+ "auto",
24119
+ "auto-flow",
24120
+ "avoid",
24121
+ "avoid-column",
24122
+ "avoid-page",
24123
+ "avoid-region",
24124
+ "axis-pan",
24125
+ "background",
24126
+ "backwards",
24127
+ "baseline",
24128
+ "below",
24129
+ "bidi-override",
24130
+ "binary",
24131
+ "bengali",
24132
+ "blink",
24133
+ "block",
24134
+ "block-axis",
24135
+ "blur",
24136
+ "bold",
24137
+ "bolder",
24138
+ "border",
24139
+ "border-box",
24140
+ "both",
24141
+ "bottom",
24142
+ "break",
24143
+ "break-all",
24144
+ "break-word",
24145
+ "brightness",
24146
+ "bullets",
24147
+ "button",
24148
+ "button-bevel",
24149
+ "buttonface",
24150
+ "buttonhighlight",
24151
+ "buttonshadow",
24152
+ "buttontext",
24153
+ "calc",
24154
+ "cambodian",
24155
+ "capitalize",
24156
+ "caps-lock-indicator",
24157
+ "caption",
24158
+ "captiontext",
24159
+ "caret",
24160
+ "cell",
24161
+ "center",
24162
+ "checkbox",
24163
+ "circle",
24164
+ "cjk-decimal",
24165
+ "cjk-earthly-branch",
24166
+ "cjk-heavenly-stem",
24167
+ "cjk-ideographic",
24168
+ "clear",
24169
+ "clip",
24170
+ "close-quote",
24171
+ "col-resize",
24172
+ "collapse",
24173
+ "color",
24174
+ "color-burn",
24175
+ "color-dodge",
24176
+ "column",
24177
+ "column-reverse",
24178
+ "compact",
24179
+ "condensed",
24180
+ "contain",
24181
+ "content",
24182
+ "contents",
24183
+ "content-box",
24184
+ "context-menu",
24185
+ "continuous",
24186
+ "contrast",
24187
+ "copy",
24188
+ "counter",
24189
+ "counters",
24190
+ "cover",
24191
+ "crop",
24192
+ "cross",
24193
+ "crosshair",
24194
+ "cubic-bezier",
24195
+ "currentcolor",
24196
+ "cursive",
24197
+ "cyclic",
24198
+ "darken",
24199
+ "dashed",
24200
+ "decimal",
24201
+ "decimal-leading-zero",
24202
+ "default",
24203
+ "default-button",
24204
+ "dense",
24205
+ "destination-atop",
24206
+ "destination-in",
24207
+ "destination-out",
24208
+ "destination-over",
24209
+ "devanagari",
24210
+ "difference",
24211
+ "disc",
24212
+ "discard",
24213
+ "disclosure-closed",
24214
+ "disclosure-open",
24215
+ "document",
24216
+ "dot-dash",
24217
+ "dot-dot-dash",
24218
+ "dotted",
24219
+ "double",
24220
+ "down",
24221
+ "drop-shadow",
24222
+ "e-resize",
24223
+ "ease",
24224
+ "ease-in",
24225
+ "ease-in-out",
24226
+ "ease-out",
24227
+ "element",
24228
+ "ellipse",
24229
+ "ellipsis",
24230
+ "embed",
24231
+ "end",
24232
+ "ethiopic",
24233
+ "ethiopic-abegede",
24234
+ "ethiopic-abegede-am-et",
24235
+ "ethiopic-abegede-gez",
24236
+ "ethiopic-abegede-ti-er",
24237
+ "ethiopic-abegede-ti-et",
24238
+ "ethiopic-halehame-aa-er",
24239
+ "ethiopic-halehame-aa-et",
24240
+ "ethiopic-halehame-am-et",
24241
+ "ethiopic-halehame-gez",
24242
+ "ethiopic-halehame-om-et",
24243
+ "ethiopic-halehame-sid-et",
24244
+ "ethiopic-halehame-so-et",
24245
+ "ethiopic-halehame-ti-er",
24246
+ "ethiopic-halehame-ti-et",
24247
+ "ethiopic-halehame-tig",
24248
+ "ethiopic-numeric",
24249
+ "ew-resize",
24250
+ "exclusion",
24251
+ "expanded",
24252
+ "extends",
24253
+ "extra-condensed",
24254
+ "extra-expanded",
24255
+ "fantasy",
24256
+ "fast",
24257
+ "fill",
24258
+ "fill-box",
24259
+ "fixed",
24260
+ "flat",
24261
+ "flex",
24262
+ "flex-end",
24263
+ "flex-start",
24264
+ "footnotes",
24265
+ "forwards",
24266
+ "from",
24267
+ "geometricPrecision",
24268
+ "georgian",
24269
+ "grayscale",
24270
+ "graytext",
24271
+ "grid",
24272
+ "groove",
24273
+ "gujarati",
24274
+ "gurmukhi",
24275
+ "hand",
24276
+ "hangul",
24277
+ "hangul-consonant",
24278
+ "hard-light",
24279
+ "hebrew",
24280
+ "help",
24281
+ "hidden",
24282
+ "hide",
24283
+ "higher",
24284
+ "highlight",
24285
+ "highlighttext",
24286
+ "hiragana",
24287
+ "hiragana-iroha",
24288
+ "horizontal",
24289
+ "hsl",
24290
+ "hsla",
24291
+ "hue",
24292
+ "hue-rotate",
24293
+ "icon",
24294
+ "ignore",
24295
+ "inactiveborder",
24296
+ "inactivecaption",
24297
+ "inactivecaptiontext",
24298
+ "infinite",
24299
+ "infobackground",
24300
+ "infotext",
24301
+ "inherit",
24302
+ "initial",
24303
+ "inline",
24304
+ "inline-axis",
24305
+ "inline-block",
24306
+ "inline-flex",
24307
+ "inline-grid",
24308
+ "inline-table",
24309
+ "inset",
24310
+ "inside",
24311
+ "intrinsic",
24312
+ "invert",
24313
+ "italic",
24314
+ "japanese-formal",
24315
+ "japanese-informal",
24316
+ "justify",
24317
+ "kannada",
24318
+ "katakana",
24319
+ "katakana-iroha",
24320
+ "keep-all",
24321
+ "khmer",
24322
+ "korean-hangul-formal",
24323
+ "korean-hanja-formal",
24324
+ "korean-hanja-informal",
24325
+ "landscape",
24326
+ "lao",
24327
+ "large",
24328
+ "larger",
24329
+ "left",
24330
+ "level",
24331
+ "lighter",
24332
+ "lighten",
24333
+ "line-through",
24334
+ "linear",
24335
+ "linear-gradient",
24336
+ "lines",
24337
+ "list-item",
24338
+ "listbox",
24339
+ "listitem",
24340
+ "local",
24341
+ "logical",
24342
+ "loud",
24343
+ "lower",
24344
+ "lower-alpha",
24345
+ "lower-armenian",
24346
+ "lower-greek",
24347
+ "lower-hexadecimal",
24348
+ "lower-latin",
24349
+ "lower-norwegian",
24350
+ "lower-roman",
24351
+ "lowercase",
24352
+ "ltr",
24353
+ "luminosity",
24354
+ "malayalam",
24355
+ "manipulation",
24356
+ "match",
24357
+ "matrix",
24358
+ "matrix3d",
24359
+ "media-controls-background",
24360
+ "media-current-time-display",
24361
+ "media-fullscreen-button",
24362
+ "media-mute-button",
24363
+ "media-play-button",
24364
+ "media-return-to-realtime-button",
24365
+ "media-rewind-button",
24366
+ "media-seek-back-button",
24367
+ "media-seek-forward-button",
24368
+ "media-slider",
24369
+ "media-sliderthumb",
24370
+ "media-time-remaining-display",
24371
+ "media-volume-slider",
24372
+ "media-volume-slider-container",
24373
+ "media-volume-sliderthumb",
24374
+ "medium",
24375
+ "menu",
24376
+ "menulist",
24377
+ "menulist-button",
24378
+ "menulist-text",
24379
+ "menulist-textfield",
24380
+ "menutext",
24381
+ "message-box",
24382
+ "middle",
24383
+ "min-intrinsic",
24384
+ "mix",
24385
+ "mongolian",
24386
+ "monospace",
24387
+ "move",
24388
+ "multiple",
24389
+ "multiple_mask_images",
24390
+ "multiply",
24391
+ "myanmar",
24392
+ "n-resize",
24393
+ "narrower",
24394
+ "ne-resize",
24395
+ "nesw-resize",
24396
+ "no-close-quote",
24397
+ "no-drop",
24398
+ "no-open-quote",
24399
+ "no-repeat",
24400
+ "none",
24401
+ "normal",
24402
+ "not-allowed",
24403
+ "nowrap",
24404
+ "ns-resize",
24405
+ "numbers",
24406
+ "numeric",
24407
+ "nw-resize",
24408
+ "nwse-resize",
24409
+ "oblique",
24410
+ "octal",
24411
+ "opacity",
24412
+ "open-quote",
24413
+ "optimizeLegibility",
24414
+ "optimizeSpeed",
24415
+ "oriya",
24416
+ "oromo",
24417
+ "outset",
24418
+ "outside",
24419
+ "outside-shape",
24420
+ "overlay",
24421
+ "overline",
24422
+ "padding",
24423
+ "padding-box",
24424
+ "painted",
24425
+ "page",
24426
+ "paused",
24427
+ "persian",
24428
+ "perspective",
24429
+ "pinch-zoom",
24430
+ "plus-darker",
24431
+ "plus-lighter",
24432
+ "pointer",
24433
+ "polygon",
24434
+ "portrait",
24435
+ "pre",
24436
+ "pre-line",
24437
+ "pre-wrap",
24438
+ "preserve-3d",
24439
+ "progress",
24440
+ "push-button",
24441
+ "radial-gradient",
24442
+ "radio",
24443
+ "read-only",
24444
+ "read-write",
24445
+ "read-write-plaintext-only",
24446
+ "rectangle",
24447
+ "region",
24448
+ "relative",
24449
+ "repeat",
24450
+ "repeating-linear-gradient",
24451
+ "repeating-radial-gradient",
24452
+ "repeat-x",
24453
+ "repeat-y",
24454
+ "reset",
24455
+ "reverse",
24456
+ "rgb",
24457
+ "rgba",
24458
+ "ridge",
24459
+ "right",
24460
+ "rotate",
24461
+ "rotate3d",
24462
+ "rotateX",
24463
+ "rotateY",
24464
+ "rotateZ",
24465
+ "round",
24466
+ "row",
24467
+ "row-resize",
24468
+ "row-reverse",
24469
+ "rtl",
24470
+ "run-in",
24471
+ "running",
24472
+ "s-resize",
24473
+ "sans-serif",
24474
+ "saturate",
24475
+ "saturation",
24476
+ "scale",
24477
+ "scale3d",
24478
+ "scaleX",
24479
+ "scaleY",
24480
+ "scaleZ",
24481
+ "screen",
24482
+ "scroll",
24483
+ "scrollbar",
24484
+ "scroll-position",
24485
+ "se-resize",
24486
+ "searchfield",
24487
+ "searchfield-cancel-button",
24488
+ "searchfield-decoration",
24489
+ "searchfield-results-button",
24490
+ "searchfield-results-decoration",
24491
+ "self-start",
24492
+ "self-end",
24493
+ "semi-condensed",
24494
+ "semi-expanded",
24495
+ "separate",
24496
+ "sepia",
24497
+ "serif",
24498
+ "show",
24499
+ "sidama",
24500
+ "simp-chinese-formal",
24501
+ "simp-chinese-informal",
24502
+ "single",
24503
+ "skew",
24504
+ "skewX",
24505
+ "skewY",
24506
+ "skip-white-space",
24507
+ "slide",
24508
+ "slider-horizontal",
24509
+ "slider-vertical",
24510
+ "sliderthumb-horizontal",
24511
+ "sliderthumb-vertical",
24512
+ "slow",
24513
+ "small",
24514
+ "small-caps",
24515
+ "small-caption",
24516
+ "smaller",
24517
+ "soft-light",
24518
+ "solid",
24519
+ "somali",
24520
+ "source-atop",
24521
+ "source-in",
24522
+ "source-out",
24523
+ "source-over",
24524
+ "space",
24525
+ "space-around",
24526
+ "space-between",
24527
+ "space-evenly",
24528
+ "spell-out",
24529
+ "square",
24530
+ "square-button",
24531
+ "start",
24532
+ "static",
24533
+ "status-bar",
24534
+ "stretch",
24535
+ "stroke",
24536
+ "stroke-box",
24537
+ "sub",
24538
+ "subpixel-antialiased",
24539
+ "svg_masks",
24540
+ "super",
24541
+ "sw-resize",
24542
+ "symbolic",
24543
+ "symbols",
24544
+ "system-ui",
24545
+ "table",
24546
+ "table-caption",
24547
+ "table-cell",
24548
+ "table-column",
24549
+ "table-column-group",
24550
+ "table-footer-group",
24551
+ "table-header-group",
24552
+ "table-row",
24553
+ "table-row-group",
24554
+ "tamil",
24555
+ "telugu",
24556
+ "text",
24557
+ "text-bottom",
24558
+ "text-top",
24559
+ "textarea",
24560
+ "textfield",
24561
+ "thai",
24562
+ "thick",
24563
+ "thin",
24564
+ "threeddarkshadow",
24565
+ "threedface",
24566
+ "threedhighlight",
24567
+ "threedlightshadow",
24568
+ "threedshadow",
24569
+ "tibetan",
24570
+ "tigre",
24571
+ "tigrinya-er",
24572
+ "tigrinya-er-abegede",
24573
+ "tigrinya-et",
24574
+ "tigrinya-et-abegede",
24575
+ "to",
24576
+ "top",
24577
+ "trad-chinese-formal",
24578
+ "trad-chinese-informal",
24579
+ "transform",
24580
+ "translate",
24581
+ "translate3d",
24582
+ "translateX",
24583
+ "translateY",
24584
+ "translateZ",
24585
+ "transparent",
24586
+ "ultra-condensed",
24587
+ "ultra-expanded",
24588
+ "underline",
24589
+ "unidirectional-pan",
24590
+ "unset",
24591
+ "up",
24592
+ "upper-alpha",
24593
+ "upper-armenian",
24594
+ "upper-greek",
24595
+ "upper-hexadecimal",
24596
+ "upper-latin",
24597
+ "upper-norwegian",
24598
+ "upper-roman",
24599
+ "uppercase",
24600
+ "urdu",
24601
+ "url",
24602
+ "var",
24603
+ "vertical",
24604
+ "vertical-text",
24605
+ "view-box",
24606
+ "visible",
24607
+ "visibleFill",
24608
+ "visiblePainted",
24609
+ "visibleStroke",
24610
+ "visual",
24611
+ "w-resize",
24612
+ "wait",
24613
+ "wave",
24614
+ "wider",
24615
+ "window",
24616
+ "windowframe",
24617
+ "windowtext",
24618
+ "words",
24619
+ "wrap",
24620
+ "wrap-reverse",
24621
+ "x-large",
24622
+ "x-small",
24623
+ "xor",
24624
+ "xx-large",
24625
+ "xx-small",
24626
+ ],
24627
+ y = e(_),
24628
+ x = n
24629
+ .concat(r)
24630
+ .concat(s)
24631
+ .concat(l)
24632
+ .concat(h)
24633
+ .concat(f)
24634
+ .concat(m)
24635
+ .concat(_);
24636
+ function k(t, e) {
24637
+ for (var n, i = !1; null != (n = t.next()); ) {
24638
+ if (i && "/" == n) {
24639
+ e.tokenize = null;
24640
+ break;
24641
+ }
24642
+ i = "*" == n;
24643
+ }
24644
+ return ["comment", "comment"];
24645
+ }
24646
+ t.registerHelper("hintWords", "css", x),
24647
+ t.defineMIME("text/css", {
24648
+ documentTypes: i,
24649
+ mediaTypes: o,
24650
+ mediaFeatures: a,
24651
+ mediaValueKeywords: c,
24652
+ propertyKeywords: u,
24653
+ nonStandardPropertyKeywords: d,
24654
+ fontProperties: p,
24655
+ counterDescriptors: g,
24656
+ colorKeywords: v,
24657
+ valueKeywords: y,
24658
+ tokenHooks: {
24659
+ "/": function (t, e) {
24660
+ return !!t.eat("*") && ((e.tokenize = k), k(t, e));
24661
+ },
24662
+ },
24663
+ name: "css",
24664
+ }),
24665
+ t.defineMIME("text/x-scss", {
24666
+ mediaTypes: o,
24667
+ mediaFeatures: a,
24668
+ mediaValueKeywords: c,
24669
+ propertyKeywords: u,
24670
+ nonStandardPropertyKeywords: d,
24671
+ colorKeywords: v,
24672
+ valueKeywords: y,
24673
+ fontProperties: p,
24674
+ allowNested: !0,
24675
+ lineComment: "//",
24676
+ tokenHooks: {
24677
+ "/": function (t, e) {
24678
+ return t.eat("/")
24679
+ ? (t.skipToEnd(), ["comment", "comment"])
24680
+ : t.eat("*")
24681
+ ? ((e.tokenize = k), k(t, e))
24682
+ : ["operator", "operator"];
24683
+ },
24684
+ ":": function (t) {
24685
+ return !!t.match(/^\s*\{/, !1) && [null, null];
24686
+ },
24687
+ $: function (t) {
24688
+ return (
24689
+ t.match(/^[\w-]+/),
24690
+ t.match(/^\s*:/, !1)
24691
+ ? ["variable-2", "variable-definition"]
24692
+ : ["variable-2", "variable"]
24693
+ );
24694
+ },
24695
+ "#": function (t) {
24696
+ return !!t.eat("{") && [null, "interpolation"];
24697
+ },
24698
+ },
24699
+ name: "css",
24700
+ helperType: "scss",
24701
+ }),
24702
+ t.defineMIME("text/x-less", {
24703
+ mediaTypes: o,
24704
+ mediaFeatures: a,
24705
+ mediaValueKeywords: c,
24706
+ propertyKeywords: u,
24707
+ nonStandardPropertyKeywords: d,
24708
+ colorKeywords: v,
24709
+ valueKeywords: y,
24710
+ fontProperties: p,
24711
+ allowNested: !0,
24712
+ lineComment: "//",
24713
+ tokenHooks: {
24714
+ "/": function (t, e) {
24715
+ return t.eat("/")
24716
+ ? (t.skipToEnd(), ["comment", "comment"])
24717
+ : t.eat("*")
24718
+ ? ((e.tokenize = k), k(t, e))
24719
+ : ["operator", "operator"];
24720
+ },
24721
+ "@": function (t) {
24722
+ return t.eat("{")
24723
+ ? [null, "interpolation"]
24724
+ : !t.match(
24725
+ /^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,
24726
+ !1
24727
+ ) &&
24728
+ (t.eatWhile(/[\w\\\-]/),
24729
+ t.match(/^\s*:/, !1)
24730
+ ? ["variable-2", "variable-definition"]
24731
+ : ["variable-2", "variable"]);
24732
+ },
24733
+ "&": function () {
24734
+ return ["atom", "atom"];
24735
+ },
24736
+ },
24737
+ name: "css",
24738
+ helperType: "less",
24739
+ }),
24740
+ t.defineMIME("text/x-gss", {
24741
+ documentTypes: i,
24742
+ mediaTypes: o,
24743
+ mediaFeatures: a,
24744
+ propertyKeywords: u,
24745
+ nonStandardPropertyKeywords: d,
24746
+ fontProperties: p,
24747
+ counterDescriptors: g,
24748
+ colorKeywords: v,
24749
+ valueKeywords: y,
24750
+ supportsAtComponent: !0,
24751
+ tokenHooks: {
24752
+ "/": function (t, e) {
24753
+ return !!t.eat("*") && ((e.tokenize = k), k(t, e));
24754
+ },
24755
+ },
24756
+ name: "css",
24757
+ helperType: "gss",
24758
+ });
24759
+ }),
24760
+ "object" == typeof n && "object" == typeof e
24761
+ ? i(t("../../lib/codemirror"))
24762
+ : "function" == typeof define && define.amd
24763
+ ? define(["../../lib/codemirror"], i)
24764
+ : i(CodeMirror);
24765
+ },
24766
+ { "../../lib/codemirror": 13 },
24767
+ ],
24768
+ 16: [
24769
+ function (t, e, n) {
24770
+ var i;
24771
+ (i = function (t) {
24772
+ "use strict";
24773
+ var e = {
24774
+ script: [
24775
+ ["lang", /(javascript|babel)/i, "javascript"],
24776
+ [
24777
+ "type",
24778
+ /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,
24779
+ "javascript",
24780
+ ],
24781
+ ["type", /./, "text/plain"],
24782
+ [null, null, "javascript"],
24783
+ ],
24784
+ style: [
24785
+ ["lang", /^css$/i, "css"],
24786
+ ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
24787
+ ["type", /./, "text/plain"],
24788
+ [null, null, "css"],
24789
+ ],
24790
+ },
24791
+ n = {};
24792
+ function i(t, e) {
24793
+ var i = t.match(
24794
+ (function (t) {
24795
+ return (
24796
+ n[t] ||
24797
+ (n[t] = new RegExp(
24798
+ "\\s+" + t + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"
24799
+ ))
24800
+ );
24801
+ })(e)
24802
+ );
24803
+ return i ? /^\s*(.*?)\s*$/.exec(i[2])[1] : "";
24804
+ }
24805
+ function r(t, e) {
24806
+ return new RegExp((e ? "^" : "") + "</s*" + t + "s*>", "i");
24807
+ }
24808
+ function o(t, e) {
24809
+ for (var n in t)
24810
+ for (
24811
+ var i = e[n] || (e[n] = []), r = t[n], o = r.length - 1;
24812
+ o >= 0;
24813
+ o--
24814
+ )
24815
+ i.unshift(r[o]);
24816
+ }
24817
+ t.defineMode(
24818
+ "htmlmixed",
24819
+ function (n, s) {
24820
+ var a = t.getMode(n, {
24821
+ name: "xml",
24822
+ htmlMode: !0,
24823
+ multilineTagIndentFactor: s.multilineTagIndentFactor,
24824
+ multilineTagIndentPastTag: s.multilineTagIndentPastTag,
24825
+ allowMissingTagName: s.allowMissingTagName,
24826
+ }),
24827
+ l = {},
24828
+ c = s && s.tags,
24829
+ h = s && s.scriptTypes;
24830
+ if ((o(e, l), c && o(c, l), h))
24831
+ for (var u = h.length - 1; u >= 0; u--)
24832
+ l.script.unshift(["type", h[u].matches, h[u].mode]);
24833
+ function f(e, o) {
24834
+ var s,
24835
+ c = a.token(e, o.htmlState),
24836
+ h = /\btag\b/.test(c);
24837
+ if (
24838
+ h &&
24839
+ !/[<>\s\/]/.test(e.current()) &&
24840
+ (s =
24841
+ o.htmlState.tagName && o.htmlState.tagName.toLowerCase()) &&
24842
+ l.hasOwnProperty(s)
24843
+ )
24844
+ o.inTag = s + " ";
24845
+ else if (o.inTag && h && />$/.test(e.current())) {
24846
+ var u = /^([\S]+) (.*)/.exec(o.inTag);
24847
+ o.inTag = null;
24848
+ var d =
24849
+ ">" == e.current() &&
24850
+ (function (t, e) {
24851
+ for (var n = 0; n < t.length; n++) {
24852
+ var r = t[n];
24853
+ if (!r[0] || r[1].test(i(e, r[0]))) return r[2];
24854
+ }
24855
+ })(l[u[1]], u[2]),
24856
+ p = t.getMode(n, d),
24857
+ g = r(u[1], !0),
24858
+ m = r(u[1], !1);
24859
+ (o.token = function (t, e) {
24860
+ return t.match(g, !1)
24861
+ ? ((e.token = f),
24862
+ (e.localState = e.localMode = null),
24863
+ null)
24864
+ : (function (t, e, n) {
24865
+ var i = t.current(),
24866
+ r = i.search(e);
24867
+ return (
24868
+ r > -1
24869
+ ? t.backUp(i.length - r)
24870
+ : i.match(/<\/?$/) &&
24871
+ (t.backUp(i.length),
24872
+ t.match(e, !1) || t.match(i)),
24873
+ n
24874
+ );
24875
+ })(t, m, e.localMode.token(t, e.localState));
24876
+ }),
24877
+ (o.localMode = p),
24878
+ (o.localState = t.startState(
24879
+ p,
24880
+ a.indent(o.htmlState, "", "")
24881
+ ));
24882
+ } else
24883
+ o.inTag &&
24884
+ ((o.inTag += e.current()), e.eol() && (o.inTag += " "));
24885
+ return c;
24886
+ }
24887
+ return {
24888
+ startState: function () {
24889
+ return {
24890
+ token: f,
24891
+ inTag: null,
24892
+ localMode: null,
24893
+ localState: null,
24894
+ htmlState: t.startState(a),
24895
+ };
24896
+ },
24897
+ copyState: function (e) {
24898
+ var n;
24899
+ return (
24900
+ e.localState &&
24901
+ (n = t.copyState(e.localMode, e.localState)),
24902
+ {
24903
+ token: e.token,
24904
+ inTag: e.inTag,
24905
+ localMode: e.localMode,
24906
+ localState: n,
24907
+ htmlState: t.copyState(a, e.htmlState),
24908
+ }
24909
+ );
24910
+ },
24911
+ token: function (t, e) {
24912
+ return e.token(t, e);
24913
+ },
24914
+ indent: function (e, n, i) {
24915
+ return !e.localMode || /^\s*<\//.test(n)
24916
+ ? a.indent(e.htmlState, n, i)
24917
+ : e.localMode.indent
24918
+ ? e.localMode.indent(e.localState, n, i)
24919
+ : t.Pass;
24920
+ },
24921
+ innerMode: function (t) {
24922
+ return {
24923
+ state: t.localState || t.htmlState,
24924
+ mode: t.localMode || a,
24925
+ };
24926
+ },
24927
+ };
24928
+ },
24929
+ "xml",
24930
+ "javascript",
24931
+ "css"
24932
+ ),
24933
+ t.defineMIME("text/html", "htmlmixed");
24934
+ }),
24935
+ "object" == typeof n && "object" == typeof e
24936
+ ? i(
24937
+ t("../../lib/codemirror"),
24938
+ t("../xml/xml"),
24939
+ t("../javascript/javascript"),
24940
+ t("../css/css")
24941
+ )
24942
+ : "function" == typeof define && define.amd
24943
+ ? define(
24944
+ [
24945
+ "../../lib/codemirror",
24946
+ "../xml/xml",
24947
+ "../javascript/javascript",
24948
+ "../css/css",
24949
+ ],
24950
+ i
24951
+ )
24952
+ : i(CodeMirror);
24953
+ },
24954
+ {
24955
+ "../../lib/codemirror": 13,
24956
+ "../css/css": 15,
24957
+ "../javascript/javascript": 17,
24958
+ "../xml/xml": 19,
24959
+ },
24960
+ ],
24961
+ 17: [
24962
+ function (t, e, n) {
24963
+ var i;
24964
+ (i = function (t) {
24965
+ "use strict";
24966
+ t.defineMode("javascript", function (e, n) {
24967
+ var i,
24968
+ r,
24969
+ o = e.indentUnit,
24970
+ s = n.statementIndent,
24971
+ a = n.jsonld,
24972
+ l = n.json || a,
24973
+ c = !1 !== n.trackScope,
24974
+ h = n.typescript,
24975
+ u = n.wordCharacters || /[\w$\xa1-\uffff]/,
24976
+ f = (function () {
24977
+ function t(t) {
24978
+ return { type: t, style: "keyword" };
24979
+ }
24980
+ var e = t("keyword a"),
24981
+ n = t("keyword b"),
24982
+ i = t("keyword c"),
24983
+ r = t("keyword d"),
24984
+ o = t("operator"),
24985
+ s = { type: "atom", style: "atom" };
24986
+ return {
24987
+ if: t("if"),
24988
+ while: e,
24989
+ with: e,
24990
+ else: n,
24991
+ do: n,
24992
+ try: n,
24993
+ finally: n,
24994
+ return: r,
24995
+ break: r,
24996
+ continue: r,
24997
+ new: t("new"),
24998
+ delete: i,
24999
+ void: i,
25000
+ throw: i,
25001
+ debugger: t("debugger"),
25002
+ var: t("var"),
25003
+ const: t("var"),
25004
+ let: t("var"),
25005
+ function: t("function"),
25006
+ catch: t("catch"),
25007
+ for: t("for"),
25008
+ switch: t("switch"),
25009
+ case: t("case"),
25010
+ default: t("default"),
25011
+ in: o,
25012
+ typeof: o,
25013
+ instanceof: o,
25014
+ true: s,
25015
+ false: s,
25016
+ null: s,
25017
+ undefined: s,
25018
+ NaN: s,
25019
+ Infinity: s,
25020
+ this: t("this"),
25021
+ class: t("class"),
25022
+ super: t("atom"),
25023
+ yield: i,
25024
+ export: t("export"),
25025
+ import: t("import"),
25026
+ extends: i,
25027
+ await: i,
25028
+ };
25029
+ })(),
25030
+ d = /[+\-*&%=<>!?|~^@]/,
25031
+ p =
25032
+ /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
25033
+ function g(t, e, n) {
25034
+ return (i = t), (r = n), e;
25035
+ }
25036
+ function m(t, e) {
25037
+ var n,
25038
+ i = t.next();
25039
+ if ('"' == i || "'" == i)
25040
+ return (
25041
+ (e.tokenize =
25042
+ ((n = i),
25043
+ function (t, e) {
25044
+ var i,
25045
+ r = !1;
25046
+ if (a && "@" == t.peek() && t.match(p))
25047
+ return (e.tokenize = m), g("jsonld-keyword", "meta");
25048
+ for (; null != (i = t.next()) && (i != n || r); )
25049
+ r = !r && "\\" == i;
25050
+ return r || (e.tokenize = m), g("string", "string");
25051
+ })),
25052
+ e.tokenize(t, e)
25053
+ );
25054
+ if ("." == i && t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))
25055
+ return g("number", "number");
25056
+ if ("." == i && t.match("..")) return g("spread", "meta");
25057
+ if (/[\[\]{}\(\),;\:\.]/.test(i)) return g(i);
25058
+ if ("=" == i && t.eat(">")) return g("=>", "operator");
25059
+ if ("0" == i && t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))
25060
+ return g("number", "number");
25061
+ if (/\d/.test(i))
25062
+ return (
25063
+ t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),
25064
+ g("number", "number")
25065
+ );
25066
+ if ("/" == i)
25067
+ return t.eat("*")
25068
+ ? ((e.tokenize = v), v(t, e))
25069
+ : t.eat("/")
25070
+ ? (t.skipToEnd(), g("comment", "comment"))
25071
+ : Jt(t, e, 1)
25072
+ ? ((function (t) {
25073
+ for (var e, n = !1, i = !1; null != (e = t.next()); ) {
25074
+ if (!n) {
25075
+ if ("/" == e && !i) return;
25076
+ "[" == e ? (i = !0) : i && "]" == e && (i = !1);
25077
+ }
25078
+ n = !n && "\\" == e;
25079
+ }
25080
+ })(t),
25081
+ t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),
25082
+ g("regexp", "string-2"))
25083
+ : (t.eat("="), g("operator", "operator", t.current()));
25084
+ if ("`" == i) return (e.tokenize = _), _(t, e);
25085
+ if ("#" == i && "!" == t.peek())
25086
+ return t.skipToEnd(), g("meta", "meta");
25087
+ if ("#" == i && t.eatWhile(u)) return g("variable", "property");
25088
+ if (
25089
+ ("<" == i && t.match("!--")) ||
25090
+ ("-" == i &&
25091
+ t.match("->") &&
25092
+ !/\S/.test(t.string.slice(0, t.start)))
25093
+ )
25094
+ return t.skipToEnd(), g("comment", "comment");
25095
+ if (d.test(i))
25096
+ return (
25097
+ (">" == i && e.lexical && ">" == e.lexical.type) ||
25098
+ (t.eat("=")
25099
+ ? ("!" != i && "=" != i) || t.eat("=")
25100
+ : /[<>*+\-|&?]/.test(i) &&
25101
+ (t.eat(i), ">" == i && t.eat(i))),
25102
+ "?" == i && t.eat(".")
25103
+ ? g(".")
25104
+ : g("operator", "operator", t.current())
25105
+ );
25106
+ if (u.test(i)) {
25107
+ t.eatWhile(u);
25108
+ var r = t.current();
25109
+ if ("." != e.lastType) {
25110
+ if (f.propertyIsEnumerable(r)) {
25111
+ var o = f[r];
25112
+ return g(o.type, o.style, r);
25113
+ }
25114
+ if (
25115
+ "async" == r &&
25116
+ t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, !1)
25117
+ )
25118
+ return g("async", "keyword", r);
25119
+ }
25120
+ return g("variable", "variable", r);
25121
+ }
25122
+ }
25123
+ function v(t, e) {
25124
+ for (var n, i = !1; (n = t.next()); ) {
25125
+ if ("/" == n && i) {
25126
+ e.tokenize = m;
25127
+ break;
25128
+ }
25129
+ i = "*" == n;
25130
+ }
25131
+ return g("comment", "comment");
25132
+ }
25133
+ function _(t, e) {
25134
+ for (var n, i = !1; null != (n = t.next()); ) {
25135
+ if (!i && ("`" == n || ("$" == n && t.eat("{")))) {
25136
+ e.tokenize = m;
25137
+ break;
25138
+ }
25139
+ i = !i && "\\" == n;
25140
+ }
25141
+ return g("quasi", "string-2", t.current());
25142
+ }
25143
+ function y(t, e) {
25144
+ e.fatArrowAt && (e.fatArrowAt = null);
25145
+ var n = t.string.indexOf("=>", t.start);
25146
+ if (!(n < 0)) {
25147
+ if (h) {
25148
+ var i = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(
25149
+ t.string.slice(t.start, n)
25150
+ );
25151
+ i && (n = i.index);
25152
+ }
25153
+ for (var r = 0, o = !1, s = n - 1; s >= 0; --s) {
25154
+ var a = t.string.charAt(s),
25155
+ l = "([{}])".indexOf(a);
25156
+ if (l >= 0 && l < 3) {
25157
+ if (!r) {
25158
+ ++s;
25159
+ break;
25160
+ }
25161
+ if (0 == --r) {
25162
+ "(" == a && (o = !0);
25163
+ break;
25164
+ }
25165
+ } else if (l >= 3 && l < 6) ++r;
25166
+ else if (u.test(a)) o = !0;
25167
+ else if (/["'\/`]/.test(a))
25168
+ for (; ; --s) {
25169
+ if (0 == s) return;
25170
+ if (
25171
+ t.string.charAt(s - 1) == a &&
25172
+ "\\" != t.string.charAt(s - 2)
25173
+ ) {
25174
+ s--;
25175
+ break;
25176
+ }
25177
+ }
25178
+ else if (o && !r) {
25179
+ ++s;
25180
+ break;
25181
+ }
25182
+ }
25183
+ o && !r && (e.fatArrowAt = s);
25184
+ }
25185
+ }
25186
+ var x = {
25187
+ atom: !0,
25188
+ number: !0,
25189
+ variable: !0,
25190
+ string: !0,
25191
+ regexp: !0,
25192
+ this: !0,
25193
+ import: !0,
25194
+ "jsonld-keyword": !0,
25195
+ };
25196
+ function k(t, e, n, i, r, o) {
25197
+ (this.indented = t),
25198
+ (this.column = e),
25199
+ (this.type = n),
25200
+ (this.prev = r),
25201
+ (this.info = o),
25202
+ null != i && (this.align = i);
25203
+ }
25204
+ function b(t, e) {
25205
+ if (!c) return !1;
25206
+ for (var n = t.localVars; n; n = n.next)
25207
+ if (n.name == e) return !0;
25208
+ for (var i = t.context; i; i = i.prev)
25209
+ for (n = i.vars; n; n = n.next) if (n.name == e) return !0;
25210
+ }
25211
+ function T(t, e, n, i, r) {
25212
+ var o = t.cc;
25213
+ for (
25214
+ C.state = t,
25215
+ C.stream = r,
25216
+ C.marked = null,
25217
+ C.cc = o,
25218
+ C.style = e,
25219
+ t.lexical.hasOwnProperty("align") || (t.lexical.align = !0);
25220
+ ;
25221
+
25222
+ )
25223
+ if ((o.length ? o.pop() : l ? z : U)(n, i)) {
25224
+ for (; o.length && o[o.length - 1].lex; ) o.pop()();
25225
+ return C.marked
25226
+ ? C.marked
25227
+ : "variable" == n && b(t, i)
25228
+ ? "variable-2"
25229
+ : e;
25230
+ }
25231
+ }
25232
+ var C = { state: null, column: null, marked: null, cc: null };
25233
+ function w() {
25234
+ for (var t = arguments.length - 1; t >= 0; t--)
25235
+ C.cc.push(arguments[t]);
25236
+ }
25237
+ function E() {
25238
+ return w.apply(null, arguments), !0;
25239
+ }
25240
+ function S(t, e) {
25241
+ for (var n = e; n; n = n.next) if (n.name == t) return !0;
25242
+ return !1;
25243
+ }
25244
+ function A(t) {
25245
+ var e = C.state;
25246
+ if (((C.marked = "def"), c)) {
25247
+ if (e.context)
25248
+ if ("var" == e.lexical.info && e.context && e.context.block) {
25249
+ var i = L(t, e.context);
25250
+ if (null != i) return void (e.context = i);
25251
+ } else if (!S(t, e.localVars))
25252
+ return void (e.localVars = new I(t, e.localVars));
25253
+ n.globalVars &&
25254
+ !S(t, e.globalVars) &&
25255
+ (e.globalVars = new I(t, e.globalVars));
25256
+ }
25257
+ }
25258
+ function L(t, e) {
25259
+ if (e) {
25260
+ if (e.block) {
25261
+ var n = L(t, e.prev);
25262
+ return n ? (n == e.prev ? e : new N(n, e.vars, !0)) : null;
25263
+ }
25264
+ return S(t, e.vars) ? e : new N(e.prev, new I(t, e.vars), !1);
25265
+ }
25266
+ return null;
25267
+ }
25268
+ function O(t) {
25269
+ return (
25270
+ "public" == t ||
25271
+ "private" == t ||
25272
+ "protected" == t ||
25273
+ "abstract" == t ||
25274
+ "readonly" == t
25275
+ );
25276
+ }
25277
+ function N(t, e, n) {
25278
+ (this.prev = t), (this.vars = e), (this.block = n);
25279
+ }
25280
+ function I(t, e) {
25281
+ (this.name = t), (this.next = e);
25282
+ }
25283
+ var M = new I("this", new I("arguments", null));
25284
+ function $() {
25285
+ (C.state.context = new N(C.state.context, C.state.localVars, !1)),
25286
+ (C.state.localVars = M);
25287
+ }
25288
+ function R() {
25289
+ (C.state.context = new N(C.state.context, C.state.localVars, !0)),
25290
+ (C.state.localVars = null);
25291
+ }
25292
+ function D() {
25293
+ (C.state.localVars = C.state.context.vars),
25294
+ (C.state.context = C.state.context.prev);
25295
+ }
25296
+ function P(t, e) {
25297
+ var n = function () {
25298
+ var n = C.state,
25299
+ i = n.indented;
25300
+ if ("stat" == n.lexical.type) i = n.lexical.indented;
25301
+ else
25302
+ for (
25303
+ var r = n.lexical;
25304
+ r && ")" == r.type && r.align;
25305
+ r = r.prev
25306
+ )
25307
+ i = r.indented;
25308
+ n.lexical = new k(i, C.stream.column(), t, null, n.lexical, e);
25309
+ };
25310
+ return (n.lex = !0), n;
25311
+ }
25312
+ function F() {
25313
+ var t = C.state;
25314
+ t.lexical.prev &&
25315
+ (")" == t.lexical.type && (t.indented = t.lexical.indented),
25316
+ (t.lexical = t.lexical.prev));
25317
+ }
25318
+ function B(t) {
25319
+ return function e(n) {
25320
+ return n == t
25321
+ ? E()
25322
+ : ";" == t || "}" == n || ")" == n || "]" == n
25323
+ ? w()
25324
+ : E(e);
25325
+ };
25326
+ }
25327
+ function U(t, e) {
25328
+ return "var" == t
25329
+ ? E(P("vardef", e), Ct, B(";"), F)
25330
+ : "keyword a" == t
25331
+ ? E(P("form"), j, U, F)
25332
+ : "keyword b" == t
25333
+ ? E(P("form"), U, F)
25334
+ : "keyword d" == t
25335
+ ? C.stream.match(/^\s*$/, !1)
25336
+ ? E()
25337
+ : E(P("stat"), q, B(";"), F)
25338
+ : "debugger" == t
25339
+ ? E(B(";"))
25340
+ : "{" == t
25341
+ ? E(P("}"), R, lt, F, D)
25342
+ : ";" == t
25343
+ ? E()
25344
+ : "if" == t
25345
+ ? ("else" == C.state.lexical.info &&
25346
+ C.state.cc[C.state.cc.length - 1] == F &&
25347
+ C.state.cc.pop()(),
25348
+ E(P("form"), j, U, F, Ot))
25349
+ : "function" == t
25350
+ ? E($t)
25351
+ : "for" == t
25352
+ ? E(P("form"), R, Nt, U, D, F)
25353
+ : "class" == t || (h && "interface" == e)
25354
+ ? ((C.marked = "keyword"),
25355
+ E(P("form", "class" == t ? t : e), Bt, F))
25356
+ : "variable" == t
25357
+ ? h && "declare" == e
25358
+ ? ((C.marked = "keyword"), E(U))
25359
+ : h &&
25360
+ ("module" == e || "enum" == e || "type" == e) &&
25361
+ C.stream.match(/^\s*\w/, !1)
25362
+ ? ((C.marked = "keyword"),
25363
+ "enum" == e
25364
+ ? E(Qt)
25365
+ : "type" == e
25366
+ ? E(Dt, B("operator"), dt, B(";"))
25367
+ : E(P("form"), wt, B("{"), P("}"), lt, F, F))
25368
+ : h && "namespace" == e
25369
+ ? ((C.marked = "keyword"), E(P("form"), z, U, F))
25370
+ : h && "abstract" == e
25371
+ ? ((C.marked = "keyword"), E(U))
25372
+ : E(P("stat"), et)
25373
+ : "switch" == t
25374
+ ? E(P("form"), j, B("{"), P("}", "switch"), R, lt, F, F, D)
25375
+ : "case" == t
25376
+ ? E(z, B(":"))
25377
+ : "default" == t
25378
+ ? E(B(":"))
25379
+ : "catch" == t
25380
+ ? E(P("form"), $, H, U, F, D)
25381
+ : "export" == t
25382
+ ? E(P("stat"), Wt, F)
25383
+ : "import" == t
25384
+ ? E(P("stat"), Gt, F)
25385
+ : "async" == t
25386
+ ? E(U)
25387
+ : "@" == e
25388
+ ? E(z, U)
25389
+ : w(P("stat"), z, B(";"), F);
25390
+ }
25391
+ function H(t) {
25392
+ if ("(" == t) return E(Pt, B(")"));
25393
+ }
25394
+ function z(t, e) {
25395
+ return G(t, e, !1);
25396
+ }
25397
+ function W(t, e) {
25398
+ return G(t, e, !0);
25399
+ }
25400
+ function j(t) {
25401
+ return "(" != t ? w() : E(P(")"), q, B(")"), F);
25402
+ }
25403
+ function G(t, e, n) {
25404
+ if (C.state.fatArrowAt == C.stream.start) {
25405
+ var i = n ? Z : Q;
25406
+ if ("(" == t)
25407
+ return E($, P(")"), st(Pt, ")"), F, B("=>"), i, D);
25408
+ if ("variable" == t) return w($, wt, B("=>"), i, D);
25409
+ }
25410
+ var r = n ? Y : V;
25411
+ return x.hasOwnProperty(t)
25412
+ ? E(r)
25413
+ : "function" == t
25414
+ ? E($t, r)
25415
+ : "class" == t || (h && "interface" == e)
25416
+ ? ((C.marked = "keyword"), E(P("form"), Ft, F))
25417
+ : "keyword c" == t || "async" == t
25418
+ ? E(n ? W : z)
25419
+ : "(" == t
25420
+ ? E(P(")"), q, B(")"), F, r)
25421
+ : "operator" == t || "spread" == t
25422
+ ? E(n ? W : z)
25423
+ : "[" == t
25424
+ ? E(P("]"), Xt, F, r)
25425
+ : "{" == t
25426
+ ? at(it, "}", null, r)
25427
+ : "quasi" == t
25428
+ ? w(K, r)
25429
+ : "new" == t
25430
+ ? E(
25431
+ (function (t) {
25432
+ return function (e) {
25433
+ return "." == e
25434
+ ? E(t ? tt : J)
25435
+ : "variable" == e && h
25436
+ ? E(kt, t ? Y : V)
25437
+ : w(t ? W : z);
25438
+ };
25439
+ })(n)
25440
+ )
25441
+ : E();
25442
+ }
25443
+ function q(t) {
25444
+ return t.match(/[;\}\)\],]/) ? w() : w(z);
25445
+ }
25446
+ function V(t, e) {
25447
+ return "," == t ? E(q) : Y(t, e, !1);
25448
+ }
25449
+ function Y(t, e, n) {
25450
+ var i = 0 == n ? V : Y,
25451
+ r = 0 == n ? z : W;
25452
+ return "=>" == t
25453
+ ? E($, n ? Z : Q, D)
25454
+ : "operator" == t
25455
+ ? /\+\+|--/.test(e) || (h && "!" == e)
25456
+ ? E(i)
25457
+ : h &&
25458
+ "<" == e &&
25459
+ C.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, !1)
25460
+ ? E(P(">"), st(dt, ">"), F, i)
25461
+ : "?" == e
25462
+ ? E(z, B(":"), r)
25463
+ : E(r)
25464
+ : "quasi" == t
25465
+ ? w(K, i)
25466
+ : ";" != t
25467
+ ? "(" == t
25468
+ ? at(W, ")", "call", i)
25469
+ : "." == t
25470
+ ? E(nt, i)
25471
+ : "[" == t
25472
+ ? E(P("]"), q, B("]"), F, i)
25473
+ : h && "as" == e
25474
+ ? ((C.marked = "keyword"), E(dt, i))
25475
+ : "regexp" == t
25476
+ ? ((C.state.lastType = C.marked = "operator"),
25477
+ C.stream.backUp(C.stream.pos - C.stream.start - 1),
25478
+ E(r))
25479
+ : void 0
25480
+ : void 0;
25481
+ }
25482
+ function K(t, e) {
25483
+ return "quasi" != t
25484
+ ? w()
25485
+ : "${" != e.slice(e.length - 2)
25486
+ ? E(K)
25487
+ : E(q, X);
25488
+ }
25489
+ function X(t) {
25490
+ if ("}" == t)
25491
+ return (C.marked = "string-2"), (C.state.tokenize = _), E(K);
25492
+ }
25493
+ function Q(t) {
25494
+ return y(C.stream, C.state), w("{" == t ? U : z);
25495
+ }
25496
+ function Z(t) {
25497
+ return y(C.stream, C.state), w("{" == t ? U : W);
25498
+ }
25499
+ function J(t, e) {
25500
+ if ("target" == e) return (C.marked = "keyword"), E(V);
25501
+ }
25502
+ function tt(t, e) {
25503
+ if ("target" == e) return (C.marked = "keyword"), E(Y);
25504
+ }
25505
+ function et(t) {
25506
+ return ":" == t ? E(F, U) : w(V, B(";"), F);
25507
+ }
25508
+ function nt(t) {
25509
+ if ("variable" == t) return (C.marked = "property"), E();
25510
+ }
25511
+ function it(t, e) {
25512
+ return "async" == t
25513
+ ? ((C.marked = "property"), E(it))
25514
+ : "variable" == t || "keyword" == C.style
25515
+ ? ((C.marked = "property"),
25516
+ "get" == e || "set" == e
25517
+ ? E(rt)
25518
+ : (h &&
25519
+ C.state.fatArrowAt == C.stream.start &&
25520
+ (n = C.stream.match(/^\s*:\s*/, !1)) &&
25521
+ (C.state.fatArrowAt = C.stream.pos + n[0].length),
25522
+ E(ot)))
25523
+ : "number" == t || "string" == t
25524
+ ? ((C.marked = a ? "property" : C.style + " property"), E(ot))
25525
+ : "jsonld-keyword" == t
25526
+ ? E(ot)
25527
+ : h && O(e)
25528
+ ? ((C.marked = "keyword"), E(it))
25529
+ : "[" == t
25530
+ ? E(z, ct, B("]"), ot)
25531
+ : "spread" == t
25532
+ ? E(W, ot)
25533
+ : "*" == e
25534
+ ? ((C.marked = "keyword"), E(it))
25535
+ : ":" == t
25536
+ ? w(ot)
25537
+ : void 0;
25538
+ var n;
25539
+ }
25540
+ function rt(t) {
25541
+ return "variable" != t ? w(ot) : ((C.marked = "property"), E($t));
25542
+ }
25543
+ function ot(t) {
25544
+ return ":" == t ? E(W) : "(" == t ? w($t) : void 0;
25545
+ }
25546
+ function st(t, e, n) {
25547
+ function i(r, o) {
25548
+ if (n ? n.indexOf(r) > -1 : "," == r) {
25549
+ var s = C.state.lexical;
25550
+ return (
25551
+ "call" == s.info && (s.pos = (s.pos || 0) + 1),
25552
+ E(function (n, i) {
25553
+ return n == e || i == e ? w() : w(t);
25554
+ }, i)
25555
+ );
25556
+ }
25557
+ return r == e || o == e
25558
+ ? E()
25559
+ : n && n.indexOf(";") > -1
25560
+ ? w(t)
25561
+ : E(B(e));
25562
+ }
25563
+ return function (n, r) {
25564
+ return n == e || r == e ? E() : w(t, i);
25565
+ };
25566
+ }
25567
+ function at(t, e, n) {
25568
+ for (var i = 3; i < arguments.length; i++)
25569
+ C.cc.push(arguments[i]);
25570
+ return E(P(e, n), st(t, e), F);
25571
+ }
25572
+ function lt(t) {
25573
+ return "}" == t ? E() : w(U, lt);
25574
+ }
25575
+ function ct(t, e) {
25576
+ if (h) {
25577
+ if (":" == t) return E(dt);
25578
+ if ("?" == e) return E(ct);
25579
+ }
25580
+ }
25581
+ function ht(t, e) {
25582
+ if (h && (":" == t || "in" == e)) return E(dt);
25583
+ }
25584
+ function ut(t) {
25585
+ if (h && ":" == t)
25586
+ return C.stream.match(/^\s*\w+\s+is\b/, !1)
25587
+ ? E(z, ft, dt)
25588
+ : E(dt);
25589
+ }
25590
+ function ft(t, e) {
25591
+ if ("is" == e) return (C.marked = "keyword"), E();
25592
+ }
25593
+ function dt(t, e) {
25594
+ return "keyof" == e ||
25595
+ "typeof" == e ||
25596
+ "infer" == e ||
25597
+ "readonly" == e
25598
+ ? ((C.marked = "keyword"), E("typeof" == e ? W : dt))
25599
+ : "variable" == t || "void" == e
25600
+ ? ((C.marked = "type"), E(xt))
25601
+ : "|" == e || "&" == e
25602
+ ? E(dt)
25603
+ : "string" == t || "number" == t || "atom" == t
25604
+ ? E(xt)
25605
+ : "[" == t
25606
+ ? E(P("]"), st(dt, "]", ","), F, xt)
25607
+ : "{" == t
25608
+ ? E(P("}"), gt, F, xt)
25609
+ : "(" == t
25610
+ ? E(st(yt, ")"), pt, xt)
25611
+ : "<" == t
25612
+ ? E(st(dt, ">"), dt)
25613
+ : "quasi" == t
25614
+ ? w(vt, xt)
25615
+ : void 0;
25616
+ }
25617
+ function pt(t) {
25618
+ if ("=>" == t) return E(dt);
25619
+ }
25620
+ function gt(t) {
25621
+ return t.match(/[\}\)\]]/)
25622
+ ? E()
25623
+ : "," == t || ";" == t
25624
+ ? E(gt)
25625
+ : w(mt, gt);
25626
+ }
25627
+ function mt(t, e) {
25628
+ return "variable" == t || "keyword" == C.style
25629
+ ? ((C.marked = "property"), E(mt))
25630
+ : "?" == e || "number" == t || "string" == t
25631
+ ? E(mt)
25632
+ : ":" == t
25633
+ ? E(dt)
25634
+ : "[" == t
25635
+ ? E(B("variable"), ht, B("]"), mt)
25636
+ : "(" == t
25637
+ ? w(Rt, mt)
25638
+ : t.match(/[;\}\)\],]/)
25639
+ ? void 0
25640
+ : E();
25641
+ }
25642
+ function vt(t, e) {
25643
+ return "quasi" != t
25644
+ ? w()
25645
+ : "${" != e.slice(e.length - 2)
25646
+ ? E(vt)
25647
+ : E(dt, _t);
25648
+ }
25649
+ function _t(t) {
25650
+ if ("}" == t)
25651
+ return (C.marked = "string-2"), (C.state.tokenize = _), E(vt);
25652
+ }
25653
+ function yt(t, e) {
25654
+ return ("variable" == t && C.stream.match(/^\s*[?:]/, !1)) ||
25655
+ "?" == e
25656
+ ? E(yt)
25657
+ : ":" == t
25658
+ ? E(dt)
25659
+ : "spread" == t
25660
+ ? E(yt)
25661
+ : w(dt);
25662
+ }
25663
+ function xt(t, e) {
25664
+ return "<" == e
25665
+ ? E(P(">"), st(dt, ">"), F, xt)
25666
+ : "|" == e || "." == t || "&" == e
25667
+ ? E(dt)
25668
+ : "[" == t
25669
+ ? E(dt, B("]"), xt)
25670
+ : "extends" == e || "implements" == e
25671
+ ? ((C.marked = "keyword"), E(dt))
25672
+ : "?" == e
25673
+ ? E(dt, B(":"), dt)
25674
+ : void 0;
25675
+ }
25676
+ function kt(t, e) {
25677
+ if ("<" == e) return E(P(">"), st(dt, ">"), F, xt);
25678
+ }
25679
+ function bt() {
25680
+ return w(dt, Tt);
25681
+ }
25682
+ function Tt(t, e) {
25683
+ if ("=" == e) return E(dt);
25684
+ }
25685
+ function Ct(t, e) {
25686
+ return "enum" == e
25687
+ ? ((C.marked = "keyword"), E(Qt))
25688
+ : w(wt, ct, At, Lt);
25689
+ }
25690
+ function wt(t, e) {
25691
+ return h && O(e)
25692
+ ? ((C.marked = "keyword"), E(wt))
25693
+ : "variable" == t
25694
+ ? (A(e), E())
25695
+ : "spread" == t
25696
+ ? E(wt)
25697
+ : "[" == t
25698
+ ? at(St, "]")
25699
+ : "{" == t
25700
+ ? at(Et, "}")
25701
+ : void 0;
25702
+ }
25703
+ function Et(t, e) {
25704
+ return "variable" != t || C.stream.match(/^\s*:/, !1)
25705
+ ? ("variable" == t && (C.marked = "property"),
25706
+ "spread" == t
25707
+ ? E(wt)
25708
+ : "}" == t
25709
+ ? w()
25710
+ : "[" == t
25711
+ ? E(z, B("]"), B(":"), Et)
25712
+ : E(B(":"), wt, At))
25713
+ : (A(e), E(At));
25714
+ }
25715
+ function St() {
25716
+ return w(wt, At);
25717
+ }
25718
+ function At(t, e) {
25719
+ if ("=" == e) return E(W);
25720
+ }
25721
+ function Lt(t) {
25722
+ if ("," == t) return E(Ct);
25723
+ }
25724
+ function Ot(t, e) {
25725
+ if ("keyword b" == t && "else" == e)
25726
+ return E(P("form", "else"), U, F);
25727
+ }
25728
+ function Nt(t, e) {
25729
+ return "await" == e
25730
+ ? E(Nt)
25731
+ : "(" == t
25732
+ ? E(P(")"), It, F)
25733
+ : void 0;
25734
+ }
25735
+ function It(t) {
25736
+ return "var" == t ? E(Ct, Mt) : "variable" == t ? E(Mt) : w(Mt);
25737
+ }
25738
+ function Mt(t, e) {
25739
+ return ")" == t
25740
+ ? E()
25741
+ : ";" == t
25742
+ ? E(Mt)
25743
+ : "in" == e || "of" == e
25744
+ ? ((C.marked = "keyword"), E(z, Mt))
25745
+ : w(z, Mt);
25746
+ }
25747
+ function $t(t, e) {
25748
+ return "*" == e
25749
+ ? ((C.marked = "keyword"), E($t))
25750
+ : "variable" == t
25751
+ ? (A(e), E($t))
25752
+ : "(" == t
25753
+ ? E($, P(")"), st(Pt, ")"), F, ut, U, D)
25754
+ : h && "<" == e
25755
+ ? E(P(">"), st(bt, ">"), F, $t)
25756
+ : void 0;
25757
+ }
25758
+ function Rt(t, e) {
25759
+ return "*" == e
25760
+ ? ((C.marked = "keyword"), E(Rt))
25761
+ : "variable" == t
25762
+ ? (A(e), E(Rt))
25763
+ : "(" == t
25764
+ ? E($, P(")"), st(Pt, ")"), F, ut, D)
25765
+ : h && "<" == e
25766
+ ? E(P(">"), st(bt, ">"), F, Rt)
25767
+ : void 0;
25768
+ }
25769
+ function Dt(t, e) {
25770
+ return "keyword" == t || "variable" == t
25771
+ ? ((C.marked = "type"), E(Dt))
25772
+ : "<" == e
25773
+ ? E(P(">"), st(bt, ">"), F)
25774
+ : void 0;
25775
+ }
25776
+ function Pt(t, e) {
25777
+ return (
25778
+ "@" == e && E(z, Pt),
25779
+ "spread" == t
25780
+ ? E(Pt)
25781
+ : h && O(e)
25782
+ ? ((C.marked = "keyword"), E(Pt))
25783
+ : h && "this" == t
25784
+ ? E(ct, At)
25785
+ : w(wt, ct, At)
25786
+ );
25787
+ }
25788
+ function Ft(t, e) {
25789
+ return "variable" == t ? Bt(t, e) : Ut(t, e);
25790
+ }
25791
+ function Bt(t, e) {
25792
+ if ("variable" == t) return A(e), E(Ut);
25793
+ }
25794
+ function Ut(t, e) {
25795
+ return "<" == e
25796
+ ? E(P(">"), st(bt, ">"), F, Ut)
25797
+ : "extends" == e || "implements" == e || (h && "," == t)
25798
+ ? ("implements" == e && (C.marked = "keyword"),
25799
+ E(h ? dt : z, Ut))
25800
+ : "{" == t
25801
+ ? E(P("}"), Ht, F)
25802
+ : void 0;
25803
+ }
25804
+ function Ht(t, e) {
25805
+ return "async" == t ||
25806
+ ("variable" == t &&
25807
+ ("static" == e || "get" == e || "set" == e || (h && O(e))) &&
25808
+ C.stream.match(/^\s+[\w$\xa1-\uffff]/, !1))
25809
+ ? ((C.marked = "keyword"), E(Ht))
25810
+ : "variable" == t || "keyword" == C.style
25811
+ ? ((C.marked = "property"), E(zt, Ht))
25812
+ : "number" == t || "string" == t
25813
+ ? E(zt, Ht)
25814
+ : "[" == t
25815
+ ? E(z, ct, B("]"), zt, Ht)
25816
+ : "*" == e
25817
+ ? ((C.marked = "keyword"), E(Ht))
25818
+ : h && "(" == t
25819
+ ? w(Rt, Ht)
25820
+ : ";" == t || "," == t
25821
+ ? E(Ht)
25822
+ : "}" == t
25823
+ ? E()
25824
+ : "@" == e
25825
+ ? E(z, Ht)
25826
+ : void 0;
25827
+ }
25828
+ function zt(t, e) {
25829
+ if ("!" == e) return E(zt);
25830
+ if ("?" == e) return E(zt);
25831
+ if (":" == t) return E(dt, At);
25832
+ if ("=" == e) return E(W);
25833
+ var n = C.state.lexical.prev;
25834
+ return w(n && "interface" == n.info ? Rt : $t);
25835
+ }
25836
+ function Wt(t, e) {
25837
+ return "*" == e
25838
+ ? ((C.marked = "keyword"), E(Kt, B(";")))
25839
+ : "default" == e
25840
+ ? ((C.marked = "keyword"), E(z, B(";")))
25841
+ : "{" == t
25842
+ ? E(st(jt, "}"), Kt, B(";"))
25843
+ : w(U);
25844
+ }
25845
+ function jt(t, e) {
25846
+ return "as" == e
25847
+ ? ((C.marked = "keyword"), E(B("variable")))
25848
+ : "variable" == t
25849
+ ? w(W, jt)
25850
+ : void 0;
25851
+ }
25852
+ function Gt(t) {
25853
+ return "string" == t
25854
+ ? E()
25855
+ : "(" == t
25856
+ ? w(z)
25857
+ : "." == t
25858
+ ? w(V)
25859
+ : w(qt, Vt, Kt);
25860
+ }
25861
+ function qt(t, e) {
25862
+ return "{" == t
25863
+ ? at(qt, "}")
25864
+ : ("variable" == t && A(e),
25865
+ "*" == e && (C.marked = "keyword"),
25866
+ E(Yt));
25867
+ }
25868
+ function Vt(t) {
25869
+ if ("," == t) return E(qt, Vt);
25870
+ }
25871
+ function Yt(t, e) {
25872
+ if ("as" == e) return (C.marked = "keyword"), E(qt);
25873
+ }
25874
+ function Kt(t, e) {
25875
+ if ("from" == e) return (C.marked = "keyword"), E(z);
25876
+ }
25877
+ function Xt(t) {
25878
+ return "]" == t ? E() : w(st(W, "]"));
25879
+ }
25880
+ function Qt() {
25881
+ return w(P("form"), wt, B("{"), P("}"), st(Zt, "}"), F, F);
25882
+ }
25883
+ function Zt() {
25884
+ return w(wt, At);
25885
+ }
25886
+ function Jt(t, e, n) {
25887
+ return (
25888
+ (e.tokenize == m &&
25889
+ /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(
25890
+ e.lastType
25891
+ )) ||
25892
+ ("quasi" == e.lastType &&
25893
+ /\{\s*$/.test(t.string.slice(0, t.pos - (n || 0))))
25894
+ );
25895
+ }
25896
+ return (
25897
+ (D.lex = !0),
25898
+ (F.lex = !0),
25899
+ {
25900
+ startState: function (t) {
25901
+ var e = {
25902
+ tokenize: m,
25903
+ lastType: "sof",
25904
+ cc: [],
25905
+ lexical: new k((t || 0) - o, 0, "block", !1),
25906
+ localVars: n.localVars,
25907
+ context: n.localVars && new N(null, null, !1),
25908
+ indented: t || 0,
25909
+ };
25910
+ return (
25911
+ n.globalVars &&
25912
+ "object" == typeof n.globalVars &&
25913
+ (e.globalVars = n.globalVars),
25914
+ e
25915
+ );
25916
+ },
25917
+ token: function (t, e) {
25918
+ if (
25919
+ (t.sol() &&
25920
+ (e.lexical.hasOwnProperty("align") ||
25921
+ (e.lexical.align = !1),
25922
+ (e.indented = t.indentation()),
25923
+ y(t, e)),
25924
+ e.tokenize != v && t.eatSpace())
25925
+ )
25926
+ return null;
25927
+ var n = e.tokenize(t, e);
25928
+ return "comment" == i
25929
+ ? n
25930
+ : ((e.lastType =
25931
+ "operator" != i || ("++" != r && "--" != r)
25932
+ ? i
25933
+ : "incdec"),
25934
+ T(e, n, i, r, t));
25935
+ },
25936
+ indent: function (e, i) {
25937
+ if (e.tokenize == v || e.tokenize == _) return t.Pass;
25938
+ if (e.tokenize != m) return 0;
25939
+ var r,
25940
+ a = i && i.charAt(0),
25941
+ l = e.lexical;
25942
+ if (!/^\s*else\b/.test(i))
25943
+ for (var c = e.cc.length - 1; c >= 0; --c) {
25944
+ var h = e.cc[c];
25945
+ if (h == F) l = l.prev;
25946
+ else if (h != Ot && h != D) break;
25947
+ }
25948
+ for (
25949
+ ;
25950
+ ("stat" == l.type || "form" == l.type) &&
25951
+ ("}" == a ||
25952
+ ((r = e.cc[e.cc.length - 1]) &&
25953
+ (r == V || r == Y) &&
25954
+ !/^[,\.=+\-*:?[\(]/.test(i)));
25955
+
25956
+ )
25957
+ l = l.prev;
25958
+ s && ")" == l.type && "stat" == l.prev.type && (l = l.prev);
25959
+ var u = l.type,
25960
+ f = a == u;
25961
+ return "vardef" == u
25962
+ ? l.indented +
25963
+ ("operator" == e.lastType || "," == e.lastType
25964
+ ? l.info.length + 1
25965
+ : 0)
25966
+ : "form" == u && "{" == a
25967
+ ? l.indented
25968
+ : "form" == u
25969
+ ? l.indented + o
25970
+ : "stat" == u
25971
+ ? l.indented +
25972
+ ((function (t, e) {
25973
+ return (
25974
+ "operator" == t.lastType ||
25975
+ "," == t.lastType ||
25976
+ d.test(e.charAt(0)) ||
25977
+ /[,.]/.test(e.charAt(0))
25978
+ );
25979
+ })(e, i)
25980
+ ? s || o
25981
+ : 0)
25982
+ : "switch" != l.info || f || 0 == n.doubleIndentSwitch
25983
+ ? l.align
25984
+ ? l.column + (f ? 0 : 1)
25985
+ : l.indented + (f ? 0 : o)
25986
+ : l.indented + (/^(?:case|default)\b/.test(i) ? o : 2 * o);
25987
+ },
25988
+ electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
25989
+ blockCommentStart: l ? null : "/*",
25990
+ blockCommentEnd: l ? null : "*/",
25991
+ blockCommentContinue: l ? null : " * ",
25992
+ lineComment: l ? null : "//",
25993
+ fold: "brace",
25994
+ closeBrackets: "()[]{}''\"\"``",
25995
+ helperType: l ? "json" : "javascript",
25996
+ jsonldMode: a,
25997
+ jsonMode: l,
25998
+ expressionAllowed: Jt,
25999
+ skipExpression: function (e) {
26000
+ T(e, "atom", "atom", "true", new t.StringStream("", 2, null));
26001
+ },
26002
+ }
26003
+ );
26004
+ }),
26005
+ t.registerHelper("wordChars", "javascript", /[\w$]/),
26006
+ t.defineMIME("text/javascript", "javascript"),
26007
+ t.defineMIME("text/ecmascript", "javascript"),
26008
+ t.defineMIME("application/javascript", "javascript"),
26009
+ t.defineMIME("application/x-javascript", "javascript"),
26010
+ t.defineMIME("application/ecmascript", "javascript"),
26011
+ t.defineMIME("application/json", { name: "javascript", json: !0 }),
26012
+ t.defineMIME("application/x-json", {
26013
+ name: "javascript",
26014
+ json: !0,
26015
+ }),
26016
+ t.defineMIME("application/manifest+json", {
26017
+ name: "javascript",
26018
+ json: !0,
26019
+ }),
26020
+ t.defineMIME("application/ld+json", {
26021
+ name: "javascript",
26022
+ jsonld: !0,
26023
+ }),
26024
+ t.defineMIME("text/typescript", {
26025
+ name: "javascript",
26026
+ typescript: !0,
26027
+ }),
26028
+ t.defineMIME("application/typescript", {
26029
+ name: "javascript",
26030
+ typescript: !0,
26031
+ });
26032
+ }),
26033
+ "object" == typeof n && "object" == typeof e
26034
+ ? i(t("../../lib/codemirror"))
26035
+ : "function" == typeof define && define.amd
26036
+ ? define(["../../lib/codemirror"], i)
26037
+ : i(CodeMirror);
26038
+ },
26039
+ { "../../lib/codemirror": 13 },
26040
+ ],
26041
+ 18: [
26042
+ function (t, e, n) {
26043
+ var i;
26044
+ (i = function (t) {
26045
+ "use strict";
26046
+ function e(t) {
26047
+ for (var e = {}, n = t.split(" "), i = 0; i < n.length; ++i)
26048
+ e[n[i]] = !0;
26049
+ return e;
26050
+ }
26051
+ function n(t, e, r) {
26052
+ return 0 == t.length
26053
+ ? i(e)
26054
+ : function (o, s) {
26055
+ for (var a = t[0], l = 0; l < a.length; l++)
26056
+ if (o.match(a[l][0]))
26057
+ return (s.tokenize = n(t.slice(1), e)), a[l][1];
26058
+ return (s.tokenize = i(e, r)), "string";
26059
+ };
26060
+ }
26061
+ function i(t, e) {
26062
+ return function (i, r) {
26063
+ return (function (t, e, i, r) {
26064
+ if ((!1 !== r && t.match("${", !1)) || t.match("{$", !1))
26065
+ return (e.tokenize = null), "string";
26066
+ if (!1 !== r && t.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))
26067
+ return (
26068
+ t.match("[", !1) &&
26069
+ (e.tokenize = n(
26070
+ [
26071
+ [["[", null]],
26072
+ [
26073
+ [/\d[\w\.]*/, "number"],
26074
+ [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
26075
+ [/[\w\$]+/, "variable"],
26076
+ ],
26077
+ [["]", null]],
26078
+ ],
26079
+ i,
26080
+ r
26081
+ )),
26082
+ t.match(/^->\w/, !1) &&
26083
+ (e.tokenize = n(
26084
+ [[["->", null]], [[/[\w]+/, "variable"]]],
26085
+ i,
26086
+ r
26087
+ )),
26088
+ "variable-2"
26089
+ );
26090
+ for (
26091
+ var o = !1;
26092
+ !t.eol() &&
26093
+ (o ||
26094
+ !1 === r ||
26095
+ (!t.match("{$", !1) &&
26096
+ !t.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, !1)));
26097
+
26098
+ ) {
26099
+ if (!o && t.match(i)) {
26100
+ (e.tokenize = null), e.tokStack.pop(), e.tokStack.pop();
26101
+ break;
26102
+ }
26103
+ o = "\\" == t.next() && !o;
26104
+ }
26105
+ return "string";
26106
+ })(i, r, t, e);
26107
+ };
26108
+ }
26109
+ var r =
26110
+ "abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",
26111
+ o =
26112
+ "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",
26113
+ s =
26114
+ "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
26115
+ t.registerHelper("hintWords", "php", [r, o, s].join(" ").split(" ")),
26116
+ t.registerHelper("wordChars", "php", /[\w$]/);
26117
+ var a = {
26118
+ name: "clike",
26119
+ helperType: "php",
26120
+ keywords: e(r),
26121
+ blockKeywords: e(
26122
+ "catch do else elseif for foreach if switch try while finally"
26123
+ ),
26124
+ defKeywords: e("class function interface namespace trait"),
26125
+ atoms: e(o),
26126
+ builtin: e(s),
26127
+ multiLineStrings: !0,
26128
+ hooks: {
26129
+ $: function (t) {
26130
+ return t.eatWhile(/[\w\$_]/), "variable-2";
26131
+ },
26132
+ "<": function (t, e) {
26133
+ var n;
26134
+ if ((n = t.match(/^<<\s*/))) {
26135
+ var r = t.eat(/['"]/);
26136
+ t.eatWhile(/[\w\.]/);
26137
+ var o = t.current().slice(n[0].length + (r ? 2 : 1));
26138
+ if ((r && t.eat(r), o))
26139
+ return (
26140
+ (e.tokStack || (e.tokStack = [])).push(o, 0),
26141
+ (e.tokenize = i(o, "'" != r)),
26142
+ "string"
26143
+ );
26144
+ }
26145
+ return !1;
26146
+ },
26147
+ "#": function (t) {
26148
+ for (; !t.eol() && !t.match("?>", !1); ) t.next();
26149
+ return "comment";
26150
+ },
26151
+ "/": function (t) {
26152
+ if (t.eat("/")) {
26153
+ for (; !t.eol() && !t.match("?>", !1); ) t.next();
26154
+ return "comment";
26155
+ }
26156
+ return !1;
26157
+ },
26158
+ '"': function (t, e) {
26159
+ return (
26160
+ (e.tokStack || (e.tokStack = [])).push('"', 0),
26161
+ (e.tokenize = i('"')),
26162
+ "string"
26163
+ );
26164
+ },
26165
+ "{": function (t, e) {
26166
+ return (
26167
+ e.tokStack &&
26168
+ e.tokStack.length &&
26169
+ e.tokStack[e.tokStack.length - 1]++,
26170
+ !1
26171
+ );
26172
+ },
26173
+ "}": function (t, e) {
26174
+ return (
26175
+ e.tokStack &&
26176
+ e.tokStack.length > 0 &&
26177
+ !--e.tokStack[e.tokStack.length - 1] &&
26178
+ (e.tokenize = i(e.tokStack[e.tokStack.length - 2])),
26179
+ !1
26180
+ );
26181
+ },
26182
+ },
26183
+ };
26184
+ t.defineMode(
26185
+ "php",
26186
+ function (e, n) {
26187
+ var i = t.getMode(e, (n && n.htmlMode) || "text/html"),
26188
+ r = t.getMode(e, a);
26189
+ return {
26190
+ startState: function () {
26191
+ var e = t.startState(i),
26192
+ o = n.startOpen ? t.startState(r) : null;
26193
+ return {
26194
+ html: e,
26195
+ php: o,
26196
+ curMode: n.startOpen ? r : i,
26197
+ curState: n.startOpen ? o : e,
26198
+ pending: null,
26199
+ };
26200
+ },
26201
+ copyState: function (e) {
26202
+ var n,
26203
+ o = e.html,
26204
+ s = t.copyState(i, o),
26205
+ a = e.php,
26206
+ l = a && t.copyState(r, a);
26207
+ return (
26208
+ (n = e.curMode == i ? s : l),
26209
+ {
26210
+ html: s,
26211
+ php: l,
26212
+ curMode: e.curMode,
26213
+ curState: n,
26214
+ pending: e.pending,
26215
+ }
26216
+ );
26217
+ },
26218
+ token: function (e, n) {
26219
+ var o = n.curMode == r;
26220
+ if (
26221
+ (e.sol() &&
26222
+ n.pending &&
26223
+ '"' != n.pending &&
26224
+ "'" != n.pending &&
26225
+ (n.pending = null),
26226
+ o)
26227
+ )
26228
+ return o && null == n.php.tokenize && e.match("?>")
26229
+ ? ((n.curMode = i),
26230
+ (n.curState = n.html),
26231
+ n.php.context.prev || (n.php = null),
26232
+ "meta")
26233
+ : r.token(e, n.curState);
26234
+ if (e.match(/^<\?\w*/))
26235
+ return (
26236
+ (n.curMode = r),
26237
+ n.php ||
26238
+ (n.php = t.startState(r, i.indent(n.html, "", ""))),
26239
+ (n.curState = n.php),
26240
+ "meta"
26241
+ );
26242
+ if ('"' == n.pending || "'" == n.pending) {
26243
+ for (; !e.eol() && e.next() != n.pending; );
26244
+ var s = "string";
26245
+ } else
26246
+ n.pending && e.pos < n.pending.end
26247
+ ? ((e.pos = n.pending.end), (s = n.pending.style))
26248
+ : (s = i.token(e, n.curState));
26249
+ n.pending && (n.pending = null);
26250
+ var a,
26251
+ l = e.current(),
26252
+ c = l.search(/<\?/);
26253
+ return (
26254
+ -1 != c &&
26255
+ ("string" == s &&
26256
+ (a = l.match(/[\'\"]$/)) &&
26257
+ !/\?>/.test(l)
26258
+ ? (n.pending = a[0])
26259
+ : (n.pending = { end: e.pos, style: s }),
26260
+ e.backUp(l.length - c)),
26261
+ s
26262
+ );
26263
+ },
26264
+ indent: function (t, e, n) {
26265
+ return (t.curMode != r && /^\s*<\//.test(e)) ||
26266
+ (t.curMode == r && /^\?>/.test(e))
26267
+ ? i.indent(t.html, e, n)
26268
+ : t.curMode.indent(t.curState, e, n);
26269
+ },
26270
+ blockCommentStart: "/*",
26271
+ blockCommentEnd: "*/",
26272
+ lineComment: "//",
26273
+ innerMode: function (t) {
26274
+ return { state: t.curState, mode: t.curMode };
26275
+ },
26276
+ };
26277
+ },
26278
+ "htmlmixed",
26279
+ "clike"
26280
+ ),
26281
+ t.defineMIME("application/x-httpd-php", "php"),
26282
+ t.defineMIME("application/x-httpd-php-open", {
26283
+ name: "php",
26284
+ startOpen: !0,
26285
+ }),
26286
+ t.defineMIME("text/x-php", a);
26287
+ }),
26288
+ "object" == typeof n && "object" == typeof e
26289
+ ? i(
26290
+ t("../../lib/codemirror"),
26291
+ t("../htmlmixed/htmlmixed"),
26292
+ t("../clike/clike")
26293
+ )
26294
+ : "function" == typeof define && define.amd
26295
+ ? define(
26296
+ [
26297
+ "../../lib/codemirror",
26298
+ "../htmlmixed/htmlmixed",
26299
+ "../clike/clike",
26300
+ ],
26301
+ i
26302
+ )
26303
+ : i(CodeMirror);
26304
+ },
26305
+ {
26306
+ "../../lib/codemirror": 13,
26307
+ "../clike/clike": 14,
26308
+ "../htmlmixed/htmlmixed": 16,
26309
+ },
26310
+ ],
26311
+ 19: [
26312
+ function (t, e, n) {
26313
+ var i;
26314
+ (i = function (t) {
26315
+ "use strict";
26316
+ var e = {
26317
+ autoSelfClosers: {
26318
+ area: !0,
26319
+ base: !0,
26320
+ br: !0,
26321
+ col: !0,
26322
+ command: !0,
26323
+ embed: !0,
26324
+ frame: !0,
26325
+ hr: !0,
26326
+ img: !0,
26327
+ input: !0,
26328
+ keygen: !0,
26329
+ link: !0,
26330
+ meta: !0,
26331
+ param: !0,
26332
+ source: !0,
26333
+ track: !0,
26334
+ wbr: !0,
26335
+ menuitem: !0,
26336
+ },
26337
+ implicitlyClosed: {
26338
+ dd: !0,
26339
+ li: !0,
26340
+ optgroup: !0,
26341
+ option: !0,
26342
+ p: !0,
26343
+ rp: !0,
26344
+ rt: !0,
26345
+ tbody: !0,
26346
+ td: !0,
26347
+ tfoot: !0,
26348
+ th: !0,
26349
+ tr: !0,
26350
+ },
26351
+ contextGrabbers: {
26352
+ dd: { dd: !0, dt: !0 },
26353
+ dt: { dd: !0, dt: !0 },
26354
+ li: { li: !0 },
26355
+ option: { option: !0, optgroup: !0 },
26356
+ optgroup: { optgroup: !0 },
26357
+ p: {
26358
+ address: !0,
26359
+ article: !0,
26360
+ aside: !0,
26361
+ blockquote: !0,
26362
+ dir: !0,
26363
+ div: !0,
26364
+ dl: !0,
26365
+ fieldset: !0,
26366
+ footer: !0,
26367
+ form: !0,
26368
+ h1: !0,
26369
+ h2: !0,
26370
+ h3: !0,
26371
+ h4: !0,
26372
+ h5: !0,
26373
+ h6: !0,
26374
+ header: !0,
26375
+ hgroup: !0,
26376
+ hr: !0,
26377
+ menu: !0,
26378
+ nav: !0,
26379
+ ol: !0,
26380
+ p: !0,
26381
+ pre: !0,
26382
+ section: !0,
26383
+ table: !0,
26384
+ ul: !0,
26385
+ },
26386
+ rp: { rp: !0, rt: !0 },
26387
+ rt: { rp: !0, rt: !0 },
26388
+ tbody: { tbody: !0, tfoot: !0 },
26389
+ td: { td: !0, th: !0 },
26390
+ tfoot: { tbody: !0 },
26391
+ th: { td: !0, th: !0 },
26392
+ thead: { tbody: !0, tfoot: !0 },
26393
+ tr: { tr: !0 },
26394
+ },
26395
+ doNotIndent: { pre: !0 },
26396
+ allowUnquoted: !0,
26397
+ allowMissing: !0,
26398
+ caseFold: !0,
26399
+ },
26400
+ n = {
26401
+ autoSelfClosers: {},
26402
+ implicitlyClosed: {},
26403
+ contextGrabbers: {},
26404
+ doNotIndent: {},
26405
+ allowUnquoted: !1,
26406
+ allowMissing: !1,
26407
+ allowMissingTagName: !1,
26408
+ caseFold: !1,
26409
+ };
26410
+ t.defineMode("xml", function (i, r) {
26411
+ var o,
26412
+ s,
26413
+ a = i.indentUnit,
26414
+ l = {},
26415
+ c = r.htmlMode ? e : n;
26416
+ for (var h in c) l[h] = c[h];
26417
+ for (var h in r) l[h] = r[h];
26418
+ function u(t, e) {
26419
+ function n(n) {
26420
+ return (e.tokenize = n), n(t, e);
26421
+ }
26422
+ var i = t.next();
26423
+ return "<" == i
26424
+ ? t.eat("!")
26425
+ ? t.eat("[")
26426
+ ? t.match("CDATA[")
26427
+ ? n(d("atom", "]]>"))
26428
+ : null
26429
+ : t.match("--")
26430
+ ? n(d("comment", "--\x3e"))
26431
+ : t.match("DOCTYPE", !0, !0)
26432
+ ? (t.eatWhile(/[\w\._\-]/), n(p(1)))
26433
+ : null
26434
+ : t.eat("?")
26435
+ ? (t.eatWhile(/[\w\._\-]/),
26436
+ (e.tokenize = d("meta", "?>")),
26437
+ "meta")
26438
+ : ((o = t.eat("/") ? "closeTag" : "openTag"),
26439
+ (e.tokenize = f),
26440
+ "tag bracket")
26441
+ : "&" == i
26442
+ ? (
26443
+ t.eat("#")
26444
+ ? t.eat("x")
26445
+ ? t.eatWhile(/[a-fA-F\d]/) && t.eat(";")
26446
+ : t.eatWhile(/[\d]/) && t.eat(";")
26447
+ : t.eatWhile(/[\w\.\-:]/) && t.eat(";")
26448
+ )
26449
+ ? "atom"
26450
+ : "error"
26451
+ : (t.eatWhile(/[^&<]/), null);
26452
+ }
26453
+ function f(t, e) {
26454
+ var n,
26455
+ i,
26456
+ r = t.next();
26457
+ if (">" == r || ("/" == r && t.eat(">")))
26458
+ return (
26459
+ (e.tokenize = u),
26460
+ (o = ">" == r ? "endTag" : "selfcloseTag"),
26461
+ "tag bracket"
26462
+ );
26463
+ if ("=" == r) return (o = "equals"), null;
26464
+ if ("<" == r) {
26465
+ (e.tokenize = u),
26466
+ (e.state = _),
26467
+ (e.tagName = e.tagStart = null);
26468
+ var s = e.tokenize(t, e);
26469
+ return s ? s + " tag error" : "tag error";
26470
+ }
26471
+ return /[\'\"]/.test(r)
26472
+ ? ((e.tokenize =
26473
+ ((n = r),
26474
+ ((i = function (t, e) {
26475
+ for (; !t.eol(); )
26476
+ if (t.next() == n) {
26477
+ e.tokenize = f;
26478
+ break;
26479
+ }
26480
+ return "string";
26481
+ }).isInAttribute = !0),
26482
+ i)),
26483
+ (e.stringStartCol = t.column()),
26484
+ e.tokenize(t, e))
26485
+ : (t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word");
26486
+ }
26487
+ function d(t, e) {
26488
+ return function (n, i) {
26489
+ for (; !n.eol(); ) {
26490
+ if (n.match(e)) {
26491
+ i.tokenize = u;
26492
+ break;
26493
+ }
26494
+ n.next();
26495
+ }
26496
+ return t;
26497
+ };
26498
+ }
26499
+ function p(t) {
26500
+ return function (e, n) {
26501
+ for (var i; null != (i = e.next()); ) {
26502
+ if ("<" == i)
26503
+ return (n.tokenize = p(t + 1)), n.tokenize(e, n);
26504
+ if (">" == i) {
26505
+ if (1 == t) {
26506
+ n.tokenize = u;
26507
+ break;
26508
+ }
26509
+ return (n.tokenize = p(t - 1)), n.tokenize(e, n);
26510
+ }
26511
+ }
26512
+ return "meta";
26513
+ };
26514
+ }
26515
+ function g(t, e, n) {
26516
+ (this.prev = t.context),
26517
+ (this.tagName = e || ""),
26518
+ (this.indent = t.indented),
26519
+ (this.startOfLine = n),
26520
+ (l.doNotIndent.hasOwnProperty(e) ||
26521
+ (t.context && t.context.noIndent)) &&
26522
+ (this.noIndent = !0);
26523
+ }
26524
+ function m(t) {
26525
+ t.context && (t.context = t.context.prev);
26526
+ }
26527
+ function v(t, e) {
26528
+ for (var n; ; ) {
26529
+ if (!t.context) return;
26530
+ if (
26531
+ ((n = t.context.tagName),
26532
+ !l.contextGrabbers.hasOwnProperty(n) ||
26533
+ !l.contextGrabbers[n].hasOwnProperty(e))
26534
+ )
26535
+ return;
26536
+ m(t);
26537
+ }
26538
+ }
26539
+ function _(t, e, n) {
26540
+ return "openTag" == t
26541
+ ? ((n.tagStart = e.column()), y)
26542
+ : "closeTag" == t
26543
+ ? x
26544
+ : _;
26545
+ }
26546
+ function y(t, e, n) {
26547
+ return "word" == t
26548
+ ? ((n.tagName = e.current()), (s = "tag"), T)
26549
+ : l.allowMissingTagName && "endTag" == t
26550
+ ? ((s = "tag bracket"), T(t, 0, n))
26551
+ : ((s = "error"), y);
26552
+ }
26553
+ function x(t, e, n) {
26554
+ if ("word" == t) {
26555
+ var i = e.current();
26556
+ return (
26557
+ n.context &&
26558
+ n.context.tagName != i &&
26559
+ l.implicitlyClosed.hasOwnProperty(n.context.tagName) &&
26560
+ m(n),
26561
+ (n.context && n.context.tagName == i) || !1 === l.matchClosing
26562
+ ? ((s = "tag"), k)
26563
+ : ((s = "tag error"), b)
26564
+ );
26565
+ }
26566
+ return l.allowMissingTagName && "endTag" == t
26567
+ ? ((s = "tag bracket"), k(t, 0, n))
26568
+ : ((s = "error"), b);
26569
+ }
26570
+ function k(t, e, n) {
26571
+ return "endTag" != t ? ((s = "error"), k) : (m(n), _);
26572
+ }
26573
+ function b(t, e, n) {
26574
+ return (s = "error"), k(t, 0, n);
26575
+ }
26576
+ function T(t, e, n) {
26577
+ if ("word" == t) return (s = "attribute"), C;
26578
+ if ("endTag" == t || "selfcloseTag" == t) {
26579
+ var i = n.tagName,
26580
+ r = n.tagStart;
26581
+ return (
26582
+ (n.tagName = n.tagStart = null),
26583
+ "selfcloseTag" == t || l.autoSelfClosers.hasOwnProperty(i)
26584
+ ? v(n, i)
26585
+ : (v(n, i), (n.context = new g(n, i, r == n.indented))),
26586
+ _
26587
+ );
26588
+ }
26589
+ return (s = "error"), T;
26590
+ }
26591
+ function C(t, e, n) {
26592
+ return "equals" == t
26593
+ ? w
26594
+ : (l.allowMissing || (s = "error"), T(t, 0, n));
26595
+ }
26596
+ function w(t, e, n) {
26597
+ return "string" == t
26598
+ ? E
26599
+ : "word" == t && l.allowUnquoted
26600
+ ? ((s = "string"), T)
26601
+ : ((s = "error"), T(t, 0, n));
26602
+ }
26603
+ function E(t, e, n) {
26604
+ return "string" == t ? E : T(t, 0, n);
26605
+ }
26606
+ return (
26607
+ (u.isInText = !0),
26608
+ {
26609
+ startState: function (t) {
26610
+ var e = {
26611
+ tokenize: u,
26612
+ state: _,
26613
+ indented: t || 0,
26614
+ tagName: null,
26615
+ tagStart: null,
26616
+ context: null,
26617
+ };
26618
+ return null != t && (e.baseIndent = t), e;
26619
+ },
26620
+ token: function (t, e) {
26621
+ if (
26622
+ (!e.tagName && t.sol() && (e.indented = t.indentation()),
26623
+ t.eatSpace())
26624
+ )
26625
+ return null;
26626
+ o = null;
26627
+ var n = e.tokenize(t, e);
26628
+ return (
26629
+ (n || o) &&
26630
+ "comment" != n &&
26631
+ ((s = null),
26632
+ (e.state = e.state(o || n, t, e)),
26633
+ s && (n = "error" == s ? n + " error" : s)),
26634
+ n
26635
+ );
26636
+ },
26637
+ indent: function (e, n, i) {
26638
+ var r = e.context;
26639
+ if (e.tokenize.isInAttribute)
26640
+ return e.tagStart == e.indented
26641
+ ? e.stringStartCol + 1
26642
+ : e.indented + a;
26643
+ if (r && r.noIndent) return t.Pass;
26644
+ if (e.tokenize != f && e.tokenize != u)
26645
+ return i ? i.match(/^(\s*)/)[0].length : 0;
26646
+ if (e.tagName)
26647
+ return !1 !== l.multilineTagIndentPastTag
26648
+ ? e.tagStart + e.tagName.length + 2
26649
+ : e.tagStart + a * (l.multilineTagIndentFactor || 1);
26650
+ if (l.alignCDATA && /<!\[CDATA\[/.test(n)) return 0;
26651
+ var o = n && /^<(\/)?([\w_:\.-]*)/.exec(n);
26652
+ if (o && o[1])
26653
+ for (; r; ) {
26654
+ if (r.tagName == o[2]) {
26655
+ r = r.prev;
26656
+ break;
26657
+ }
26658
+ if (!l.implicitlyClosed.hasOwnProperty(r.tagName)) break;
26659
+ r = r.prev;
26660
+ }
26661
+ else if (o)
26662
+ for (; r; ) {
26663
+ var s = l.contextGrabbers[r.tagName];
26664
+ if (!s || !s.hasOwnProperty(o[2])) break;
26665
+ r = r.prev;
26666
+ }
26667
+ for (; r && r.prev && !r.startOfLine; ) r = r.prev;
26668
+ return r ? r.indent + a : e.baseIndent || 0;
26669
+ },
26670
+ electricInput: /<\/[\s\w:]+>$/,
26671
+ blockCommentStart: "\x3c!--",
26672
+ blockCommentEnd: "--\x3e",
26673
+ configuration: l.htmlMode ? "html" : "xml",
26674
+ helperType: l.htmlMode ? "html" : "xml",
26675
+ skipAttribute: function (t) {
26676
+ t.state == w && (t.state = T);
26677
+ },
26678
+ xmlCurrentTag: function (t) {
26679
+ return t.tagName
26680
+ ? { name: t.tagName, close: "closeTag" == t.type }
26681
+ : null;
26682
+ },
26683
+ xmlCurrentContext: function (t) {
26684
+ for (var e = [], n = t.context; n; n = n.prev)
26685
+ e.push(n.tagName);
26686
+ return e.reverse();
26687
+ },
26688
+ }
26689
+ );
26690
+ }),
26691
+ t.defineMIME("text/xml", "xml"),
26692
+ t.defineMIME("application/xml", "xml"),
26693
+ t.mimeModes.hasOwnProperty("text/html") ||
26694
+ t.defineMIME("text/html", { name: "xml", htmlMode: !0 });
26695
+ }),
26696
+ "object" == typeof n && "object" == typeof e
26697
+ ? i(t("../../lib/codemirror"))
26698
+ : "function" == typeof define && define.amd
26699
+ ? define(["../../lib/codemirror"], i)
26700
+ : i(CodeMirror);
26701
+ },
26702
+ { "../../lib/codemirror": 13 },
26703
+ ],
26704
+ 20: [
26705
+ function (t, e, n) {
26706
+ "use strict";
26707
+ const i = t("./ast/location"),
26708
+ r = t("./ast/position"),
26709
+ o = function (t, e) {
26710
+ (this.withPositions = t), (this.withSource = e);
26711
+ };
26712
+ (o.prototype.position = function (t) {
26713
+ return new r(
26714
+ t.lexer.yylloc.first_line,
26715
+ t.lexer.yylloc.first_column,
26716
+ t.lexer.yylloc.first_offset
26717
+ );
26718
+ }),
26719
+ (o.precedence = {}),
26720
+ [
26721
+ ["or"],
26722
+ ["xor"],
26723
+ ["and"],
26724
+ ["="],
26725
+ ["?"],
26726
+ ["??"],
26727
+ ["||"],
26728
+ ["&&"],
26729
+ ["|"],
26730
+ ["^"],
26731
+ ["&"],
26732
+ ["==", "!=", "===", "!==", "<=>"],
26733
+ ["<", "<=", ">", ">="],
26734
+ ["<<", ">>"],
26735
+ ["+", "-", "."],
26736
+ ["*", "/", "%"],
26737
+ ["!"],
26738
+ ["instanceof"],
26739
+ ["cast", "silent"],
26740
+ ["**"],
26741
+ ].forEach(function (t, e) {
26742
+ t.forEach(function (t) {
26743
+ o.precedence[t] = e + 1;
26744
+ });
26745
+ }),
26746
+ (o.prototype.isRightAssociative = function (t) {
26747
+ return "**" === t || "??" === t;
26748
+ }),
26749
+ (o.prototype.swapLocations = function (t, e, n, i) {
26750
+ this.withPositions &&
26751
+ ((t.loc.start = e.loc.start),
26752
+ (t.loc.end = n.loc.end),
26753
+ this.withSource &&
26754
+ (t.loc.source = i.lexer._input.substring(
26755
+ t.loc.start.offset,
26756
+ t.loc.end.offset
26757
+ )));
26758
+ }),
26759
+ (o.prototype.resolveLocations = function (t, e, n, i) {
26760
+ this.withPositions &&
26761
+ (t.loc.start.offset > e.loc.start.offset &&
26762
+ (t.loc.start = e.loc.start),
26763
+ t.loc.end.offset < n.loc.end.offset && (t.loc.end = n.loc.end),
26764
+ this.withSource &&
26765
+ (t.loc.source = i.lexer._input.substring(
26766
+ t.loc.start.offset,
26767
+ t.loc.end.offset
26768
+ )));
26769
+ }),
26770
+ (o.prototype.resolvePrecedence = function (t, e) {
26771
+ let n, i, r;
26772
+ return (
26773
+ "call" === t.kind
26774
+ ? this.resolveLocations(t, t.what, t, e)
26775
+ : "propertylookup" === t.kind ||
26776
+ "staticlookup" === t.kind ||
26777
+ ("offsetlookup" === t.kind && t.offset)
26778
+ ? this.resolveLocations(t, t.what, t.offset, e)
26779
+ : "bin" === t.kind
26780
+ ? t.right &&
26781
+ !t.right.parenthesizedExpression &&
26782
+ ("bin" === t.right.kind
26783
+ ? ((i = o.precedence[t.type]),
26784
+ (r = o.precedence[t.right.type]),
26785
+ i &&
26786
+ r &&
26787
+ r <= i &&
26788
+ (t.type !== t.right.type ||
26789
+ !this.isRightAssociative(t.type)) &&
26790
+ ((n = t.right),
26791
+ (t.right = t.right.left),
26792
+ this.swapLocations(t, t.left, t.right, e),
26793
+ (n.left = this.resolvePrecedence(t, e)),
26794
+ this.swapLocations(n, n.left, n.right, e),
26795
+ (t = n)))
26796
+ : "retif" === t.right.kind &&
26797
+ ((i = o.precedence[t.type]),
26798
+ (r = o.precedence["?"]),
26799
+ i &&
26800
+ r &&
26801
+ r <= i &&
26802
+ ((n = t.right),
26803
+ (t.right = t.right.test),
26804
+ this.swapLocations(t, t.left, t.right, e),
26805
+ (n.test = this.resolvePrecedence(t, e)),
26806
+ this.swapLocations(n, n.test, n.falseExpr, e),
26807
+ (t = n))))
26808
+ : ("silent" !== t.kind && "cast" !== t.kind) ||
26809
+ !t.expr ||
26810
+ t.expr.parenthesizedExpression
26811
+ ? "unary" === t.kind
26812
+ ? t.what &&
26813
+ !t.what.parenthesizedExpression &&
26814
+ ("bin" === t.what.kind
26815
+ ? ((n = t.what),
26816
+ (t.what = t.what.left),
26817
+ this.swapLocations(t, t, t.what, e),
26818
+ (n.left = this.resolvePrecedence(t, e)),
26819
+ this.swapLocations(n, n.left, n.right, e),
26820
+ (t = n))
26821
+ : "retif" === t.what.kind &&
26822
+ ((n = t.what),
26823
+ (t.what = t.what.test),
26824
+ this.swapLocations(t, t, t.what, e),
26825
+ (n.test = this.resolvePrecedence(t, e)),
26826
+ this.swapLocations(n, n.test, n.falseExpr, e),
26827
+ (t = n)))
26828
+ : "retif" === t.kind
26829
+ ? t.falseExpr &&
26830
+ "retif" === t.falseExpr.kind &&
26831
+ !t.falseExpr.parenthesizedExpression &&
26832
+ ((n = t.falseExpr),
26833
+ (t.falseExpr = n.test),
26834
+ this.swapLocations(t, t.test, t.falseExpr, e),
26835
+ (n.test = this.resolvePrecedence(t, e)),
26836
+ this.swapLocations(n, n.test, n.falseExpr, e),
26837
+ (t = n))
26838
+ : "assign" === t.kind
26839
+ ? t.right &&
26840
+ "bin" === t.right.kind &&
26841
+ !t.right.parenthesizedExpression &&
26842
+ ((i = o.precedence["="]),
26843
+ (r = o.precedence[t.right.type]),
26844
+ i &&
26845
+ r &&
26846
+ r < i &&
26847
+ ((n = t.right),
26848
+ (t.right = t.right.left),
26849
+ (n.left = t),
26850
+ this.swapLocations(n, n.left, t.right, e),
26851
+ (t = n)))
26852
+ : "expressionstatement" === t.kind &&
26853
+ this.swapLocations(t, t.expression, t, e)
26854
+ : "bin" === t.expr.kind
26855
+ ? ((n = t.expr),
26856
+ (t.expr = t.expr.left),
26857
+ this.swapLocations(t, t, t.expr, e),
26858
+ (n.left = this.resolvePrecedence(t, e)),
26859
+ this.swapLocations(n, n.left, n.right, e),
26860
+ (t = n))
26861
+ : "retif" === t.expr.kind &&
26862
+ ((n = t.expr),
26863
+ (t.expr = t.expr.test),
26864
+ this.swapLocations(t, t, t.expr, e),
26865
+ (n.test = this.resolvePrecedence(t, e)),
26866
+ this.swapLocations(n, n.test, n.falseExpr, e),
26867
+ (t = n)),
26868
+ t
26869
+ );
26870
+ }),
26871
+ (o.prototype.prepare = function (t, e, n) {
26872
+ let s = null;
26873
+ (this.withPositions || this.withSource) && (s = this.position(n));
26874
+ const a = this,
26875
+ l = function () {
26876
+ let c = null;
26877
+ const h = Array.prototype.slice.call(arguments);
26878
+ if ((h.push(e), a.withPositions || a.withSource)) {
26879
+ let t = null;
26880
+ a.withSource &&
26881
+ (t = n.lexer._input.substring(s.offset, n.prev[2])),
26882
+ (c = new i(t, s, new r(n.prev[0], n.prev[1], n.prev[2]))),
26883
+ h.push(c);
26884
+ }
26885
+ t || (t = h.shift());
26886
+ const u = a[t];
26887
+ if ("function" != typeof u)
26888
+ throw new Error('Undefined node "' + t + '"');
26889
+ const f = Object.create(u.prototype);
26890
+ return (
26891
+ u.apply(f, h),
26892
+ (l.instance = f),
26893
+ l.trailingComments &&
26894
+ (f.trailingComments = l.trailingComments),
26895
+ "function" == typeof l.postBuild && l.postBuild(f),
26896
+ n.debug && delete o.stack[l.stackUid],
26897
+ a.resolvePrecedence(f, n)
26898
+ );
26899
+ };
26900
+ return (
26901
+ n.debug &&
26902
+ (o.stack || ((o.stack = {}), (o.stackUid = 1)),
26903
+ (o.stack[++o.stackUid] = {
26904
+ position: s,
26905
+ stack: new Error().stack.split("\n").slice(3, 5),
26906
+ }),
26907
+ (l.stackUid = o.stackUid)),
26908
+ (l.setTrailingComments = function (t) {
26909
+ l.instance
26910
+ ? l.instance.setTrailingComments(t)
26911
+ : (l.trailingComments = t);
26912
+ }),
26913
+ (l.destroy = function (t) {
26914
+ e &&
26915
+ (t
26916
+ ? t.leadingComments
26917
+ ? (t.leadingComments = e.concat(t.leadingComments))
26918
+ : (t.leadingComments = e)
26919
+ : (n._docIndex = n._docs.length - e.length)),
26920
+ n.debug && delete o.stack[l.stackUid];
26921
+ }),
26922
+ l
26923
+ );
26924
+ }),
26925
+ (o.prototype.checkNodes = function () {
26926
+ const t = [];
26927
+ for (const e in o.stack)
26928
+ o.stack.hasOwnProperty(e) && t.push(o.stack[e]);
26929
+ return (o.stack = {}), t;
26930
+ }),
26931
+ [
26932
+ t("./ast/array"),
26933
+ t("./ast/arrowfunc"),
26934
+ t("./ast/assign"),
26935
+ t("./ast/assignref"),
26936
+ t("./ast/attribute"),
26937
+ t("./ast/attrgroup"),
26938
+ t("./ast/bin"),
26939
+ t("./ast/block"),
26940
+ t("./ast/boolean"),
26941
+ t("./ast/break"),
26942
+ t("./ast/byref"),
26943
+ t("./ast/call"),
26944
+ t("./ast/case"),
26945
+ t("./ast/cast"),
26946
+ t("./ast/catch"),
26947
+ t("./ast/class"),
26948
+ t("./ast/classconstant"),
26949
+ t("./ast/clone"),
26950
+ t("./ast/closure"),
26951
+ t("./ast/comment"),
26952
+ t("./ast/commentblock"),
26953
+ t("./ast/commentline"),
26954
+ t("./ast/constant"),
26955
+ t("./ast/constantstatement"),
26956
+ t("./ast/continue"),
26957
+ t("./ast/declaration"),
26958
+ t("./ast/declare"),
26959
+ t("./ast/declaredirective"),
26960
+ t("./ast/do"),
26961
+ t("./ast/echo"),
26962
+ t("./ast/empty"),
26963
+ t("./ast/encapsed"),
26964
+ t("./ast/encapsedpart"),
26965
+ t("./ast/entry"),
26966
+ t("./ast/error"),
26967
+ t("./ast/eval"),
26968
+ t("./ast/exit"),
26969
+ t("./ast/expression"),
26970
+ t("./ast/expressionstatement"),
26971
+ t("./ast/for"),
26972
+ t("./ast/foreach"),
26973
+ t("./ast/function"),
26974
+ t("./ast/global"),
26975
+ t("./ast/goto"),
26976
+ t("./ast/halt"),
26977
+ t("./ast/identifier"),
26978
+ t("./ast/if"),
26979
+ t("./ast/include"),
26980
+ t("./ast/inline"),
26981
+ t("./ast/interface"),
26982
+ t("./ast/isset"),
26983
+ t("./ast/label"),
26984
+ t("./ast/list"),
26985
+ t("./ast/literal"),
26986
+ t("./ast/lookup"),
26987
+ t("./ast/magic"),
26988
+ t("./ast/match"),
26989
+ t("./ast/matcharm"),
26990
+ t("./ast/method"),
26991
+ t("./ast/name"),
26992
+ t("./ast/namespace"),
26993
+ t("./ast/namedargument"),
26994
+ t("./ast/new"),
26995
+ t("./ast/node"),
26996
+ t("./ast/noop"),
26997
+ t("./ast/nowdoc"),
26998
+ t("./ast/nullkeyword"),
26999
+ t("./ast/nullsafepropertylookup"),
27000
+ t("./ast/number"),
27001
+ t("./ast/offsetlookup"),
27002
+ t("./ast/operation"),
27003
+ t("./ast/parameter"),
27004
+ t("./ast/parentreference"),
27005
+ t("./ast/post"),
27006
+ t("./ast/pre"),
27007
+ t("./ast/print"),
27008
+ t("./ast/program"),
27009
+ t("./ast/property"),
27010
+ t("./ast/propertylookup"),
27011
+ t("./ast/propertystatement"),
27012
+ t("./ast/reference"),
27013
+ t("./ast/retif"),
27014
+ t("./ast/return"),
27015
+ t("./ast/selfreference"),
27016
+ t("./ast/silent"),
27017
+ t("./ast/statement"),
27018
+ t("./ast/static"),
27019
+ t("./ast/staticvariable"),
27020
+ t("./ast/staticlookup"),
27021
+ t("./ast/staticreference"),
27022
+ t("./ast/string"),
27023
+ t("./ast/switch"),
27024
+ t("./ast/throw"),
27025
+ t("./ast/trait"),
27026
+ t("./ast/traitalias"),
27027
+ t("./ast/traitprecedence"),
27028
+ t("./ast/traituse"),
27029
+ t("./ast/try"),
27030
+ t("./ast/typereference"),
27031
+ t("./ast/unary"),
27032
+ t("./ast/uniontype"),
27033
+ t("./ast/unset"),
27034
+ t("./ast/usegroup"),
27035
+ t("./ast/useitem"),
27036
+ t("./ast/variable"),
27037
+ t("./ast/variadic"),
27038
+ t("./ast/while"),
27039
+ t("./ast/yield"),
27040
+ t("./ast/yieldfrom"),
27041
+ ].forEach(function (t) {
27042
+ o.prototype[t.kind] = t;
27043
+ }),
27044
+ (e.exports = o);
27045
+ },
27046
+ {
27047
+ "./ast/array": 21,
27048
+ "./ast/arrowfunc": 22,
27049
+ "./ast/assign": 23,
27050
+ "./ast/assignref": 24,
27051
+ "./ast/attrgroup": 25,
27052
+ "./ast/attribute": 26,
27053
+ "./ast/bin": 27,
27054
+ "./ast/block": 28,
27055
+ "./ast/boolean": 29,
27056
+ "./ast/break": 30,
27057
+ "./ast/byref": 31,
27058
+ "./ast/call": 32,
27059
+ "./ast/case": 33,
27060
+ "./ast/cast": 34,
27061
+ "./ast/catch": 35,
27062
+ "./ast/class": 36,
27063
+ "./ast/classconstant": 37,
27064
+ "./ast/clone": 38,
27065
+ "./ast/closure": 39,
27066
+ "./ast/comment": 40,
27067
+ "./ast/commentblock": 41,
27068
+ "./ast/commentline": 42,
27069
+ "./ast/constant": 43,
27070
+ "./ast/constantstatement": 44,
27071
+ "./ast/continue": 45,
27072
+ "./ast/declaration": 46,
27073
+ "./ast/declare": 47,
27074
+ "./ast/declaredirective": 48,
27075
+ "./ast/do": 49,
27076
+ "./ast/echo": 50,
27077
+ "./ast/empty": 51,
27078
+ "./ast/encapsed": 52,
27079
+ "./ast/encapsedpart": 53,
27080
+ "./ast/entry": 54,
27081
+ "./ast/error": 55,
27082
+ "./ast/eval": 56,
27083
+ "./ast/exit": 57,
27084
+ "./ast/expression": 58,
27085
+ "./ast/expressionstatement": 59,
27086
+ "./ast/for": 60,
27087
+ "./ast/foreach": 61,
27088
+ "./ast/function": 62,
27089
+ "./ast/global": 63,
27090
+ "./ast/goto": 64,
27091
+ "./ast/halt": 65,
27092
+ "./ast/identifier": 66,
27093
+ "./ast/if": 67,
27094
+ "./ast/include": 68,
27095
+ "./ast/inline": 69,
27096
+ "./ast/interface": 70,
27097
+ "./ast/isset": 71,
27098
+ "./ast/label": 72,
27099
+ "./ast/list": 73,
27100
+ "./ast/literal": 74,
27101
+ "./ast/location": 75,
27102
+ "./ast/lookup": 76,
27103
+ "./ast/magic": 77,
27104
+ "./ast/match": 78,
27105
+ "./ast/matcharm": 79,
27106
+ "./ast/method": 80,
27107
+ "./ast/name": 81,
27108
+ "./ast/namedargument": 82,
27109
+ "./ast/namespace": 83,
27110
+ "./ast/new": 84,
27111
+ "./ast/node": 85,
27112
+ "./ast/noop": 86,
27113
+ "./ast/nowdoc": 87,
27114
+ "./ast/nullkeyword": 88,
27115
+ "./ast/nullsafepropertylookup": 89,
27116
+ "./ast/number": 90,
27117
+ "./ast/offsetlookup": 91,
27118
+ "./ast/operation": 92,
27119
+ "./ast/parameter": 93,
27120
+ "./ast/parentreference": 94,
27121
+ "./ast/position": 95,
27122
+ "./ast/post": 96,
27123
+ "./ast/pre": 97,
27124
+ "./ast/print": 98,
27125
+ "./ast/program": 99,
27126
+ "./ast/property": 100,
27127
+ "./ast/propertylookup": 101,
27128
+ "./ast/propertystatement": 102,
27129
+ "./ast/reference": 103,
27130
+ "./ast/retif": 104,
27131
+ "./ast/return": 105,
27132
+ "./ast/selfreference": 106,
27133
+ "./ast/silent": 107,
27134
+ "./ast/statement": 108,
27135
+ "./ast/static": 109,
27136
+ "./ast/staticlookup": 110,
27137
+ "./ast/staticreference": 111,
27138
+ "./ast/staticvariable": 112,
27139
+ "./ast/string": 113,
27140
+ "./ast/switch": 114,
27141
+ "./ast/throw": 115,
27142
+ "./ast/trait": 116,
27143
+ "./ast/traitalias": 117,
27144
+ "./ast/traitprecedence": 118,
27145
+ "./ast/traituse": 119,
27146
+ "./ast/try": 120,
27147
+ "./ast/typereference": 121,
27148
+ "./ast/unary": 122,
27149
+ "./ast/uniontype": 123,
27150
+ "./ast/unset": 124,
27151
+ "./ast/usegroup": 125,
27152
+ "./ast/useitem": 126,
27153
+ "./ast/variable": 127,
27154
+ "./ast/variadic": 128,
27155
+ "./ast/while": 129,
27156
+ "./ast/yield": 130,
27157
+ "./ast/yieldfrom": 131,
27158
+ },
27159
+ ],
27160
+ 21: [
27161
+ function (t, e, n) {
27162
+ "use strict";
27163
+ const i = t("./expression"),
27164
+ r = "array";
27165
+ e.exports = i.extends(r, function (t, e, n, o) {
27166
+ i.apply(this, [r, n, o]), (this.items = e), (this.shortForm = t);
27167
+ });
27168
+ },
27169
+ { "./expression": 58 },
27170
+ ],
27171
+ 22: [
27172
+ function (t, e, n) {
27173
+ "use strict";
27174
+ const i = t("./expression"),
27175
+ r = "arrowfunc";
27176
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l, c) {
27177
+ i.apply(this, [r, l, c]),
27178
+ (this.arguments = t),
27179
+ (this.byref = e),
27180
+ (this.body = n),
27181
+ (this.type = o),
27182
+ (this.nullable = s),
27183
+ (this.isStatic = a || !1);
27184
+ });
27185
+ },
27186
+ { "./expression": 58 },
27187
+ ],
27188
+ 23: [
27189
+ function (t, e, n) {
27190
+ "use strict";
27191
+ const i = t("./expression"),
27192
+ r = "assign";
27193
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27194
+ i.apply(this, [r, o, s]),
27195
+ (this.left = t),
27196
+ (this.right = e),
27197
+ (this.operator = n);
27198
+ });
27199
+ },
27200
+ { "./expression": 58 },
27201
+ ],
27202
+ 24: [
27203
+ function (t, e, n) {
27204
+ "use strict";
27205
+ const i = t("./expression"),
27206
+ r = "assignref";
27207
+ e.exports = i.extends(r, function (t, e, n, o) {
27208
+ i.apply(this, [r, n, o]), (this.left = t), (this.right = e);
27209
+ });
27210
+ },
27211
+ { "./expression": 58 },
27212
+ ],
27213
+ 25: [
27214
+ function (t, e, n) {
27215
+ "use strict";
27216
+ const i = t("./node"),
27217
+ r = "attrgroup";
27218
+ e.exports = i.extends(r, function (t, e, n) {
27219
+ i.apply(this, [r, e, n]), (this.attrs = t || []);
27220
+ });
27221
+ },
27222
+ { "./node": 85 },
27223
+ ],
27224
+ 26: [
27225
+ function (t, e, n) {
27226
+ "use strict";
27227
+ const i = t("./node"),
27228
+ r = "attribute";
27229
+ e.exports = i.extends(r, function (t, e, n, o) {
27230
+ i.apply(this, [r, n, o]), (this.name = t), (this.args = e);
27231
+ });
27232
+ },
27233
+ { "./node": 85 },
27234
+ ],
27235
+ 27: [
27236
+ function (t, e, n) {
27237
+ "use strict";
27238
+ const i = t("./operation");
27239
+ e.exports = i.extends("bin", function (t, e, n, r, o) {
27240
+ i.apply(this, ["bin", r, o]),
27241
+ (this.type = t),
27242
+ (this.left = e),
27243
+ (this.right = n);
27244
+ });
27245
+ },
27246
+ { "./operation": 92 },
27247
+ ],
27248
+ 28: [
27249
+ function (t, e, n) {
27250
+ "use strict";
27251
+ const i = t("./statement"),
27252
+ r = "block";
27253
+ e.exports = i.extends(r, function (t, e, n, o) {
27254
+ i.apply(this, [t || r, n, o]), (this.children = e.filter(Boolean));
27255
+ });
27256
+ },
27257
+ { "./statement": 108 },
27258
+ ],
27259
+ 29: [
27260
+ function (t, e, n) {
27261
+ "use strict";
27262
+ const i = t("./literal"),
27263
+ r = "boolean";
27264
+ e.exports = i.extends(r, function (t, e, n, o) {
27265
+ i.apply(this, [r, t, e, n, o]);
27266
+ });
27267
+ },
27268
+ { "./literal": 74 },
27269
+ ],
27270
+ 30: [
27271
+ function (t, e, n) {
27272
+ "use strict";
27273
+ const i = t("./statement"),
27274
+ r = "break";
27275
+ e.exports = i.extends(r, function (t, e, n) {
27276
+ i.apply(this, [r, e, n]), (this.level = t);
27277
+ });
27278
+ },
27279
+ { "./statement": 108 },
27280
+ ],
27281
+ 31: [
27282
+ function (t, e, n) {
27283
+ "use strict";
27284
+ const i = t("./expression"),
27285
+ r = "byref";
27286
+ e.exports = i.extends(r, function (t, e, n) {
27287
+ i.apply(this, [r, e, n]), (this.what = t);
27288
+ });
27289
+ },
27290
+ { "./expression": 58 },
27291
+ ],
27292
+ 32: [
27293
+ function (t, e, n) {
27294
+ "use strict";
27295
+ const i = t("./expression"),
27296
+ r = "call";
27297
+ e.exports = i.extends(r, function (t, e, n, o) {
27298
+ i.apply(this, [r, n, o]), (this.what = t), (this.arguments = e);
27299
+ });
27300
+ },
27301
+ { "./expression": 58 },
27302
+ ],
27303
+ 33: [
27304
+ function (t, e, n) {
27305
+ "use strict";
27306
+ const i = t("./statement"),
27307
+ r = "case";
27308
+ e.exports = i.extends(r, function (t, e, n, o) {
27309
+ i.apply(this, [r, n, o]), (this.test = t), (this.body = e);
27310
+ });
27311
+ },
27312
+ { "./statement": 108 },
27313
+ ],
27314
+ 34: [
27315
+ function (t, e, n) {
27316
+ "use strict";
27317
+ const i = t("./operation"),
27318
+ r = "cast";
27319
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27320
+ i.apply(this, [r, o, s]),
27321
+ (this.type = t),
27322
+ (this.raw = e),
27323
+ (this.expr = n);
27324
+ });
27325
+ },
27326
+ { "./operation": 92 },
27327
+ ],
27328
+ 35: [
27329
+ function (t, e, n) {
27330
+ "use strict";
27331
+ const i = t("./statement"),
27332
+ r = "catch";
27333
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27334
+ i.apply(this, [r, o, s]),
27335
+ (this.body = t),
27336
+ (this.what = e),
27337
+ (this.variable = n);
27338
+ });
27339
+ },
27340
+ { "./statement": 108 },
27341
+ ],
27342
+ 36: [
27343
+ function (t, e, n) {
27344
+ "use strict";
27345
+ const i = t("./declaration"),
27346
+ r = "class";
27347
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l) {
27348
+ i.apply(this, [r, t, a, l]),
27349
+ (this.isAnonymous = !t),
27350
+ (this.extends = e),
27351
+ (this.implements = n),
27352
+ (this.body = o),
27353
+ (this.attrGroups = []),
27354
+ this.parseFlags(s);
27355
+ });
27356
+ },
27357
+ { "./declaration": 46 },
27358
+ ],
27359
+ 37: [
27360
+ function (t, e, n) {
27361
+ "use strict";
27362
+ const i = t("./constantstatement"),
27363
+ r = "classconstant",
27364
+ o = i.extends(r, function (t, e, n, o, s, a) {
27365
+ i.apply(this, [t || r, e, s, a]),
27366
+ this.parseFlags(n),
27367
+ (this.attrGroups = o);
27368
+ });
27369
+ (o.prototype.parseFlags = function (t) {
27370
+ -1 === t[0]
27371
+ ? (this.visibility = "")
27372
+ : null === t[0]
27373
+ ? (this.visibility = null)
27374
+ : 0 === t[0]
27375
+ ? (this.visibility = "public")
27376
+ : 1 === t[0]
27377
+ ? (this.visibility = "protected")
27378
+ : 2 === t[0] && (this.visibility = "private");
27379
+ }),
27380
+ (e.exports = o);
27381
+ },
27382
+ { "./constantstatement": 44 },
27383
+ ],
27384
+ 38: [
27385
+ function (t, e, n) {
27386
+ "use strict";
27387
+ const i = t("./expression"),
27388
+ r = "clone";
27389
+ e.exports = i.extends(r, function (t, e, n) {
27390
+ i.apply(this, [r, e, n]), (this.what = t);
27391
+ });
27392
+ },
27393
+ { "./expression": 58 },
27394
+ ],
27395
+ 39: [
27396
+ function (t, e, n) {
27397
+ "use strict";
27398
+ const i = t("./expression"),
27399
+ r = "closure";
27400
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l, c) {
27401
+ i.apply(this, [r, l, c]),
27402
+ (this.uses = n),
27403
+ (this.arguments = t),
27404
+ (this.byref = e),
27405
+ (this.type = o),
27406
+ (this.nullable = s),
27407
+ (this.isStatic = a || !1),
27408
+ (this.body = null),
27409
+ (this.attrGroups = []);
27410
+ });
27411
+ },
27412
+ { "./expression": 58 },
27413
+ ],
27414
+ 40: [
27415
+ function (t, e, n) {
27416
+ "use strict";
27417
+ const i = t("./node");
27418
+ e.exports = i.extends("comment", function (t, e, n, r) {
27419
+ i.apply(this, [t, n, r]), (this.value = e);
27420
+ });
27421
+ },
27422
+ { "./node": 85 },
27423
+ ],
27424
+ 41: [
27425
+ function (t, e, n) {
27426
+ "use strict";
27427
+ const i = t("./comment"),
27428
+ r = "commentblock";
27429
+ e.exports = i.extends(r, function (t, e, n) {
27430
+ i.apply(this, [r, t, e, n]);
27431
+ });
27432
+ },
27433
+ { "./comment": 40 },
27434
+ ],
27435
+ 42: [
27436
+ function (t, e, n) {
27437
+ "use strict";
27438
+ const i = t("./comment"),
27439
+ r = "commentline";
27440
+ e.exports = i.extends(r, function (t, e, n) {
27441
+ i.apply(this, [r, t, e, n]);
27442
+ });
27443
+ },
27444
+ { "./comment": 40 },
27445
+ ],
27446
+ 43: [
27447
+ function (t, e, n) {
27448
+ "use strict";
27449
+ const i = t("./node"),
27450
+ r = "constant";
27451
+ e.exports = i.extends(r, function (t, e, n, o) {
27452
+ i.apply(this, [r, n, o]), (this.name = t), (this.value = e);
27453
+ });
27454
+ },
27455
+ { "./node": 85 },
27456
+ ],
27457
+ 44: [
27458
+ function (t, e, n) {
27459
+ "use strict";
27460
+ const i = t("./statement"),
27461
+ r = "constantstatement";
27462
+ e.exports = i.extends(r, function (t, e, n, o) {
27463
+ i.apply(this, [t || r, n, o]), (this.constants = e);
27464
+ });
27465
+ },
27466
+ { "./statement": 108 },
27467
+ ],
27468
+ 45: [
27469
+ function (t, e, n) {
27470
+ "use strict";
27471
+ const i = t("./statement"),
27472
+ r = "continue";
27473
+ e.exports = i.extends(r, function (t, e, n) {
27474
+ i.apply(this, [r, e, n]), (this.level = t);
27475
+ });
27476
+ },
27477
+ { "./statement": 108 },
27478
+ ],
27479
+ 46: [
27480
+ function (t, e, n) {
27481
+ "use strict";
27482
+ const i = t("./statement"),
27483
+ r = "declaration",
27484
+ o = i.extends(r, function (t, e, n, o) {
27485
+ i.apply(this, [t || r, n, o]), (this.name = e);
27486
+ });
27487
+ (o.prototype.parseFlags = function (t) {
27488
+ (this.isAbstract = 1 === t[2]),
27489
+ (this.isFinal = 2 === t[2]),
27490
+ "class" !== this.kind &&
27491
+ (-1 === t[0]
27492
+ ? (this.visibility = "")
27493
+ : null === t[0]
27494
+ ? (this.visibility = null)
27495
+ : 0 === t[0]
27496
+ ? (this.visibility = "public")
27497
+ : 1 === t[0]
27498
+ ? (this.visibility = "protected")
27499
+ : 2 === t[0] && (this.visibility = "private"),
27500
+ (this.isStatic = 1 === t[1]));
27501
+ }),
27502
+ (e.exports = o);
27503
+ },
27504
+ { "./statement": 108 },
27505
+ ],
27506
+ 47: [
27507
+ function (t, e, n) {
27508
+ "use strict";
27509
+ const i = t("./block"),
27510
+ r = "declare",
27511
+ o = i.extends(r, function (t, e, n, o, s) {
27512
+ i.apply(this, [r, e, o, s]), (this.directives = t), (this.mode = n);
27513
+ });
27514
+ (o.MODE_SHORT = "short"),
27515
+ (o.MODE_BLOCK = "block"),
27516
+ (o.MODE_NONE = "none"),
27517
+ (e.exports = o);
27518
+ },
27519
+ { "./block": 28 },
27520
+ ],
27521
+ 48: [
27522
+ function (t, e, n) {
27523
+ "use strict";
27524
+ const i = t("./node"),
27525
+ r = "declaredirective";
27526
+ e.exports = i.extends(r, function (t, e, n, o) {
27527
+ i.apply(this, [r, n, o]), (this.key = t), (this.value = e);
27528
+ });
27529
+ },
27530
+ { "./node": 85 },
27531
+ ],
27532
+ 49: [
27533
+ function (t, e, n) {
27534
+ "use strict";
27535
+ const i = t("./statement");
27536
+ e.exports = i.extends("do", function (t, e, n, r) {
27537
+ i.apply(this, ["do", n, r]), (this.test = t), (this.body = e);
27538
+ });
27539
+ },
27540
+ { "./statement": 108 },
27541
+ ],
27542
+ 50: [
27543
+ function (t, e, n) {
27544
+ "use strict";
27545
+ const i = t("./statement"),
27546
+ r = "echo";
27547
+ e.exports = i.extends(r, function (t, e, n, o) {
27548
+ i.apply(this, [r, n, o]),
27549
+ (this.shortForm = e),
27550
+ (this.expressions = t);
27551
+ });
27552
+ },
27553
+ { "./statement": 108 },
27554
+ ],
27555
+ 51: [
27556
+ function (t, e, n) {
27557
+ "use strict";
27558
+ const i = t("./expression"),
27559
+ r = "empty";
27560
+ e.exports = i.extends(r, function (t, e, n) {
27561
+ i.apply(this, [r, e, n]), (this.expression = t);
27562
+ });
27563
+ },
27564
+ { "./expression": 58 },
27565
+ ],
27566
+ 52: [
27567
+ function (t, e, n) {
27568
+ "use strict";
27569
+ const i = t("./literal"),
27570
+ r = "encapsed",
27571
+ o = i.extends(r, function (t, e, n, o, s) {
27572
+ i.apply(this, [r, t, e, o, s]), (this.type = n);
27573
+ });
27574
+ (o.TYPE_STRING = "string"),
27575
+ (o.TYPE_SHELL = "shell"),
27576
+ (o.TYPE_HEREDOC = "heredoc"),
27577
+ (o.TYPE_OFFSET = "offset"),
27578
+ (e.exports = o);
27579
+ },
27580
+ { "./literal": 74 },
27581
+ ],
27582
+ 53: [
27583
+ function (t, e, n) {
27584
+ "use strict";
27585
+ const i = t("./expression"),
27586
+ r = "encapsedpart";
27587
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27588
+ i.apply(this, [r, o, s]),
27589
+ (this.expression = t),
27590
+ (this.syntax = e),
27591
+ (this.curly = n);
27592
+ });
27593
+ },
27594
+ { "./expression": 58 },
27595
+ ],
27596
+ 54: [
27597
+ function (t, e, n) {
27598
+ "use strict";
27599
+ const i = t("./expression"),
27600
+ r = "entry";
27601
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
27602
+ i.apply(this, [r, s, a]),
27603
+ (this.key = t),
27604
+ (this.value = e),
27605
+ (this.byRef = n),
27606
+ (this.unpack = o);
27607
+ });
27608
+ },
27609
+ { "./expression": 58 },
27610
+ ],
27611
+ 55: [
27612
+ function (t, e, n) {
27613
+ "use strict";
27614
+ const i = t("./node"),
27615
+ r = "error";
27616
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
27617
+ i.apply(this, [r, s, a]),
27618
+ (this.message = t),
27619
+ (this.token = e),
27620
+ (this.line = n),
27621
+ (this.expected = o);
27622
+ });
27623
+ },
27624
+ { "./node": 85 },
27625
+ ],
27626
+ 56: [
27627
+ function (t, e, n) {
27628
+ "use strict";
27629
+ const i = t("./expression"),
27630
+ r = "eval";
27631
+ e.exports = i.extends(r, function (t, e, n) {
27632
+ i.apply(this, [r, e, n]), (this.source = t);
27633
+ });
27634
+ },
27635
+ { "./expression": 58 },
27636
+ ],
27637
+ 57: [
27638
+ function (t, e, n) {
27639
+ "use strict";
27640
+ const i = t("./expression"),
27641
+ r = "exit";
27642
+ e.exports = i.extends(r, function (t, e, n, o) {
27643
+ i.apply(this, [r, n, o]), (this.expression = t), (this.useDie = e);
27644
+ });
27645
+ },
27646
+ { "./expression": 58 },
27647
+ ],
27648
+ 58: [
27649
+ function (t, e, n) {
27650
+ "use strict";
27651
+ const i = t("./node"),
27652
+ r = "expression";
27653
+ e.exports = i.extends(r, function (t, e, n) {
27654
+ i.apply(this, [t || r, e, n]);
27655
+ });
27656
+ },
27657
+ { "./node": 85 },
27658
+ ],
27659
+ 59: [
27660
+ function (t, e, n) {
27661
+ "use strict";
27662
+ const i = t("./statement"),
27663
+ r = "expressionstatement";
27664
+ e.exports = i.extends(r, function (t, e, n) {
27665
+ i.apply(this, [r, e, n]), (this.expression = t);
27666
+ });
27667
+ },
27668
+ { "./statement": 108 },
27669
+ ],
27670
+ 60: [
27671
+ function (t, e, n) {
27672
+ "use strict";
27673
+ const i = t("./statement");
27674
+ e.exports = i.extends("for", function (t, e, n, r, o, s, a) {
27675
+ i.apply(this, ["for", s, a]),
27676
+ (this.init = t),
27677
+ (this.test = e),
27678
+ (this.increment = n),
27679
+ (this.shortForm = o),
27680
+ (this.body = r);
27681
+ });
27682
+ },
27683
+ { "./statement": 108 },
27684
+ ],
27685
+ 61: [
27686
+ function (t, e, n) {
27687
+ "use strict";
27688
+ const i = t("./statement"),
27689
+ r = "foreach";
27690
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l) {
27691
+ i.apply(this, [r, a, l]),
27692
+ (this.source = t),
27693
+ (this.key = e),
27694
+ (this.value = n),
27695
+ (this.shortForm = s),
27696
+ (this.body = o);
27697
+ });
27698
+ },
27699
+ { "./statement": 108 },
27700
+ ],
27701
+ 62: [
27702
+ function (t, e, n) {
27703
+ "use strict";
27704
+ const i = t("./declaration"),
27705
+ r = "function";
27706
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l) {
27707
+ i.apply(this, [r, t, a, l]),
27708
+ (this.arguments = e),
27709
+ (this.byref = n),
27710
+ (this.type = o),
27711
+ (this.nullable = s),
27712
+ (this.body = null),
27713
+ (this.attrGroups = []);
27714
+ });
27715
+ },
27716
+ { "./declaration": 46 },
27717
+ ],
27718
+ 63: [
27719
+ function (t, e, n) {
27720
+ "use strict";
27721
+ const i = t("./statement"),
27722
+ r = "global";
27723
+ e.exports = i.extends(r, function (t, e, n) {
27724
+ i.apply(this, [r, e, n]), (this.items = t);
27725
+ });
27726
+ },
27727
+ { "./statement": 108 },
27728
+ ],
27729
+ 64: [
27730
+ function (t, e, n) {
27731
+ "use strict";
27732
+ const i = t("./statement"),
27733
+ r = "goto";
27734
+ e.exports = i.extends(r, function (t, e, n) {
27735
+ i.apply(this, [r, e, n]), (this.label = t);
27736
+ });
27737
+ },
27738
+ { "./statement": 108 },
27739
+ ],
27740
+ 65: [
27741
+ function (t, e, n) {
27742
+ "use strict";
27743
+ const i = t("./statement"),
27744
+ r = "halt";
27745
+ e.exports = i.extends(r, function (t, e, n) {
27746
+ i.apply(this, [r, e, n]), (this.after = t);
27747
+ });
27748
+ },
27749
+ { "./statement": 108 },
27750
+ ],
27751
+ 66: [
27752
+ function (t, e, n) {
27753
+ "use strict";
27754
+ const i = t("./node"),
27755
+ r = "identifier",
27756
+ o = i.extends(r, function (t, e, n) {
27757
+ i.apply(this, [r, e, n]), (this.name = t);
27758
+ });
27759
+ e.exports = o;
27760
+ },
27761
+ { "./node": 85 },
27762
+ ],
27763
+ 67: [
27764
+ function (t, e, n) {
27765
+ "use strict";
27766
+ const i = t("./statement");
27767
+ e.exports = i.extends("if", function (t, e, n, r, o, s) {
27768
+ i.apply(this, ["if", o, s]),
27769
+ (this.test = t),
27770
+ (this.body = e),
27771
+ (this.alternate = n),
27772
+ (this.shortForm = r);
27773
+ });
27774
+ },
27775
+ { "./statement": 108 },
27776
+ ],
27777
+ 68: [
27778
+ function (t, e, n) {
27779
+ "use strict";
27780
+ const i = t("./expression"),
27781
+ r = "include";
27782
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27783
+ i.apply(this, [r, o, s]),
27784
+ (this.once = t),
27785
+ (this.require = e),
27786
+ (this.target = n);
27787
+ });
27788
+ },
27789
+ { "./expression": 58 },
27790
+ ],
27791
+ 69: [
27792
+ function (t, e, n) {
27793
+ "use strict";
27794
+ const i = t("./literal"),
27795
+ r = "inline";
27796
+ e.exports = i.extends(r, function (t, e, n, o) {
27797
+ i.apply(this, [r, t, e, n, o]);
27798
+ });
27799
+ },
27800
+ { "./literal": 74 },
27801
+ ],
27802
+ 70: [
27803
+ function (t, e, n) {
27804
+ "use strict";
27805
+ const i = t("./declaration"),
27806
+ r = "interface";
27807
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
27808
+ i.apply(this, [r, t, s, a]),
27809
+ (this.extends = e),
27810
+ (this.body = n),
27811
+ (this.attrGroups = o);
27812
+ });
27813
+ },
27814
+ { "./declaration": 46 },
27815
+ ],
27816
+ 71: [
27817
+ function (t, e, n) {
27818
+ "use strict";
27819
+ const i = t("./expression"),
27820
+ r = "isset";
27821
+ e.exports = i.extends(r, function (t, e, n) {
27822
+ i.apply(this, [r, e, n]), (this.variables = t);
27823
+ });
27824
+ },
27825
+ { "./expression": 58 },
27826
+ ],
27827
+ 72: [
27828
+ function (t, e, n) {
27829
+ "use strict";
27830
+ const i = t("./statement"),
27831
+ r = "label";
27832
+ e.exports = i.extends(r, function (t, e, n) {
27833
+ i.apply(this, [r, e, n]), (this.name = t);
27834
+ });
27835
+ },
27836
+ { "./statement": 108 },
27837
+ ],
27838
+ 73: [
27839
+ function (t, e, n) {
27840
+ "use strict";
27841
+ const i = t("./expression"),
27842
+ r = "list";
27843
+ e.exports = i.extends(r, function (t, e, n, o) {
27844
+ i.apply(this, [r, n, o]), (this.items = t), (this.shortForm = e);
27845
+ });
27846
+ },
27847
+ { "./expression": 58 },
27848
+ ],
27849
+ 74: [
27850
+ function (t, e, n) {
27851
+ "use strict";
27852
+ const i = t("./expression"),
27853
+ r = "literal";
27854
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27855
+ i.apply(this, [t || r, o, s]), (this.value = e), n && (this.raw = n);
27856
+ });
27857
+ },
27858
+ { "./expression": 58 },
27859
+ ],
27860
+ 75: [
27861
+ function (t, e, n) {
27862
+ "use strict";
27863
+ e.exports = function (t, e, n) {
27864
+ (this.source = t), (this.start = e), (this.end = n);
27865
+ };
27866
+ },
27867
+ {},
27868
+ ],
27869
+ 76: [
27870
+ function (t, e, n) {
27871
+ "use strict";
27872
+ const i = t("./expression"),
27873
+ r = "lookup";
27874
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27875
+ i.apply(this, [t || r, o, s]), (this.what = e), (this.offset = n);
27876
+ });
27877
+ },
27878
+ { "./expression": 58 },
27879
+ ],
27880
+ 77: [
27881
+ function (t, e, n) {
27882
+ "use strict";
27883
+ const i = t("./literal"),
27884
+ r = "magic";
27885
+ e.exports = i.extends(r, function (t, e, n, o) {
27886
+ i.apply(this, [r, t, e, n, o]);
27887
+ });
27888
+ },
27889
+ { "./literal": 74 },
27890
+ ],
27891
+ 78: [
27892
+ function (t, e, n) {
27893
+ "use strict";
27894
+ const i = t("./expression"),
27895
+ r = "match";
27896
+ e.exports = i.extends(r, function (t, e, n, o) {
27897
+ i.apply(this, [r, n, o]), (this.cond = t), (this.arms = e);
27898
+ });
27899
+ },
27900
+ { "./expression": 58 },
27901
+ ],
27902
+ 79: [
27903
+ function (t, e, n) {
27904
+ "use strict";
27905
+ const i = t("./expression"),
27906
+ r = "matcharm";
27907
+ e.exports = i.extends(r, function (t, e, n, o) {
27908
+ i.apply(this, [r, n, o]), (this.conds = t), (this.body = e);
27909
+ });
27910
+ },
27911
+ { "./expression": 58 },
27912
+ ],
27913
+ 80: [
27914
+ function (t, e, n) {
27915
+ "use strict";
27916
+ const i = t("./function"),
27917
+ r = "method";
27918
+ e.exports = i.extends(r, function () {
27919
+ i.apply(this, arguments), (this.kind = r);
27920
+ });
27921
+ },
27922
+ { "./function": 62 },
27923
+ ],
27924
+ 81: [
27925
+ function (t, e, n) {
27926
+ "use strict";
27927
+ const i = t("./reference"),
27928
+ r = "name",
27929
+ o = i.extends(r, function t(e, n, o, s) {
27930
+ i.apply(this, [r, o, s]),
27931
+ n
27932
+ ? (this.resolution = t.RELATIVE_NAME)
27933
+ : 1 === e.length
27934
+ ? (this.resolution = t.UNQUALIFIED_NAME)
27935
+ : e[0]
27936
+ ? (this.resolution = t.QUALIFIED_NAME)
27937
+ : (this.resolution = t.FULL_QUALIFIED_NAME),
27938
+ (this.name = e.join("\\"));
27939
+ });
27940
+ (o.UNQUALIFIED_NAME = "uqn"),
27941
+ (o.QUALIFIED_NAME = "qn"),
27942
+ (o.FULL_QUALIFIED_NAME = "fqn"),
27943
+ (o.RELATIVE_NAME = "rn"),
27944
+ (e.exports = o);
27945
+ },
27946
+ { "./reference": 103 },
27947
+ ],
27948
+ 82: [
27949
+ function (t, e, n) {
27950
+ "use strict";
27951
+ const i = t("./expression"),
27952
+ r = "namedargument";
27953
+ e.exports = i.extends(r, function (t, e, n, o) {
27954
+ i.apply(this, [r, n, o]), (this.name = t), (this.value = e);
27955
+ });
27956
+ },
27957
+ { "./expression": 58 },
27958
+ ],
27959
+ 83: [
27960
+ function (t, e, n) {
27961
+ "use strict";
27962
+ const i = t("./block"),
27963
+ r = "namespace";
27964
+ e.exports = i.extends(r, function (t, e, n, o, s) {
27965
+ i.apply(this, [r, e, o, s]),
27966
+ (this.name = t),
27967
+ (this.withBrackets = n || !1);
27968
+ });
27969
+ },
27970
+ { "./block": 28 },
27971
+ ],
27972
+ 84: [
27973
+ function (t, e, n) {
27974
+ "use strict";
27975
+ const i = t("./expression");
27976
+ e.exports = i.extends("new", function (t, e, n, r) {
27977
+ i.apply(this, ["new", n, r]), (this.what = t), (this.arguments = e);
27978
+ });
27979
+ },
27980
+ { "./expression": 58 },
27981
+ ],
27982
+ 85: [
27983
+ function (t, e, n) {
27984
+ "use strict";
27985
+ const i = function (t, e, n) {
27986
+ (this.kind = t), e && (this.leadingComments = e), n && (this.loc = n);
27987
+ };
27988
+ (i.prototype.setTrailingComments = function (t) {
27989
+ this.trailingComments = t;
27990
+ }),
27991
+ (i.prototype.destroy = function (t) {
27992
+ if (!t)
27993
+ throw new Error(
27994
+ "Node already initialized, you must swap with another node"
27995
+ );
27996
+ return (
27997
+ this.leadingComments &&
27998
+ (t.leadingComments
27999
+ ? (t.leadingComments = Array.concat(
28000
+ this.leadingComments,
28001
+ t.leadingComments
28002
+ ))
28003
+ : (t.leadingComments = this.leadingComments)),
28004
+ this.trailingComments &&
28005
+ (t.trailingComments
28006
+ ? (t.trailingComments = Array.concat(
28007
+ this.trailingComments,
28008
+ t.trailingComments
28009
+ ))
28010
+ : (t.trailingComments = this.trailingComments)),
28011
+ t
28012
+ );
28013
+ }),
28014
+ (i.prototype.includeToken = function (t) {
28015
+ return (
28016
+ this.loc &&
28017
+ (this.loc.end &&
28018
+ ((this.loc.end.line = t.lexer.yylloc.last_line),
28019
+ (this.loc.end.column = t.lexer.yylloc.last_column),
28020
+ (this.loc.end.offset = t.lexer.offset)),
28021
+ t.ast.withSource &&
28022
+ (this.loc.source = t.lexer._input.substring(
28023
+ this.loc.start.offset,
28024
+ t.lexer.offset
28025
+ ))),
28026
+ this
28027
+ );
28028
+ }),
28029
+ (i.extends = function (t, e) {
28030
+ return (
28031
+ (e.prototype = Object.create(this.prototype)),
28032
+ (e.extends = this.extends),
28033
+ (e.prototype.constructor = e),
28034
+ (e.kind = t),
28035
+ e
28036
+ );
28037
+ }),
28038
+ (e.exports = i);
28039
+ },
28040
+ {},
28041
+ ],
28042
+ 86: [
28043
+ function (t, e, n) {
28044
+ "use strict";
28045
+ const i = t("./node"),
28046
+ r = "noop";
28047
+ e.exports = i.extends(r, function (t, e) {
28048
+ i.apply(this, [r, t, e]);
28049
+ });
28050
+ },
28051
+ { "./node": 85 },
28052
+ ],
28053
+ 87: [
28054
+ function (t, e, n) {
28055
+ "use strict";
28056
+ const i = t("./literal"),
28057
+ r = "nowdoc";
28058
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28059
+ i.apply(this, [r, t, e, o, s]), (this.label = n);
28060
+ });
28061
+ },
28062
+ { "./literal": 74 },
28063
+ ],
28064
+ 88: [
28065
+ function (t, e, n) {
28066
+ "use strict";
28067
+ const i = t("./node"),
28068
+ r = "nullkeyword";
28069
+ e.exports = i.extends(r, function (t, e, n) {
28070
+ i.apply(this, [r, e, n]), (this.raw = t);
28071
+ });
28072
+ },
28073
+ { "./node": 85 },
28074
+ ],
28075
+ 89: [
28076
+ function (t, e, n) {
28077
+ "use strict";
28078
+ const i = t("./lookup"),
28079
+ r = "nullsafepropertylookup";
28080
+ e.exports = i.extends(r, function (t, e, n, o) {
28081
+ i.apply(this, [r, t, e, n, o]);
28082
+ });
28083
+ },
28084
+ { "./lookup": 76 },
28085
+ ],
28086
+ 90: [
28087
+ function (t, e, n) {
28088
+ "use strict";
28089
+ const i = t("./literal"),
28090
+ r = "number";
28091
+ e.exports = i.extends(r, function (t, e, n, o) {
28092
+ i.apply(this, [r, t, e, n, o]);
28093
+ });
28094
+ },
28095
+ { "./literal": 74 },
28096
+ ],
28097
+ 91: [
28098
+ function (t, e, n) {
28099
+ "use strict";
28100
+ const i = t("./lookup"),
28101
+ r = "offsetlookup";
28102
+ e.exports = i.extends(r, function (t, e, n, o) {
28103
+ i.apply(this, [r, t, e, n, o]);
28104
+ });
28105
+ },
28106
+ { "./lookup": 76 },
28107
+ ],
28108
+ 92: [
28109
+ function (t, e, n) {
28110
+ "use strict";
28111
+ const i = t("./expression"),
28112
+ r = "operation";
28113
+ e.exports = i.extends(r, function (t, e, n) {
28114
+ i.apply(this, [t || r, e, n]);
28115
+ });
28116
+ },
28117
+ { "./expression": 58 },
28118
+ ],
28119
+ 93: [
28120
+ function (t, e, n) {
28121
+ "use strict";
28122
+ const i = t("./declaration"),
28123
+ r = "parameter";
28124
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l, c, h) {
28125
+ i.apply(this, [r, t, c, h]),
28126
+ (this.value = n),
28127
+ (this.type = e),
28128
+ (this.byref = o),
28129
+ (this.variadic = s),
28130
+ (this.nullable = a),
28131
+ (this.flags = l || 0),
28132
+ (this.attrGroups = []);
28133
+ });
28134
+ },
28135
+ { "./declaration": 46 },
28136
+ ],
28137
+ 94: [
28138
+ function (t, e, n) {
28139
+ "use strict";
28140
+ const i = t("./reference"),
28141
+ r = "parentreference",
28142
+ o = i.extends(r, function (t, e, n) {
28143
+ i.apply(this, [r, e, n]), (this.raw = t);
28144
+ });
28145
+ e.exports = o;
28146
+ },
28147
+ { "./reference": 103 },
28148
+ ],
28149
+ 95: [
28150
+ function (t, e, n) {
28151
+ "use strict";
28152
+ e.exports = function (t, e, n) {
28153
+ (this.line = t), (this.column = e), (this.offset = n);
28154
+ };
28155
+ },
28156
+ {},
28157
+ ],
28158
+ 96: [
28159
+ function (t, e, n) {
28160
+ "use strict";
28161
+ const i = t("./operation"),
28162
+ r = "post";
28163
+ e.exports = i.extends(r, function (t, e, n, o) {
28164
+ i.apply(this, [r, n, o]), (this.type = t), (this.what = e);
28165
+ });
28166
+ },
28167
+ { "./operation": 92 },
28168
+ ],
28169
+ 97: [
28170
+ function (t, e, n) {
28171
+ "use strict";
28172
+ const i = t("./operation");
28173
+ e.exports = i.extends("pre", function (t, e, n, r) {
28174
+ i.apply(this, ["pre", n, r]), (this.type = t), (this.what = e);
28175
+ });
28176
+ },
28177
+ { "./operation": 92 },
28178
+ ],
28179
+ 98: [
28180
+ function (t, e, n) {
28181
+ "use strict";
28182
+ const i = t("./expression"),
28183
+ r = "print";
28184
+ e.exports = i.extends(r, function (t, e, n) {
28185
+ i.apply(this, [r, e, n]), (this.expression = t);
28186
+ });
28187
+ },
28188
+ { "./expression": 58 },
28189
+ ],
28190
+ 99: [
28191
+ function (t, e, n) {
28192
+ "use strict";
28193
+ const i = t("./block"),
28194
+ r = "program";
28195
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
28196
+ i.apply(this, [r, t, s, a]),
28197
+ (this.errors = e),
28198
+ n && (this.comments = n),
28199
+ o && (this.tokens = o);
28200
+ });
28201
+ },
28202
+ { "./block": 28 },
28203
+ ],
28204
+ 100: [
28205
+ function (t, e, n) {
28206
+ "use strict";
28207
+ const i = t("./statement"),
28208
+ r = "property";
28209
+ e.exports = i.extends(r, function (t, e, n, o, s, a, l) {
28210
+ i.apply(this, [r, a, l]),
28211
+ (this.name = t),
28212
+ (this.value = e),
28213
+ (this.nullable = n),
28214
+ (this.type = o),
28215
+ (this.attrGroups = s);
28216
+ });
28217
+ },
28218
+ { "./statement": 108 },
28219
+ ],
28220
+ 101: [
28221
+ function (t, e, n) {
28222
+ "use strict";
28223
+ const i = t("./lookup"),
28224
+ r = "propertylookup";
28225
+ e.exports = i.extends(r, function (t, e, n, o) {
28226
+ i.apply(this, [r, t, e, n, o]);
28227
+ });
28228
+ },
28229
+ { "./lookup": 76 },
28230
+ ],
28231
+ 102: [
28232
+ function (t, e, n) {
28233
+ "use strict";
28234
+ const i = t("./statement"),
28235
+ r = "propertystatement",
28236
+ o = i.extends(r, function (t, e, n, o, s) {
28237
+ i.apply(this, [r, o, s]), (this.properties = e), this.parseFlags(n);
28238
+ });
28239
+ (o.prototype.parseFlags = function (t) {
28240
+ -1 === t[0]
28241
+ ? (this.visibility = "")
28242
+ : null === t[0]
28243
+ ? (this.visibility = null)
28244
+ : 0 === t[0]
28245
+ ? (this.visibility = "public")
28246
+ : 1 === t[0]
28247
+ ? (this.visibility = "protected")
28248
+ : 2 === t[0] && (this.visibility = "private"),
28249
+ (this.isStatic = 1 === t[1]);
28250
+ }),
28251
+ (e.exports = o);
28252
+ },
28253
+ { "./statement": 108 },
28254
+ ],
28255
+ 103: [
28256
+ function (t, e, n) {
28257
+ "use strict";
28258
+ const i = t("./node"),
28259
+ r = "reference",
28260
+ o = i.extends(r, function (t, e, n) {
28261
+ i.apply(this, [t || r, e, n]);
28262
+ });
28263
+ e.exports = o;
28264
+ },
28265
+ { "./node": 85 },
28266
+ ],
28267
+ 104: [
28268
+ function (t, e, n) {
28269
+ "use strict";
28270
+ const i = t("./expression"),
28271
+ r = "retif";
28272
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28273
+ i.apply(this, [r, o, s]),
28274
+ (this.test = t),
28275
+ (this.trueExpr = e),
28276
+ (this.falseExpr = n);
28277
+ });
28278
+ },
28279
+ { "./expression": 58 },
28280
+ ],
28281
+ 105: [
28282
+ function (t, e, n) {
28283
+ "use strict";
28284
+ const i = t("./statement"),
28285
+ r = "return";
28286
+ e.exports = i.extends(r, function (t, e, n) {
28287
+ i.apply(this, [r, e, n]), (this.expr = t);
28288
+ });
28289
+ },
28290
+ { "./statement": 108 },
28291
+ ],
28292
+ 106: [
28293
+ function (t, e, n) {
28294
+ "use strict";
28295
+ const i = t("./reference"),
28296
+ r = "selfreference",
28297
+ o = i.extends(r, function (t, e, n) {
28298
+ i.apply(this, [r, e, n]), (this.raw = t);
28299
+ });
28300
+ e.exports = o;
28301
+ },
28302
+ { "./reference": 103 },
28303
+ ],
28304
+ 107: [
28305
+ function (t, e, n) {
28306
+ "use strict";
28307
+ const i = t("./expression"),
28308
+ r = "silent";
28309
+ e.exports = i.extends(r, function (t, e, n) {
28310
+ i.apply(this, [r, e, n]), (this.expr = t);
28311
+ });
28312
+ },
28313
+ { "./expression": 58 },
28314
+ ],
28315
+ 108: [
28316
+ function (t, e, n) {
28317
+ "use strict";
28318
+ const i = t("./node"),
28319
+ r = "statement";
28320
+ e.exports = i.extends(r, function (t, e, n) {
28321
+ i.apply(this, [t || r, e, n]);
28322
+ });
28323
+ },
28324
+ { "./node": 85 },
28325
+ ],
28326
+ 109: [
28327
+ function (t, e, n) {
28328
+ "use strict";
28329
+ const i = t("./statement"),
28330
+ r = "static";
28331
+ e.exports = i.extends(r, function (t, e, n) {
28332
+ i.apply(this, [r, e, n]), (this.variables = t);
28333
+ });
28334
+ },
28335
+ { "./statement": 108 },
28336
+ ],
28337
+ 110: [
28338
+ function (t, e, n) {
28339
+ "use strict";
28340
+ const i = t("./lookup"),
28341
+ r = "staticlookup";
28342
+ e.exports = i.extends(r, function (t, e, n, o) {
28343
+ i.apply(this, [r, t, e, n, o]);
28344
+ });
28345
+ },
28346
+ { "./lookup": 76 },
28347
+ ],
28348
+ 111: [
28349
+ function (t, e, n) {
28350
+ "use strict";
28351
+ const i = t("./reference"),
28352
+ r = "staticreference",
28353
+ o = i.extends(r, function (t, e, n) {
28354
+ i.apply(this, [r, e, n]), (this.raw = t);
28355
+ });
28356
+ e.exports = o;
28357
+ },
28358
+ { "./reference": 103 },
28359
+ ],
28360
+ 112: [
28361
+ function (t, e, n) {
28362
+ "use strict";
28363
+ const i = t("./node"),
28364
+ r = "staticvariable";
28365
+ e.exports = i.extends(r, function (t, e, n, o) {
28366
+ i.apply(this, [r, n, o]),
28367
+ (this.variable = t),
28368
+ (this.defaultValue = e);
28369
+ });
28370
+ },
28371
+ { "./node": 85 },
28372
+ ],
28373
+ 113: [
28374
+ function (t, e, n) {
28375
+ "use strict";
28376
+ const i = t("./literal"),
28377
+ r = "string";
28378
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
28379
+ i.apply(this, [r, e, o, s, a]),
28380
+ (this.unicode = n),
28381
+ (this.isDoubleQuote = t);
28382
+ });
28383
+ },
28384
+ { "./literal": 74 },
28385
+ ],
28386
+ 114: [
28387
+ function (t, e, n) {
28388
+ "use strict";
28389
+ const i = t("./statement"),
28390
+ r = "switch";
28391
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28392
+ i.apply(this, [r, o, s]),
28393
+ (this.test = t),
28394
+ (this.body = e),
28395
+ (this.shortForm = n);
28396
+ });
28397
+ },
28398
+ { "./statement": 108 },
28399
+ ],
28400
+ 115: [
28401
+ function (t, e, n) {
28402
+ "use strict";
28403
+ const i = t("./statement"),
28404
+ r = "throw";
28405
+ e.exports = i.extends(r, function (t, e, n) {
28406
+ i.apply(this, [r, e, n]), (this.what = t);
28407
+ });
28408
+ },
28409
+ { "./statement": 108 },
28410
+ ],
28411
+ 116: [
28412
+ function (t, e, n) {
28413
+ "use strict";
28414
+ const i = t("./declaration"),
28415
+ r = "trait";
28416
+ e.exports = i.extends(r, function (t, e, n, o) {
28417
+ i.apply(this, [r, t, n, o]), (this.body = e);
28418
+ });
28419
+ },
28420
+ { "./declaration": 46 },
28421
+ ],
28422
+ 117: [
28423
+ function (t, e, n) {
28424
+ "use strict";
28425
+ const i = t("./node"),
28426
+ r = "traitalias";
28427
+ e.exports = i.extends(r, function (t, e, n, o, s, a) {
28428
+ i.apply(this, [r, s, a]),
28429
+ (this.trait = t),
28430
+ (this.method = e),
28431
+ (this.as = n),
28432
+ (this.visibility = ""),
28433
+ o &&
28434
+ (0 === o[0]
28435
+ ? (this.visibility = "public")
28436
+ : 1 === o[0]
28437
+ ? (this.visibility = "protected")
28438
+ : 2 === o[0] && (this.visibility = "private"));
28439
+ });
28440
+ },
28441
+ { "./node": 85 },
28442
+ ],
28443
+ 118: [
28444
+ function (t, e, n) {
28445
+ "use strict";
28446
+ const i = t("./node"),
28447
+ r = "traitprecedence";
28448
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28449
+ i.apply(this, [r, o, s]),
28450
+ (this.trait = t),
28451
+ (this.method = e),
28452
+ (this.instead = n);
28453
+ });
28454
+ },
28455
+ { "./node": 85 },
28456
+ ],
28457
+ 119: [
28458
+ function (t, e, n) {
28459
+ "use strict";
28460
+ const i = t("./node"),
28461
+ r = "traituse";
28462
+ e.exports = i.extends(r, function (t, e, n, o) {
28463
+ i.apply(this, [r, n, o]), (this.traits = t), (this.adaptations = e);
28464
+ });
28465
+ },
28466
+ { "./node": 85 },
28467
+ ],
28468
+ 120: [
28469
+ function (t, e, n) {
28470
+ "use strict";
28471
+ const i = t("./statement");
28472
+ e.exports = i.extends("try", function (t, e, n, r, o) {
28473
+ i.apply(this, ["try", r, o]),
28474
+ (this.body = t),
28475
+ (this.catches = e),
28476
+ (this.always = n);
28477
+ });
28478
+ },
28479
+ { "./statement": 108 },
28480
+ ],
28481
+ 121: [
28482
+ function (t, e, n) {
28483
+ "use strict";
28484
+ const i = t("./reference"),
28485
+ r = "typereference",
28486
+ o = i.extends(r, function (t, e, n, o) {
28487
+ i.apply(this, [r, n, o]), (this.name = t), (this.raw = e);
28488
+ });
28489
+ (o.types = [
28490
+ "int",
28491
+ "float",
28492
+ "string",
28493
+ "bool",
28494
+ "object",
28495
+ "array",
28496
+ "callable",
28497
+ "iterable",
28498
+ "void",
28499
+ ]),
28500
+ (e.exports = o);
28501
+ },
28502
+ { "./reference": 103 },
28503
+ ],
28504
+ 122: [
28505
+ function (t, e, n) {
28506
+ "use strict";
28507
+ const i = t("./operation"),
28508
+ r = "unary";
28509
+ e.exports = i.extends(r, function (t, e, n, o) {
28510
+ i.apply(this, [r, n, o]), (this.type = t), (this.what = e);
28511
+ });
28512
+ },
28513
+ { "./operation": 92 },
28514
+ ],
28515
+ 123: [
28516
+ function (t, e, n) {
28517
+ "use strict";
28518
+ const i = t("./declaration"),
28519
+ r = "uniontype";
28520
+ e.exports = i.extends(r, function (t, e, n) {
28521
+ i.apply(this, [r, null, e, n]), (this.types = t);
28522
+ });
28523
+ },
28524
+ { "./declaration": 46 },
28525
+ ],
28526
+ 124: [
28527
+ function (t, e, n) {
28528
+ "use strict";
28529
+ const i = t("./statement"),
28530
+ r = "unset";
28531
+ e.exports = i.extends(r, function (t, e, n) {
28532
+ i.apply(this, [r, e, n]), (this.variables = t);
28533
+ });
28534
+ },
28535
+ { "./statement": 108 },
28536
+ ],
28537
+ 125: [
28538
+ function (t, e, n) {
28539
+ "use strict";
28540
+ const i = t("./statement"),
28541
+ r = "usegroup";
28542
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28543
+ i.apply(this, [r, o, s]),
28544
+ (this.name = t),
28545
+ (this.type = e),
28546
+ (this.items = n);
28547
+ });
28548
+ },
28549
+ { "./statement": 108 },
28550
+ ],
28551
+ 126: [
28552
+ function (t, e, n) {
28553
+ "use strict";
28554
+ const i = t("./statement"),
28555
+ r = "useitem",
28556
+ o = i.extends(r, function (t, e, n, o, s) {
28557
+ i.apply(this, [r, o, s]),
28558
+ (this.name = t),
28559
+ (this.alias = e),
28560
+ (this.type = n);
28561
+ });
28562
+ (o.TYPE_CONST = "const"),
28563
+ (o.TYPE_FUNCTION = "function"),
28564
+ (e.exports = o);
28565
+ },
28566
+ { "./statement": 108 },
28567
+ ],
28568
+ 127: [
28569
+ function (t, e, n) {
28570
+ "use strict";
28571
+ const i = t("./expression"),
28572
+ r = "variable";
28573
+ e.exports = i.extends(r, function (t, e, n, o) {
28574
+ i.apply(this, [r, n, o]), (this.name = t), (this.curly = e || !1);
28575
+ });
28576
+ },
28577
+ { "./expression": 58 },
28578
+ ],
28579
+ 128: [
28580
+ function (t, e, n) {
28581
+ "use strict";
28582
+ const i = t("./expression"),
28583
+ r = "variadic";
28584
+ e.exports = i.extends(r, function (t, e, n) {
28585
+ i.apply(this, [r, e, n]), (this.what = t);
28586
+ });
28587
+ },
28588
+ { "./expression": 58 },
28589
+ ],
28590
+ 129: [
28591
+ function (t, e, n) {
28592
+ "use strict";
28593
+ const i = t("./statement"),
28594
+ r = "while";
28595
+ e.exports = i.extends(r, function (t, e, n, o, s) {
28596
+ i.apply(this, [r, o, s]),
28597
+ (this.test = t),
28598
+ (this.body = e),
28599
+ (this.shortForm = n);
28600
+ });
28601
+ },
28602
+ { "./statement": 108 },
28603
+ ],
28604
+ 130: [
28605
+ function (t, e, n) {
28606
+ "use strict";
28607
+ const i = t("./expression"),
28608
+ r = "yield";
28609
+ e.exports = i.extends(r, function (t, e, n, o) {
28610
+ i.apply(this, [r, n, o]), (this.value = t), (this.key = e);
28611
+ });
28612
+ },
28613
+ { "./expression": 58 },
28614
+ ],
28615
+ 131: [
28616
+ function (t, e, n) {
28617
+ "use strict";
28618
+ const i = t("./expression"),
28619
+ r = "yieldfrom";
28620
+ e.exports = i.extends(r, function (t, e, n) {
28621
+ i.apply(this, [r, e, n]), (this.value = t);
28622
+ });
28623
+ },
28624
+ { "./expression": 58 },
28625
+ ],
28626
+ 132: [
28627
+ function (t, e, n) {
28628
+ "use strict";
28629
+ const i = t("./lexer"),
28630
+ r = t("./parser"),
28631
+ o = t("./tokens"),
28632
+ s = t("./ast");
28633
+ function a(t, e) {
28634
+ const n = Object.keys(t);
28635
+ let i = n.length;
28636
+ for (; i--; ) {
28637
+ const r = n[i],
28638
+ o = t[r];
28639
+ null === o
28640
+ ? delete e[r]
28641
+ : "function" == typeof o
28642
+ ? (e[r] = o.bind(e))
28643
+ : Array.isArray(o)
28644
+ ? (e[r] = Array.isArray(e[r]) ? e[r].concat(o) : o)
28645
+ : (e[r] =
28646
+ "object" == typeof o && "object" == typeof e[r]
28647
+ ? a(o, e[r])
28648
+ : o);
28649
+ }
28650
+ return e;
28651
+ }
28652
+ const l = function (t) {
28653
+ if ("function" == typeof this) return new this(t);
28654
+ if (
28655
+ ((this.tokens = o),
28656
+ (this.lexer = new i(this)),
28657
+ (this.ast = new s()),
28658
+ (this.parser = new r(this.lexer, this.ast)),
28659
+ t && "object" == typeof t)
28660
+ ) {
28661
+ if (t.parser && (t.lexer || (t.lexer = {}), t.parser.version)) {
28662
+ if ("string" == typeof t.parser.version) {
28663
+ let e = t.parser.version.split(".");
28664
+ if (((e = 100 * parseInt(e[0]) + parseInt(e[1])), isNaN(e)))
28665
+ throw new Error("Bad version number : " + t.parser.version);
28666
+ t.parser.version = e;
28667
+ } else if ("number" != typeof t.parser.version)
28668
+ throw new Error("Expecting a number for version");
28669
+ if (t.parser.version < 500 || t.parser.version > 900)
28670
+ throw new Error(
28671
+ "Can only handle versions between 5.x to 8.x"
28672
+ );
28673
+ }
28674
+ a(t, this), (this.lexer.version = this.parser.version);
28675
+ }
28676
+ },
28677
+ c = function (t) {
28678
+ return "function" == typeof t.write ? t.toString() : t;
28679
+ };
28680
+ (l.create = function (t) {
28681
+ return new l(t);
28682
+ }),
28683
+ (l.parseEval = function (t, e) {
28684
+ return new l(e).parseEval(t);
28685
+ }),
28686
+ (l.prototype.parseEval = function (t) {
28687
+ return (
28688
+ (this.lexer.mode_eval = !0),
28689
+ (this.lexer.all_tokens = !1),
28690
+ (t = c(t)),
28691
+ this.parser.parse(t, "eval")
28692
+ );
28693
+ }),
28694
+ (l.parseCode = function (t, e, n) {
28695
+ "object" != typeof e || n || ((n = e), (e = "unknown"));
28696
+ return new l(n).parseCode(t, e);
28697
+ }),
28698
+ (l.prototype.parseCode = function (t, e) {
28699
+ return (
28700
+ (this.lexer.mode_eval = !1),
28701
+ (this.lexer.all_tokens = !1),
28702
+ (t = c(t)),
28703
+ this.parser.parse(t, e)
28704
+ );
28705
+ }),
28706
+ (l.tokenGetAll = function (t, e) {
28707
+ return new l(e).tokenGetAll(t);
28708
+ }),
28709
+ (l.prototype.tokenGetAll = function (t) {
28710
+ (this.lexer.mode_eval = !1),
28711
+ (this.lexer.all_tokens = !0),
28712
+ (t = c(t));
28713
+ const e = this.lexer.EOF,
28714
+ n = this.tokens.values;
28715
+ this.lexer.setInput(t);
28716
+ let i = this.lexer.lex() || e;
28717
+ const r = [];
28718
+ for (; i != e; ) {
28719
+ let t = this.lexer.yytext;
28720
+ n.hasOwnProperty(i) &&
28721
+ (t = [n[i], t, this.lexer.yylloc.first_line]),
28722
+ r.push(t),
28723
+ (i = this.lexer.lex() || e);
28724
+ }
28725
+ return r;
28726
+ }),
28727
+ (e.exports = l),
28728
+ (e.exports.tokens = o),
28729
+ (e.exports.lexer = i),
28730
+ (e.exports.AST = s),
28731
+ (e.exports.parser = r),
28732
+ (e.exports.combine = a),
28733
+ (e.exports.default = l);
28734
+ },
28735
+ { "./ast": 20, "./lexer": 133, "./parser": 143, "./tokens": 159 },
28736
+ ],
28737
+ 133: [
28738
+ function (t, e, n) {
28739
+ "use strict";
28740
+ const i = function (t) {
28741
+ (this.engine = t),
28742
+ (this.tok = this.engine.tokens.names),
28743
+ (this.EOF = 1),
28744
+ (this.debug = !1),
28745
+ (this.all_tokens = !0),
28746
+ (this.comment_tokens = !1),
28747
+ (this.mode_eval = !1),
28748
+ (this.asp_tags = !1),
28749
+ (this.short_tags = !1),
28750
+ (this.version = 800),
28751
+ (this.yyprevcol = 0),
28752
+ (this.keywords = {
28753
+ __class__: this.tok.T_CLASS_C,
28754
+ __trait__: this.tok.T_TRAIT_C,
28755
+ __function__: this.tok.T_FUNC_C,
28756
+ __method__: this.tok.T_METHOD_C,
28757
+ __line__: this.tok.T_LINE,
28758
+ __file__: this.tok.T_FILE,
28759
+ __dir__: this.tok.T_DIR,
28760
+ __namespace__: this.tok.T_NS_C,
28761
+ exit: this.tok.T_EXIT,
28762
+ die: this.tok.T_EXIT,
28763
+ function: this.tok.T_FUNCTION,
28764
+ const: this.tok.T_CONST,
28765
+ return: this.tok.T_RETURN,
28766
+ try: this.tok.T_TRY,
28767
+ catch: this.tok.T_CATCH,
28768
+ finally: this.tok.T_FINALLY,
28769
+ throw: this.tok.T_THROW,
28770
+ if: this.tok.T_IF,
28771
+ elseif: this.tok.T_ELSEIF,
28772
+ endif: this.tok.T_ENDIF,
28773
+ else: this.tok.T_ELSE,
28774
+ while: this.tok.T_WHILE,
28775
+ endwhile: this.tok.T_ENDWHILE,
28776
+ do: this.tok.T_DO,
28777
+ for: this.tok.T_FOR,
28778
+ endfor: this.tok.T_ENDFOR,
28779
+ foreach: this.tok.T_FOREACH,
28780
+ endforeach: this.tok.T_ENDFOREACH,
28781
+ declare: this.tok.T_DECLARE,
28782
+ enddeclare: this.tok.T_ENDDECLARE,
28783
+ instanceof: this.tok.T_INSTANCEOF,
28784
+ as: this.tok.T_AS,
28785
+ switch: this.tok.T_SWITCH,
28786
+ endswitch: this.tok.T_ENDSWITCH,
28787
+ case: this.tok.T_CASE,
28788
+ default: this.tok.T_DEFAULT,
28789
+ break: this.tok.T_BREAK,
28790
+ continue: this.tok.T_CONTINUE,
28791
+ goto: this.tok.T_GOTO,
28792
+ echo: this.tok.T_ECHO,
28793
+ print: this.tok.T_PRINT,
28794
+ class: this.tok.T_CLASS,
28795
+ interface: this.tok.T_INTERFACE,
28796
+ trait: this.tok.T_TRAIT,
28797
+ extends: this.tok.T_EXTENDS,
28798
+ implements: this.tok.T_IMPLEMENTS,
28799
+ new: this.tok.T_NEW,
28800
+ clone: this.tok.T_CLONE,
28801
+ var: this.tok.T_VAR,
28802
+ eval: this.tok.T_EVAL,
28803
+ include: this.tok.T_INCLUDE,
28804
+ include_once: this.tok.T_INCLUDE_ONCE,
28805
+ require: this.tok.T_REQUIRE,
28806
+ require_once: this.tok.T_REQUIRE_ONCE,
28807
+ namespace: this.tok.T_NAMESPACE,
28808
+ use: this.tok.T_USE,
28809
+ insteadof: this.tok.T_INSTEADOF,
28810
+ global: this.tok.T_GLOBAL,
28811
+ isset: this.tok.T_ISSET,
28812
+ empty: this.tok.T_EMPTY,
28813
+ __halt_compiler: this.tok.T_HALT_COMPILER,
28814
+ static: this.tok.T_STATIC,
28815
+ abstract: this.tok.T_ABSTRACT,
28816
+ final: this.tok.T_FINAL,
28817
+ private: this.tok.T_PRIVATE,
28818
+ protected: this.tok.T_PROTECTED,
28819
+ public: this.tok.T_PUBLIC,
28820
+ unset: this.tok.T_UNSET,
28821
+ list: this.tok.T_LIST,
28822
+ array: this.tok.T_ARRAY,
28823
+ callable: this.tok.T_CALLABLE,
28824
+ or: this.tok.T_LOGICAL_OR,
28825
+ and: this.tok.T_LOGICAL_AND,
28826
+ xor: this.tok.T_LOGICAL_XOR,
28827
+ match: this.tok.T_MATCH,
28828
+ }),
28829
+ (this.castKeywords = {
28830
+ int: this.tok.T_INT_CAST,
28831
+ integer: this.tok.T_INT_CAST,
28832
+ real: this.tok.T_DOUBLE_CAST,
28833
+ double: this.tok.T_DOUBLE_CAST,
28834
+ float: this.tok.T_DOUBLE_CAST,
28835
+ string: this.tok.T_STRING_CAST,
28836
+ binary: this.tok.T_STRING_CAST,
28837
+ array: this.tok.T_ARRAY_CAST,
28838
+ object: this.tok.T_OBJECT_CAST,
28839
+ bool: this.tok.T_BOOL_CAST,
28840
+ boolean: this.tok.T_BOOL_CAST,
28841
+ unset: this.tok.T_UNSET_CAST,
28842
+ });
28843
+ };
28844
+ (i.prototype.setInput = function (t) {
28845
+ return (
28846
+ (this._input = t),
28847
+ (this.size = t.length),
28848
+ (this.yylineno = 1),
28849
+ (this.offset = 0),
28850
+ (this.yyprevcol = 0),
28851
+ (this.yytext = ""),
28852
+ (this.yylloc = {
28853
+ first_offset: 0,
28854
+ first_line: 1,
28855
+ first_column: 0,
28856
+ prev_offset: 0,
28857
+ prev_line: 1,
28858
+ prev_column: 0,
28859
+ last_line: 1,
28860
+ last_column: 0,
28861
+ }),
28862
+ (this.tokens = []),
28863
+ this.version > 703
28864
+ ? (this.keywords.fn = this.tok.T_FN)
28865
+ : delete this.keywords.fn,
28866
+ (this.done = this.offset >= this.size),
28867
+ !this.all_tokens && this.mode_eval
28868
+ ? ((this.conditionStack = ["INITIAL"]),
28869
+ this.begin("ST_IN_SCRIPTING"))
28870
+ : ((this.conditionStack = []), this.begin("INITIAL")),
28871
+ (this.heredoc_label = {
28872
+ label: "",
28873
+ length: 0,
28874
+ indentation: 0,
28875
+ indentation_uses_spaces: !1,
28876
+ finished: !1,
28877
+ first_encaps_node: !1,
28878
+ toString: function () {
28879
+ this.label;
28880
+ },
28881
+ }),
28882
+ this
28883
+ );
28884
+ }),
28885
+ (i.prototype.input = function () {
28886
+ const t = this._input[this.offset];
28887
+ return t
28888
+ ? ((this.yytext += t),
28889
+ this.offset++,
28890
+ "\r" === t &&
28891
+ "\n" === this._input[this.offset] &&
28892
+ ((this.yytext += "\n"), this.offset++),
28893
+ "\n" === t || "\r" === t
28894
+ ? ((this.yylloc.last_line = ++this.yylineno),
28895
+ (this.yyprevcol = this.yylloc.last_column),
28896
+ (this.yylloc.last_column = 0))
28897
+ : this.yylloc.last_column++,
28898
+ t)
28899
+ : "";
28900
+ }),
28901
+ (i.prototype.unput = function (t) {
28902
+ if (1 === t)
28903
+ this.offset--,
28904
+ "\n" === this._input[this.offset] &&
28905
+ "\r" === this._input[this.offset - 1] &&
28906
+ (this.offset--, t++),
28907
+ "\r" === this._input[this.offset] ||
28908
+ "\n" === this._input[this.offset]
28909
+ ? (this.yylloc.last_line--,
28910
+ this.yylineno--,
28911
+ (this.yylloc.last_column = this.yyprevcol))
28912
+ : this.yylloc.last_column--,
28913
+ (this.yytext = this.yytext.substring(
28914
+ 0,
28915
+ this.yytext.length - t
28916
+ ));
28917
+ else if (t > 0)
28918
+ if (((this.offset -= t), t < this.yytext.length)) {
28919
+ (this.yytext = this.yytext.substring(
28920
+ 0,
28921
+ this.yytext.length - t
28922
+ )),
28923
+ (this.yylloc.last_line = this.yylloc.first_line),
28924
+ (this.yylloc.last_column = this.yyprevcol =
28925
+ this.yylloc.first_column);
28926
+ for (let t = 0; t < this.yytext.length; t++) {
28927
+ let e = this.yytext[t];
28928
+ "\r" === e
28929
+ ? ((e = this.yytext[++t]),
28930
+ (this.yyprevcol = this.yylloc.last_column),
28931
+ this.yylloc.last_line++,
28932
+ (this.yylloc.last_column = 0),
28933
+ "\n" !== e &&
28934
+ ("\r" === e
28935
+ ? this.yylloc.last_line++
28936
+ : this.yylloc.last_column++))
28937
+ : "\n" === e
28938
+ ? ((this.yyprevcol = this.yylloc.last_column),
28939
+ this.yylloc.last_line++,
28940
+ (this.yylloc.last_column = 0))
28941
+ : this.yylloc.last_column++;
28942
+ }
28943
+ this.yylineno = this.yylloc.last_line;
28944
+ } else
28945
+ (this.yytext = ""),
28946
+ (this.yylloc.last_line = this.yylineno =
28947
+ this.yylloc.first_line),
28948
+ (this.yylloc.last_column = this.yylloc.first_column);
28949
+ return this;
28950
+ }),
28951
+ (i.prototype.tryMatch = function (t) {
28952
+ return t === this.ahead(t.length);
28953
+ }),
28954
+ (i.prototype.tryMatchCaseless = function (t) {
28955
+ return t === this.ahead(t.length).toLowerCase();
28956
+ }),
28957
+ (i.prototype.ahead = function (t) {
28958
+ let e = this._input.substring(this.offset, this.offset + t);
28959
+ return (
28960
+ "\r" === e[e.length - 1] &&
28961
+ "\n" === this._input[this.offset + t + 1] &&
28962
+ (e += "\n"),
28963
+ e
28964
+ );
28965
+ }),
28966
+ (i.prototype.consume = function (t) {
28967
+ for (let e = 0; e < t; e++) {
28968
+ const t = this._input[this.offset];
28969
+ if (!t) break;
28970
+ (this.yytext += t),
28971
+ this.offset++,
28972
+ "\r" === t &&
28973
+ "\n" === this._input[this.offset] &&
28974
+ ((this.yytext += "\n"), this.offset++, e++),
28975
+ "\n" === t || "\r" === t
28976
+ ? ((this.yylloc.last_line = ++this.yylineno),
28977
+ (this.yyprevcol = this.yylloc.last_column),
28978
+ (this.yylloc.last_column = 0))
28979
+ : this.yylloc.last_column++;
28980
+ }
28981
+ return this;
28982
+ }),
28983
+ (i.prototype.getState = function () {
28984
+ return {
28985
+ yytext: this.yytext,
28986
+ offset: this.offset,
28987
+ yylineno: this.yylineno,
28988
+ yyprevcol: this.yyprevcol,
28989
+ yylloc: {
28990
+ first_offset: this.yylloc.first_offset,
28991
+ first_line: this.yylloc.first_line,
28992
+ first_column: this.yylloc.first_column,
28993
+ last_line: this.yylloc.last_line,
28994
+ last_column: this.yylloc.last_column,
28995
+ },
28996
+ heredoc_label: this.heredoc_label,
28997
+ };
28998
+ }),
28999
+ (i.prototype.setState = function (t) {
29000
+ return (
29001
+ (this.yytext = t.yytext),
29002
+ (this.offset = t.offset),
29003
+ (this.yylineno = t.yylineno),
29004
+ (this.yyprevcol = t.yyprevcol),
29005
+ (this.yylloc = t.yylloc),
29006
+ t.heredoc_label && (this.heredoc_label = t.heredoc_label),
29007
+ this
29008
+ );
29009
+ }),
29010
+ (i.prototype.appendToken = function (t, e) {
29011
+ return this.tokens.push([t, e]), this;
29012
+ }),
29013
+ (i.prototype.lex = function () {
29014
+ (this.yylloc.prev_offset = this.offset),
29015
+ (this.yylloc.prev_line = this.yylloc.last_line),
29016
+ (this.yylloc.prev_column = this.yylloc.last_column);
29017
+ let t = this.next() || this.lex();
29018
+ if (!this.all_tokens) {
29019
+ for (
29020
+ ;
29021
+ t === this.tok.T_WHITESPACE ||
29022
+ (!this.comment_tokens &&
29023
+ (t === this.tok.T_COMMENT || t === this.tok.T_DOC_COMMENT)) ||
29024
+ t === this.tok.T_OPEN_TAG;
29025
+
29026
+ )
29027
+ t = this.next() || this.lex();
29028
+ if (t == this.tok.T_OPEN_TAG_WITH_ECHO) return this.tok.T_ECHO;
29029
+ if (t === this.tok.T_CLOSE_TAG) return ";";
29030
+ }
29031
+ return (
29032
+ this.yylloc.prev_offset ||
29033
+ ((this.yylloc.prev_offset = this.yylloc.first_offset),
29034
+ (this.yylloc.prev_line = this.yylloc.first_line),
29035
+ (this.yylloc.prev_column = this.yylloc.first_column)),
29036
+ t
29037
+ );
29038
+ }),
29039
+ (i.prototype.begin = function (t) {
29040
+ if (
29041
+ (this.conditionStack.push(t),
29042
+ (this.curCondition = t),
29043
+ (this.stateCb = this["match" + t]),
29044
+ "function" != typeof this.stateCb)
29045
+ )
29046
+ throw new Error('Undefined condition state "' + t + '"');
29047
+ return this;
29048
+ }),
29049
+ (i.prototype.popState = function () {
29050
+ const t =
29051
+ this.conditionStack.length - 1 > 0
29052
+ ? this.conditionStack.pop()
29053
+ : this.conditionStack[0];
29054
+ if (
29055
+ ((this.curCondition =
29056
+ this.conditionStack[this.conditionStack.length - 1]),
29057
+ (this.stateCb = this["match" + this.curCondition]),
29058
+ "function" != typeof this.stateCb)
29059
+ )
29060
+ throw new Error(
29061
+ 'Undefined condition state "' + this.curCondition + '"'
29062
+ );
29063
+ return t;
29064
+ }),
29065
+ (i.prototype.next = function () {
29066
+ let t;
29067
+ if (
29068
+ (this._input || (this.done = !0),
29069
+ (this.yylloc.first_offset = this.offset),
29070
+ (this.yylloc.first_line = this.yylloc.last_line),
29071
+ (this.yylloc.first_column = this.yylloc.last_column),
29072
+ (this.yytext = ""),
29073
+ this.done)
29074
+ )
29075
+ return (
29076
+ (this.yylloc.prev_offset = this.yylloc.first_offset),
29077
+ (this.yylloc.prev_line = this.yylloc.first_line),
29078
+ (this.yylloc.prev_column = this.yylloc.first_column),
29079
+ this.EOF
29080
+ );
29081
+ if (
29082
+ (this.tokens.length > 0
29083
+ ? ((t = this.tokens.shift()),
29084
+ "object" == typeof t[1]
29085
+ ? this.setState(t[1])
29086
+ : this.consume(t[1]),
29087
+ (t = t[0]))
29088
+ : (t = this.stateCb.apply(this, [])),
29089
+ this.offset >= this.size &&
29090
+ 0 === this.tokens.length &&
29091
+ (this.done = !0),
29092
+ this.debug)
29093
+ ) {
29094
+ let e = t;
29095
+ e =
29096
+ "number" == typeof e
29097
+ ? this.engine.tokens.values[e]
29098
+ : '"' + e + '"';
29099
+ const n = new Error(
29100
+ e +
29101
+ "\tfrom " +
29102
+ this.yylloc.first_line +
29103
+ "," +
29104
+ this.yylloc.first_column +
29105
+ "\t - to " +
29106
+ this.yylloc.last_line +
29107
+ "," +
29108
+ this.yylloc.last_column +
29109
+ '\t"' +
29110
+ this.yytext +
29111
+ '"'
29112
+ );
29113
+ console.error(n.stack);
29114
+ }
29115
+ return t;
29116
+ }),
29117
+ [
29118
+ t("./lexer/attribute.js"),
29119
+ t("./lexer/comments.js"),
29120
+ t("./lexer/initial.js"),
29121
+ t("./lexer/numbers.js"),
29122
+ t("./lexer/property.js"),
29123
+ t("./lexer/scripting.js"),
29124
+ t("./lexer/strings.js"),
29125
+ t("./lexer/tokens.js"),
29126
+ t("./lexer/utils.js"),
29127
+ ].forEach(function (t) {
29128
+ for (const e in t) i.prototype[e] = t[e];
29129
+ }),
29130
+ (e.exports = i);
29131
+ },
29132
+ {
29133
+ "./lexer/attribute.js": 134,
29134
+ "./lexer/comments.js": 135,
29135
+ "./lexer/initial.js": 136,
29136
+ "./lexer/numbers.js": 137,
29137
+ "./lexer/property.js": 138,
29138
+ "./lexer/scripting.js": 139,
29139
+ "./lexer/strings.js": 140,
29140
+ "./lexer/tokens.js": 141,
29141
+ "./lexer/utils.js": 142,
29142
+ },
29143
+ ],
29144
+ 134: [
29145
+ function (t, e, n) {
29146
+ "use strict";
29147
+ e.exports = {
29148
+ matchST_ATTRIBUTE: function () {
29149
+ let t = 0,
29150
+ e = this.input();
29151
+ if (this.is_WHITESPACE()) {
29152
+ do {
29153
+ e = this.input();
29154
+ } while (this.is_WHITESPACE());
29155
+ return this.unput(1), null;
29156
+ }
29157
+ switch (e) {
29158
+ case "]":
29159
+ return 0 === t ? this.popState() : t--, "]";
29160
+ case "(":
29161
+ case ")":
29162
+ case ":":
29163
+ case "=":
29164
+ return this.consume_TOKEN();
29165
+ case "[":
29166
+ return t++, "[";
29167
+ case ",":
29168
+ return ",";
29169
+ case '"':
29170
+ return this.ST_DOUBLE_QUOTES();
29171
+ case "'":
29172
+ return this.T_CONSTANT_ENCAPSED_STRING();
29173
+ case "/":
29174
+ if ("/" === this._input[this.offset]) return this.T_COMMENT();
29175
+ if ("*" === this._input[this.offset])
29176
+ return this.input(), this.T_DOC_COMMENT();
29177
+ }
29178
+ if (this.is_LABEL_START() || "\\" === e) {
29179
+ for (; this.offset < this.size; ) {
29180
+ const t = this.input();
29181
+ if (!this.is_LABEL() && "\\" !== t) {
29182
+ t && this.unput(1);
29183
+ break;
29184
+ }
29185
+ }
29186
+ return this.tok.T_STRING;
29187
+ }
29188
+ if (this.is_NUM()) return this.consume_NUM();
29189
+ throw new Error(
29190
+ `Bad terminal sequence "${e}" at line ${this.yylineno} (offset ${this.offset})`
29191
+ );
29192
+ },
29193
+ };
29194
+ },
29195
+ {},
29196
+ ],
29197
+ 135: [
29198
+ function (t, e, n) {
29199
+ "use strict";
29200
+ e.exports = {
29201
+ T_COMMENT: function () {
29202
+ for (; this.offset < this.size; ) {
29203
+ const t = this.input();
29204
+ if ("\n" === t || "\r" === t) return this.tok.T_COMMENT;
29205
+ if (
29206
+ "?" === t &&
29207
+ !this.aspTagMode &&
29208
+ ">" === this._input[this.offset]
29209
+ )
29210
+ return this.unput(1), this.tok.T_COMMENT;
29211
+ if (
29212
+ "%" === t &&
29213
+ this.aspTagMode &&
29214
+ ">" === this._input[this.offset]
29215
+ )
29216
+ return this.unput(1), this.tok.T_COMMENT;
29217
+ }
29218
+ return this.tok.T_COMMENT;
29219
+ },
29220
+ T_DOC_COMMENT: function () {
29221
+ let t = this.input(),
29222
+ e = this.tok.T_COMMENT;
29223
+ if ("*" === t) {
29224
+ if (
29225
+ ((t = this.input()),
29226
+ this.is_WHITESPACE() && (e = this.tok.T_DOC_COMMENT),
29227
+ "/" === t)
29228
+ )
29229
+ return e;
29230
+ this.unput(1);
29231
+ }
29232
+ for (; this.offset < this.size; )
29233
+ if (
29234
+ ((t = this.input()),
29235
+ "*" === t && "/" === this._input[this.offset])
29236
+ ) {
29237
+ this.input();
29238
+ break;
29239
+ }
29240
+ return e;
29241
+ },
29242
+ };
29243
+ },
29244
+ {},
29245
+ ],
29246
+ 136: [
29247
+ function (t, e, n) {
29248
+ "use strict";
29249
+ e.exports = {
29250
+ nextINITIAL: function () {
29251
+ return (
29252
+ this.conditionStack.length > 1 &&
29253
+ "INITIAL" === this.conditionStack[this.conditionStack.length - 1]
29254
+ ? this.popState()
29255
+ : this.begin("ST_IN_SCRIPTING"),
29256
+ this
29257
+ );
29258
+ },
29259
+ matchINITIAL: function () {
29260
+ for (; this.offset < this.size; ) {
29261
+ let t = this.input();
29262
+ if ("<" == t)
29263
+ if (((t = this.ahead(1)), "?" == t)) {
29264
+ if (this.tryMatch("?=")) {
29265
+ this.unput(1)
29266
+ .appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3)
29267
+ .nextINITIAL();
29268
+ break;
29269
+ }
29270
+ if (
29271
+ this.tryMatchCaseless("?php") &&
29272
+ ((t = this._input[this.offset + 4]),
29273
+ " " === t || "\t" === t || "\n" === t || "\r" === t)
29274
+ ) {
29275
+ this.unput(1)
29276
+ .appendToken(this.tok.T_OPEN_TAG, 6)
29277
+ .nextINITIAL();
29278
+ break;
29279
+ }
29280
+ if (this.short_tags) {
29281
+ this.unput(1)
29282
+ .appendToken(this.tok.T_OPEN_TAG, 2)
29283
+ .nextINITIAL();
29284
+ break;
29285
+ }
29286
+ } else if (this.asp_tags && "%" == t) {
29287
+ if (this.tryMatch("%=")) {
29288
+ (this.aspTagMode = !0),
29289
+ this.unput(1)
29290
+ .appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3)
29291
+ .nextINITIAL();
29292
+ break;
29293
+ }
29294
+ (this.aspTagMode = !0),
29295
+ this.unput(1)
29296
+ .appendToken(this.tok.T_OPEN_TAG, 2)
29297
+ .nextINITIAL();
29298
+ break;
29299
+ }
29300
+ }
29301
+ return this.yytext.length > 0 && this.tok.T_INLINE_HTML;
29302
+ },
29303
+ };
29304
+ },
29305
+ {},
29306
+ ],
29307
+ 137: [
29308
+ function (t, e, n) {
29309
+ (function (t) {
29310
+ (function () {
29311
+ "use strict";
29312
+ let n = 10,
29313
+ i = "2147483648";
29314
+ "x64" == t.arch && ((n = 19), (i = "9223372036854775808")),
29315
+ (e.exports = {
29316
+ consume_NUM: function () {
29317
+ let t = this.yytext[0],
29318
+ e = "." === t;
29319
+ if ("0" === t)
29320
+ if (((t = this.input()), "x" === t || "X" === t)) {
29321
+ if (((t = this.input()), "_" !== t && this.is_HEX()))
29322
+ return this.consume_HNUM();
29323
+ this.unput(t ? 2 : 1);
29324
+ } else if ("b" === t || "B" === t) {
29325
+ if (
29326
+ ((t = this.input()),
29327
+ ("_" !== t && "0" === t) || "1" === t)
29328
+ )
29329
+ return this.consume_BNUM();
29330
+ this.unput(t ? 2 : 1);
29331
+ } else this.is_NUM() || (t && this.unput(1));
29332
+ for (; this.offset < this.size; ) {
29333
+ const n = t;
29334
+ if (((t = this.input()), "_" === t)) {
29335
+ if ("_" === n) {
29336
+ this.unput(2);
29337
+ break;
29338
+ }
29339
+ if ("." === n) {
29340
+ this.unput(1);
29341
+ break;
29342
+ }
29343
+ if ("e" === n || "E" === n) {
29344
+ this.unput(2);
29345
+ break;
29346
+ }
29347
+ } else {
29348
+ if ("." === t) {
29349
+ if (e) {
29350
+ this.unput(1);
29351
+ break;
29352
+ }
29353
+ if ("_" === n) {
29354
+ this.unput(2);
29355
+ break;
29356
+ }
29357
+ e = !0;
29358
+ continue;
29359
+ }
29360
+ if ("e" === t || "E" === t) {
29361
+ if ("_" === n) {
29362
+ this.unput(1);
29363
+ break;
29364
+ }
29365
+ let e = 2;
29366
+ if (
29367
+ ((t = this.input()),
29368
+ ("+" !== t && "-" !== t) ||
29369
+ ((e = 3), (t = this.input())),
29370
+ this.is_NUM_START())
29371
+ )
29372
+ return this.consume_LNUM(), this.tok.T_DNUMBER;
29373
+ this.unput(t ? e : e - 1);
29374
+ break;
29375
+ }
29376
+ }
29377
+ if (!this.is_NUM()) {
29378
+ t && this.unput(1);
29379
+ break;
29380
+ }
29381
+ }
29382
+ return e
29383
+ ? this.tok.T_DNUMBER
29384
+ : this.yytext.length < n - 1 ||
29385
+ this.yytext.length < n ||
29386
+ (this.yytext.length == n && this.yytext < i)
29387
+ ? this.tok.T_LNUMBER
29388
+ : this.tok.T_DNUMBER;
29389
+ },
29390
+ consume_HNUM: function () {
29391
+ for (; this.offset < this.size; ) {
29392
+ const t = this.input();
29393
+ if (!this.is_HEX()) {
29394
+ t && this.unput(1);
29395
+ break;
29396
+ }
29397
+ }
29398
+ return this.tok.T_LNUMBER;
29399
+ },
29400
+ consume_LNUM: function () {
29401
+ for (; this.offset < this.size; ) {
29402
+ const t = this.input();
29403
+ if (!this.is_NUM()) {
29404
+ t && this.unput(1);
29405
+ break;
29406
+ }
29407
+ }
29408
+ return this.tok.T_LNUMBER;
29409
+ },
29410
+ consume_BNUM: function () {
29411
+ let t;
29412
+ for (; this.offset < this.size; )
29413
+ if (
29414
+ ((t = this.input()), "0" !== t && "1" !== t && "_" !== t)
29415
+ ) {
29416
+ t && this.unput(1);
29417
+ break;
29418
+ }
29419
+ return this.tok.T_LNUMBER;
29420
+ },
29421
+ });
29422
+ }.call(this));
29423
+ }.call(this, t("_process")));
29424
+ },
29425
+ { _process: 160 },
29426
+ ],
29427
+ 138: [
29428
+ function (t, e, n) {
29429
+ "use strict";
29430
+ e.exports = {
29431
+ matchST_LOOKING_FOR_PROPERTY: function () {
29432
+ let t = this.input();
29433
+ if ("-" === t) {
29434
+ if (((t = this.input()), ">" === t))
29435
+ return this.tok.T_OBJECT_OPERATOR;
29436
+ t && this.unput(1);
29437
+ } else {
29438
+ if (this.is_WHITESPACE()) return this.tok.T_WHITESPACE;
29439
+ if (this.is_LABEL_START())
29440
+ return this.consume_LABEL(), this.popState(), this.tok.T_STRING;
29441
+ }
29442
+ return this.popState(), t && this.unput(1), !1;
29443
+ },
29444
+ matchST_LOOKING_FOR_VARNAME: function () {
29445
+ let t = this.input();
29446
+ if (
29447
+ (this.popState(),
29448
+ this.begin("ST_IN_SCRIPTING"),
29449
+ this.is_LABEL_START())
29450
+ ) {
29451
+ if (
29452
+ (this.consume_LABEL(),
29453
+ (t = this.input()),
29454
+ "[" === t || "}" === t)
29455
+ )
29456
+ return this.unput(1), this.tok.T_STRING_VARNAME;
29457
+ this.unput(this.yytext.length);
29458
+ } else t && this.unput(1);
29459
+ return !1;
29460
+ },
29461
+ matchST_VAR_OFFSET: function () {
29462
+ const t = this.input();
29463
+ if (this.is_NUM_START())
29464
+ return this.consume_NUM(), this.tok.T_NUM_STRING;
29465
+ if ("]" === t) return this.popState(), "]";
29466
+ if ("$" === t) {
29467
+ if ((this.input(), this.is_LABEL_START()))
29468
+ return this.consume_LABEL(), this.tok.T_VARIABLE;
29469
+ throw new Error("Unexpected terminal");
29470
+ }
29471
+ if (this.is_LABEL_START())
29472
+ return this.consume_LABEL(), this.tok.T_STRING;
29473
+ if (this.is_WHITESPACE() || "\\" === t || "'" === t || "#" === t)
29474
+ return this.tok.T_ENCAPSED_AND_WHITESPACE;
29475
+ if (
29476
+ "[" === t ||
29477
+ "{" === t ||
29478
+ "}" === t ||
29479
+ '"' === t ||
29480
+ "`" === t ||
29481
+ this.is_TOKEN()
29482
+ )
29483
+ return t;
29484
+ throw new Error("Unexpected terminal");
29485
+ },
29486
+ };
29487
+ },
29488
+ {},
29489
+ ],
29490
+ 139: [
29491
+ function (t, e, n) {
29492
+ "use strict";
29493
+ e.exports = {
29494
+ matchST_IN_SCRIPTING: function () {
29495
+ let t = this.input();
29496
+ switch (t) {
29497
+ case " ":
29498
+ case "\t":
29499
+ case "\n":
29500
+ case "\r":
29501
+ case "\r\n":
29502
+ return this.T_WHITESPACE();
29503
+ case "#":
29504
+ return "[" === this._input[this.offset]
29505
+ ? (this.input(),
29506
+ this.begin("ST_ATTRIBUTE"),
29507
+ this.tok.T_ATTRIBUTE)
29508
+ : this.T_COMMENT();
29509
+ case "/":
29510
+ return "/" === this._input[this.offset]
29511
+ ? this.T_COMMENT()
29512
+ : "*" === this._input[this.offset]
29513
+ ? (this.input(), this.T_DOC_COMMENT())
29514
+ : this.consume_TOKEN();
29515
+ case "'":
29516
+ return this.T_CONSTANT_ENCAPSED_STRING();
29517
+ case '"':
29518
+ return this.ST_DOUBLE_QUOTES();
29519
+ case "`":
29520
+ return this.begin("ST_BACKQUOTE"), "`";
29521
+ case "?":
29522
+ if (!this.aspTagMode && this.tryMatch(">")) {
29523
+ this.input();
29524
+ const t = this._input[this.offset];
29525
+ return (
29526
+ ("\n" !== t && "\r" !== t) || this.input(),
29527
+ this.conditionStack.length > 1 && this.begin("INITIAL"),
29528
+ this.tok.T_CLOSE_TAG
29529
+ );
29530
+ }
29531
+ return this.consume_TOKEN();
29532
+ case "%":
29533
+ return this.aspTagMode && ">" === this._input[this.offset]
29534
+ ? (this.input(),
29535
+ (t = this._input[this.offset]),
29536
+ ("\n" !== t && "\r" !== t) || this.input(),
29537
+ (this.aspTagMode = !1),
29538
+ this.conditionStack.length > 1 && this.begin("INITIAL"),
29539
+ this.tok.T_CLOSE_TAG)
29540
+ : this.consume_TOKEN();
29541
+ case "{":
29542
+ return this.begin("ST_IN_SCRIPTING"), "{";
29543
+ case "}":
29544
+ return this.conditionStack.length > 2 && this.popState(), "}";
29545
+ default:
29546
+ if ("." === t) {
29547
+ if (((t = this.input()), this.is_NUM_START()))
29548
+ return this.consume_NUM();
29549
+ t && this.unput(1);
29550
+ }
29551
+ if (this.is_NUM_START()) return this.consume_NUM();
29552
+ if (this.is_LABEL_START())
29553
+ return this.consume_LABEL().T_STRING();
29554
+ if (this.is_TOKEN()) return this.consume_TOKEN();
29555
+ }
29556
+ throw new Error(
29557
+ 'Bad terminal sequence "' +
29558
+ t +
29559
+ '" at line ' +
29560
+ this.yylineno +
29561
+ " (offset " +
29562
+ this.offset +
29563
+ ")"
29564
+ );
29565
+ },
29566
+ T_WHITESPACE: function () {
29567
+ for (; this.offset < this.size; ) {
29568
+ const t = this.input();
29569
+ if (" " !== t && "\t" !== t && "\n" !== t && "\r" !== t) {
29570
+ t && this.unput(1);
29571
+ break;
29572
+ }
29573
+ }
29574
+ return this.tok.T_WHITESPACE;
29575
+ },
29576
+ };
29577
+ },
29578
+ {},
29579
+ ],
29580
+ 140: [
29581
+ function (t, e, n) {
29582
+ "use strict";
29583
+ const i = ["\n", "\r"],
29584
+ r = ["\n", "\r", ";"],
29585
+ o = r.concat(["\t", " ", ",", "]", ")", "/", "=", "!"]);
29586
+ e.exports = {
29587
+ T_CONSTANT_ENCAPSED_STRING: function () {
29588
+ let t;
29589
+ for (; this.offset < this.size; )
29590
+ if (((t = this.input()), "\\" == t)) this.input();
29591
+ else if ("'" == t) break;
29592
+ return this.tok.T_CONSTANT_ENCAPSED_STRING;
29593
+ },
29594
+ is_HEREDOC: function () {
29595
+ const t = this.offset;
29596
+ if (
29597
+ "<" === this._input[this.offset - 1] &&
29598
+ "<" === this._input[this.offset] &&
29599
+ "<" === this._input[this.offset + 1]
29600
+ ) {
29601
+ if (((this.offset += 3), this.is_TABSPACE()))
29602
+ for (
29603
+ ;
29604
+ this.offset < this.size &&
29605
+ (this.offset++, this.is_TABSPACE());
29606
+
29607
+ );
29608
+ let e = this._input[this.offset - 1];
29609
+ if (
29610
+ ("'" === e || '"' === e ? this.offset++ : (e = null),
29611
+ this.is_LABEL_START())
29612
+ ) {
29613
+ let n = this.offset - 1;
29614
+ for (
29615
+ ;
29616
+ this.offset < this.size && (this.offset++, this.is_LABEL());
29617
+
29618
+ );
29619
+ const r = this._input.substring(n, this.offset - 1);
29620
+ if (
29621
+ (!e || e === this._input[this.offset - 1]) &&
29622
+ (e && this.offset++, i.includes(this._input[this.offset - 1]))
29623
+ )
29624
+ return (
29625
+ (this.heredoc_label.label = r),
29626
+ (this.heredoc_label.length = r.length),
29627
+ (this.heredoc_label.finished = !1),
29628
+ (n = this.offset - t),
29629
+ (this.offset = t),
29630
+ this.consume(n),
29631
+ "'" === e
29632
+ ? this.begin("ST_NOWDOC")
29633
+ : this.begin("ST_HEREDOC"),
29634
+ this.prematch_ENDOFDOC(),
29635
+ this.tok.T_START_HEREDOC
29636
+ );
29637
+ }
29638
+ }
29639
+ return (this.offset = t), !1;
29640
+ },
29641
+ ST_DOUBLE_QUOTES: function () {
29642
+ let t;
29643
+ for (; this.offset < this.size; )
29644
+ if (((t = this.input()), "\\" == t)) this.input();
29645
+ else {
29646
+ if ('"' == t) break;
29647
+ if ("$" == t) {
29648
+ if (((t = this.input()), "{" == t || this.is_LABEL_START())) {
29649
+ this.unput(2);
29650
+ break;
29651
+ }
29652
+ t && this.unput(1);
29653
+ } else if ("{" == t) {
29654
+ if (((t = this.input()), "$" == t)) {
29655
+ this.unput(2);
29656
+ break;
29657
+ }
29658
+ t && this.unput(1);
29659
+ }
29660
+ }
29661
+ if ('"' == t) return this.tok.T_CONSTANT_ENCAPSED_STRING;
29662
+ {
29663
+ let t = 1;
29664
+ return (
29665
+ ("b" !== this.yytext[0] && "B" !== this.yytext[0]) || (t = 2),
29666
+ this.yytext.length > 2 &&
29667
+ this.appendToken(
29668
+ this.tok.T_ENCAPSED_AND_WHITESPACE,
29669
+ this.yytext.length - t
29670
+ ),
29671
+ this.unput(this.yytext.length - t),
29672
+ this.begin("ST_DOUBLE_QUOTES"),
29673
+ this.yytext
29674
+ );
29675
+ }
29676
+ },
29677
+ isDOC_MATCH: function (t, e) {
29678
+ const n = this._input[t - 2];
29679
+ if (!i.includes(n)) return !1;
29680
+ let s = !1,
29681
+ a = !1,
29682
+ l = 0,
29683
+ c = this._input[t - 1];
29684
+ if (this.version >= 703) {
29685
+ for (; "\t" === c || " " === c; )
29686
+ " " === c ? (s = !0) : "\t" === c && (a = !0),
29687
+ (c = this._input[t + l]),
29688
+ l++;
29689
+ if (((t += l), i.includes(this._input[t - 1]))) return !1;
29690
+ }
29691
+ if (
29692
+ this._input.substring(
29693
+ t - 1,
29694
+ t - 1 + this.heredoc_label.length
29695
+ ) === this.heredoc_label.label
29696
+ ) {
29697
+ const n = this._input[t - 1 + this.heredoc_label.length];
29698
+ if ((this.version >= 703 ? o : r).includes(n)) {
29699
+ if (e) {
29700
+ if ((this.consume(l), s && a))
29701
+ throw new Error(
29702
+ "Parse error: mixing spaces and tabs in ending marker at line " +
29703
+ this.yylineno +
29704
+ " (offset " +
29705
+ this.offset +
29706
+ ")"
29707
+ );
29708
+ } else
29709
+ (this.heredoc_label.indentation = l),
29710
+ (this.heredoc_label.indentation_uses_spaces = s),
29711
+ (this.heredoc_label.first_encaps_node = !0);
29712
+ return !0;
29713
+ }
29714
+ }
29715
+ return !1;
29716
+ },
29717
+ prematch_ENDOFDOC: function () {
29718
+ (this.heredoc_label.indentation_uses_spaces = !1),
29719
+ (this.heredoc_label.indentation = 0),
29720
+ (this.heredoc_label.first_encaps_node = !0);
29721
+ let t = this.offset + 1;
29722
+ for (; t < this._input.length; ) {
29723
+ if (this.isDOC_MATCH(t, !1)) return;
29724
+ if (!i.includes(this._input[t - 1]))
29725
+ for (
29726
+ ;
29727
+ !i.includes(this._input[t++]) && t < this._input.length;
29728
+
29729
+ );
29730
+ t++;
29731
+ }
29732
+ },
29733
+ matchST_NOWDOC: function () {
29734
+ if (this.isDOC_MATCH(this.offset, !0))
29735
+ return (
29736
+ this.consume(this.heredoc_label.length),
29737
+ this.popState(),
29738
+ this.tok.T_END_HEREDOC
29739
+ );
29740
+ let t = this._input[this.offset - 1];
29741
+ for (; this.offset < this.size; )
29742
+ if (i.includes(t)) {
29743
+ if (((t = this.input()), this.isDOC_MATCH(this.offset, !0)))
29744
+ return (
29745
+ this.unput(1).popState(),
29746
+ this.appendToken(
29747
+ this.tok.T_END_HEREDOC,
29748
+ this.heredoc_label.length
29749
+ ),
29750
+ this.tok.T_ENCAPSED_AND_WHITESPACE
29751
+ );
29752
+ } else t = this.input();
29753
+ return this.tok.T_ENCAPSED_AND_WHITESPACE;
29754
+ },
29755
+ matchST_HEREDOC: function () {
29756
+ let t = this.input();
29757
+ if (this.isDOC_MATCH(this.offset, !0))
29758
+ return (
29759
+ this.consume(this.heredoc_label.length - 1),
29760
+ this.popState(),
29761
+ this.tok.T_END_HEREDOC
29762
+ );
29763
+ for (; this.offset < this.size; )
29764
+ if (
29765
+ ("\\" === t &&
29766
+ ((t = this.input()), i.includes(t) || (t = this.input())),
29767
+ i.includes(t))
29768
+ ) {
29769
+ if (((t = this.input()), this.isDOC_MATCH(this.offset, !0)))
29770
+ return (
29771
+ this.unput(1).popState(),
29772
+ this.appendToken(
29773
+ this.tok.T_END_HEREDOC,
29774
+ this.heredoc_label.length
29775
+ ),
29776
+ this.tok.T_ENCAPSED_AND_WHITESPACE
29777
+ );
29778
+ } else if ("$" === t) {
29779
+ if (((t = this.input()), "{" === t))
29780
+ return (
29781
+ this.begin("ST_LOOKING_FOR_VARNAME"),
29782
+ this.yytext.length > 2
29783
+ ? (this.appendToken(
29784
+ this.tok.T_DOLLAR_OPEN_CURLY_BRACES,
29785
+ 2
29786
+ ),
29787
+ this.unput(2),
29788
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29789
+ : this.tok.T_DOLLAR_OPEN_CURLY_BRACES
29790
+ );
29791
+ if (this.is_LABEL_START()) {
29792
+ const t = this.offset,
29793
+ e = this.consume_VARIABLE();
29794
+ return this.yytext.length > this.offset - t + 2
29795
+ ? (this.appendToken(e, this.offset - t + 2),
29796
+ this.unput(this.offset - t + 2),
29797
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29798
+ : e;
29799
+ }
29800
+ } else if ("{" === t) {
29801
+ if (((t = this.input()), "$" === t))
29802
+ return (
29803
+ this.begin("ST_IN_SCRIPTING"),
29804
+ this.yytext.length > 2
29805
+ ? (this.appendToken(this.tok.T_CURLY_OPEN, 1),
29806
+ this.unput(2),
29807
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29808
+ : (this.unput(1), this.tok.T_CURLY_OPEN)
29809
+ );
29810
+ } else t = this.input();
29811
+ return this.tok.T_ENCAPSED_AND_WHITESPACE;
29812
+ },
29813
+ consume_VARIABLE: function () {
29814
+ this.consume_LABEL();
29815
+ const t = this.input();
29816
+ if ("[" == t)
29817
+ return (
29818
+ this.unput(1), this.begin("ST_VAR_OFFSET"), this.tok.T_VARIABLE
29819
+ );
29820
+ if ("-" === t) {
29821
+ if (">" === this.input())
29822
+ return (
29823
+ this.input(),
29824
+ this.is_LABEL_START() &&
29825
+ this.begin("ST_LOOKING_FOR_PROPERTY"),
29826
+ this.unput(3),
29827
+ this.tok.T_VARIABLE
29828
+ );
29829
+ this.unput(2);
29830
+ } else t && this.unput(1);
29831
+ return this.tok.T_VARIABLE;
29832
+ },
29833
+ matchST_BACKQUOTE: function () {
29834
+ let t = this.input();
29835
+ if ("$" === t) {
29836
+ if (((t = this.input()), "{" === t))
29837
+ return (
29838
+ this.begin("ST_LOOKING_FOR_VARNAME"),
29839
+ this.tok.T_DOLLAR_OPEN_CURLY_BRACES
29840
+ );
29841
+ if (this.is_LABEL_START()) {
29842
+ return this.consume_VARIABLE();
29843
+ }
29844
+ } else if ("{" === t) {
29845
+ if ("$" === this._input[this.offset])
29846
+ return this.begin("ST_IN_SCRIPTING"), this.tok.T_CURLY_OPEN;
29847
+ } else if ("`" === t) return this.popState(), "`";
29848
+ for (; this.offset < this.size; ) {
29849
+ if ("\\" === t) this.input();
29850
+ else {
29851
+ if ("`" === t) {
29852
+ this.unput(1), this.popState(), this.appendToken("`", 1);
29853
+ break;
29854
+ }
29855
+ if ("$" === t) {
29856
+ if (((t = this.input()), "{" === t))
29857
+ return (
29858
+ this.begin("ST_LOOKING_FOR_VARNAME"),
29859
+ this.yytext.length > 2
29860
+ ? (this.appendToken(
29861
+ this.tok.T_DOLLAR_OPEN_CURLY_BRACES,
29862
+ 2
29863
+ ),
29864
+ this.unput(2),
29865
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29866
+ : this.tok.T_DOLLAR_OPEN_CURLY_BRACES
29867
+ );
29868
+ if (this.is_LABEL_START()) {
29869
+ const t = this.offset,
29870
+ e = this.consume_VARIABLE();
29871
+ return this.yytext.length > this.offset - t + 2
29872
+ ? (this.appendToken(e, this.offset - t + 2),
29873
+ this.unput(this.offset - t + 2),
29874
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29875
+ : e;
29876
+ }
29877
+ continue;
29878
+ }
29879
+ if ("{" === t) {
29880
+ if (((t = this.input()), "$" === t))
29881
+ return (
29882
+ this.begin("ST_IN_SCRIPTING"),
29883
+ this.yytext.length > 2
29884
+ ? (this.appendToken(this.tok.T_CURLY_OPEN, 1),
29885
+ this.unput(2),
29886
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29887
+ : (this.unput(1), this.tok.T_CURLY_OPEN)
29888
+ );
29889
+ continue;
29890
+ }
29891
+ }
29892
+ t = this.input();
29893
+ }
29894
+ return this.tok.T_ENCAPSED_AND_WHITESPACE;
29895
+ },
29896
+ matchST_DOUBLE_QUOTES: function () {
29897
+ let t = this.input();
29898
+ if ("$" === t) {
29899
+ if (((t = this.input()), "{" === t))
29900
+ return (
29901
+ this.begin("ST_LOOKING_FOR_VARNAME"),
29902
+ this.tok.T_DOLLAR_OPEN_CURLY_BRACES
29903
+ );
29904
+ if (this.is_LABEL_START()) {
29905
+ return this.consume_VARIABLE();
29906
+ }
29907
+ } else if ("{" === t) {
29908
+ if ("$" === this._input[this.offset])
29909
+ return this.begin("ST_IN_SCRIPTING"), this.tok.T_CURLY_OPEN;
29910
+ } else if ('"' === t) return this.popState(), '"';
29911
+ for (; this.offset < this.size; ) {
29912
+ if ("\\" === t) this.input();
29913
+ else {
29914
+ if ('"' === t) {
29915
+ this.unput(1), this.popState(), this.appendToken('"', 1);
29916
+ break;
29917
+ }
29918
+ if ("$" === t) {
29919
+ if (((t = this.input()), "{" === t))
29920
+ return (
29921
+ this.begin("ST_LOOKING_FOR_VARNAME"),
29922
+ this.yytext.length > 2
29923
+ ? (this.appendToken(
29924
+ this.tok.T_DOLLAR_OPEN_CURLY_BRACES,
29925
+ 2
29926
+ ),
29927
+ this.unput(2),
29928
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29929
+ : this.tok.T_DOLLAR_OPEN_CURLY_BRACES
29930
+ );
29931
+ if (this.is_LABEL_START()) {
29932
+ const t = this.offset,
29933
+ e = this.consume_VARIABLE();
29934
+ return this.yytext.length > this.offset - t + 2
29935
+ ? (this.appendToken(e, this.offset - t + 2),
29936
+ this.unput(this.offset - t + 2),
29937
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29938
+ : e;
29939
+ }
29940
+ t && this.unput(1);
29941
+ } else if ("{" === t) {
29942
+ if (((t = this.input()), "$" === t))
29943
+ return (
29944
+ this.begin("ST_IN_SCRIPTING"),
29945
+ this.yytext.length > 2
29946
+ ? (this.appendToken(this.tok.T_CURLY_OPEN, 1),
29947
+ this.unput(2),
29948
+ this.tok.T_ENCAPSED_AND_WHITESPACE)
29949
+ : (this.unput(1), this.tok.T_CURLY_OPEN)
29950
+ );
29951
+ t && this.unput(1);
29952
+ }
29953
+ }
29954
+ t = this.input();
29955
+ }
29956
+ return this.tok.T_ENCAPSED_AND_WHITESPACE;
29957
+ },
29958
+ };
29959
+ },
29960
+ {},
29961
+ ],
29962
+ 141: [
29963
+ function (t, e, n) {
29964
+ "use strict";
29965
+ e.exports = {
29966
+ T_STRING: function () {
29967
+ const t = this.yytext.toLowerCase();
29968
+ let e = this.keywords[t];
29969
+ if ("number" != typeof e)
29970
+ if ("yield" === t)
29971
+ this.version >= 700 && this.tryMatch(" from")
29972
+ ? (this.consume(5), (e = this.tok.T_YIELD_FROM))
29973
+ : (e = this.tok.T_YIELD);
29974
+ else if (((e = this.tok.T_STRING), "b" === t || "B" === t)) {
29975
+ const t = this.input(1);
29976
+ if ('"' === t) return this.ST_DOUBLE_QUOTES();
29977
+ if ("'" === t) return this.T_CONSTANT_ENCAPSED_STRING();
29978
+ t && this.unput(1);
29979
+ }
29980
+ return e;
29981
+ },
29982
+ consume_TOKEN: function () {
29983
+ const t = this._input[this.offset - 1],
29984
+ e = this.tokenTerminals[t];
29985
+ return e ? e.apply(this, []) : this.yytext;
29986
+ },
29987
+ tokenTerminals: {
29988
+ $: function () {
29989
+ return (
29990
+ this.offset++,
29991
+ this.is_LABEL_START()
29992
+ ? (this.offset--, this.consume_LABEL(), this.tok.T_VARIABLE)
29993
+ : (this.offset--, "$")
29994
+ );
29995
+ },
29996
+ "-": function () {
29997
+ const t = this._input[this.offset];
29998
+ return ">" === t
29999
+ ? (this.begin("ST_LOOKING_FOR_PROPERTY").input(),
30000
+ this.tok.T_OBJECT_OPERATOR)
30001
+ : "-" === t
30002
+ ? (this.input(), this.tok.T_DEC)
30003
+ : "=" === t
30004
+ ? (this.input(), this.tok.T_MINUS_EQUAL)
30005
+ : "-";
30006
+ },
30007
+ "\\": function () {
30008
+ return this.tok.T_NS_SEPARATOR;
30009
+ },
30010
+ "/": function () {
30011
+ return "=" === this._input[this.offset]
30012
+ ? (this.input(), this.tok.T_DIV_EQUAL)
30013
+ : "/";
30014
+ },
30015
+ ":": function () {
30016
+ return ":" === this._input[this.offset]
30017
+ ? (this.input(), this.tok.T_DOUBLE_COLON)
30018
+ : ":";
30019
+ },
30020
+ "(": function () {
30021
+ const t = this.offset;
30022
+ if (
30023
+ (this.input(),
30024
+ this.is_TABSPACE() && this.consume_TABSPACE().input(),
30025
+ this.is_LABEL_START())
30026
+ ) {
30027
+ const t = this.yytext.length;
30028
+ this.consume_LABEL();
30029
+ const e = this.yytext.substring(t - 1).toLowerCase(),
30030
+ n = this.castKeywords[e];
30031
+ if (
30032
+ "number" == typeof n &&
30033
+ (this.input(),
30034
+ this.is_TABSPACE() && this.consume_TABSPACE().input(),
30035
+ ")" === this._input[this.offset - 1])
30036
+ )
30037
+ return n;
30038
+ }
30039
+ return this.unput(this.offset - t), "(";
30040
+ },
30041
+ "=": function () {
30042
+ const t = this._input[this.offset];
30043
+ return ">" === t
30044
+ ? (this.input(), this.tok.T_DOUBLE_ARROW)
30045
+ : "=" === t
30046
+ ? "=" === this._input[this.offset + 1]
30047
+ ? (this.consume(2), this.tok.T_IS_IDENTICAL)
30048
+ : (this.input(), this.tok.T_IS_EQUAL)
30049
+ : "=";
30050
+ },
30051
+ "+": function () {
30052
+ const t = this._input[this.offset];
30053
+ return "+" === t
30054
+ ? (this.input(), this.tok.T_INC)
30055
+ : "=" === t
30056
+ ? (this.input(), this.tok.T_PLUS_EQUAL)
30057
+ : "+";
30058
+ },
30059
+ "!": function () {
30060
+ return "=" === this._input[this.offset]
30061
+ ? "=" === this._input[this.offset + 1]
30062
+ ? (this.consume(2), this.tok.T_IS_NOT_IDENTICAL)
30063
+ : (this.input(), this.tok.T_IS_NOT_EQUAL)
30064
+ : "!";
30065
+ },
30066
+ "?": function () {
30067
+ return this.version >= 700 && "?" === this._input[this.offset]
30068
+ ? this.version >= 704 && "=" === this._input[this.offset + 1]
30069
+ ? (this.consume(2), this.tok.T_COALESCE_EQUAL)
30070
+ : (this.input(), this.tok.T_COALESCE)
30071
+ : this.version >= 800 &&
30072
+ "-" === this._input[this.offset] &&
30073
+ ">" === this._input[this.offset + 1]
30074
+ ? (this.consume(2), this.tok.T_NULLSAFE_OBJECT_OPERATOR)
30075
+ : "?";
30076
+ },
30077
+ "<": function () {
30078
+ let t = this._input[this.offset];
30079
+ return "<" === t
30080
+ ? ((t = this._input[this.offset + 1]),
30081
+ "=" === t
30082
+ ? (this.consume(2), this.tok.T_SL_EQUAL)
30083
+ : "<" === t && this.is_HEREDOC()
30084
+ ? this.tok.T_START_HEREDOC
30085
+ : (this.input(), this.tok.T_SL))
30086
+ : "=" === t
30087
+ ? (this.input(),
30088
+ this.version >= 700 && ">" === this._input[this.offset]
30089
+ ? (this.input(), this.tok.T_SPACESHIP)
30090
+ : this.tok.T_IS_SMALLER_OR_EQUAL)
30091
+ : ">" === t
30092
+ ? (this.input(), this.tok.T_IS_NOT_EQUAL)
30093
+ : "<";
30094
+ },
30095
+ ">": function () {
30096
+ let t = this._input[this.offset];
30097
+ return "=" === t
30098
+ ? (this.input(), this.tok.T_IS_GREATER_OR_EQUAL)
30099
+ : ">" === t
30100
+ ? ((t = this._input[this.offset + 1]),
30101
+ "=" === t
30102
+ ? (this.consume(2), this.tok.T_SR_EQUAL)
30103
+ : (this.input(), this.tok.T_SR))
30104
+ : ">";
30105
+ },
30106
+ "*": function () {
30107
+ const t = this._input[this.offset];
30108
+ return "=" === t
30109
+ ? (this.input(), this.tok.T_MUL_EQUAL)
30110
+ : "*" === t
30111
+ ? (this.input(),
30112
+ "=" === this._input[this.offset]
30113
+ ? (this.input(), this.tok.T_POW_EQUAL)
30114
+ : this.tok.T_POW)
30115
+ : "*";
30116
+ },
30117
+ ".": function () {
30118
+ const t = this._input[this.offset];
30119
+ return "=" === t
30120
+ ? (this.input(), this.tok.T_CONCAT_EQUAL)
30121
+ : "." === t && "." === this._input[this.offset + 1]
30122
+ ? (this.consume(2), this.tok.T_ELLIPSIS)
30123
+ : ".";
30124
+ },
30125
+ "%": function () {
30126
+ return "=" === this._input[this.offset]
30127
+ ? (this.input(), this.tok.T_MOD_EQUAL)
30128
+ : "%";
30129
+ },
30130
+ "&": function () {
30131
+ const t = this._input[this.offset];
30132
+ return "=" === t
30133
+ ? (this.input(), this.tok.T_AND_EQUAL)
30134
+ : "&" === t
30135
+ ? (this.input(), this.tok.T_BOOLEAN_AND)
30136
+ : "&";
30137
+ },
30138
+ "|": function () {
30139
+ const t = this._input[this.offset];
30140
+ return "=" === t
30141
+ ? (this.input(), this.tok.T_OR_EQUAL)
30142
+ : "|" === t
30143
+ ? (this.input(), this.tok.T_BOOLEAN_OR)
30144
+ : "|";
30145
+ },
30146
+ "^": function () {
30147
+ return "=" === this._input[this.offset]
30148
+ ? (this.input(), this.tok.T_XOR_EQUAL)
30149
+ : "^";
30150
+ },
30151
+ },
30152
+ };
30153
+ },
30154
+ {},
30155
+ ],
30156
+ 142: [
30157
+ function (t, e, n) {
30158
+ "use strict";
30159
+ e.exports = {
30160
+ is_NUM: function () {
30161
+ const t = this._input.charCodeAt(this.offset - 1);
30162
+ return (t > 47 && t < 58) || 95 === t;
30163
+ },
30164
+ is_NUM_START: function () {
30165
+ const t = this._input.charCodeAt(this.offset - 1);
30166
+ return t > 47 && t < 58;
30167
+ },
30168
+ is_LABEL: function () {
30169
+ const t = this._input.charCodeAt(this.offset - 1);
30170
+ return (
30171
+ (t > 96 && t < 123) ||
30172
+ (t > 64 && t < 91) ||
30173
+ 95 === t ||
30174
+ (t > 47 && t < 58) ||
30175
+ t > 126
30176
+ );
30177
+ },
30178
+ is_LABEL_START: function () {
30179
+ const t = this._input.charCodeAt(this.offset - 1);
30180
+ return (
30181
+ (t > 64 && t < 91) || (t > 96 && t < 123) || 95 === t || t > 126
30182
+ );
30183
+ },
30184
+ consume_LABEL: function () {
30185
+ for (; this.offset < this.size; ) {
30186
+ const t = this.input();
30187
+ if (!this.is_LABEL()) {
30188
+ t && this.unput(1);
30189
+ break;
30190
+ }
30191
+ }
30192
+ return this;
30193
+ },
30194
+ is_TOKEN: function () {
30195
+ const t = this._input[this.offset - 1];
30196
+ return -1 !== ";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t);
30197
+ },
30198
+ is_WHITESPACE: function () {
30199
+ const t = this._input[this.offset - 1];
30200
+ return " " === t || "\t" === t || "\n" === t || "\r" === t;
30201
+ },
30202
+ is_TABSPACE: function () {
30203
+ const t = this._input[this.offset - 1];
30204
+ return " " === t || "\t" === t;
30205
+ },
30206
+ consume_TABSPACE: function () {
30207
+ for (; this.offset < this.size; ) {
30208
+ const t = this.input();
30209
+ if (!this.is_TABSPACE()) {
30210
+ t && this.unput(1);
30211
+ break;
30212
+ }
30213
+ }
30214
+ return this;
30215
+ },
30216
+ is_HEX: function () {
30217
+ const t = this._input.charCodeAt(this.offset - 1);
30218
+ return (
30219
+ (t > 47 && t < 58) ||
30220
+ (t > 64 && t < 71) ||
30221
+ (t > 96 && t < 103) ||
30222
+ 95 === t
30223
+ );
30224
+ },
30225
+ };
30226
+ },
30227
+ {},
30228
+ ],
30229
+ 143: [
30230
+ function (t, e, n) {
30231
+ "use strict";
30232
+ function i(t) {
30233
+ return "." != t && "," != t && !isNaN(parseFloat(t)) && isFinite(t);
30234
+ }
30235
+ const r = function (t, e) {
30236
+ (this.lexer = t),
30237
+ (this.ast = e),
30238
+ (this.tok = t.tok),
30239
+ (this.EOF = t.EOF),
30240
+ (this.token = null),
30241
+ (this.prev = null),
30242
+ (this.debug = !1),
30243
+ (this.version = 800),
30244
+ (this.extractDoc = !1),
30245
+ (this.extractTokens = !1),
30246
+ (this.suppressErrors = !1);
30247
+ const n = function (t) {
30248
+ return [t, null];
30249
+ };
30250
+ this.entries = {
30251
+ IDENTIFIER: new Map(
30252
+ [
30253
+ this.tok.T_ABSTRACT,
30254
+ this.tok.T_ARRAY,
30255
+ this.tok.T_AS,
30256
+ this.tok.T_BREAK,
30257
+ this.tok.T_CALLABLE,
30258
+ this.tok.T_CASE,
30259
+ this.tok.T_CATCH,
30260
+ this.tok.T_CLASS,
30261
+ this.tok.T_CLASS_C,
30262
+ this.tok.T_CLONE,
30263
+ this.tok.T_CONST,
30264
+ this.tok.T_CONTINUE,
30265
+ this.tok.T_DECLARE,
30266
+ this.tok.T_DEFAULT,
30267
+ this.tok.T_DIR,
30268
+ this.tok.T_DO,
30269
+ this.tok.T_ECHO,
30270
+ this.tok.T_ELSE,
30271
+ this.tok.T_ELSEIF,
30272
+ this.tok.T_EMPTY,
30273
+ this.tok.T_ENDDECLARE,
30274
+ this.tok.T_ENDFOR,
30275
+ this.tok.T_ENDFOREACH,
30276
+ this.tok.T_ENDIF,
30277
+ this.tok.T_ENDSWITCH,
30278
+ this.tok.T_ENDWHILE,
30279
+ this.tok.T_EVAL,
30280
+ this.tok.T_EXIT,
30281
+ this.tok.T_EXTENDS,
30282
+ this.tok.T_FILE,
30283
+ this.tok.T_FINAL,
30284
+ this.tok.T_FINALLY,
30285
+ this.tok.T_FN,
30286
+ this.tok.T_FOR,
30287
+ this.tok.T_FOREACH,
30288
+ this.tok.T_FUNC_C,
30289
+ this.tok.T_FUNCTION,
30290
+ this.tok.T_GLOBAL,
30291
+ this.tok.T_GOTO,
30292
+ this.tok.T_IF,
30293
+ this.tok.T_IMPLEMENTS,
30294
+ this.tok.T_INCLUDE,
30295
+ this.tok.T_INCLUDE_ONCE,
30296
+ this.tok.T_INSTANCEOF,
30297
+ this.tok.T_INSTEADOF,
30298
+ this.tok.T_INTERFACE,
30299
+ this.tok.T_ISSET,
30300
+ this.tok.T_LINE,
30301
+ this.tok.T_LIST,
30302
+ this.tok.T_LOGICAL_AND,
30303
+ this.tok.T_LOGICAL_OR,
30304
+ this.tok.T_LOGICAL_XOR,
30305
+ this.tok.T_MATCH,
30306
+ this.tok.T_METHOD_C,
30307
+ this.tok.T_NAMESPACE,
30308
+ this.tok.T_NEW,
30309
+ this.tok.T_NS_C,
30310
+ this.tok.T_PRINT,
30311
+ this.tok.T_PRIVATE,
30312
+ this.tok.T_PROTECTED,
30313
+ this.tok.T_PUBLIC,
30314
+ this.tok.T_REQUIRE,
30315
+ this.tok.T_REQUIRE_ONCE,
30316
+ this.tok.T_RETURN,
30317
+ this.tok.T_STATIC,
30318
+ this.tok.T_SWITCH,
30319
+ this.tok.T_THROW,
30320
+ this.tok.T_TRAIT,
30321
+ this.tok.T_TRY,
30322
+ this.tok.T_UNSET,
30323
+ this.tok.T_USE,
30324
+ this.tok.T_VAR,
30325
+ this.tok.T_WHILE,
30326
+ this.tok.T_YIELD,
30327
+ ].map(n)
30328
+ ),
30329
+ VARIABLE: new Map(
30330
+ [
30331
+ this.tok.T_VARIABLE,
30332
+ "$",
30333
+ "&",
30334
+ this.tok.T_NS_SEPARATOR,
30335
+ this.tok.T_STRING,
30336
+ this.tok.T_NAMESPACE,
30337
+ this.tok.T_STATIC,
30338
+ ].map(n)
30339
+ ),
30340
+ SCALAR: new Map(
30341
+ [
30342
+ this.tok.T_CONSTANT_ENCAPSED_STRING,
30343
+ this.tok.T_START_HEREDOC,
30344
+ this.tok.T_LNUMBER,
30345
+ this.tok.T_DNUMBER,
30346
+ this.tok.T_ARRAY,
30347
+ "[",
30348
+ this.tok.T_CLASS_C,
30349
+ this.tok.T_TRAIT_C,
30350
+ this.tok.T_FUNC_C,
30351
+ this.tok.T_METHOD_C,
30352
+ this.tok.T_LINE,
30353
+ this.tok.T_FILE,
30354
+ this.tok.T_DIR,
30355
+ this.tok.T_NS_C,
30356
+ '"',
30357
+ 'b"',
30358
+ 'B"',
30359
+ "-",
30360
+ this.tok.T_NS_SEPARATOR,
30361
+ ].map(n)
30362
+ ),
30363
+ T_MAGIC_CONST: new Map(
30364
+ [
30365
+ this.tok.T_CLASS_C,
30366
+ this.tok.T_TRAIT_C,
30367
+ this.tok.T_FUNC_C,
30368
+ this.tok.T_METHOD_C,
30369
+ this.tok.T_LINE,
30370
+ this.tok.T_FILE,
30371
+ this.tok.T_DIR,
30372
+ this.tok.T_NS_C,
30373
+ ].map(n)
30374
+ ),
30375
+ T_MEMBER_FLAGS: new Map(
30376
+ [
30377
+ this.tok.T_PUBLIC,
30378
+ this.tok.T_PRIVATE,
30379
+ this.tok.T_PROTECTED,
30380
+ this.tok.T_STATIC,
30381
+ this.tok.T_ABSTRACT,
30382
+ this.tok.T_FINAL,
30383
+ ].map(n)
30384
+ ),
30385
+ EOS: new Map([";", this.EOF, this.tok.T_INLINE_HTML].map(n)),
30386
+ EXPR: new Map(
30387
+ [
30388
+ "@",
30389
+ "-",
30390
+ "+",
30391
+ "!",
30392
+ "~",
30393
+ "(",
30394
+ "`",
30395
+ this.tok.T_LIST,
30396
+ this.tok.T_CLONE,
30397
+ this.tok.T_INC,
30398
+ this.tok.T_DEC,
30399
+ this.tok.T_NEW,
30400
+ this.tok.T_ISSET,
30401
+ this.tok.T_EMPTY,
30402
+ this.tok.T_MATCH,
30403
+ this.tok.T_INCLUDE,
30404
+ this.tok.T_INCLUDE_ONCE,
30405
+ this.tok.T_REQUIRE,
30406
+ this.tok.T_REQUIRE_ONCE,
30407
+ this.tok.T_EVAL,
30408
+ this.tok.T_INT_CAST,
30409
+ this.tok.T_DOUBLE_CAST,
30410
+ this.tok.T_STRING_CAST,
30411
+ this.tok.T_ARRAY_CAST,
30412
+ this.tok.T_OBJECT_CAST,
30413
+ this.tok.T_BOOL_CAST,
30414
+ this.tok.T_UNSET_CAST,
30415
+ this.tok.T_EXIT,
30416
+ this.tok.T_PRINT,
30417
+ this.tok.T_YIELD,
30418
+ this.tok.T_STATIC,
30419
+ this.tok.T_FUNCTION,
30420
+ this.tok.T_FN,
30421
+ this.tok.T_VARIABLE,
30422
+ "$",
30423
+ this.tok.T_NS_SEPARATOR,
30424
+ this.tok.T_STRING,
30425
+ this.tok.T_STRING,
30426
+ this.tok.T_CONSTANT_ENCAPSED_STRING,
30427
+ this.tok.T_START_HEREDOC,
30428
+ this.tok.T_LNUMBER,
30429
+ this.tok.T_DNUMBER,
30430
+ this.tok.T_ARRAY,
30431
+ "[",
30432
+ this.tok.T_CLASS_C,
30433
+ this.tok.T_TRAIT_C,
30434
+ this.tok.T_FUNC_C,
30435
+ this.tok.T_METHOD_C,
30436
+ this.tok.T_LINE,
30437
+ this.tok.T_FILE,
30438
+ this.tok.T_DIR,
30439
+ this.tok.T_NS_C,
30440
+ '"',
30441
+ 'b"',
30442
+ 'B"',
30443
+ "-",
30444
+ this.tok.T_NS_SEPARATOR,
30445
+ ].map(n)
30446
+ ),
30447
+ };
30448
+ };
30449
+ (r.prototype.getTokenName = function (t) {
30450
+ return i(t)
30451
+ ? t == this.EOF
30452
+ ? "the end of file (EOF)"
30453
+ : this.lexer.engine.tokens.values[t]
30454
+ : "'" + t + "'";
30455
+ }),
30456
+ (r.prototype.parse = function (t, e) {
30457
+ (this._errors = []),
30458
+ (this.filename = e || "eval"),
30459
+ (this.currentNamespace = [""]),
30460
+ this.extractDoc ? (this._docs = []) : (this._docs = null),
30461
+ this.extractTokens ? (this._tokens = []) : (this._tokens = null),
30462
+ (this._docIndex = 0),
30463
+ (this._lastNode = null),
30464
+ this.lexer.setInput(t),
30465
+ (this.lexer.all_tokens = this.extractTokens),
30466
+ (this.lexer.comment_tokens = this.extractDoc),
30467
+ (this.length = this.lexer._input.length),
30468
+ (this.innerList = !1),
30469
+ (this.innerListForm = !1);
30470
+ const n = this.node("program"),
30471
+ i = [];
30472
+ for (this.next(); this.token != this.EOF; )
30473
+ i.push(this.read_start());
30474
+ 0 === i.length &&
30475
+ this.extractDoc &&
30476
+ this._docs.length > this._docIndex &&
30477
+ i.push(this.node("noop")()),
30478
+ (this.prev = [
30479
+ this.lexer.yylloc.last_line,
30480
+ this.lexer.yylloc.last_column,
30481
+ this.lexer.offset,
30482
+ ]);
30483
+ const r = n(i, this._errors, this._docs, this._tokens);
30484
+ if (this.debug) {
30485
+ const t = this.ast.checkNodes();
30486
+ if (t.length > 0)
30487
+ throw (
30488
+ (t.forEach(function (t) {
30489
+ t.position &&
30490
+ console.log(
30491
+ "Node at line " +
30492
+ t.position.line +
30493
+ ", column " +
30494
+ t.position.column
30495
+ ),
30496
+ console.log(t.stack.join("\n"));
30497
+ }),
30498
+ new Error("Some nodes are not closed"))
30499
+ );
30500
+ }
30501
+ return r;
30502
+ }),
30503
+ (r.prototype.raiseError = function (t, e, n, i) {
30504
+ if (
30505
+ ((t += " on line " + this.lexer.yylloc.first_line),
30506
+ !this.suppressErrors)
30507
+ ) {
30508
+ const e = new SyntaxError(
30509
+ t,
30510
+ this.filename,
30511
+ this.lexer.yylloc.first_line
30512
+ );
30513
+ throw (
30514
+ ((e.lineNumber = this.lexer.yylloc.first_line),
30515
+ (e.fileName = this.filename),
30516
+ (e.columnNumber = this.lexer.yylloc.first_column),
30517
+ e)
30518
+ );
30519
+ }
30520
+ const r = this.ast.prepare("error", null, this)(
30521
+ t,
30522
+ i,
30523
+ this.lexer.yylloc.first_line,
30524
+ n
30525
+ );
30526
+ return this._errors.push(r), r;
30527
+ }),
30528
+ (r.prototype.error = function (t) {
30529
+ let e = "Parse Error : syntax error",
30530
+ n = this.getTokenName(this.token),
30531
+ r = "";
30532
+ if (this.token !== this.EOF) {
30533
+ if (i(this.token)) {
30534
+ let t = this.text();
30535
+ t.length > 10 && (t = t.substring(0, 7) + "..."),
30536
+ (n = "'" + t + "' (" + n + ")");
30537
+ }
30538
+ e += ", unexpected " + n;
30539
+ }
30540
+ return (
30541
+ t &&
30542
+ !Array.isArray(t) &&
30543
+ ((i(t) || 1 === t.length) &&
30544
+ (r = ", expecting " + this.getTokenName(t)),
30545
+ (e += r)),
30546
+ this.raiseError(e, r, t, n)
30547
+ );
30548
+ }),
30549
+ (r.prototype.node = function (t) {
30550
+ if (this.extractDoc) {
30551
+ let e = null;
30552
+ this._docIndex < this._docs.length &&
30553
+ ((e = this._docs.slice(this._docIndex)),
30554
+ (this._docIndex = this._docs.length),
30555
+ this.debug &&
30556
+ (console.log(new Error("Append docs on " + t)),
30557
+ console.log(e)));
30558
+ const n = this.ast.prepare(t, e, this);
30559
+ return (
30560
+ (n.postBuild = function (t) {
30561
+ if (this._docIndex < this._docs.length)
30562
+ if (this._lastNode) {
30563
+ const t = this.prev[2];
30564
+ let e = this._docIndex;
30565
+ for (
30566
+ ;
30567
+ e < this._docs.length && !(this._docs[e].offset > t);
30568
+ e++
30569
+ );
30570
+ e > this._docIndex &&
30571
+ (this._lastNode.setTrailingComments(
30572
+ this._docs.slice(this._docIndex, e)
30573
+ ),
30574
+ (this._docIndex = e));
30575
+ } else
30576
+ this.token === this.EOF &&
30577
+ (t.setTrailingComments(
30578
+ this._docs.slice(this._docIndex)
30579
+ ),
30580
+ (this._docIndex = this._docs.length));
30581
+ this._lastNode = t;
30582
+ }.bind(this)),
30583
+ n
30584
+ );
30585
+ }
30586
+ return this.ast.prepare(t, null, this);
30587
+ }),
30588
+ (r.prototype.expectEndOfStatement = function (t) {
30589
+ if (";" === this.token)
30590
+ t && ";" === this.lexer.yytext && t.includeToken(this);
30591
+ else if (
30592
+ this.token !== this.tok.T_INLINE_HTML &&
30593
+ this.token !== this.EOF
30594
+ )
30595
+ return this.error(";"), !1;
30596
+ return this.next(), !0;
30597
+ });
30598
+ const o = ["parser.next", "parser.node", "parser.showlog"];
30599
+ (r.prototype.showlog = function () {
30600
+ const t = new Error().stack.split("\n");
30601
+ let e;
30602
+ for (let n = 2; n < t.length; n++) {
30603
+ e = t[n].trim();
30604
+ let i = !1;
30605
+ for (let t = 0; t < o.length; t++)
30606
+ if (e.substring(3, 3 + o[t].length) === o[t]) {
30607
+ i = !0;
30608
+ break;
30609
+ }
30610
+ if (!i) break;
30611
+ }
30612
+ return (
30613
+ console.log(
30614
+ "Line " +
30615
+ this.lexer.yylloc.first_line +
30616
+ " : " +
30617
+ this.getTokenName(this.token) +
30618
+ ">" +
30619
+ this.lexer.yytext +
30620
+ "< @--\x3e" +
30621
+ e
30622
+ ),
30623
+ this
30624
+ );
30625
+ }),
30626
+ (r.prototype.expect = function (t) {
30627
+ if (Array.isArray(t)) {
30628
+ if (-1 === t.indexOf(this.token)) return this.error(t), !1;
30629
+ } else if (this.token != t) return this.error(t), !1;
30630
+ return !0;
30631
+ }),
30632
+ (r.prototype.text = function () {
30633
+ return this.lexer.yytext;
30634
+ }),
30635
+ (r.prototype.next = function () {
30636
+ if (
30637
+ ((";" === this.token && ";" !== this.lexer.yytext) ||
30638
+ (this.prev = [
30639
+ this.lexer.yylloc.last_line,
30640
+ this.lexer.yylloc.last_column,
30641
+ this.lexer.offset,
30642
+ ]),
30643
+ this.lex(),
30644
+ this.debug && this.showlog(),
30645
+ this.extractDoc)
30646
+ )
30647
+ for (
30648
+ ;
30649
+ this.token === this.tok.T_COMMENT ||
30650
+ this.token === this.tok.T_DOC_COMMENT;
30651
+
30652
+ )
30653
+ this.token === this.tok.T_COMMENT
30654
+ ? this._docs.push(this.read_comment())
30655
+ : this._docs.push(this.read_doc_comment());
30656
+ return this;
30657
+ }),
30658
+ (r.prototype.lex = function () {
30659
+ if (this.extractTokens)
30660
+ do {
30661
+ if (
30662
+ ((this.token = this.lexer.lex() || this.EOF),
30663
+ this.token === this.EOF)
30664
+ )
30665
+ return this;
30666
+ let t = this.lexer.yytext;
30667
+ if (
30668
+ ((t = this.lexer.engine.tokens.values.hasOwnProperty(
30669
+ this.token
30670
+ )
30671
+ ? [
30672
+ this.lexer.engine.tokens.values[this.token],
30673
+ t,
30674
+ this.lexer.yylloc.first_line,
30675
+ this.lexer.yylloc.first_offset,
30676
+ this.lexer.offset,
30677
+ ]
30678
+ : [
30679
+ null,
30680
+ t,
30681
+ this.lexer.yylloc.first_line,
30682
+ this.lexer.yylloc.first_offset,
30683
+ this.lexer.offset,
30684
+ ]),
30685
+ this._tokens.push(t),
30686
+ this.token === this.tok.T_CLOSE_TAG)
30687
+ )
30688
+ return (this.token = ";"), this;
30689
+ if (this.token === this.tok.T_OPEN_TAG_WITH_ECHO)
30690
+ return (this.token = this.tok.T_ECHO), this;
30691
+ } while (
30692
+ this.token === this.tok.T_WHITESPACE ||
30693
+ (!this.extractDoc &&
30694
+ (this.token === this.tok.T_COMMENT ||
30695
+ this.token === this.tok.T_DOC_COMMENT)) ||
30696
+ this.token === this.tok.T_OPEN_TAG
30697
+ );
30698
+ else this.token = this.lexer.lex() || this.EOF;
30699
+ return this;
30700
+ }),
30701
+ (r.prototype.is = function (t) {
30702
+ return Array.isArray(t)
30703
+ ? -1 !== t.indexOf(this.token)
30704
+ : this.entries[t].has(this.token);
30705
+ }),
30706
+ [
30707
+ t("./parser/array.js"),
30708
+ t("./parser/class.js"),
30709
+ t("./parser/comment.js"),
30710
+ t("./parser/expr.js"),
30711
+ t("./parser/function.js"),
30712
+ t("./parser/if.js"),
30713
+ t("./parser/loops.js"),
30714
+ t("./parser/main.js"),
30715
+ t("./parser/namespace.js"),
30716
+ t("./parser/scalar.js"),
30717
+ t("./parser/statement.js"),
30718
+ t("./parser/switch.js"),
30719
+ t("./parser/try.js"),
30720
+ t("./parser/utils.js"),
30721
+ t("./parser/variable.js"),
30722
+ ].forEach(function (t) {
30723
+ for (const e in t) {
30724
+ if (r.prototype.hasOwnProperty(e))
30725
+ throw new Error(
30726
+ "Function " + e + " is already defined - collision"
30727
+ );
30728
+ r.prototype[e] = t[e];
30729
+ }
30730
+ }),
30731
+ (e.exports = r);
30732
+ },
30733
+ {
30734
+ "./parser/array.js": 144,
30735
+ "./parser/class.js": 145,
30736
+ "./parser/comment.js": 146,
30737
+ "./parser/expr.js": 147,
30738
+ "./parser/function.js": 148,
30739
+ "./parser/if.js": 149,
30740
+ "./parser/loops.js": 150,
30741
+ "./parser/main.js": 151,
30742
+ "./parser/namespace.js": 152,
30743
+ "./parser/scalar.js": 153,
30744
+ "./parser/statement.js": 154,
30745
+ "./parser/switch.js": 155,
30746
+ "./parser/try.js": 156,
30747
+ "./parser/utils.js": 157,
30748
+ "./parser/variable.js": 158,
30749
+ },
30750
+ ],
30751
+ 144: [
30752
+ function (t, e, n) {
30753
+ "use strict";
30754
+ e.exports = {
30755
+ read_array: function () {
30756
+ let t = null,
30757
+ e = !1;
30758
+ const n = this.node("array");
30759
+ this.token === this.tok.T_ARRAY
30760
+ ? (this.next().expect("("), (t = ")"))
30761
+ : ((e = !0), (t = "]"));
30762
+ let i = [];
30763
+ return (
30764
+ this.next().token !== t && (i = this.read_array_pair_list(e)),
30765
+ this.expect(t),
30766
+ this.next(),
30767
+ n(e, i)
30768
+ );
30769
+ },
30770
+ read_array_pair_list: function (t) {
30771
+ const e = this;
30772
+ return this.read_list(
30773
+ function () {
30774
+ return e.read_array_pair(t);
30775
+ },
30776
+ ",",
30777
+ !0
30778
+ );
30779
+ },
30780
+ read_array_pair: function (t) {
30781
+ if ((!t && ")" === this.token) || (t && "]" === this.token)) return;
30782
+ if ("," === this.token) return this.node("noop")();
30783
+ const e = this.node("entry");
30784
+ let n = null,
30785
+ i = null,
30786
+ r = !1,
30787
+ o = !1;
30788
+ if ("&" === this.token)
30789
+ this.next(), (r = !0), (i = this.read_variable(!0, !1));
30790
+ else if (this.token === this.tok.T_ELLIPSIS && this.version >= 704)
30791
+ this.next(),
30792
+ "&" === this.token && this.error(),
30793
+ (o = !0),
30794
+ (i = this.read_expr());
30795
+ else {
30796
+ const t = this.read_expr();
30797
+ this.token === this.tok.T_DOUBLE_ARROW
30798
+ ? (this.next(),
30799
+ (n = t),
30800
+ "&" === this.token
30801
+ ? (this.next(), (r = !0), (i = this.read_variable(!0, !1)))
30802
+ : (i = this.read_expr()))
30803
+ : (i = t);
30804
+ }
30805
+ return e(n, i, r, o);
30806
+ },
30807
+ };
30808
+ },
30809
+ {},
30810
+ ],
30811
+ 145: [
30812
+ function (t, e, n) {
30813
+ "use strict";
30814
+ e.exports = {
30815
+ read_class_declaration_statement: function (t) {
30816
+ const e = this.node("class"),
30817
+ n = this.read_class_modifiers();
30818
+ if (this.token !== this.tok.T_CLASS)
30819
+ return this.error(this.tok.T_CLASS), this.next(), null;
30820
+ this.next().expect(this.tok.T_STRING);
30821
+ let i = this.node("identifier");
30822
+ const r = this.text();
30823
+ this.next(), (i = i(r));
30824
+ const o = this.read_extends_from(),
30825
+ s = this.read_implements_list();
30826
+ this.expect("{");
30827
+ const a = e(i, o, s, this.next().read_class_body(), n);
30828
+ return t && (a.attrGroups = t), a;
30829
+ },
30830
+ read_class_modifiers: function () {
30831
+ return [0, 0, this.read_class_modifier()];
30832
+ },
30833
+ read_class_modifier: function () {
30834
+ return this.token === this.tok.T_ABSTRACT
30835
+ ? (this.next(), 1)
30836
+ : this.token === this.tok.T_FINAL
30837
+ ? (this.next(), 2)
30838
+ : 0;
30839
+ },
30840
+ read_class_body: function () {
30841
+ let t = [],
30842
+ e = [];
30843
+ for (; this.token !== this.EOF && "}" !== this.token; ) {
30844
+ if (this.token === this.tok.T_COMMENT) {
30845
+ t.push(this.read_comment());
30846
+ continue;
30847
+ }
30848
+ if (this.token === this.tok.T_DOC_COMMENT) {
30849
+ t.push(this.read_doc_comment());
30850
+ continue;
30851
+ }
30852
+ if (this.token === this.tok.T_USE) {
30853
+ t = t.concat(this.read_trait_use_statement());
30854
+ continue;
30855
+ }
30856
+ this.token === this.tok.T_ATTRIBUTE &&
30857
+ (e = this.read_attr_list());
30858
+ const n = this.read_member_flags(!1);
30859
+ if (this.token !== this.tok.T_CONST)
30860
+ if (
30861
+ (this.token === this.tok.T_VAR &&
30862
+ (this.next().expect(this.tok.T_VARIABLE),
30863
+ (n[0] = null),
30864
+ (n[1] = 0)),
30865
+ this.token === this.tok.T_FUNCTION)
30866
+ )
30867
+ t.push(this.read_function(!1, n, e)), (e = []);
30868
+ else if (
30869
+ this.token === this.tok.T_VARIABLE ||
30870
+ (this.version >= 704 &&
30871
+ ("?" === this.token ||
30872
+ this.token === this.tok.T_CALLABLE ||
30873
+ this.token === this.tok.T_ARRAY ||
30874
+ this.token === this.tok.T_NS_SEPARATOR ||
30875
+ this.token === this.tok.T_STRING ||
30876
+ this.token === this.tok.T_NAMESPACE))
30877
+ ) {
30878
+ const i = this.read_variable_list(n, e);
30879
+ (e = []), this.expect(";"), this.next(), (t = t.concat(i));
30880
+ } else
30881
+ this.error([
30882
+ this.tok.T_CONST,
30883
+ this.tok.T_VARIABLE,
30884
+ this.tok.T_FUNCTION,
30885
+ ]),
30886
+ this.next();
30887
+ else {
30888
+ const i = this.read_constant_list(n, e);
30889
+ this.expect(";") && this.next(), (t = t.concat(i));
30890
+ }
30891
+ }
30892
+ return this.expect("}"), this.next(), t;
30893
+ },
30894
+ read_variable_list: function (t, e) {
30895
+ const n = this.node("propertystatement"),
30896
+ i = this.read_list(function () {
30897
+ const t = this.node("property"),
30898
+ [n, i] = this.read_optional_type();
30899
+ this.expect(this.tok.T_VARIABLE);
30900
+ let r = this.node("identifier");
30901
+ const o = this.text().substring(1);
30902
+ return (
30903
+ this.next(),
30904
+ (r = r(o)),
30905
+ ";" === this.token || "," === this.token
30906
+ ? t(r, null, n, i, e || [])
30907
+ : "=" === this.token
30908
+ ? t(r, this.next().read_expr(), n, i, e || [])
30909
+ : (this.expect([",", ";", "="]), t(r, null, n, i, e || []))
30910
+ );
30911
+ }, ",");
30912
+ return n(null, i, t);
30913
+ },
30914
+ read_constant_list: function (t, e) {
30915
+ this.expect(this.tok.T_CONST) && this.next();
30916
+ const n = this.node("classconstant"),
30917
+ i = this.read_list(function () {
30918
+ const t = this.node("constant");
30919
+ let e = null,
30920
+ n = null;
30921
+ if (
30922
+ this.token === this.tok.T_STRING ||
30923
+ (this.version >= 700 && this.is("IDENTIFIER"))
30924
+ ) {
30925
+ e = this.node("identifier");
30926
+ const t = this.text();
30927
+ this.next(), (e = e(t));
30928
+ } else this.expect("IDENTIFIER");
30929
+ return (
30930
+ this.expect("=") && (n = this.next().read_expr()), t(e, n)
30931
+ );
30932
+ }, ",");
30933
+ return n(null, i, t, e || []);
30934
+ },
30935
+ read_member_flags: function (t) {
30936
+ const e = [-1, -1, -1];
30937
+ if (this.is("T_MEMBER_FLAGS")) {
30938
+ let n = 0,
30939
+ i = 0;
30940
+ do {
30941
+ switch (this.token) {
30942
+ case this.tok.T_PUBLIC:
30943
+ (n = 0), (i = 0);
30944
+ break;
30945
+ case this.tok.T_PROTECTED:
30946
+ (n = 0), (i = 1);
30947
+ break;
30948
+ case this.tok.T_PRIVATE:
30949
+ (n = 0), (i = 2);
30950
+ break;
30951
+ case this.tok.T_STATIC:
30952
+ (n = 1), (i = 1);
30953
+ break;
30954
+ case this.tok.T_ABSTRACT:
30955
+ (n = 2), (i = 1);
30956
+ break;
30957
+ case this.tok.T_FINAL:
30958
+ (n = 2), (i = 2);
30959
+ }
30960
+ t &&
30961
+ (0 == n && 2 == i
30962
+ ? (this.expect([this.tok.T_PUBLIC, this.tok.T_PROTECTED]),
30963
+ (i = -1))
30964
+ : 2 == n && 1 == i && (this.error(), (i = -1))),
30965
+ -1 !== e[n] ? this.error() : -1 !== i && (e[n] = i);
30966
+ } while (this.next().is("T_MEMBER_FLAGS"));
30967
+ }
30968
+ return -1 == e[1] && (e[1] = 0), -1 == e[2] && (e[2] = 0), e;
30969
+ },
30970
+ read_optional_type: function () {
30971
+ let t = !1;
30972
+ "?" === this.token && ((t = !0), this.next());
30973
+ let e = this.read_types();
30974
+ if (
30975
+ (t &&
30976
+ !e &&
30977
+ this.raiseError(
30978
+ "Expecting a type definition combined with nullable operator"
30979
+ ),
30980
+ !t && !e)
30981
+ )
30982
+ return [!1, null];
30983
+ if ("|" === this.token) {
30984
+ e = [e];
30985
+ do {
30986
+ this.next();
30987
+ const t = this.read_type();
30988
+ if (!t) {
30989
+ this.raiseError("Expecting a type definition");
30990
+ break;
30991
+ }
30992
+ e.push(t);
30993
+ } while ("|" === this.token);
30994
+ }
30995
+ return [t, e];
30996
+ },
30997
+ read_interface_declaration_statement: function (t) {
30998
+ const e = this.node("interface");
30999
+ if (this.token !== this.tok.T_INTERFACE)
31000
+ return this.error(this.tok.T_INTERFACE), this.next(), null;
31001
+ this.next().expect(this.tok.T_STRING);
31002
+ let n = this.node("identifier");
31003
+ const i = this.text();
31004
+ this.next(), (n = n(i));
31005
+ const r = this.read_interface_extends_list();
31006
+ this.expect("{");
31007
+ return e(n, r, this.next().read_interface_body(), t || []);
31008
+ },
31009
+ read_interface_body: function () {
31010
+ let t = [],
31011
+ e = [];
31012
+ for (; this.token !== this.EOF && "}" !== this.token; ) {
31013
+ if (this.token === this.tok.T_COMMENT) {
31014
+ t.push(this.read_comment());
31015
+ continue;
31016
+ }
31017
+ if (this.token === this.tok.T_DOC_COMMENT) {
31018
+ t.push(this.read_doc_comment());
31019
+ continue;
31020
+ }
31021
+ e = this.read_attr_list();
31022
+ const n = this.read_member_flags(!0);
31023
+ if (this.token == this.tok.T_CONST) {
31024
+ const i = this.read_constant_list(n, e);
31025
+ this.expect(";") && this.next(), (t = t.concat(i)), (e = []);
31026
+ } else if (this.token === this.tok.T_FUNCTION) {
31027
+ const i = this.read_function_declaration(2, n, e);
31028
+ i.parseFlags(n),
31029
+ t.push(i),
31030
+ this.expect(";") && this.next(),
31031
+ (e = []);
31032
+ } else
31033
+ this.error([this.tok.T_CONST, this.tok.T_FUNCTION]),
31034
+ this.next();
31035
+ }
31036
+ return this.expect("}") && this.next(), t;
31037
+ },
31038
+ read_trait_declaration_statement: function () {
31039
+ const t = this.node("trait");
31040
+ if (this.token !== this.tok.T_TRAIT)
31041
+ return this.error(this.tok.T_TRAIT), this.next(), null;
31042
+ this.next().expect(this.tok.T_STRING);
31043
+ let e = this.node("identifier");
31044
+ const n = this.text();
31045
+ this.next(), (e = e(n)), this.expect("{");
31046
+ return t(e, this.next().read_class_body());
31047
+ },
31048
+ read_trait_use_statement: function () {
31049
+ const t = this.node("traituse");
31050
+ this.expect(this.tok.T_USE) && this.next();
31051
+ const e = [this.read_namespace_name()];
31052
+ let n = null;
31053
+ for (; "," === this.token; )
31054
+ e.push(this.next().read_namespace_name());
31055
+ if ("{" === this.token) {
31056
+ for (
31057
+ n = [];
31058
+ this.next().token !== this.EOF && "}" !== this.token;
31059
+
31060
+ )
31061
+ n.push(this.read_trait_use_alias()), this.expect(";");
31062
+ this.expect("}") && this.next();
31063
+ } else this.expect(";") && this.next();
31064
+ return t(e, n);
31065
+ },
31066
+ read_trait_use_alias: function () {
31067
+ const t = this.node();
31068
+ let e,
31069
+ n = null;
31070
+ if (this.is("IDENTIFIER")) {
31071
+ e = this.node("identifier");
31072
+ const t = this.text();
31073
+ this.next(), (e = e(t));
31074
+ } else if (
31075
+ ((e = this.read_namespace_name()),
31076
+ this.token === this.tok.T_DOUBLE_COLON)
31077
+ )
31078
+ if (
31079
+ (this.next(),
31080
+ this.token === this.tok.T_STRING ||
31081
+ (this.version >= 700 && this.is("IDENTIFIER")))
31082
+ ) {
31083
+ (n = e), (e = this.node("identifier"));
31084
+ const t = this.text();
31085
+ this.next(), (e = e(t));
31086
+ } else this.expect(this.tok.T_STRING);
31087
+ else e = e.name;
31088
+ if (this.token === this.tok.T_INSTEADOF)
31089
+ return t("traitprecedence", n, e, this.next().read_name_list());
31090
+ if (this.token === this.tok.T_AS) {
31091
+ let i = null,
31092
+ r = null;
31093
+ if (
31094
+ (this.next().is("T_MEMBER_FLAGS") &&
31095
+ (i = this.read_member_flags()),
31096
+ this.token === this.tok.T_STRING ||
31097
+ (this.version >= 700 && this.is("IDENTIFIER")))
31098
+ ) {
31099
+ r = this.node("identifier");
31100
+ const t = this.text();
31101
+ this.next(), (r = r(t));
31102
+ } else !1 === i && this.expect(this.tok.T_STRING);
31103
+ return t("traitalias", n, e, r, i);
31104
+ }
31105
+ return (
31106
+ this.expect([this.tok.T_AS, this.tok.T_INSTEADOF]),
31107
+ t("traitalias", n, e, null, null)
31108
+ );
31109
+ },
31110
+ };
31111
+ },
31112
+ {},
31113
+ ],
31114
+ 146: [
31115
+ function (t, e, n) {
31116
+ "use strict";
31117
+ e.exports = {
31118
+ read_comment: function () {
31119
+ const t = this.text();
31120
+ let e = this.ast.prepare(
31121
+ "/*" === t.substring(0, 2) ? "commentblock" : "commentline",
31122
+ null,
31123
+ this
31124
+ );
31125
+ const n = this.lexer.yylloc.first_offset,
31126
+ i = this.prev;
31127
+ return (
31128
+ (this.prev = [
31129
+ this.lexer.yylloc.last_line,
31130
+ this.lexer.yylloc.last_column,
31131
+ this.lexer.offset,
31132
+ ]),
31133
+ this.lex(),
31134
+ (e = e(t)),
31135
+ (e.offset = n),
31136
+ (this.prev = i),
31137
+ e
31138
+ );
31139
+ },
31140
+ read_doc_comment: function () {
31141
+ let t = this.ast.prepare("commentblock", null, this);
31142
+ const e = this.lexer.yylloc.first_offset,
31143
+ n = this.text(),
31144
+ i = this.prev;
31145
+ return (
31146
+ (this.prev = [
31147
+ this.lexer.yylloc.last_line,
31148
+ this.lexer.yylloc.last_column,
31149
+ this.lexer.offset,
31150
+ ]),
31151
+ this.lex(),
31152
+ (t = t(n)),
31153
+ (t.offset = e),
31154
+ (this.prev = i),
31155
+ t
31156
+ );
31157
+ },
31158
+ };
31159
+ },
31160
+ {},
31161
+ ],
31162
+ 147: [
31163
+ function (t, e, n) {
31164
+ "use strict";
31165
+ e.exports = {
31166
+ read_expr: function (t) {
31167
+ const e = this.node();
31168
+ if ("@" === this.token)
31169
+ return t || (t = this.next().read_expr()), e("silent", t);
31170
+ if ((t || (t = this.read_expr_item()), "|" === this.token))
31171
+ return e("bin", "|", t, this.next().read_expr());
31172
+ if ("&" === this.token)
31173
+ return e("bin", "&", t, this.next().read_expr());
31174
+ if ("^" === this.token)
31175
+ return e("bin", "^", t, this.next().read_expr());
31176
+ if ("." === this.token)
31177
+ return e("bin", ".", t, this.next().read_expr());
31178
+ if ("+" === this.token)
31179
+ return e("bin", "+", t, this.next().read_expr());
31180
+ if ("-" === this.token)
31181
+ return e("bin", "-", t, this.next().read_expr());
31182
+ if ("*" === this.token)
31183
+ return e("bin", "*", t, this.next().read_expr());
31184
+ if ("/" === this.token)
31185
+ return e("bin", "/", t, this.next().read_expr());
31186
+ if ("%" === this.token)
31187
+ return e("bin", "%", t, this.next().read_expr());
31188
+ if (this.token === this.tok.T_POW)
31189
+ return e("bin", "**", t, this.next().read_expr());
31190
+ if (this.token === this.tok.T_SL)
31191
+ return e("bin", "<<", t, this.next().read_expr());
31192
+ if (this.token === this.tok.T_SR)
31193
+ return e("bin", ">>", t, this.next().read_expr());
31194
+ if (this.token === this.tok.T_BOOLEAN_OR)
31195
+ return e("bin", "||", t, this.next().read_expr());
31196
+ if (this.token === this.tok.T_LOGICAL_OR)
31197
+ return e("bin", "or", t, this.next().read_expr());
31198
+ if (this.token === this.tok.T_BOOLEAN_AND)
31199
+ return e("bin", "&&", t, this.next().read_expr());
31200
+ if (this.token === this.tok.T_LOGICAL_AND)
31201
+ return e("bin", "and", t, this.next().read_expr());
31202
+ if (this.token === this.tok.T_LOGICAL_XOR)
31203
+ return e("bin", "xor", t, this.next().read_expr());
31204
+ if (this.token === this.tok.T_IS_IDENTICAL)
31205
+ return e("bin", "===", t, this.next().read_expr());
31206
+ if (this.token === this.tok.T_IS_NOT_IDENTICAL)
31207
+ return e("bin", "!==", t, this.next().read_expr());
31208
+ if (this.token === this.tok.T_IS_EQUAL)
31209
+ return e("bin", "==", t, this.next().read_expr());
31210
+ if (this.token === this.tok.T_IS_NOT_EQUAL)
31211
+ return e("bin", "!=", t, this.next().read_expr());
31212
+ if ("<" === this.token)
31213
+ return e("bin", "<", t, this.next().read_expr());
31214
+ if (">" === this.token)
31215
+ return e("bin", ">", t, this.next().read_expr());
31216
+ if (this.token === this.tok.T_IS_SMALLER_OR_EQUAL)
31217
+ return e("bin", "<=", t, this.next().read_expr());
31218
+ if (this.token === this.tok.T_IS_GREATER_OR_EQUAL)
31219
+ return e("bin", ">=", t, this.next().read_expr());
31220
+ if (this.token === this.tok.T_SPACESHIP)
31221
+ return e("bin", "<=>", t, this.next().read_expr());
31222
+ if (
31223
+ (this.token === this.tok.T_INSTANCEOF &&
31224
+ ((t = e(
31225
+ "bin",
31226
+ "instanceof",
31227
+ t,
31228
+ this.next().read_class_name_reference()
31229
+ )),
31230
+ ";" !== this.token &&
31231
+ this.token !== this.tok.T_INLINE_HTML &&
31232
+ this.token !== this.EOF &&
31233
+ (t = this.read_expr(t))),
31234
+ this.token === this.tok.T_COALESCE)
31235
+ )
31236
+ return e("bin", "??", t, this.next().read_expr());
31237
+ if ("?" === this.token) {
31238
+ let n = null;
31239
+ return (
31240
+ ":" !== this.next().token && (n = this.read_expr()),
31241
+ this.expect(":") && this.next(),
31242
+ e("retif", t, n, this.read_expr())
31243
+ );
31244
+ }
31245
+ return e.destroy(t), t;
31246
+ },
31247
+ read_expr_cast: function (t) {
31248
+ return this.node("cast")(t, this.text(), this.next().read_expr());
31249
+ },
31250
+ read_isset_variable: function () {
31251
+ return this.read_expr();
31252
+ },
31253
+ read_isset_variables: function () {
31254
+ return this.read_function_list(this.read_isset_variable, ",");
31255
+ },
31256
+ read_internal_functions_in_yacc: function () {
31257
+ let t = null;
31258
+ switch (this.token) {
31259
+ case this.tok.T_ISSET:
31260
+ {
31261
+ (t = this.node("isset")),
31262
+ this.next().expect("(") && this.next();
31263
+ const e = this.read_isset_variables();
31264
+ this.expect(")") && this.next(), (t = t(e));
31265
+ }
31266
+ break;
31267
+ case this.tok.T_EMPTY:
31268
+ {
31269
+ (t = this.node("empty")),
31270
+ this.next().expect("(") && this.next();
31271
+ const e = this.read_expr();
31272
+ this.expect(")") && this.next(), (t = t(e));
31273
+ }
31274
+ break;
31275
+ case this.tok.T_INCLUDE:
31276
+ t = this.node("include")(!1, !1, this.next().read_expr());
31277
+ break;
31278
+ case this.tok.T_INCLUDE_ONCE:
31279
+ t = this.node("include")(!0, !1, this.next().read_expr());
31280
+ break;
31281
+ case this.tok.T_EVAL:
31282
+ {
31283
+ (t = this.node("eval")),
31284
+ this.next().expect("(") && this.next();
31285
+ const e = this.read_expr();
31286
+ this.expect(")") && this.next(), (t = t(e));
31287
+ }
31288
+ break;
31289
+ case this.tok.T_REQUIRE:
31290
+ t = this.node("include")(!1, !0, this.next().read_expr());
31291
+ break;
31292
+ case this.tok.T_REQUIRE_ONCE:
31293
+ t = this.node("include")(!0, !0, this.next().read_expr());
31294
+ }
31295
+ return t;
31296
+ },
31297
+ read_optional_expr: function (t) {
31298
+ return this.token !== t ? this.read_expr() : null;
31299
+ },
31300
+ read_exit_expr: function () {
31301
+ let t = null;
31302
+ return (
31303
+ "(" === this.token &&
31304
+ (this.next(),
31305
+ (t = this.read_optional_expr(")")),
31306
+ this.expect(")") && this.next()),
31307
+ t
31308
+ );
31309
+ },
31310
+ read_expr_item: function () {
31311
+ let t,
31312
+ e,
31313
+ n = [];
31314
+ if ("+" === this.token)
31315
+ return this.node("unary")("+", this.next().read_expr());
31316
+ if ("-" === this.token)
31317
+ return this.node("unary")("-", this.next().read_expr());
31318
+ if ("!" === this.token)
31319
+ return this.node("unary")("!", this.next().read_expr());
31320
+ if ("~" === this.token)
31321
+ return this.node("unary")("~", this.next().read_expr());
31322
+ if ("(" === this.token)
31323
+ return (
31324
+ (e = this.next().read_expr()),
31325
+ (e.parenthesizedExpression = !0),
31326
+ this.expect(")") && this.next(),
31327
+ this.handleDereferencable(e)
31328
+ );
31329
+ if ("`" === this.token) return this.read_encapsed_string("`");
31330
+ if (this.token === this.tok.T_LIST) {
31331
+ let e = null;
31332
+ const n = this.innerList;
31333
+ (t = this.node("list")),
31334
+ n || (e = this.node("assign")),
31335
+ this.next().expect("(") && this.next(),
31336
+ this.innerList || (this.innerList = !0);
31337
+ const i = this.read_array_pair_list(!1);
31338
+ this.expect(")") && this.next();
31339
+ let r = !1;
31340
+ for (let t = 0; t < i.length; t++)
31341
+ if (null !== i[t] && "noop" !== i[t].kind) {
31342
+ r = !0;
31343
+ break;
31344
+ }
31345
+ return (
31346
+ r ||
31347
+ this.raiseError(
31348
+ "Fatal Error : Cannot use empty list on line " +
31349
+ this.lexer.yylloc.first_line
31350
+ ),
31351
+ n
31352
+ ? t(i, !1)
31353
+ : ((this.innerList = !1),
31354
+ this.expect("=")
31355
+ ? e(t(i, !1), this.next().read_expr(), "=")
31356
+ : t(i, !1))
31357
+ );
31358
+ }
31359
+ if (
31360
+ (this.token === this.tok.T_ATTRIBUTE &&
31361
+ (n = this.read_attr_list()),
31362
+ this.token === this.tok.T_CLONE)
31363
+ )
31364
+ return this.node("clone")(this.next().read_expr());
31365
+ switch (this.token) {
31366
+ case this.tok.T_INC:
31367
+ return this.node("pre")("+", this.next().read_variable(!1, !1));
31368
+ case this.tok.T_DEC:
31369
+ return this.node("pre")("-", this.next().read_variable(!1, !1));
31370
+ case this.tok.T_NEW:
31371
+ return this.read_new_expr();
31372
+ case this.tok.T_ISSET:
31373
+ case this.tok.T_EMPTY:
31374
+ case this.tok.T_INCLUDE:
31375
+ case this.tok.T_INCLUDE_ONCE:
31376
+ case this.tok.T_EVAL:
31377
+ case this.tok.T_REQUIRE:
31378
+ case this.tok.T_REQUIRE_ONCE:
31379
+ return this.read_internal_functions_in_yacc();
31380
+ case this.tok.T_MATCH:
31381
+ return this.read_match_expression();
31382
+ case this.tok.T_INT_CAST:
31383
+ return this.read_expr_cast("int");
31384
+ case this.tok.T_DOUBLE_CAST:
31385
+ return this.read_expr_cast("float");
31386
+ case this.tok.T_STRING_CAST:
31387
+ return this.read_expr_cast(
31388
+ -1 !== this.text().indexOf("binary") ? "binary" : "string"
31389
+ );
31390
+ case this.tok.T_ARRAY_CAST:
31391
+ return this.read_expr_cast("array");
31392
+ case this.tok.T_OBJECT_CAST:
31393
+ return this.read_expr_cast("object");
31394
+ case this.tok.T_BOOL_CAST:
31395
+ return this.read_expr_cast("bool");
31396
+ case this.tok.T_UNSET_CAST:
31397
+ return this.read_expr_cast("unset");
31398
+ case this.tok.T_THROW:
31399
+ this.version < 800 &&
31400
+ this.raiseError(
31401
+ "PHP 8+ is required to use throw as an expression"
31402
+ );
31403
+ return this.node("throw")(this.next().read_expr());
31404
+ case this.tok.T_EXIT: {
31405
+ const e = "die" === this.lexer.yytext.toLowerCase();
31406
+ (t = this.node("exit")), this.next();
31407
+ return t(this.read_exit_expr(), e);
31408
+ }
31409
+ case this.tok.T_PRINT:
31410
+ return this.node("print")(this.next().read_expr());
31411
+ case this.tok.T_YIELD: {
31412
+ let e = null,
31413
+ n = null;
31414
+ return (
31415
+ (t = this.node("yield")),
31416
+ this.next().is("EXPR") &&
31417
+ ((e = this.read_expr()),
31418
+ this.token === this.tok.T_DOUBLE_ARROW &&
31419
+ ((n = e), (e = this.next().read_expr()))),
31420
+ t(e, n)
31421
+ );
31422
+ }
31423
+ case this.tok.T_YIELD_FROM:
31424
+ return (
31425
+ (t = this.node("yieldfrom")),
31426
+ (e = this.next().read_expr()),
31427
+ t(e)
31428
+ );
31429
+ case this.tok.T_FN:
31430
+ case this.tok.T_FUNCTION:
31431
+ return this.read_inline_function(void 0, n);
31432
+ case this.tok.T_STATIC: {
31433
+ const t = [this.token, this.lexer.getState()];
31434
+ if (
31435
+ (this.next(),
31436
+ this.token === this.tok.T_FUNCTION ||
31437
+ (this.version >= 704 && this.token === this.tok.T_FN))
31438
+ )
31439
+ return this.read_inline_function([0, 1, 0], n);
31440
+ this.lexer.tokens.push(t), this.next();
31441
+ }
31442
+ }
31443
+ if (this.is("VARIABLE")) {
31444
+ (t = this.node()), (e = this.read_variable(!1, !1));
31445
+ const n =
31446
+ "identifier" === e.kind ||
31447
+ ("staticlookup" === e.kind && "identifier" === e.offset.kind);
31448
+ switch (this.token) {
31449
+ case "=":
31450
+ return (
31451
+ n && this.error("VARIABLE"),
31452
+ "&" == this.next().token
31453
+ ? this.read_assignref(t, e)
31454
+ : t("assign", e, this.read_expr(), "=")
31455
+ );
31456
+ case this.tok.T_PLUS_EQUAL:
31457
+ return (
31458
+ n && this.error("VARIABLE"),
31459
+ t("assign", e, this.next().read_expr(), "+=")
31460
+ );
31461
+ case this.tok.T_MINUS_EQUAL:
31462
+ return (
31463
+ n && this.error("VARIABLE"),
31464
+ t("assign", e, this.next().read_expr(), "-=")
31465
+ );
31466
+ case this.tok.T_MUL_EQUAL:
31467
+ return (
31468
+ n && this.error("VARIABLE"),
31469
+ t("assign", e, this.next().read_expr(), "*=")
31470
+ );
31471
+ case this.tok.T_POW_EQUAL:
31472
+ return (
31473
+ n && this.error("VARIABLE"),
31474
+ t("assign", e, this.next().read_expr(), "**=")
31475
+ );
31476
+ case this.tok.T_DIV_EQUAL:
31477
+ return (
31478
+ n && this.error("VARIABLE"),
31479
+ t("assign", e, this.next().read_expr(), "/=")
31480
+ );
31481
+ case this.tok.T_CONCAT_EQUAL:
31482
+ return (
31483
+ n && this.error("VARIABLE"),
31484
+ t("assign", e, this.next().read_expr(), ".=")
31485
+ );
31486
+ case this.tok.T_MOD_EQUAL:
31487
+ return (
31488
+ n && this.error("VARIABLE"),
31489
+ t("assign", e, this.next().read_expr(), "%=")
31490
+ );
31491
+ case this.tok.T_AND_EQUAL:
31492
+ return (
31493
+ n && this.error("VARIABLE"),
31494
+ t("assign", e, this.next().read_expr(), "&=")
31495
+ );
31496
+ case this.tok.T_OR_EQUAL:
31497
+ return (
31498
+ n && this.error("VARIABLE"),
31499
+ t("assign", e, this.next().read_expr(), "|=")
31500
+ );
31501
+ case this.tok.T_XOR_EQUAL:
31502
+ return (
31503
+ n && this.error("VARIABLE"),
31504
+ t("assign", e, this.next().read_expr(), "^=")
31505
+ );
31506
+ case this.tok.T_SL_EQUAL:
31507
+ return (
31508
+ n && this.error("VARIABLE"),
31509
+ t("assign", e, this.next().read_expr(), "<<=")
31510
+ );
31511
+ case this.tok.T_SR_EQUAL:
31512
+ return (
31513
+ n && this.error("VARIABLE"),
31514
+ t("assign", e, this.next().read_expr(), ">>=")
31515
+ );
31516
+ case this.tok.T_COALESCE_EQUAL:
31517
+ return (
31518
+ n && this.error("VARIABLE"),
31519
+ t("assign", e, this.next().read_expr(), "??=")
31520
+ );
31521
+ case this.tok.T_INC:
31522
+ return (
31523
+ n && this.error("VARIABLE"), this.next(), t("post", "+", e)
31524
+ );
31525
+ case this.tok.T_DEC:
31526
+ return (
31527
+ n && this.error("VARIABLE"), this.next(), t("post", "-", e)
31528
+ );
31529
+ default:
31530
+ t.destroy(e);
31531
+ }
31532
+ } else {
31533
+ if (this.is("SCALAR")) {
31534
+ if (
31535
+ ((t = this.node()),
31536
+ (e = this.read_scalar()),
31537
+ "array" === e.kind && e.shortForm && "=" === this.token)
31538
+ ) {
31539
+ const n = this.convertToList(e);
31540
+ e.loc && (n.loc = e.loc);
31541
+ return t("assign", n, this.next().read_expr(), "=");
31542
+ }
31543
+ return t.destroy(e), this.handleDereferencable(e);
31544
+ }
31545
+ this.error("EXPR"), this.next();
31546
+ }
31547
+ return e;
31548
+ },
31549
+ convertToList: function (t) {
31550
+ const e = t.items.map(
31551
+ (t) => (
31552
+ t.value &&
31553
+ "array" === t.value.kind &&
31554
+ t.value.shortForm &&
31555
+ (t.value = this.convertToList(t.value)),
31556
+ t
31557
+ )
31558
+ ),
31559
+ n = this.node("list")(e, !0);
31560
+ return (
31561
+ t.loc && (n.loc = t.loc),
31562
+ t.leadingComments && (n.leadingComments = t.leadingComments),
31563
+ t.trailingComments && (n.trailingComments = t.trailingComments),
31564
+ n
31565
+ );
31566
+ },
31567
+ read_assignref: function (t, e) {
31568
+ let n;
31569
+ return (
31570
+ this.next(),
31571
+ this.token === this.tok.T_NEW
31572
+ ? (this.version >= 700 && this.error(),
31573
+ (n = this.read_new_expr()))
31574
+ : (n = this.read_variable(!1, !1)),
31575
+ t("assignref", e, n)
31576
+ );
31577
+ },
31578
+ read_inline_function: function (t, e) {
31579
+ if (this.token === this.tok.T_FUNCTION) {
31580
+ const n = this.read_function(!0, t, e);
31581
+ return (n.attrGroups = e), n;
31582
+ }
31583
+ !this.version >= 704 &&
31584
+ this.raiseError("Arrow Functions are not allowed");
31585
+ const n = this.node("arrowfunc");
31586
+ this.expect(this.tok.T_FN) && this.next();
31587
+ const i = this.is_reference();
31588
+ this.expect("(") && this.next();
31589
+ const r = this.read_parameter_list();
31590
+ this.expect(")") && this.next();
31591
+ let o = !1,
31592
+ s = null;
31593
+ ":" === this.token &&
31594
+ ("?" === this.next().token && ((o = !0), this.next()),
31595
+ (s = this.read_types())),
31596
+ this.expect(this.tok.T_DOUBLE_ARROW) && this.next();
31597
+ const a = n(r, i, this.read_expr(), s, o, !!t);
31598
+ return (a.attrGroups = e), a;
31599
+ },
31600
+ read_match_expression: function () {
31601
+ const t = this.node("match");
31602
+ this.expect(this.tok.T_MATCH) && this.next(),
31603
+ this.version < 800 &&
31604
+ this.raiseError(
31605
+ "Match statements are not allowed before PHP 8"
31606
+ );
31607
+ let e = null,
31608
+ n = [];
31609
+ return (
31610
+ this.expect("(") && this.next(),
31611
+ (e = this.read_expr()),
31612
+ this.expect(")") && this.next(),
31613
+ this.expect("{") && this.next(),
31614
+ (n = this.read_match_arms()),
31615
+ this.expect("}") && this.next(),
31616
+ t(e, n)
31617
+ );
31618
+ },
31619
+ read_match_arms: function () {
31620
+ return this.read_list(() => this.read_match_arm(), ",", !0);
31621
+ },
31622
+ read_match_arm: function () {
31623
+ if ("}" !== this.token)
31624
+ return this.node("matcharm")(
31625
+ this.read_match_arm_conds(),
31626
+ this.read_expr()
31627
+ );
31628
+ },
31629
+ read_match_arm_conds: function () {
31630
+ let t = [];
31631
+ if (this.token === this.tok.T_DEFAULT) (t = null), this.next();
31632
+ else
31633
+ for (t.push(this.read_expr()); "," === this.token; ) {
31634
+ if ((this.next(), this.token === this.tok.T_DOUBLE_ARROW))
31635
+ return this.next(), t;
31636
+ t.push(this.read_expr());
31637
+ }
31638
+ return this.expect(this.tok.T_DOUBLE_ARROW) && this.next(), t;
31639
+ },
31640
+ read_attribute() {
31641
+ const t = this.text();
31642
+ let e = [];
31643
+ return (
31644
+ this.next(),
31645
+ "(" === this.token && (e = this.read_argument_list()),
31646
+ this.node("attribute")(t, e)
31647
+ );
31648
+ },
31649
+ read_attr_list() {
31650
+ const t = [];
31651
+ if (this.token === this.tok.T_ATTRIBUTE)
31652
+ do {
31653
+ const e = this.node("attrgroup")([]);
31654
+ for (
31655
+ this.next(), e.attrs.push(this.read_attribute());
31656
+ "," === this.token;
31657
+
31658
+ )
31659
+ this.next(),
31660
+ "]" !== this.token && e.attrs.push(this.read_attribute());
31661
+ t.push(e), this.expect("]"), this.next();
31662
+ } while (this.token === this.tok.T_ATTRIBUTE);
31663
+ return t;
31664
+ },
31665
+ read_new_expr: function () {
31666
+ const t = this.node("new");
31667
+ this.expect(this.tok.T_NEW) && this.next();
31668
+ let e = [];
31669
+ const n = this.read_attr_list();
31670
+ if (this.token === this.tok.T_CLASS) {
31671
+ const i = this.node("class");
31672
+ "(" === this.next().token && (e = this.read_argument_list());
31673
+ const r = this.read_extends_from(),
31674
+ o = this.read_implements_list();
31675
+ let s = null;
31676
+ this.expect("{") && (s = this.next().read_class_body());
31677
+ const a = i(null, r, o, s, [0, 0, 0]);
31678
+ return (a.attrGroups = n), t(a, e);
31679
+ }
31680
+ const i = this.read_new_class_name();
31681
+ return (
31682
+ "(" === this.token && (e = this.read_argument_list()), t(i, e)
31683
+ );
31684
+ },
31685
+ read_new_class_name: function () {
31686
+ if (
31687
+ this.token === this.tok.T_NS_SEPARATOR ||
31688
+ this.token === this.tok.T_STRING ||
31689
+ this.token === this.tok.T_NAMESPACE
31690
+ ) {
31691
+ let t = this.read_namespace_name(!0);
31692
+ return (
31693
+ this.token === this.tok.T_DOUBLE_COLON &&
31694
+ (t = this.read_static_getter(t)),
31695
+ t
31696
+ );
31697
+ }
31698
+ if (this.is("VARIABLE")) return this.read_variable(!0, !1);
31699
+ this.expect([this.tok.T_STRING, "VARIABLE"]);
31700
+ },
31701
+ handleDereferencable: function (t) {
31702
+ for (; this.token !== this.EOF; )
31703
+ if (
31704
+ this.token === this.tok.T_OBJECT_OPERATOR ||
31705
+ this.token === this.tok.T_DOUBLE_COLON
31706
+ )
31707
+ t = this.recursive_variable_chain_scan(t, !1, !1, !0);
31708
+ else if (
31709
+ this.token === this.tok.T_CURLY_OPEN ||
31710
+ "[" === this.token
31711
+ )
31712
+ t = this.read_dereferencable(t);
31713
+ else {
31714
+ if ("(" !== this.token) return t;
31715
+ t = this.node("call")(t, this.read_argument_list());
31716
+ }
31717
+ return t;
31718
+ },
31719
+ };
31720
+ },
31721
+ {},
31722
+ ],
31723
+ 148: [
31724
+ function (t, e, n) {
31725
+ "use strict";
31726
+ e.exports = {
31727
+ is_reference: function () {
31728
+ return "&" == this.token && (this.next(), !0);
31729
+ },
31730
+ is_variadic: function () {
31731
+ return this.token === this.tok.T_ELLIPSIS && (this.next(), !0);
31732
+ },
31733
+ read_function: function (t, e, n) {
31734
+ const i = this.read_function_declaration(
31735
+ t ? 1 : e ? 2 : 0,
31736
+ e && 1 === e[1],
31737
+ n || []
31738
+ );
31739
+ return (
31740
+ e && 1 == e[2]
31741
+ ? (i.parseFlags(e), this.expect(";") && this.next())
31742
+ : (this.expect("{") &&
31743
+ ((i.body = this.read_code_block(!1)),
31744
+ i.loc && i.body.loc && (i.loc.end = i.body.loc.end)),
31745
+ !t && e && i.parseFlags(e)),
31746
+ i
31747
+ );
31748
+ },
31749
+ read_function_declaration: function (t, e, n) {
31750
+ let i = "function";
31751
+ 1 === t ? (i = "closure") : 2 === t && (i = "method");
31752
+ const r = this.node(i);
31753
+ this.expect(this.tok.T_FUNCTION) && this.next();
31754
+ const o = this.is_reference();
31755
+ let s = !1,
31756
+ a = [],
31757
+ l = null,
31758
+ c = !1;
31759
+ if (1 !== t) {
31760
+ const e = this.node("identifier");
31761
+ 2 === t
31762
+ ? this.version >= 700
31763
+ ? this.token === this.tok.T_STRING || this.is("IDENTIFIER")
31764
+ ? ((s = this.text()), this.next())
31765
+ : this.version < 704 && this.error("IDENTIFIER")
31766
+ : this.token === this.tok.T_STRING
31767
+ ? ((s = this.text()), this.next())
31768
+ : this.error("IDENTIFIER")
31769
+ : this.version >= 700
31770
+ ? this.token === this.tok.T_STRING
31771
+ ? ((s = this.text()), this.next())
31772
+ : this.version >= 704
31773
+ ? this.expect("(") || this.next()
31774
+ : (this.error(this.tok.T_STRING), this.next())
31775
+ : (this.expect(this.tok.T_STRING) && (s = this.text()),
31776
+ this.next()),
31777
+ (s = e(s));
31778
+ }
31779
+ this.expect("(") && this.next();
31780
+ const h = this.read_parameter_list();
31781
+ if (
31782
+ (this.expect(")") && this.next(),
31783
+ 1 === t && (a = this.read_lexical_vars()),
31784
+ ":" === this.token &&
31785
+ ("?" === this.next().token && ((c = !0), this.next()),
31786
+ (l = this.read_types())),
31787
+ 1 === t)
31788
+ ) {
31789
+ const t = r(h, o, a, l, c, e);
31790
+ return (t.attrGroups = n || []), t;
31791
+ }
31792
+ const u = r(s, h, o, l, c);
31793
+ return (u.attrGroups = n || []), u;
31794
+ },
31795
+ read_lexical_vars: function () {
31796
+ let t = [];
31797
+ return (
31798
+ this.token === this.tok.T_USE &&
31799
+ (this.next(),
31800
+ this.expect("(") && this.next(),
31801
+ (t = this.read_lexical_var_list()),
31802
+ this.expect(")") && this.next()),
31803
+ t
31804
+ );
31805
+ },
31806
+ read_list_with_dangling_comma: function (t) {
31807
+ const e = [];
31808
+ for (; this.token != this.EOF; ) {
31809
+ if ((e.push(t()), "," != this.token)) {
31810
+ if (")" == this.token) break;
31811
+ this.error([",", ")"]);
31812
+ break;
31813
+ }
31814
+ if ((this.next(), this.version >= 800 && ")" === this.token))
31815
+ return e;
31816
+ }
31817
+ return e;
31818
+ },
31819
+ read_lexical_var_list: function () {
31820
+ return this.read_list_with_dangling_comma(
31821
+ this.read_lexical_var.bind(this)
31822
+ );
31823
+ },
31824
+ read_lexical_var: function () {
31825
+ if ("&" === this.token)
31826
+ return this.read_byref(this.read_lexical_var.bind(this));
31827
+ const t = this.node("variable");
31828
+ this.expect(this.tok.T_VARIABLE);
31829
+ const e = this.text().substring(1);
31830
+ return this.next(), t(e, !1);
31831
+ },
31832
+ read_parameter_list: function () {
31833
+ return ")" != this.token
31834
+ ? this.read_list_with_dangling_comma(
31835
+ this.read_parameter.bind(this)
31836
+ )
31837
+ : [];
31838
+ },
31839
+ read_parameter: function () {
31840
+ const t = this.node("parameter");
31841
+ let e = null,
31842
+ n = null,
31843
+ i = null,
31844
+ r = !1,
31845
+ o = [];
31846
+ this.token === this.tok.T_ATTRIBUTE && (o = this.read_attr_list());
31847
+ const s = this.read_promoted();
31848
+ "?" === this.token && (this.next(), (r = !0)),
31849
+ (i = this.read_types()),
31850
+ r &&
31851
+ !i &&
31852
+ this.raiseError(
31853
+ "Expecting a type definition combined with nullable operator"
31854
+ );
31855
+ const a = this.is_reference(),
31856
+ l = this.is_variadic();
31857
+ if (this.expect(this.tok.T_VARIABLE)) {
31858
+ e = this.node("identifier");
31859
+ const t = this.text().substring(1);
31860
+ this.next(), (e = e(t));
31861
+ }
31862
+ "=" == this.token && (n = this.next().read_expr());
31863
+ const c = t(e, i, n, a, l, r, s);
31864
+ return o && (c.attrGroups = o), c;
31865
+ },
31866
+ read_types() {
31867
+ const t = [],
31868
+ e = this.node("uniontype");
31869
+ let n = this.read_type();
31870
+ if (!n) return null;
31871
+ for (t.push(n); "|" === this.token; )
31872
+ this.next(), (n = this.read_type()), t.push(n);
31873
+ return 1 === t.length ? t[0] : e(t);
31874
+ },
31875
+ read_promoted() {
31876
+ return this.token === this.tok.T_PUBLIC
31877
+ ? (this.next(), 1)
31878
+ : this.token === this.tok.T_PROTECTED
31879
+ ? (this.next(), 2)
31880
+ : this.token === this.tok.T_PRIVATE
31881
+ ? (this.next(), 4)
31882
+ : 0;
31883
+ },
31884
+ read_argument_list: function () {
31885
+ let t = [];
31886
+ return (
31887
+ this.expect("(") && this.next(),
31888
+ ")" !== this.token && (t = this.read_non_empty_argument_list()),
31889
+ this.expect(")") && this.next(),
31890
+ t
31891
+ );
31892
+ },
31893
+ read_non_empty_argument_list: function () {
31894
+ let t = !1;
31895
+ return this.read_function_list(
31896
+ function () {
31897
+ const e = this.read_argument();
31898
+ return (
31899
+ e &&
31900
+ (t &&
31901
+ this.raiseError(
31902
+ "Unexpected argument after a variadic argument"
31903
+ ),
31904
+ "variadic" === e.kind && (t = !0)),
31905
+ e
31906
+ );
31907
+ }.bind(this),
31908
+ ","
31909
+ );
31910
+ },
31911
+ read_argument: function () {
31912
+ if (this.token === this.tok.T_ELLIPSIS)
31913
+ return this.node("variadic")(this.next().read_expr());
31914
+ if (
31915
+ this.token === this.tok.T_STRING ||
31916
+ Object.values(this.lexer.keywords).includes(this.token)
31917
+ ) {
31918
+ const t = this.lexer.getState(),
31919
+ e = this.lexer.lex();
31920
+ if ((this.lexer.setState(t), ":" === e))
31921
+ return (
31922
+ this.version < 800 &&
31923
+ this.raiseError(
31924
+ "PHP 8+ is required to use named arguments"
31925
+ ),
31926
+ this.node("namedargument")(
31927
+ this.text(),
31928
+ this.next().next().read_expr()
31929
+ )
31930
+ );
31931
+ }
31932
+ return this.read_expr();
31933
+ },
31934
+ read_type: function () {
31935
+ const t = this.node();
31936
+ if (
31937
+ this.token === this.tok.T_ARRAY ||
31938
+ this.token === this.tok.T_CALLABLE
31939
+ ) {
31940
+ const e = this.text();
31941
+ return this.next(), t("typereference", e.toLowerCase(), e);
31942
+ }
31943
+ if (this.token === this.tok.T_STRING) {
31944
+ const e = this.text(),
31945
+ n = [this.token, this.lexer.getState()];
31946
+ return (
31947
+ this.next(),
31948
+ this.token !== this.tok.T_NS_SEPARATOR &&
31949
+ this.ast.typereference.types.indexOf(e.toLowerCase()) > -1
31950
+ ? t("typereference", e.toLowerCase(), e)
31951
+ : (this.lexer.tokens.push(n),
31952
+ this.next(),
31953
+ t.destroy(),
31954
+ this.read_namespace_name())
31955
+ );
31956
+ }
31957
+ return this.token === this.tok.T_NAMESPACE ||
31958
+ this.token === this.tok.T_NS_SEPARATOR
31959
+ ? (t.destroy(), this.read_namespace_name())
31960
+ : (t.destroy(), null);
31961
+ },
31962
+ };
31963
+ },
31964
+ {},
31965
+ ],
31966
+ 149: [
31967
+ function (t, e, n) {
31968
+ "use strict";
31969
+ e.exports = {
31970
+ read_if: function () {
31971
+ const t = this.node("if"),
31972
+ e = this.next().read_if_expr();
31973
+ let n = null,
31974
+ i = null,
31975
+ r = !1;
31976
+ if (":" === this.token) {
31977
+ (r = !0), this.next(), (n = this.node("block"));
31978
+ const t = [];
31979
+ for (
31980
+ ;
31981
+ this.token !== this.EOF && this.token !== this.tok.T_ENDIF;
31982
+
31983
+ ) {
31984
+ if (this.token === this.tok.T_ELSEIF) {
31985
+ i = this.read_elseif_short();
31986
+ break;
31987
+ }
31988
+ if (this.token === this.tok.T_ELSE) {
31989
+ i = this.read_else_short();
31990
+ break;
31991
+ }
31992
+ t.push(this.read_inner_statement());
31993
+ }
31994
+ (n = n(null, t)),
31995
+ this.expect(this.tok.T_ENDIF) && this.next(),
31996
+ this.expectEndOfStatement();
31997
+ } else
31998
+ (n = this.read_statement()),
31999
+ this.token === this.tok.T_ELSEIF
32000
+ ? (i = this.read_if())
32001
+ : this.token === this.tok.T_ELSE &&
32002
+ (i = this.next().read_statement());
32003
+ return t(e, n, i, r);
32004
+ },
32005
+ read_if_expr: function () {
32006
+ this.expect("(") && this.next();
32007
+ const t = this.read_expr();
32008
+ return this.expect(")") && this.next(), t;
32009
+ },
32010
+ read_elseif_short: function () {
32011
+ let t = null;
32012
+ const e = this.node("if"),
32013
+ n = this.next().read_if_expr();
32014
+ this.expect(":") && this.next();
32015
+ const i = this.node("block"),
32016
+ r = [];
32017
+ for (
32018
+ ;
32019
+ this.token != this.EOF && this.token !== this.tok.T_ENDIF;
32020
+
32021
+ ) {
32022
+ if (this.token === this.tok.T_ELSEIF) {
32023
+ t = this.read_elseif_short();
32024
+ break;
32025
+ }
32026
+ if (this.token === this.tok.T_ELSE) {
32027
+ t = this.read_else_short();
32028
+ break;
32029
+ }
32030
+ r.push(this.read_inner_statement());
32031
+ }
32032
+ return e(n, i(null, r), t, !0);
32033
+ },
32034
+ read_else_short: function () {
32035
+ this.next().expect(":") && this.next();
32036
+ const t = this.node("block"),
32037
+ e = [];
32038
+ for (; this.token != this.EOF && this.token !== this.tok.T_ENDIF; )
32039
+ e.push(this.read_inner_statement());
32040
+ return t(null, e);
32041
+ },
32042
+ };
32043
+ },
32044
+ {},
32045
+ ],
32046
+ 150: [
32047
+ function (t, e, n) {
32048
+ "use strict";
32049
+ e.exports = {
32050
+ read_while: function () {
32051
+ const t = this.node("while");
32052
+ this.expect(this.tok.T_WHILE) && this.next();
32053
+ let e = null,
32054
+ n = null,
32055
+ i = !1;
32056
+ return (
32057
+ this.expect("(") && this.next(),
32058
+ (e = this.read_expr()),
32059
+ this.expect(")") && this.next(),
32060
+ ":" === this.token
32061
+ ? ((i = !0), (n = this.read_short_form(this.tok.T_ENDWHILE)))
32062
+ : (n = this.read_statement()),
32063
+ t(e, n, i)
32064
+ );
32065
+ },
32066
+ read_do: function () {
32067
+ const t = this.node("do");
32068
+ this.expect(this.tok.T_DO) && this.next();
32069
+ let e = null,
32070
+ n = null;
32071
+ return (
32072
+ (n = this.read_statement()),
32073
+ this.expect(this.tok.T_WHILE) &&
32074
+ (this.next().expect("(") && this.next(),
32075
+ (e = this.read_expr()),
32076
+ this.expect(")") && this.next(),
32077
+ this.expect(";") && this.next()),
32078
+ t(e, n)
32079
+ );
32080
+ },
32081
+ read_for: function () {
32082
+ const t = this.node("for");
32083
+ this.expect(this.tok.T_FOR) && this.next();
32084
+ let e = [],
32085
+ n = [],
32086
+ i = [],
32087
+ r = null,
32088
+ o = !1;
32089
+ return (
32090
+ this.expect("(") && this.next(),
32091
+ ";" !== this.token
32092
+ ? ((e = this.read_list(this.read_expr, ",")),
32093
+ this.expect(";") && this.next())
32094
+ : this.next(),
32095
+ ";" !== this.token
32096
+ ? ((n = this.read_list(this.read_expr, ",")),
32097
+ this.expect(";") && this.next())
32098
+ : this.next(),
32099
+ ")" !== this.token
32100
+ ? ((i = this.read_list(this.read_expr, ",")),
32101
+ this.expect(")") && this.next())
32102
+ : this.next(),
32103
+ ":" === this.token
32104
+ ? ((o = !0), (r = this.read_short_form(this.tok.T_ENDFOR)))
32105
+ : (r = this.read_statement()),
32106
+ t(e, n, i, r, o)
32107
+ );
32108
+ },
32109
+ read_foreach: function () {
32110
+ const t = this.node("foreach");
32111
+ this.expect(this.tok.T_FOREACH) && this.next();
32112
+ let e = null,
32113
+ n = null,
32114
+ i = null,
32115
+ r = null,
32116
+ o = !1;
32117
+ return (
32118
+ this.expect("(") && this.next(),
32119
+ (e = this.read_expr()),
32120
+ this.expect(this.tok.T_AS) &&
32121
+ (this.next(),
32122
+ (i = this.read_foreach_variable()),
32123
+ this.token === this.tok.T_DOUBLE_ARROW &&
32124
+ ((n = i), (i = this.next().read_foreach_variable()))),
32125
+ n &&
32126
+ "list" === n.kind &&
32127
+ this.raiseError("Fatal Error : Cannot use list as key element"),
32128
+ this.expect(")") && this.next(),
32129
+ ":" === this.token
32130
+ ? ((o = !0), (r = this.read_short_form(this.tok.T_ENDFOREACH)))
32131
+ : (r = this.read_statement()),
32132
+ t(e, n, i, r, o)
32133
+ );
32134
+ },
32135
+ read_foreach_variable: function () {
32136
+ if (this.token === this.tok.T_LIST || "[" === this.token) {
32137
+ const t = "[" === this.token,
32138
+ e = this.node("list");
32139
+ this.next(), !t && this.expect("(") && this.next();
32140
+ const n = this.read_array_pair_list(t);
32141
+ return this.expect(t ? "]" : ")") && this.next(), e(n, t);
32142
+ }
32143
+ return this.read_variable(!1, !1);
32144
+ },
32145
+ };
32146
+ },
32147
+ {},
32148
+ ],
32149
+ 151: [
32150
+ function (t, e, n) {
32151
+ "use strict";
32152
+ e.exports = {
32153
+ read_start: function () {
32154
+ return this.token == this.tok.T_NAMESPACE
32155
+ ? this.read_namespace()
32156
+ : this.read_top_statement();
32157
+ },
32158
+ };
32159
+ },
32160
+ {},
32161
+ ],
32162
+ 152: [
32163
+ function (t, e, n) {
32164
+ "use strict";
32165
+ e.exports = {
32166
+ read_namespace: function () {
32167
+ const t = this.node("namespace");
32168
+ let e, n;
32169
+ return (
32170
+ this.expect(this.tok.T_NAMESPACE) && this.next(),
32171
+ (n =
32172
+ "{" == this.token
32173
+ ? { name: [""] }
32174
+ : this.read_namespace_name()),
32175
+ (this.currentNamespace = n),
32176
+ ";" == this.token
32177
+ ? ((this.currentNamespace = n),
32178
+ (e = this.next().read_top_statements()),
32179
+ this.expect(this.EOF),
32180
+ t(n.name, e, !1))
32181
+ : "{" == this.token
32182
+ ? ((this.currentNamespace = n),
32183
+ (e = this.next().read_top_statements()),
32184
+ this.expect("}") && this.next(),
32185
+ 0 === e.length &&
32186
+ this.extractDoc &&
32187
+ this._docs.length > this._docIndex &&
32188
+ e.push(this.node("noop")()),
32189
+ t(n.name, e, !0))
32190
+ : "(" === this.token
32191
+ ? ((n.resolution = this.ast.reference.RELATIVE_NAME),
32192
+ (n.name = n.name.substring(1)),
32193
+ t.destroy(),
32194
+ this.node("call")(n, this.read_argument_list()))
32195
+ : (this.error(["{", ";"]),
32196
+ (this.currentNamespace = n),
32197
+ (e = this.read_top_statements()),
32198
+ this.expect(this.EOF),
32199
+ t(n, e, !1))
32200
+ );
32201
+ },
32202
+ read_namespace_name: function (t) {
32203
+ const e = this.node();
32204
+ let n = !1;
32205
+ this.token === this.tok.T_NAMESPACE &&
32206
+ (this.next().expect(this.tok.T_NS_SEPARATOR) && this.next(),
32207
+ (n = !0));
32208
+ const i = this.read_list(
32209
+ this.tok.T_STRING,
32210
+ this.tok.T_NS_SEPARATOR,
32211
+ !0
32212
+ );
32213
+ if (!n && 1 === i.length && (t || "(" !== this.token)) {
32214
+ if ("parent" === i[0].toLowerCase())
32215
+ return e("parentreference", i[0]);
32216
+ if ("self" === i[0].toLowerCase())
32217
+ return e("selfreference", i[0]);
32218
+ }
32219
+ return e("name", i, n);
32220
+ },
32221
+ read_use_statement: function () {
32222
+ let t = this.node("usegroup"),
32223
+ e = [],
32224
+ n = null;
32225
+ this.expect(this.tok.T_USE) && this.next();
32226
+ const i = this.read_use_type();
32227
+ return (
32228
+ e.push(this.read_use_declaration(!1)),
32229
+ "," === this.token
32230
+ ? (e = e.concat(this.next().read_use_declarations(!1)))
32231
+ : "{" === this.token &&
32232
+ ((n = e[0].name),
32233
+ (e = this.next().read_use_declarations(null === i)),
32234
+ this.expect("}") && this.next()),
32235
+ (t = t(n, i, e)),
32236
+ this.expect(";") && this.next(),
32237
+ t
32238
+ );
32239
+ },
32240
+ read_class_name_reference: function () {
32241
+ return this.read_variable(!0, !1);
32242
+ },
32243
+ read_use_declaration: function (t) {
32244
+ const e = this.node("useitem");
32245
+ let n = null;
32246
+ t && (n = this.read_use_type());
32247
+ const i = this.read_namespace_name(),
32248
+ r = this.read_use_alias();
32249
+ return e(i.name, r, n);
32250
+ },
32251
+ read_use_declarations: function (t) {
32252
+ const e = [this.read_use_declaration(t)];
32253
+ for (; "," === this.token; ) {
32254
+ if ((this.next(), t)) {
32255
+ if (
32256
+ this.token !== this.tok.T_FUNCTION &&
32257
+ this.token !== this.tok.T_CONST &&
32258
+ this.token !== this.tok.T_STRING
32259
+ )
32260
+ break;
32261
+ } else if (
32262
+ this.token !== this.tok.T_STRING &&
32263
+ this.token !== this.tok.T_NS_SEPARATOR
32264
+ )
32265
+ break;
32266
+ e.push(this.read_use_declaration(t));
32267
+ }
32268
+ return e;
32269
+ },
32270
+ read_use_alias: function () {
32271
+ let t = null;
32272
+ if (
32273
+ this.token === this.tok.T_AS &&
32274
+ this.next().expect(this.tok.T_STRING)
32275
+ ) {
32276
+ const e = this.node("identifier"),
32277
+ n = this.text();
32278
+ this.next(), (t = e(n));
32279
+ }
32280
+ return t;
32281
+ },
32282
+ read_use_type: function () {
32283
+ return this.token === this.tok.T_FUNCTION
32284
+ ? (this.next(), this.ast.useitem.TYPE_FUNCTION)
32285
+ : this.token === this.tok.T_CONST
32286
+ ? (this.next(), this.ast.useitem.TYPE_CONST)
32287
+ : null;
32288
+ },
32289
+ };
32290
+ },
32291
+ {},
32292
+ ],
32293
+ 153: [
32294
+ function (t, e, n) {
32295
+ "use strict";
32296
+ const i = {
32297
+ "\\": "\\",
32298
+ $: "$",
32299
+ n: "\n",
32300
+ r: "\r",
32301
+ t: "\t",
32302
+ f: String.fromCharCode(12),
32303
+ v: String.fromCharCode(11),
32304
+ e: String.fromCharCode(27),
32305
+ };
32306
+ e.exports = {
32307
+ resolve_special_chars: function (t, e) {
32308
+ return e
32309
+ ? t
32310
+ .replace(/\\"/, '"')
32311
+ .replace(
32312
+ /\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,
32313
+ (t, e, n) =>
32314
+ i[e]
32315
+ ? i[e]
32316
+ : "x" === e[0] || "X" === e[0]
32317
+ ? String.fromCodePoint(parseInt(e.substr(1), 16))
32318
+ : "u" === e[0]
32319
+ ? String.fromCodePoint(parseInt(n, 16))
32320
+ : String.fromCodePoint(parseInt(e, 8))
32321
+ )
32322
+ : t.replace(/\\\\/g, "\\").replace(/\\'/g, "'");
32323
+ },
32324
+ remove_heredoc_leading_whitespace_chars: function (t, e, n, i) {
32325
+ if (0 === e) return t;
32326
+ this.check_heredoc_indentation_level(t, e, n, i);
32327
+ const r = n ? " " : "\t",
32328
+ o = new RegExp(`\\n${r}{${e}}`, "g"),
32329
+ s = new RegExp(`^${r}{${e}}`);
32330
+ return i && (t = t.replace(s, "")), t.replace(o, "\n");
32331
+ },
32332
+ check_heredoc_indentation_level: function (t, e, n, i) {
32333
+ const r = t.length;
32334
+ let o = 0,
32335
+ s = 0,
32336
+ a = !0;
32337
+ const l = n ? " " : "\t";
32338
+ let c = !1;
32339
+ if (!i) {
32340
+ if (((o = t.indexOf("\n")), -1 === o)) return;
32341
+ o++;
32342
+ }
32343
+ for (; o < r; )
32344
+ a ? (t[o] === l ? s++ : (c = !0)) : (a = !1),
32345
+ "\n" !== t[o] && c && s < e
32346
+ ? this.raiseError(
32347
+ `Invalid body indentation level (expecting an indentation at least ${e})`
32348
+ )
32349
+ : (c = !1),
32350
+ "\n" === t[o] && ((a = !0), (s = 0)),
32351
+ o++;
32352
+ },
32353
+ read_dereferencable_scalar: function () {
32354
+ let t = null;
32355
+ switch (this.token) {
32356
+ case this.tok.T_CONSTANT_ENCAPSED_STRING:
32357
+ {
32358
+ let e = this.node("string");
32359
+ const n = this.text();
32360
+ let i = 0;
32361
+ ("b" !== n[0] && "B" !== n[0]) || (i = 1);
32362
+ const r = '"' === n[i];
32363
+ this.next();
32364
+ (e = e(
32365
+ r,
32366
+ this.resolve_special_chars(
32367
+ n.substring(i + 1, n.length - 1),
32368
+ r
32369
+ ),
32370
+ 1 === i,
32371
+ n
32372
+ )),
32373
+ (t =
32374
+ this.token === this.tok.T_DOUBLE_COLON
32375
+ ? this.read_static_getter(e)
32376
+ : e);
32377
+ }
32378
+ break;
32379
+ case this.tok.T_ARRAY:
32380
+ case "[":
32381
+ t = this.read_array();
32382
+ }
32383
+ return t;
32384
+ },
32385
+ read_scalar: function () {
32386
+ if (this.is("T_MAGIC_CONST")) return this.get_magic_constant();
32387
+ {
32388
+ let t, e;
32389
+ switch (this.token) {
32390
+ case this.tok.T_LNUMBER:
32391
+ case this.tok.T_DNUMBER: {
32392
+ const e = this.node("number");
32393
+ return (t = this.text()), this.next(), e(t, null);
32394
+ }
32395
+ case this.tok.T_START_HEREDOC:
32396
+ if ("ST_NOWDOC" === this.lexer.curCondition) {
32397
+ const n = this.lexer.yylloc.first_offset;
32398
+ (e = this.node("nowdoc")),
32399
+ (t = this.next().text()),
32400
+ this.lexer.heredoc_label.indentation > 0 &&
32401
+ (t = t.substring(
32402
+ 0,
32403
+ t.length - this.lexer.heredoc_label.indentation
32404
+ ));
32405
+ const i = t[t.length - 1];
32406
+ "\n" === i
32407
+ ? (t =
32408
+ "\r" === t[t.length - 2]
32409
+ ? t.substring(0, t.length - 2)
32410
+ : t.substring(0, t.length - 1))
32411
+ : "\r" === i && (t = t.substring(0, t.length - 1)),
32412
+ this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE) &&
32413
+ this.next(),
32414
+ this.expect(this.tok.T_END_HEREDOC) && this.next();
32415
+ const r = this.lexer._input.substring(
32416
+ n,
32417
+ this.lexer.yylloc.first_offset
32418
+ );
32419
+ return (
32420
+ (e = e(
32421
+ this.remove_heredoc_leading_whitespace_chars(
32422
+ t,
32423
+ this.lexer.heredoc_label.indentation,
32424
+ this.lexer.heredoc_label.indentation_uses_spaces,
32425
+ this.lexer.heredoc_label.first_encaps_node
32426
+ ),
32427
+ r,
32428
+ this.lexer.heredoc_label.label
32429
+ )),
32430
+ e
32431
+ );
32432
+ }
32433
+ return this.read_encapsed_string(this.tok.T_END_HEREDOC);
32434
+ case '"':
32435
+ return this.read_encapsed_string('"');
32436
+ case 'b"':
32437
+ case 'B"':
32438
+ return this.read_encapsed_string('"', !0);
32439
+ case this.tok.T_CONSTANT_ENCAPSED_STRING:
32440
+ case this.tok.T_ARRAY:
32441
+ case "[":
32442
+ return this.read_dereferencable_scalar();
32443
+ default: {
32444
+ const t = this.error("SCALAR");
32445
+ return this.next(), t;
32446
+ }
32447
+ }
32448
+ }
32449
+ },
32450
+ read_dereferencable: function (t) {
32451
+ let e, n;
32452
+ const i = this.node("offsetlookup");
32453
+ return (
32454
+ "[" === this.token
32455
+ ? ((n = this.next().read_expr()),
32456
+ this.expect("]") && this.next(),
32457
+ (e = i(t, n)))
32458
+ : this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES &&
32459
+ ((n = this.read_encapsed_string_item(!1)), (e = i(t, n))),
32460
+ e
32461
+ );
32462
+ },
32463
+ read_encapsed_string_item: function (t) {
32464
+ const e = this.node("encapsedpart");
32465
+ let n,
32466
+ i,
32467
+ r,
32468
+ o = null,
32469
+ s = !1,
32470
+ a = this.node();
32471
+ if (this.token === this.tok.T_ENCAPSED_AND_WHITESPACE) {
32472
+ const e = this.text();
32473
+ this.next(),
32474
+ (a = a(
32475
+ "string",
32476
+ !1,
32477
+ this.version >= 703 && !this.lexer.heredoc_label.finished
32478
+ ? this.remove_heredoc_leading_whitespace_chars(
32479
+ this.resolve_special_chars(e, t),
32480
+ this.lexer.heredoc_label.indentation,
32481
+ this.lexer.heredoc_label.indentation_uses_spaces,
32482
+ this.lexer.heredoc_label.first_encaps_node
32483
+ )
32484
+ : e,
32485
+ !1,
32486
+ e
32487
+ ));
32488
+ } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) {
32489
+ if (
32490
+ ((o = "simple"),
32491
+ (s = !0),
32492
+ (r = null),
32493
+ this.next().token === this.tok.T_STRING_VARNAME)
32494
+ ) {
32495
+ r = this.node("variable");
32496
+ const t = this.text();
32497
+ this.next(),
32498
+ "[" === this.token
32499
+ ? ((r = r(t, !1)),
32500
+ (i = this.node("offsetlookup")),
32501
+ (n = this.next().read_expr()),
32502
+ this.expect("]") && this.next(),
32503
+ (a = i(r, n)))
32504
+ : (a = r(t, !1));
32505
+ } else a = a("variable", this.read_expr(), !1);
32506
+ this.expect("}") && this.next();
32507
+ } else if (this.token === this.tok.T_CURLY_OPEN)
32508
+ (o = "complex"),
32509
+ a.destroy(),
32510
+ (a = this.next().read_variable(!1, !1)),
32511
+ this.expect("}") && this.next();
32512
+ else if (this.token === this.tok.T_VARIABLE) {
32513
+ if (
32514
+ ((o = "simple"),
32515
+ a.destroy(),
32516
+ (a = this.read_simple_variable()),
32517
+ "[" === this.token &&
32518
+ ((i = this.node("offsetlookup")),
32519
+ (n = this.next().read_encaps_var_offset()),
32520
+ this.expect("]") && this.next(),
32521
+ (a = i(a, n))),
32522
+ this.token === this.tok.T_OBJECT_OPERATOR)
32523
+ ) {
32524
+ (i = this.node("propertylookup")),
32525
+ this.next().expect(this.tok.T_STRING);
32526
+ const t = this.node("identifier");
32527
+ (r = this.text()), this.next(), (a = i(a, t(r)));
32528
+ }
32529
+ } else {
32530
+ this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);
32531
+ const t = this.text();
32532
+ this.next(), a.destroy(), (a = a("string", !1, t, !1, t));
32533
+ }
32534
+ return (
32535
+ (this.lexer.heredoc_label.first_encaps_node = !1), e(a, o, s)
32536
+ );
32537
+ },
32538
+ read_encapsed_string: function (t, e = !1) {
32539
+ const n = this.lexer.yylloc.first_offset;
32540
+ let i = this.node("encapsed");
32541
+ this.next();
32542
+ const r = this.lexer.yylloc.prev_offset - (e ? 1 : 0),
32543
+ o = [];
32544
+ let s = null;
32545
+ for (
32546
+ s =
32547
+ "`" === t
32548
+ ? this.ast.encapsed.TYPE_SHELL
32549
+ : '"' === t
32550
+ ? this.ast.encapsed.TYPE_STRING
32551
+ : this.ast.encapsed.TYPE_HEREDOC;
32552
+ this.token !== t && this.token !== this.EOF;
32553
+
32554
+ )
32555
+ o.push(this.read_encapsed_string_item(!0));
32556
+ if (
32557
+ o.length > 0 &&
32558
+ "encapsedpart" === o[o.length - 1].kind &&
32559
+ "string" === o[o.length - 1].expression.kind
32560
+ ) {
32561
+ const t = o[o.length - 1].expression,
32562
+ e = t.value[t.value.length - 1];
32563
+ "\n" === e
32564
+ ? "\r" === t.value[t.value.length - 2]
32565
+ ? (t.value = t.value.substring(0, t.value.length - 2))
32566
+ : (t.value = t.value.substring(0, t.value.length - 1))
32567
+ : "\r" === e &&
32568
+ (t.value = t.value.substring(0, t.value.length - 1));
32569
+ }
32570
+ this.expect(t) && this.next();
32571
+ return (
32572
+ (i = i(
32573
+ o,
32574
+ this.lexer._input.substring(
32575
+ "heredoc" === s ? n : r - 1,
32576
+ this.lexer.yylloc.first_offset
32577
+ ),
32578
+ s
32579
+ )),
32580
+ t === this.tok.T_END_HEREDOC &&
32581
+ ((i.label = this.lexer.heredoc_label.label),
32582
+ (this.lexer.heredoc_label.finished = !0)),
32583
+ i
32584
+ );
32585
+ },
32586
+ get_magic_constant: function () {
32587
+ const t = this.node("magic"),
32588
+ e = this.text();
32589
+ return this.next(), t(e.toUpperCase(), e);
32590
+ },
32591
+ };
32592
+ },
32593
+ {},
32594
+ ],
32595
+ 154: [
32596
+ function (t, e, n) {
32597
+ "use strict";
32598
+ e.exports = {
32599
+ read_top_statements: function () {
32600
+ let t = [];
32601
+ for (; this.token !== this.EOF && "}" !== this.token; ) {
32602
+ const e = this.read_top_statement();
32603
+ e && (Array.isArray(e) ? (t = t.concat(e)) : t.push(e));
32604
+ }
32605
+ return t;
32606
+ },
32607
+ read_top_statement: function () {
32608
+ let t = [];
32609
+ switch (
32610
+ (this.token === this.tok.T_ATTRIBUTE &&
32611
+ (t = this.read_attr_list()),
32612
+ this.token)
32613
+ ) {
32614
+ case this.tok.T_FUNCTION:
32615
+ return this.read_function(!1, !1, t);
32616
+ case this.tok.T_ABSTRACT:
32617
+ case this.tok.T_FINAL:
32618
+ case this.tok.T_CLASS:
32619
+ return this.read_class_declaration_statement(t);
32620
+ case this.tok.T_INTERFACE:
32621
+ return this.read_interface_declaration_statement(t);
32622
+ case this.tok.T_TRAIT:
32623
+ return this.read_trait_declaration_statement();
32624
+ case this.tok.T_USE:
32625
+ return this.read_use_statement();
32626
+ case this.tok.T_CONST: {
32627
+ const t = this.node("constantstatement"),
32628
+ e = this.next().read_const_list();
32629
+ return this.expectEndOfStatement(), t(null, e);
32630
+ }
32631
+ case this.tok.T_NAMESPACE:
32632
+ return this.read_namespace();
32633
+ case this.tok.T_HALT_COMPILER: {
32634
+ const t = this.node("halt");
32635
+ return (
32636
+ this.next().expect("(") && this.next(),
32637
+ this.expect(")") && this.next(),
32638
+ this.expect(";"),
32639
+ (this.lexer.done = !0),
32640
+ t(this.lexer._input.substring(this.lexer.offset))
32641
+ );
32642
+ }
32643
+ default:
32644
+ return this.read_statement();
32645
+ }
32646
+ },
32647
+ read_inner_statements: function () {
32648
+ let t = [];
32649
+ for (; this.token != this.EOF && "}" !== this.token; ) {
32650
+ const e = this.read_inner_statement();
32651
+ e && (Array.isArray(e) ? (t = t.concat(e)) : t.push(e));
32652
+ }
32653
+ return t;
32654
+ },
32655
+ read_const_list: function () {
32656
+ return this.read_list(
32657
+ function () {
32658
+ this.expect(this.tok.T_STRING);
32659
+ const t = this.node("constant");
32660
+ let e = this.node("identifier");
32661
+ const n = this.text();
32662
+ return (
32663
+ this.next(),
32664
+ (e = e(n)),
32665
+ this.expect("=") ? t(e, this.next().read_expr()) : t(e, null)
32666
+ );
32667
+ },
32668
+ ",",
32669
+ !1
32670
+ );
32671
+ },
32672
+ read_declare_list: function () {
32673
+ const t = [];
32674
+ for (; this.token != this.EOF && ")" !== this.token; ) {
32675
+ this.expect(this.tok.T_STRING);
32676
+ const e = this.node("declaredirective");
32677
+ let n = this.node("identifier");
32678
+ const i = this.text();
32679
+ this.next(), (n = n(i));
32680
+ let r = null;
32681
+ if (
32682
+ (this.expect("=") && (r = this.next().read_expr()),
32683
+ t.push(e(n, r)),
32684
+ "," !== this.token)
32685
+ )
32686
+ break;
32687
+ this.next();
32688
+ }
32689
+ return t;
32690
+ },
32691
+ read_inner_statement: function () {
32692
+ let t = [];
32693
+ switch (
32694
+ (this.token === this.tok.T_ATTRIBUTE &&
32695
+ (t = this.read_attr_list()),
32696
+ this.token)
32697
+ ) {
32698
+ case this.tok.T_FUNCTION: {
32699
+ const e = this.read_function(!1, !1);
32700
+ return (e.attrGroups = t), e;
32701
+ }
32702
+ case this.tok.T_ABSTRACT:
32703
+ case this.tok.T_FINAL:
32704
+ case this.tok.T_CLASS:
32705
+ return this.read_class_declaration_statement();
32706
+ case this.tok.T_INTERFACE:
32707
+ return this.read_interface_declaration_statement();
32708
+ case this.tok.T_TRAIT:
32709
+ return this.read_trait_declaration_statement();
32710
+ case this.tok.T_HALT_COMPILER: {
32711
+ this.raiseError(
32712
+ "__HALT_COMPILER() can only be used from the outermost scope"
32713
+ );
32714
+ let t = this.node("halt");
32715
+ return (
32716
+ this.next().expect("(") && this.next(),
32717
+ this.expect(")") && this.next(),
32718
+ (t = t(this.l