Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | MailChimp for WordPress |
Version | 4.3.2 |
Comparing to | |
See all releases |
Code changes from version 4.3.1 to 4.3.2
- CHANGELOG.md +7 -0
- assets/js/admin.js +317 -334
- assets/js/admin.min.js +1 -1
- assets/js/admin.min.js.map +1 -1
- assets/js/forms-admin.js +1126 -1088
- assets/js/forms-admin.min.js +1 -1
- assets/js/forms-admin.min.js.map +0 -1
CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
Changelog
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
#### 4.3.1 - November 28, 2018
|
5 |
|
6 |
**Fixes**
|
1 |
Changelog
|
2 |
=========
|
3 |
|
4 |
+
#### 4.3.2 - December 11, 2018
|
5 |
+
|
6 |
+
**Fixes**
|
7 |
+
|
8 |
+
- Use of `readonly` function, which is only available in WordPress 4.9 or later.
|
9 |
+
|
10 |
+
|
11 |
#### 4.3.1 - November 28, 2018
|
12 |
|
13 |
**Fixes**
|
assets/js/admin.js
CHANGED
@@ -1,36 +1,37 @@
|
|
1 |
(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
// dependencies
|
5 |
|
6 |
-
var _tlite = require(
|
7 |
-
|
8 |
-
var _tlite2 = _interopRequireDefault(_tlite);
|
9 |
|
10 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11 |
|
12 |
var m = window.m = require('mithril');
|
13 |
-
var EventEmitter = require('wolfy87-eventemitter');
|
14 |
|
15 |
-
// vars
|
|
|
|
|
16 |
var context = document.getElementById('mc4wp-admin');
|
17 |
var events = new EventEmitter();
|
|
|
18 |
var tabs = require('./admin/tabs.js')(context);
|
|
|
19 |
var helpers = require('./admin/helpers.js');
|
|
|
20 |
var settings = require('./admin/settings.js')(context, helpers, events);
|
21 |
|
22 |
-
(0,
|
23 |
-
|
24 |
-
});
|
25 |
|
26 |
-
// list fetcher
|
27 |
var ListFetcher = require('./admin/list-fetcher.js');
|
|
|
28 |
var mount = document.getElementById('mc4wp-list-fetcher');
|
|
|
29 |
if (mount) {
|
30 |
-
|
31 |
-
}
|
|
|
32 |
|
33 |
-
// expose some things
|
34 |
window.mc4wp = window.mc4wp || {};
|
35 |
window.mc4wp.deps = window.mc4wp.deps || {};
|
36 |
window.mc4wp.deps.mithril = m;
|
@@ -45,88 +46,89 @@ window.mc4wp.tabs = tabs;
|
|
45 |
var helpers = {};
|
46 |
|
47 |
helpers.toggleElement = function (selector) {
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
53 |
};
|
54 |
|
55 |
helpers.bindEventToElement = function (element, event, handler) {
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
};
|
62 |
|
63 |
helpers.bindEventToElements = function (elements, event, handler) {
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
};
|
|
|
68 |
|
69 |
-
// polling
|
70 |
helpers.debounce = function (func, wait, immediate) {
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
clearTimeout(timeout);
|
81 |
-
timeout = setTimeout(later, wait);
|
82 |
-
if (callNow) func.apply(context, args);
|
83 |
-
};
|
84 |
-
};
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**
|
87 |
* Showif.js
|
88 |
*/
|
|
|
|
|
89 |
(function () {
|
90 |
-
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
var hide = config.hide === undefined || config.hide;
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
return;
|
104 |
-
}
|
105 |
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
if (hide) {
|
110 |
-
element.style.display = conditionMet ? '' : 'none';
|
111 |
-
element.style.visibility = conditionMet ? '' : 'hidden';
|
112 |
-
} else {
|
113 |
-
element.style.opacity = conditionMet ? '' : '0.4';
|
114 |
-
}
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
});
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
});
|
130 |
})();
|
131 |
|
132 |
module.exports = helpers;
|
@@ -139,306 +141,283 @@ var config = mc4wp_vars;
|
|
139 |
var i18n = config.i18n;
|
140 |
|
141 |
function ListFetcher() {
|
142 |
-
|
143 |
-
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
}
|
149 |
}
|
150 |
|
151 |
ListFetcher.prototype.fetch = function (e) {
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
m.redraw();
|
175 |
-
}.bind(this));
|
176 |
};
|
177 |
|
178 |
ListFetcher.prototype.view = function () {
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
};
|
189 |
|
190 |
module.exports = ListFetcher;
|
191 |
|
192 |
},{}],4:[function(require,module,exports){
|
193 |
-
|
194 |
|
195 |
-
|
196 |
|
197 |
var Settings = function Settings(context, helpers, events) {
|
198 |
-
|
199 |
|
200 |
-
|
|
|
|
|
|
|
201 |
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
|
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
return el[searchKey] === searchValue;
|
211 |
-
});
|
212 |
-
}
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
217 |
|
218 |
-
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
235 |
|
236 |
-
|
237 |
-
var rows = document.querySelectorAll('.lists--only-selected > *');
|
238 |
-
Array.prototype.forEach.call(rows, function (el) {
|
239 |
|
240 |
-
|
241 |
-
|
242 |
|
243 |
-
|
244 |
-
el.setAttribute('class', el.getAttribute('class').replace('hidden', ''));
|
245 |
-
} else {
|
246 |
-
el.setAttribute('class', el.getAttribute('class') + " hidden");
|
247 |
-
}
|
248 |
-
});
|
249 |
-
}
|
250 |
|
251 |
-
events.on('selectedLists.change', toggleVisibleLists);
|
252 |
-
helpers.bindEventToElements(listInputs, 'change', updateSelectedLists);
|
253 |
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
|
|
260 |
|
261 |
-
|
|
|
262 |
|
263 |
-
|
264 |
-
|
|
|
|
|
|
|
265 |
|
266 |
-
|
|
|
|
|
267 |
|
268 |
-
// Tabs
|
269 |
-
var Tabs = function Tabs(context) {
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
var $context = $(context);
|
275 |
-
var $tabs = $context.find('.tab');
|
276 |
-
var $tabNavs = $context.find('.nav-tab');
|
277 |
-
var refererField = context.querySelector('input[name="_wp_http_referer"]');
|
278 |
-
var tabs = [];
|
279 |
-
|
280 |
-
$.each($tabs, function (i, t) {
|
281 |
-
var id = t.id.substring(4);
|
282 |
-
var title = $(t).find('h2').first().text();
|
283 |
-
|
284 |
-
tabs.push({
|
285 |
-
id: id,
|
286 |
-
title: title,
|
287 |
-
element: t,
|
288 |
-
nav: context.querySelectorAll('.nav-tab-' + id),
|
289 |
-
open: function open() {
|
290 |
-
return _open(id);
|
291 |
-
}
|
292 |
-
});
|
293 |
-
});
|
294 |
|
295 |
-
function get(id) {
|
296 |
|
297 |
-
|
298 |
-
|
299 |
-
return tabs[i];
|
300 |
-
}
|
301 |
-
}
|
302 |
|
303 |
-
|
304 |
-
|
|
|
|
|
305 |
|
306 |
-
|
|
|
307 |
|
308 |
-
|
309 |
-
if (typeof tab === "string") {
|
310 |
-
tab = get(tab);
|
311 |
-
}
|
312 |
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
|
317 |
-
// should we update state?
|
318 |
-
if (updateState == undefined) {
|
319 |
-
updateState = true;
|
320 |
-
}
|
321 |
|
322 |
-
|
323 |
-
$tabs.removeClass('tab-active').css('display', 'none');
|
324 |
-
$tabNavs.removeClass('nav-tab-active');
|
325 |
|
326 |
-
|
327 |
-
Array.prototype.forEach.call(tab.nav, function (nav) {
|
328 |
-
nav.className += " nav-tab-active";
|
329 |
-
nav.blur();
|
330 |
-
});
|
331 |
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
335 |
|
336 |
-
// create new URL
|
337 |
-
var url = URL.setParameter(window.location.href, "tab", tab.id);
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
}
|
343 |
|
344 |
-
|
345 |
-
|
346 |
|
347 |
-
|
348 |
-
|
|
|
|
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
tb_remove();
|
353 |
-
}
|
354 |
|
355 |
-
|
356 |
-
// TODO: decouple this! law of demeter etc.
|
357 |
-
if (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {
|
358 |
-
mc4wp.forms.editor.refresh();
|
359 |
-
}
|
360 |
|
361 |
-
|
362 |
-
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
|
369 |
-
function switchTab(e) {
|
370 |
-
e = e || window.event;
|
371 |
|
372 |
-
|
373 |
-
|
374 |
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
if (match) {
|
379 |
-
tabId = match[1];
|
380 |
-
}
|
381 |
-
}
|
382 |
|
383 |
-
|
384 |
-
|
385 |
-
var urlParams = URL.parse(this.href);
|
386 |
-
if (!urlParams.tab) {
|
387 |
-
return;
|
388 |
-
}
|
389 |
-
tabId = urlParams.tab;
|
390 |
-
}
|
391 |
|
392 |
-
|
393 |
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
|
400 |
-
|
401 |
-
|
402 |
|
403 |
-
|
|
|
|
|
|
|
|
|
404 |
|
405 |
-
|
406 |
-
if (!history.pushState) {
|
407 |
-
return;
|
408 |
-
}
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
}
|
414 |
-
var tab = get(activeTab.id.substring(4));
|
415 |
-
if (!tab) return;
|
416 |
|
417 |
-
|
418 |
-
|
419 |
-
history.replaceState(tab.id, '');
|
420 |
-
}
|
421 |
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
|
426 |
-
$tabNavs.click(switchTab);
|
427 |
-
$(document.body).on('click', '.tab-link', switchTab);
|
428 |
-
init();
|
429 |
|
430 |
-
|
431 |
-
|
432 |
-
if (!e.state) return true;
|
433 |
-
var tabId = e.state;
|
434 |
-
return _open(tabId, false);
|
435 |
-
});
|
436 |
-
}
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
};
|
443 |
|
444 |
module.exports = Tabs;
|
@@ -447,32 +426,36 @@ module.exports = Tabs;
|
|
447 |
'use strict';
|
448 |
|
449 |
var URL = {
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
459 |
-
}
|
460 |
-
|
461 |
-
return query;
|
462 |
-
},
|
463 |
-
build: function build(data) {
|
464 |
-
var ret = [];
|
465 |
-
for (var d in data) {
|
466 |
-
ret.push(d + "=" + encodeURIComponent(data[d]));
|
467 |
-
}return ret.join("&");
|
468 |
-
},
|
469 |
-
setParameter: function setParameter(url, key, value) {
|
470 |
-
var data = URL.parse(url);
|
471 |
-
data[key] = value;
|
472 |
-
return URL.build(data);
|
473 |
-
}
|
474 |
-
};
|
475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
module.exports = URL;
|
477 |
|
478 |
},{}],7:[function(require,module,exports){
|
1 |
(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
2 |
+
'use strict'; // dependencies
|
|
|
|
|
3 |
|
4 |
+
var _tlite = _interopRequireDefault(require("tlite"));
|
|
|
|
|
5 |
|
6 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
7 |
|
8 |
var m = window.m = require('mithril');
|
|
|
9 |
|
10 |
+
var EventEmitter = require('wolfy87-eventemitter'); // vars
|
11 |
+
|
12 |
+
|
13 |
var context = document.getElementById('mc4wp-admin');
|
14 |
var events = new EventEmitter();
|
15 |
+
|
16 |
var tabs = require('./admin/tabs.js')(context);
|
17 |
+
|
18 |
var helpers = require('./admin/helpers.js');
|
19 |
+
|
20 |
var settings = require('./admin/settings.js')(context, helpers, events);
|
21 |
|
22 |
+
(0, _tlite.default)(function (el) {
|
23 |
+
return el.className.indexOf('mc4wp-tooltip') > -1;
|
24 |
+
}); // list fetcher
|
25 |
|
|
|
26 |
var ListFetcher = require('./admin/list-fetcher.js');
|
27 |
+
|
28 |
var mount = document.getElementById('mc4wp-list-fetcher');
|
29 |
+
|
30 |
if (mount) {
|
31 |
+
m.mount(mount, new ListFetcher());
|
32 |
+
} // expose some things
|
33 |
+
|
34 |
|
|
|
35 |
window.mc4wp = window.mc4wp || {};
|
36 |
window.mc4wp.deps = window.mc4wp.deps || {};
|
37 |
window.mc4wp.deps.mithril = m;
|
46 |
var helpers = {};
|
47 |
|
48 |
helpers.toggleElement = function (selector) {
|
49 |
+
var elements = document.querySelectorAll(selector);
|
50 |
+
|
51 |
+
for (var i = 0; i < elements.length; i++) {
|
52 |
+
var show = elements[i].clientHeight <= 0;
|
53 |
+
elements[i].style.display = show ? '' : 'none';
|
54 |
+
}
|
55 |
};
|
56 |
|
57 |
helpers.bindEventToElement = function (element, event, handler) {
|
58 |
+
if (element.addEventListener) {
|
59 |
+
element.addEventListener(event, handler);
|
60 |
+
} else if (element.attachEvent) {
|
61 |
+
element.attachEvent('on' + event, handler);
|
62 |
+
}
|
63 |
};
|
64 |
|
65 |
helpers.bindEventToElements = function (elements, event, handler) {
|
66 |
+
Array.prototype.forEach.call(elements, function (element) {
|
67 |
+
helpers.bindEventToElement(element, event, handler);
|
68 |
+
});
|
69 |
+
}; // polling
|
70 |
+
|
71 |
|
|
|
72 |
helpers.debounce = function (func, wait, immediate) {
|
73 |
+
var timeout;
|
74 |
+
return function () {
|
75 |
+
var context = this,
|
76 |
+
args = arguments;
|
77 |
+
|
78 |
+
var later = function later() {
|
79 |
+
timeout = null;
|
80 |
+
if (!immediate) func.apply(context, args);
|
81 |
+
};
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
var callNow = immediate && !timeout;
|
84 |
+
clearTimeout(timeout);
|
85 |
+
timeout = setTimeout(later, wait);
|
86 |
+
if (callNow) func.apply(context, args);
|
87 |
+
};
|
88 |
+
};
|
89 |
/**
|
90 |
* Showif.js
|
91 |
*/
|
92 |
+
|
93 |
+
|
94 |
(function () {
|
95 |
+
var showIfElements = document.querySelectorAll('[data-showif]'); // dependent elements
|
96 |
|
97 |
+
Array.prototype.forEach.call(showIfElements, function (element) {
|
98 |
+
var config = JSON.parse(element.getAttribute('data-showif'));
|
99 |
+
var parentElements = document.querySelectorAll('[name="' + config.element + '"]');
|
100 |
+
var inputs = element.querySelectorAll('input,select,textarea:not([readonly])');
|
101 |
+
var hide = config.hide === undefined || config.hide;
|
|
|
102 |
|
103 |
+
function toggleElement() {
|
104 |
+
// do nothing with unchecked radio inputs
|
105 |
+
if (this.getAttribute('type') === "radio" && !this.checked) {
|
106 |
+
return;
|
107 |
+
}
|
108 |
|
109 |
+
var value = this.getAttribute("type") === "checkbox" ? this.checked : this.value;
|
110 |
+
var conditionMet = value == config.value;
|
|
|
|
|
111 |
|
112 |
+
if (hide) {
|
113 |
+
element.style.display = conditionMet ? '' : 'none';
|
114 |
+
element.style.visibility = conditionMet ? '' : 'hidden';
|
115 |
+
} else {
|
116 |
+
element.style.opacity = conditionMet ? '' : '0.4';
|
117 |
+
} // disable input fields to stop sending their values to server
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
+
Array.prototype.forEach.call(inputs, function (inputElement) {
|
121 |
+
conditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');
|
122 |
+
});
|
123 |
+
} // find checked element and call toggleElement function
|
124 |
+
|
125 |
|
126 |
+
Array.prototype.forEach.call(parentElements, function (parentElement) {
|
127 |
+
toggleElement.call(parentElement);
|
128 |
+
}); // bind on all changes
|
|
|
129 |
|
130 |
+
helpers.bindEventToElements(parentElements, 'change', toggleElement);
|
131 |
+
});
|
|
|
132 |
})();
|
133 |
|
134 |
module.exports = helpers;
|
141 |
var i18n = config.i18n;
|
142 |
|
143 |
function ListFetcher() {
|
144 |
+
this.working = false;
|
145 |
+
this.done = false; // start fetching right away when no lists but api key given
|
146 |
|
147 |
+
if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {
|
148 |
+
this.fetch();
|
149 |
+
}
|
|
|
150 |
}
|
151 |
|
152 |
ListFetcher.prototype.fetch = function (e) {
|
153 |
+
e && e.preventDefault();
|
154 |
+
this.working = true;
|
155 |
+
this.done = false;
|
156 |
+
$.post(ajaxurl, {
|
157 |
+
action: "mc4wp_renew_mailchimp_lists",
|
158 |
+
timeout: 180000
|
159 |
+
}).done(function (data) {
|
160 |
+
this.success = true;
|
161 |
+
|
162 |
+
if (data) {
|
163 |
+
window.setTimeout(function () {
|
164 |
+
window.location.reload();
|
165 |
+
}, 3000);
|
166 |
+
}
|
167 |
+
}.bind(this)).fail(function (data) {
|
168 |
+
this.success = false;
|
169 |
+
}.bind(this)).always(function (data) {
|
170 |
+
this.working = false;
|
171 |
+
this.done = true;
|
172 |
+
m.redraw();
|
173 |
+
}.bind(this));
|
|
|
|
|
|
|
174 |
};
|
175 |
|
176 |
ListFetcher.prototype.view = function () {
|
177 |
+
return m('form', {
|
178 |
+
method: "POST",
|
179 |
+
onsubmit: this.fetch.bind(this)
|
180 |
+
}, [m('p', [m('input', {
|
181 |
+
type: "submit",
|
182 |
+
value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,
|
183 |
+
className: "button",
|
184 |
+
disabled: !!this.working
|
185 |
+
}), m.trust(' '), this.working ? [m('span.mc4wp-loader', "Loading..."), m.trust(' '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);
|
186 |
};
|
187 |
|
188 |
module.exports = ListFetcher;
|
189 |
|
190 |
},{}],4:[function(require,module,exports){
|
191 |
+
"use strict";
|
192 |
|
193 |
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
194 |
|
195 |
var Settings = function Settings(context, helpers, events) {
|
196 |
+
'use strict'; // vars
|
197 |
|
198 |
+
var form = context.querySelector('form');
|
199 |
+
var listInputs = context.querySelectorAll('.mc4wp-list-input');
|
200 |
+
var lists = mc4wp_vars.mailchimp.lists;
|
201 |
+
var selectedLists = []; // functions
|
202 |
|
203 |
+
function getSelectedListsWhere(searchKey, searchValue) {
|
204 |
+
return selectedLists.filter(function (el) {
|
205 |
+
return el[searchKey] === searchValue;
|
206 |
+
});
|
207 |
+
}
|
208 |
|
209 |
+
function getSelectedLists() {
|
210 |
+
return selectedLists;
|
211 |
+
}
|
|
|
|
|
|
|
212 |
|
213 |
+
function updateSelectedLists() {
|
214 |
+
selectedLists = [];
|
215 |
+
Array.prototype.forEach.call(listInputs, function (input) {
|
216 |
+
// skip unchecked checkboxes
|
217 |
+
if (typeof input.checked === "boolean" && !input.checked) {
|
218 |
+
return;
|
219 |
+
}
|
220 |
|
221 |
+
if (_typeof(lists[input.value]) === "object") {
|
222 |
+
selectedLists.push(lists[input.value]);
|
223 |
+
}
|
224 |
+
});
|
225 |
+
events.trigger('selectedLists.change', [selectedLists]);
|
226 |
+
return selectedLists;
|
227 |
+
}
|
228 |
|
229 |
+
function toggleVisibleLists() {
|
230 |
+
var rows = document.querySelectorAll('.lists--only-selected > *');
|
231 |
+
Array.prototype.forEach.call(rows, function (el) {
|
232 |
+
var listId = el.getAttribute('data-list-id');
|
233 |
+
var isSelected = getSelectedListsWhere('id', listId).length > 0;
|
234 |
|
235 |
+
if (isSelected) {
|
236 |
+
el.setAttribute('class', el.getAttribute('class').replace('hidden', ''));
|
237 |
+
} else {
|
238 |
+
el.setAttribute('class', el.getAttribute('class') + " hidden");
|
239 |
+
}
|
240 |
+
});
|
241 |
+
}
|
242 |
|
243 |
+
events.on('selectedLists.change', toggleVisibleLists);
|
244 |
+
helpers.bindEventToElements(listInputs, 'change', updateSelectedLists);
|
245 |
+
updateSelectedLists();
|
246 |
+
return {
|
247 |
+
getSelectedLists: getSelectedLists
|
248 |
+
};
|
249 |
+
};
|
250 |
|
251 |
+
module.exports = Settings;
|
|
|
|
|
252 |
|
253 |
+
},{}],5:[function(require,module,exports){
|
254 |
+
'use strict';
|
255 |
|
256 |
+
var URL = require('./url.js'); // Tabs
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
|
|
|
|
258 |
|
259 |
+
var Tabs = function Tabs(context) {
|
260 |
+
// TODO: last piece of jQuery... can we get rid of it?
|
261 |
+
var $ = window.jQuery;
|
262 |
+
var $context = $(context);
|
263 |
+
var $tabs = $context.find('.tab');
|
264 |
+
var $tabNavs = $context.find('.nav-tab');
|
265 |
+
var refererField = context.querySelector('input[name="_wp_http_referer"]');
|
266 |
+
var tabs = [];
|
267 |
+
$.each($tabs, function (i, t) {
|
268 |
+
var id = t.id.substring(4);
|
269 |
+
var title = $(t).find('h2').first().text();
|
270 |
+
tabs.push({
|
271 |
+
id: id,
|
272 |
+
title: title,
|
273 |
+
element: t,
|
274 |
+
nav: context.querySelectorAll('.nav-tab-' + id),
|
275 |
+
open: function open() {
|
276 |
+
return _open(id);
|
277 |
+
}
|
278 |
+
});
|
279 |
+
});
|
280 |
|
281 |
+
function get(id) {
|
282 |
+
for (var i = 0; i < tabs.length; i++) {
|
283 |
+
if (tabs[i].id === id) {
|
284 |
+
return tabs[i];
|
285 |
+
}
|
286 |
+
}
|
287 |
|
288 |
+
return undefined;
|
289 |
+
}
|
290 |
|
291 |
+
function _open(tab, updateState) {
|
292 |
+
// make sure we have a tab object
|
293 |
+
if (typeof tab === "string") {
|
294 |
+
tab = get(tab);
|
295 |
+
}
|
296 |
|
297 |
+
if (!tab) {
|
298 |
+
return false;
|
299 |
+
} // should we update state?
|
300 |
|
|
|
|
|
301 |
|
302 |
+
if (updateState == undefined) {
|
303 |
+
updateState = true;
|
304 |
+
} // hide all tabs & remove active class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
|
|
306 |
|
307 |
+
$tabs.removeClass('tab-active').css('display', 'none');
|
308 |
+
$tabNavs.removeClass('nav-tab-active'); // add `nav-tab-active` to this tab
|
|
|
|
|
|
|
309 |
|
310 |
+
Array.prototype.forEach.call(tab.nav, function (nav) {
|
311 |
+
nav.className += " nav-tab-active";
|
312 |
+
nav.blur();
|
313 |
+
}); // show target tab
|
314 |
|
315 |
+
tab.element.style.display = 'block';
|
316 |
+
tab.element.className += " tab-active"; // create new URL
|
317 |
|
318 |
+
var url = URL.setParameter(window.location.href, "tab", tab.id); // update hash
|
|
|
|
|
|
|
319 |
|
320 |
+
if (history.pushState && updateState) {
|
321 |
+
history.pushState(tab.id, '', url);
|
322 |
+
} // update document title
|
323 |
|
|
|
|
|
|
|
|
|
324 |
|
325 |
+
title(tab); // update referer field
|
|
|
|
|
326 |
|
327 |
+
refererField.value = url; // if thickbox is open, close it.
|
|
|
|
|
|
|
|
|
328 |
|
329 |
+
if (typeof tb_remove === "function") {
|
330 |
+
tb_remove();
|
331 |
+
} // refresh editor after switching tabs
|
332 |
+
// TODO: decouple this! law of demeter etc.
|
333 |
|
|
|
|
|
334 |
|
335 |
+
if (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {
|
336 |
+
mc4wp.forms.editor.refresh();
|
337 |
+
}
|
|
|
338 |
|
339 |
+
return true;
|
340 |
+
}
|
341 |
|
342 |
+
function title(tab) {
|
343 |
+
var title = document.title.split('-');
|
344 |
+
document.title = document.title.replace(title[0], tab.title + " ");
|
345 |
+
}
|
346 |
|
347 |
+
function switchTab(e) {
|
348 |
+
e = e || window.event; // get from data attribute
|
|
|
|
|
349 |
|
350 |
+
var tabId = this.getAttribute('data-tab'); // get from classname
|
|
|
|
|
|
|
|
|
351 |
|
352 |
+
if (!tabId) {
|
353 |
+
var match = this.className.match(/nav-tab-(\w+)?/);
|
354 |
|
355 |
+
if (match) {
|
356 |
+
tabId = match[1];
|
357 |
+
}
|
358 |
+
} // get from href
|
359 |
|
|
|
|
|
360 |
|
361 |
+
if (!tabId) {
|
362 |
+
var urlParams = URL.parse(this.href);
|
363 |
|
364 |
+
if (!urlParams.tab) {
|
365 |
+
return;
|
366 |
+
}
|
|
|
|
|
|
|
|
|
367 |
|
368 |
+
tabId = urlParams.tab;
|
369 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
|
371 |
+
var opened = _open(tabId);
|
372 |
|
373 |
+
if (opened) {
|
374 |
+
e.preventDefault();
|
375 |
+
e.returnValue = false;
|
376 |
+
return false;
|
377 |
+
}
|
378 |
|
379 |
+
return true;
|
380 |
+
}
|
381 |
|
382 |
+
function init() {
|
383 |
+
// check for current tab
|
384 |
+
if (!history.pushState) {
|
385 |
+
return;
|
386 |
+
}
|
387 |
|
388 |
+
var activeTab = $tabs.filter(':visible').get(0);
|
|
|
|
|
|
|
389 |
|
390 |
+
if (!activeTab) {
|
391 |
+
return;
|
392 |
+
}
|
|
|
|
|
|
|
393 |
|
394 |
+
var tab = get(activeTab.id.substring(4));
|
395 |
+
if (!tab) return; // check if tab is in html5 history
|
|
|
|
|
396 |
|
397 |
+
if (history.replaceState && history.state === null) {
|
398 |
+
history.replaceState(tab.id, '');
|
399 |
+
} // update document title
|
400 |
|
|
|
|
|
|
|
401 |
|
402 |
+
title(tab);
|
403 |
+
}
|
|
|
|
|
|
|
|
|
|
|
404 |
|
405 |
+
$tabNavs.click(switchTab);
|
406 |
+
$(document.body).on('click', '.tab-link', switchTab);
|
407 |
+
init();
|
408 |
+
|
409 |
+
if (window.addEventListener && history.pushState) {
|
410 |
+
window.addEventListener('popstate', function (e) {
|
411 |
+
if (!e.state) return true;
|
412 |
+
var tabId = e.state;
|
413 |
+
return _open(tabId, false);
|
414 |
+
});
|
415 |
+
}
|
416 |
+
|
417 |
+
return {
|
418 |
+
open: _open,
|
419 |
+
get: get
|
420 |
+
};
|
421 |
};
|
422 |
|
423 |
module.exports = Tabs;
|
426 |
'use strict';
|
427 |
|
428 |
var URL = {
|
429 |
+
parse: function parse(url) {
|
430 |
+
var query = {};
|
431 |
+
var a = url.split('&');
|
432 |
+
|
433 |
+
for (var i in a) {
|
434 |
+
if (!a.hasOwnProperty(i)) {
|
435 |
+
continue;
|
436 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
|
438 |
+
var b = a[i].split('=');
|
439 |
+
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
440 |
+
}
|
441 |
+
|
442 |
+
return query;
|
443 |
+
},
|
444 |
+
build: function build(data) {
|
445 |
+
var ret = [];
|
446 |
+
|
447 |
+
for (var d in data) {
|
448 |
+
ret.push(d + "=" + encodeURIComponent(data[d]));
|
449 |
+
}
|
450 |
+
|
451 |
+
return ret.join("&");
|
452 |
+
},
|
453 |
+
setParameter: function setParameter(url, key, value) {
|
454 |
+
var data = URL.parse(url);
|
455 |
+
data[key] = value;
|
456 |
+
return URL.build(data);
|
457 |
+
}
|
458 |
+
};
|
459 |
module.exports = URL;
|
460 |
|
461 |
},{}],7:[function(require,module,exports){
|
assets/js/admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){var l=void 0;!function o(a,l,s){function u(t,e){if(!l[t]){if(!a[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return u(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var c=!1,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";var r,i=e("tlite"),o=(r=i)&&r.__esModule?r:{default:r};var a=window.m=e("mithril"),l=e("wolfy87-eventemitter"),s=document.getElementById("mc4wp-admin"),u=new l,c=e("./admin/tabs.js")(s),f=e("./admin/helpers.js"),d=e("./admin/settings.js")(s,f,u);(0,o.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")});var h=e("./admin/list-fetcher.js"),v=document.getElementById("mc4wp-list-fetcher");v&&a.mount(v,new h),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=a,window.mc4wp.helpers=f,window.mc4wp.events=u,window.mc4wp.settings=d,window.mc4wp.tabs=c},{"./admin/helpers.js":2,"./admin/list-fetcher.js":3,"./admin/settings.js":4,"./admin/tabs.js":5,mithril:7,tlite:10,"wolfy87-eventemitter":11}],2:[function(e,t,n){"use strict";var r,a={};a.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},a.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},a.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){a.bindEventToElement(e,t,n)})},a.debounce=function(r,i,o){var a;return function(){var e=this,t=arguments,n=o&&!a;clearTimeout(a),a=setTimeout(function(){a=null,o||r.apply(e,t)},i),n&&r.apply(e,t)}},r=document.querySelectorAll("[data-showif]"),Array.prototype.forEach.call(r,function(e){var n=JSON.parse(e.getAttribute("data-showif")),t=document.querySelectorAll('[name="'+n.element+'"]'),r=e.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===n.hide||n.hide;function o(){if("radio"!==this.getAttribute("type")||this.checked){var t=("checkbox"===this.getAttribute("type")?this.checked:this.value)==n.value;i?(e.style.display=t?"":"none",e.style.visibility=t?"":"hidden"):e.style.opacity=t?"":"0.4",Array.prototype.forEach.call(r,function(e){t?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}Array.prototype.forEach.call(t,function(e){o.call(e)}),a.bindEventToElements(t,"change",o)}),t.exports=a},{}],3:[function(e,t,n){"use strict";var r=window.jQuery,i=mc4wp_vars,o=i.i18n;function a(){this.working=!1,this.done=!1,i.mailchimp.api_connected&&0===i.mailchimp.lists.length&&this.fetch()}a.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,r.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists",timeout:18e4}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},a.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" "),m("em.help",o.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",o.fetching_mailchimp_lists_done):m("em.help.red",o.fetching_mailchimp_lists_error)]:""])])},t.exports=a},{}],4:[function(e,t,n){"use strict";var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.exports=function(e,t,n){e.querySelector("form");var r=e.querySelectorAll(".mc4wp-list-input"),i=mc4wp_vars.mailchimp.lists,o=[];function a(){return o=[],Array.prototype.forEach.call(r,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===l(i[e.value])&&o.push(i[e.value])}),n.trigger("selectedLists.change",[o]),o}return n.on("selectedLists.change",function(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){var t,n,r=e.getAttribute("data-list-id");0<(t="id",n=r,o.filter(function(e){return e[t]===n})).length?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}),t.bindEventToElements(r,"change",a),a(),{getSelectedLists:function(){return o}}}},{}],5:[function(e,t,n){"use strict";var d=e("./url.js");t.exports=function(i){var o=window.jQuery,e=o(i),r=e.find(".tab"),a=e.find(".nav-tab"),l=i.querySelector('input[name="_wp_http_referer"]'),s=[];function u(e){for(var t=0;t<s.length;t++)if(s[t].id===e)return s[t]}function c(e,t){if("string"==typeof e&&(e=u(e)),!e)return!1;null==t&&(t=!0),r.removeClass("tab-active").css("display","none"),a.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var n=d.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),l.value=n,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function t(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var n=this.className.match(/nav-tab-(\w+)?/);n&&(t=n[1])}if(!t){var r=d.parse(this.href);if(!r.tab)return;t=r.tab}return!c(t)||(e.preventDefault(),e.returnValue=!1)}return o.each(r,function(e,t){var n=t.id.substring(4),r=o(t).find("h2").first().text();s.push({id:n,title:r,element:t,nav:i.querySelectorAll(".nav-tab-"+n),open:function(){return c(n)}})}),a.click(t),o(document.body).on("click",".tab-link",t),function(){if(history.pushState){var e=r.filter(":visible").get(0);if(e){var t=u(e.id.substring(4));t&&(history.replaceState&&null===history.state&&history.replaceState(t.id,""),f(t))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||c(e.state,!1)}),{open:c,get:u}}},{"./url.js":6}],6:[function(e,t,n){"use strict";var i={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var r=i.parse(e);return r[t]=n,i.build(r)}};t.exports=i},{}],7:[function(e,L,t){(function(k,S){!function(){"use strict";function z(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}z.normalize=function(e){return Array.isArray(e)?z("[",void 0,void 0,z.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?z("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},z.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=z.normalize(e[t]);return e};var s=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},c={}.hasOwnProperty;function f(e){for(var t in e)if(c.call(e,t))return!1;return!0}function e(e){var t,n=arguments[1],r=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var i=u[e]||function(e){for(var t,n="div",r=[],i={};t=s.exec(e);){var o=t[1],a=t[2];if(""===o&&""!==a)n=a;else if("#"===o)i.id=a;else if("."===o)r.push(a);else if("["===t[3][0]){var l=t[6];l&&(l=l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(l):i[t[4]]=""===l?l:l||!0}}return 0<r.length&&(i.className=r.join(" ")),u[e]={tag:n,attrs:i}}(e);if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},r=1),arguments.length===r+1)t=arguments[r],Array.isArray(t)||(t=[t]);else for(t=[];r<arguments.length;)t.push(arguments[r++]);var o=z.normalizeChildren(t);return"string"==typeof e?function(e,t,n){var r,i,o=!1,a=t.className||t.class;if(!f(e.attrs)&&!f(t)){var l={};for(var s in t)c.call(t,s)&&(l[s]=t[s]);t=l}for(var s in e.attrs)c.call(e.attrs,s)&&(t[s]=e.attrs[s]);for(var s in void 0!==a&&(void 0!==t.class&&(t.class=void 0,t.className=a),null!=e.attrs.className&&(t.className=e.attrs.className+" "+a)),t)if(c.call(t,s)&&"key"!==s){o=!0;break}return Array.isArray(n)&&1===n.length&&null!=n[0]&&"#"===n[0].tag?i=n[0].children:r=n,z(e.tag,t.key,o?t:void 0,r,i)}(i,n,o):z(e,n.key,n,o)}e.trust=function(e){return null==e&&(e=""),z("<",void 0,void 0,e,void 0,void 0)},e.fragment=function(e,t){return z("[",e.key,e,z.normalizeChildren(t),void 0,void 0)};var t=e;if((d=function(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var o=this,a=[],l=[],i=t(a,!0),s=t(l,!1),u=o._instance={resolvers:a,rejectors:l},c="function"==typeof S?S:setTimeout;function t(r,i){return function t(n){var e;try{if(!i||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){i||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);a.length=0,l.length=0,u.state=i,u.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){s(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(s);try{e(t(i),r)}catch(e){r(e)}}f(e)}).prototype.then=function(e,t){var i,o,a=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(e){o&&o(e)}}),"function"==typeof a.retry&&r===a.state&&a.retry()}var r=new d(function(e,t){i=e,o=t});return n(e,a.resolvers,i,!0),n(t,a.rejectors,o,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(l){return new d(function(n,r){var i=l.length,o=0,a=[];if(0===l.length)n([]);else for(var e=0;e<l.length;e++)!function(t){function e(e){o++,a[t]=e,o===i&&n(a)}null==l[t]||"object"!=typeof l[t]&&"function"!=typeof l[t]||"function"!=typeof l[t].then?e(l[t]):l[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=d);var d=window.Promise}else if(void 0!==k){void 0===k.Promise&&(k.Promise=d);d=k.Promise}var p=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)i(t,e[t]);return r.join("&");function i(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)i(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)i(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}},m=new RegExp("^file://","i"),n=function(s,r){var t,o=0;function a(){var i=0;function o(){0==--i&&"function"==typeof t&&t()}return function t(n){var r=n.then;return n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)},n}}function u(e,t){if("string"==typeof e){var n=e;null==(e=t||{}).url&&(e.url=n)}return e}function c(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function f(e,t){var n=p(t);if(""!==n){var r=e.indexOf("?")<0?"?":"&";e+=r+n}return e}function d(t){try{return""!==t?JSON.parse(t):null}catch(e){throw new Error(t)}}function h(e){return e.responseText}function v(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}return{request:function(l,e){var t=a();l=u(l,e);var n=new r(function(r,i){null==l.method&&(l.method="GET"),l.method=l.method.toUpperCase();var e="GET"!==l.method&&"TRACE"!==l.method&&("boolean"!=typeof l.useBody||l.useBody);"function"!=typeof l.serialize&&(l.serialize="undefined"!=typeof FormData&&l.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof l.deserialize&&(l.deserialize=d),"function"!=typeof l.extract&&(l.extract=h),l.url=c(l.url,l.data),e?l.data=l.serialize(l.data):l.url=f(l.url,l.data);var o=new s.XMLHttpRequest,a=!1,t=o.abort;for(var n in o.abort=function(){a=!0,t.call(o)},o.open(l.method,l.url,"boolean"!=typeof l.async||l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),l.serialize!==JSON.stringify||!e||l.headers&&l.headers.hasOwnProperty("Content-Type")||o.setRequestHeader("Content-Type","application/json; charset=utf-8"),l.deserialize!==d||l.headers&&l.headers.hasOwnProperty("Accept")||o.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(o.withCredentials=l.withCredentials),l.headers)({}).hasOwnProperty.call(l.headers,n)&&o.setRequestHeader(n,l.headers[n]);"function"==typeof l.config&&(o=l.config(o,l)||o),o.onreadystatechange=function(){if(!a&&4===o.readyState)try{var e=l.extract!==h?l.extract(o,l):l.deserialize(l.extract(o,l));if(200<=o.status&&o.status<300||304===o.status||m.test(l.url))r(v(l.type,e));else{var t=new Error(o.responseText);for(var n in e)t[n]=e[n];i(t)}}catch(e){i(e)}},e&&null!=l.data?o.send(l.data):o.send()});return!0===l.background?n:t(n)},jsonp:function(i,e){var t=a();i=u(i,e);var n=new r(function(t,e){var n=i.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+o++,r=s.document.createElement("script");s[n]=function(e){r.parentNode.removeChild(r),t(v(i.type,e)),delete s[n]},r.onerror=function(){r.parentNode.removeChild(r),e(new Error("JSONP request failed")),delete s[n]},null==i.data&&(i.data={}),i.url=c(i.url,i.data),i.data[i.callbackKey||"callback"]=n,r.src=f(i.url,i.data),s.document.documentElement.appendChild(r)});return!0===i.background?n:t(n)},setCompletionCallback:function(e){t=e}}}(window,d),r=function(e){var a,d=e.document,u=d.createDocumentFragment(),t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function h(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function b(e,t,n,r,i,o,a){for(var l=n;l<r;l++){var s=t[l];null!=s&&x(e,s,i,a,o)}}function x(e,t,n,r,i){var o,a,l,s=t.tag;if("string"!=typeof s)return function(e,t,n,r,i){{if(p(t,n),null==t.instance)return t.domSize=0,u;var o=x(e,t.instance,n,r,i);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,k(e,o,i),o}}(e,t,n,r,i);switch(t.state={},null!=t.attrs&&j(t.attrs,t,n),s){case"#":return o=e,l=i,(a=t).dom=d.createTextNode(a.children),k(o,a.dom,l),a.dom;case"<":return v(e,t,i);case"[":return function(e,t,n,r,i){var o=d.createDocumentFragment();if(null!=t.children){var a=t.children;b(o,a,0,a.length,n,null,r)}return t.dom=o.firstChild,t.domSize=o.childNodes.length,k(e,o,i),o}(e,t,n,r,i);default:return function(e,t,n,r,i){var o=t.tag,a=t.attrs,l=a&&a.is,s=(r=h(t)||r)?l?d.createElementNS(r,o,{is:l}):d.createElementNS(r,o):l?d.createElement(o,{is:l}):d.createElement(o);t.dom=s,null!=a&&function(e,t,n){for(var r in t)w(e,r,null,t[r],n)}(t,a,r);if(k(e,s,i),null!=t.attrs&&null!=t.attrs.contenteditable)y(t);else if(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var u=t.children;b(s,u,0,u.length,n,null,r),f=(c=t).attrs,"select"===c.tag&&null!=f&&("value"in f&&w(c,"value",null,f.value,void 0),"selectedIndex"in f&&w(c,"selectedIndex",null,f.selectedIndex,void 0))}var c,f;return s}(e,t,n,r,i)}}function v(e,t,n){var r={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[(t.children.match(/^\s*?<(\w+)/im)||[])[1]]||"div",i=d.createElement(r);i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var o,a=d.createDocumentFragment();o=i.firstChild;)a.appendChild(o);return k(e,a,n),a}function p(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&j(e.attrs,e,t),j(e._state,e,t),e.instance=z.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function m(e,t,n,r,i,o,a){if(t!==n&&(null!=t||null!=n))if(null==t)b(e,n,0,n.length,i,o,a);else if(null==n)S(t,0,t.length,n);else{if(t.length===n.length){for(var l=!1,s=0;s<n.length;s++)if(null!=n[s]&&null!=t[s]){l=null==n[s].key&&null==t[s].key;break}if(l){for(s=0;s<t.length;s++)t[s]!==n[s]&&(null==t[s]&&null!=n[s]?x(e,n[s],i,a,T(t,s+1,o)):null==n[s]?S(t,s,s+1,n):E(e,t[s],n[s],i,T(t,s+1,o),r,a));return}}if(r=r||function(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}(t,n)){var u=t.pool;t=t.concat(t.pool)}for(var c,f=0,d=0,h=t.length-1,v=n.length-1;f<=h&&d<=v;){if((m=t[f])!==(y=n[d])||r)if(null==m)f++;else if(null==y)d++;else if(m.key===y.key){var p=null!=u&&f>=t.length-u.length||null==u&&r;d++,E(e,m,y,i,T(t,++f,o),p,a),r&&m.tag===y.tag&&k(e,_(m),o)}else{if((m=t[h])!==y||r)if(null==m)h--;else if(null==y)d++;else{if(m.key!==y.key)break;p=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,T(t,h+1,o),p,a),(r||d<v)&&k(e,_(m),T(t,f,o)),h--,d++}else h--,d++}else f++,d++}for(;f<=h&&d<=v;){var m,y;if((m=t[h])!==(y=n[v])||r)if(null==m)h--;else if(null==y)v--;else if(m.key===y.key){p=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,T(t,h+1,o),p,a),r&&m.tag===y.tag&&k(e,_(m),o),null!=m.dom&&(o=m.dom),h--,v--}else{if(c||(c=A(t,h)),null!=y){var g=c[y.key];if(null!=g){var w=t[g];p=null!=u&&g>=t.length-u.length||null==u&&r;E(e,w,y,i,T(t,h+1,o),r,a),k(e,_(w),o),t[g].skip=!0,null!=w.dom&&(o=w.dom)}else{o=x(e,y,i,a,o)}}v--}else h--,v--;if(v<d)break}b(e,n,d,v+1,i,o,a),S(t,f,h+1,n)}}function E(e,t,n,r,i,o,a){var l,s,u,c,f=t.tag;if(f===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!o&&function(e,t){var n,r;null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t));"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t));return!(void 0===n&&void 0===r||n||r||(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,0))}(n,t))return;if("string"==typeof f)switch(null!=n.attrs&&(o?(n.state={},j(n.attrs,n,r)):O(n.attrs,n,r)),f){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":l=e,u=n,c=i,(s=t).children!==u.children?(_(s),v(l,u,c)):(u.dom=s.dom,u.domSize=s.domSize);break;case"[":!function(e,t,n,r,i,o,a){m(e,t.children,n.children,r,i,o,a);var l=0,s=n.children;if((n.dom=null)!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,o,r,i,a);break;default:!function(e,t,n,r,i){var o=t.dom=e.dom;i=h(t)||i,"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0));(function(e,t,n,r){if(null!=n)for(var i in n)w(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||L(i)?"key"!==i&&e.dom.removeAttribute(i):C(e,i,void 0))})(t,e.attrs,t.attrs,i),null!=t.attrs&&null!=t.attrs.contenteditable?y(t):null!=e.text&&null!=t.text&&""!==t.text?e.text.toString()!==t.text.toString()&&(e.dom.firstChild.nodeValue=t.text):(null!=e.text&&(e.children=[z("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),m(o,e.children,t.children,n,r,null,i))}(t,n,o,r,a)}else!function(e,t,n,r,i,o,a){if(o)p(n,r);else{if(n.instance=z.normalize(n._state.view.call(n.state,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");null!=n.attrs&&O(n.attrs,n,r),O(n._state,n,r)}null!=n.instance?(null==t.instance?x(e,n.instance,r,a,i):E(e,t.instance,n.instance,r,i,o,a),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(g(t.instance,null),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o,a)}else g(t,null),x(e,n,r,a,i)}function A(e,t){var n={},r=0;for(r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function _(e){var t=e.domSize;if(null==t&&null!=e.dom)return e.dom;var n=d.createDocumentFragment();if(0<t){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}function T(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function k(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function y(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function S(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:g(o,r))}}function g(r,i){var e,o=1,a=0;r.attrs&&"function"==typeof r.attrs.onbeforeremove&&(null!=(e=r.attrs.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));"string"!=typeof r.tag&&"function"==typeof r._state.onbeforeremove&&(null!=(e=r._state.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));function t(){if(++a===o&&(function e(t){t.attrs&&"function"==typeof t.attrs.onremove&&t.attrs.onremove.call(t.state,t);if("string"!=typeof t.tag)"function"==typeof t._state.onremove&&t._state.onremove.call(t.state,t),null!=t.instance&&e(t.instance);else{var n=t.children;if(Array.isArray(n))for(var r=0;r<n.length;r++){var i=n[r];null!=i&&e(i)}}}(r),r.dom)){var e=r.domSize||1;if(1<e)for(var t=r.dom;--e;)l(t.nextSibling);l(r.dom),null==i||null!=r.domSize||null!=(n=r.attrs)&&(n.oncreate||n.onupdate||n.onbeforeremove||n.onremove)||"string"!=typeof r.tag||(i.pool?i.pool.push(r):i.pool=[r])}var n}t()}function l(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function w(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||(a=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&a.dom===d.activeElement)||"object"==typeof r)&&void 0!==r&&!L(t)){var a,l,s,u,c=t.indexOf(":");if(-1<c&&"xlink"===t.substr(0,c))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(c+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)C(e,t,r);else if("style"===t)!function(e,t,n){t===n&&(e.style.cssText="",t=null);if(null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{for(var r in"string"==typeof t&&(e.style.cssText=""),n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}(o,n,r);else if(t in o&&("href"!==(u=t)&&"list"!==u&&"form"!==u&&"width"!==u&&"height"!==u)&&void 0===i&&!((s=e).attrs.is||-1<s.tag.indexOf("-"))){if("value"===t){var f=""+r;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===f&&e.dom===d.activeElement)return;if("select"===e.tag)if(null===r){if(-1===e.dom.selectedIndex&&e.dom===d.activeElement)return}else if(null!==n&&e.dom.value===f&&e.dom===d.activeElement)return;if("option"===e.tag&&null!=n&&e.dom.value===f)return}if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function L(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function C(e,t,n){var r=e.dom,i="function"!=typeof a?n:function(e){var t=n.call(r,e);return a.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function j(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function O(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}return{render:function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=[],r=d.activeElement,i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),m(e,e.vnodes,z.normalizeChildren(t),!1,n,null,"http://www.w3.org/1999/xhtml"===i?void 0:i),e.vnodes=t,null!=r&&d.activeElement!==r&&r.focus();for(var o=0;o<n.length;o++)n[o]()},setEventCallback:function(e){return a=e}}};var i=function(e){var t=r(e);t.setEventCallback(function(e){!1===e.redraw?e.redraw=void 0:n()});var a=[];function l(e){var t=a.indexOf(e);-1<t&&a.splice(t,2)}function n(){for(var e=1;e<a.length;e+=2)a[e]()}return{subscribe:function(e,t){var n,r,i,o;l(e),a.push(e,(n=t,r=0,i=null,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout,function(){var e=Date.now();0===r||16<=e-r?(r=e,n()):null===i&&(i=o(function(){i=null,n(),r=Date.now()},16-(e-r)))}))},unsubscribe:l,redraw:n,render:t.render}}(window);n.setCompletionCallback(i.redraw);var o;t.mount=(o=i,function(e,t){if(null===t)return o.render(e,[]),void o.unsubscribe(e);if(null==t.view&&"function"!=typeof t)throw new Error("m.mount(element, component) expects a component, not a vnode");o.subscribe(e,function(){o.render(e,z(t))}),o.redraw()});var a,l,h,v,y,g,w,b,x,E=d,A=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),a=decodeURIComponent(o[0]),l=2===o.length?decodeURIComponent(o[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var s=a.split(/\]\[?|\[/),u=n;-1<a.indexOf("[")&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),v=c===s.length-1;if(""===f)null==r[a=s.slice(0,c).join()]&&(r[a]=0),f=r[a]++;null==u[f]&&(u[f]=v?l:h?[]:{}),u=u[f]}}return n},_=function(c){var n,f="function"==typeof c.history.pushState,r="function"==typeof S?S:setTimeout;function e(e){var t=c.location[e].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===e&&"/"!==t[0]&&(t="/"+t),t}function d(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=-1<r?r:-1<i?i:e.length;if(-1<r){var a=-1<i?i:e.length,l=A(e.slice(r+1,a));for(var s in l)t[s]=l[s]}if(-1<i){var u=A(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var h={prefix:"#!",getPath:function(){switch(h.prefix.charAt(0)){case"#":return e("hash").slice(h.prefix.length);case"?":return e("search").slice(h.prefix.length)+e("hash");default:return e("pathname").slice(h.prefix.length)+e("search")+e("hash")}},setPath:function(e,n,t){var r={},i={};if(e=d(e,r,i),null!=n){for(var o in n)r[o]=n[o];e=e.replace(/:([^\/]+)/g,function(e,t){return delete r[t],n[t]})}var a=p(r);a&&(e+="?"+a);var l=p(i);if(l&&(e+="#"+l),f){var s=t?t.state:null,u=t?t.title:null;c.onpopstate(),t&&t.replace?c.history.replaceState(s,u,h.prefix+e):c.history.pushState(s,u,h.prefix+e)}else c.location.href=h.prefix+e}};return h.defineRoutes=function(l,s,u){function e(){var r=h.getPath(),i={},e=d(r,i,i),t=c.history.state;if(null!=t)for(var n in t)i[n]=t[n];for(var o in l){var a=new RegExp("^"+o.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(a.test(e))return void e.replace(a,function(){for(var e=o.match(/:[^\/]+/g)||[],t=[].slice.call(arguments,1,-2),n=0;n<e.length;n++)i[e[n].replace(/:|\./g,"")]=decodeURIComponent(t[n]);s(l[o],i,r,o)})}u(r,i)}var t;f?c.onpopstate=(t=e,function(){null==n&&(n=r(function(){n=null,t()}))}):"#"===h.prefix.charAt(0)&&(c.onhashchange=e),e()},h};t.route=(a=window,l=i,b=_(a),(x=function(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var o=function(){null!=h&&l.render(e,h(z(v,y.key,y)))},a=function(e){if(e===t)throw new Error("Could not resolve default route "+t);b.setPath(t,null,{replace:!0})};b.defineRoutes(n,function(t,n,r){var i=w=function(e,t){i===w&&(v=null==t||"function"!=typeof t.view&&"function"!=typeof t?"div":t,y=n,g=r,w=null,h=(e.render||function(e){return e}).bind(e),o())};t.view||"function"==typeof t?i({},t):t.onmatch?E.resolve(t.onmatch(n,r)).then(function(e){i(t,e)},a):i(t,"div")},a),l.subscribe(e,o)}).set=function(e,t,n){null!=w&&((n=n||{}).replace=!0),w=null,b.setPath(e,t,n)},x.get=function(){return g},x.prefix=function(e){b.prefix=e},x.link=function(e){e.dom.setAttribute("href",b.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(b.prefix)&&(t=t.slice(b.prefix.length)),x.set(t,void 0,void 0)}}},x.param=function(e){return void 0!==y&&void 0!==e?y[e]:y},x),t.withAttr=function(t,n,r){return function(e){n.call(r||this,t in e.currentTarget?e.currentTarget[t]:e.currentTarget.getAttribute(t))}};var T=r(window);t.render=T.render,t.redraw=i.redraw,t.request=n.request,t.jsonp=n.jsonp,t.parseQueryString=A,t.buildQueryString=p,t.version="1.1.6",t.vnode=z,void 0!==L?L.exports=t:window.m=t}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{timers:9}],8:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:l}catch(e){i=l}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&v())}function v(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||s(v)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],9:[function(s,e,u){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function l(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new l(n.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new l(n.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},u.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},u.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},u._unrefActive=u.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},u.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[t]=!0,r(function(){o[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":8,timers:9}],10:[function(e,t,n){function u(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);n||(n=(t=t.parentElement)&&r(t)),n&&u.show(t,n,!0)})}u.show=function(e,t,l){var s="data-tlite";t=t||{},(e.tooltip||function(e,t){var n,r,i;function o(){u.hide(e,!0)}function a(){n||(n=function(l,e,t){var s=document.createElement("span"),n=t.grav||l.getAttribute("data-tlite")||"n";s.innerHTML=e,l.appendChild(s);var u=n[0]||"",c=n[1]||"";function r(){s.className="tlite tlite-"+u+c;var e=l.offsetTop,t=l.offsetLeft;s.offsetParent===l&&(e=t=0);var n=l.offsetWidth,r=l.offsetHeight,i=s.offsetHeight,o=s.offsetWidth,a=t+n/2;s.style.top=("s"===u?e-i-10:"n"===u?e+r+10:e+r/2-i/2)+"px",s.style.left=("w"===c?t:"e"===c?t+n-o:"w"===u?t+n+10:"e"===u?t-o-10:a-o/2)+"px"}r();var i=s.getBoundingClientRect();"s"===u&&i.top<0?(u="n",r()):"n"===u&&i.bottom>window.innerHeight?(u="s",r()):"e"===u&&i.left<0?(u="w",r()):"w"===u&&i.right>window.innerWidth&&(u="e",r());return s.className+=" tlite-visible",s}(e,i,t))}return e.addEventListener("mousedown",o),e.addEventListener("mouseleave",o),e.tooltip={show:function(){i=e.title||e.getAttribute(s)||i,e.title="",e.setAttribute(s,""),i&&!r&&(r=setTimeout(a,l?150:1))},hide:function(e){if(l===e){r=clearTimeout(r);var t=n&&n.parentNode;t&&t.removeChild(n),n=void 0}}}}(e,t)).show()},u.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=u)},{}],11:[function(e,a,t){!function(e){"use strict";function t(){}var n=t.prototype,r=e.EventEmitter;function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],t))&&i[r].splice(n,1);return this},n.off=i("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},n.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e);for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},n.trigger=i("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=r,t},"function"==typeof l&&l.amd?l(function(){return t}):"object"==typeof a&&a.exports?a.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=admin.min.js.map
|
1 |
+
!function(){var l=void 0;!function o(a,l,s){function u(t,e){if(!l[t]){if(!a[t]){var n=!1;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return u(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var c=!1,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";var r,i=(r=e("tlite"))&&r.__esModule?r:{default:r};var o=window.m=e("mithril"),a=e("wolfy87-eventemitter"),l=document.getElementById("mc4wp-admin"),s=new a,u=e("./admin/tabs.js")(l),c=e("./admin/helpers.js"),f=e("./admin/settings.js")(l,c,s);(0,i.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")});var d=e("./admin/list-fetcher.js"),h=document.getElementById("mc4wp-list-fetcher");h&&o.mount(h,new d),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=o,window.mc4wp.helpers=c,window.mc4wp.events=s,window.mc4wp.settings=f,window.mc4wp.tabs=u},{"./admin/helpers.js":2,"./admin/list-fetcher.js":3,"./admin/settings.js":4,"./admin/tabs.js":5,mithril:7,tlite:10,"wolfy87-eventemitter":11}],2:[function(e,t,n){"use strict";var r,a={};a.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},a.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},a.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){a.bindEventToElement(e,t,n)})},a.debounce=function(r,i,o){var a;return function(){var e=this,t=arguments,n=o&&!a;clearTimeout(a),a=setTimeout(function(){a=null,o||r.apply(e,t)},i),n&&r.apply(e,t)}},r=document.querySelectorAll("[data-showif]"),Array.prototype.forEach.call(r,function(e){var n=JSON.parse(e.getAttribute("data-showif")),t=document.querySelectorAll('[name="'+n.element+'"]'),r=e.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===n.hide||n.hide;function o(){if("radio"!==this.getAttribute("type")||this.checked){var t=("checkbox"===this.getAttribute("type")?this.checked:this.value)==n.value;i?(e.style.display=t?"":"none",e.style.visibility=t?"":"hidden"):e.style.opacity=t?"":"0.4",Array.prototype.forEach.call(r,function(e){t?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}Array.prototype.forEach.call(t,function(e){o.call(e)}),a.bindEventToElements(t,"change",o)}),t.exports=a},{}],3:[function(e,t,n){"use strict";var r=window.jQuery,i=mc4wp_vars,o=i.i18n;function a(){this.working=!1,this.done=!1,i.mailchimp.api_connected&&0===i.mailchimp.lists.length&&this.fetch()}a.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,r.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists",timeout:18e4}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},a.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" "),m("em.help",o.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",o.fetching_mailchimp_lists_done):m("em.help.red",o.fetching_mailchimp_lists_error)]:""])])},t.exports=a},{}],4:[function(e,t,n){"use strict";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.exports=function(e,t,n){e.querySelector("form");var r=e.querySelectorAll(".mc4wp-list-input"),i=mc4wp_vars.mailchimp.lists,o=[];function a(){return o=[],Array.prototype.forEach.call(r,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===l(i[e.value])&&o.push(i[e.value])}),n.trigger("selectedLists.change",[o]),o}return n.on("selectedLists.change",function(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){var t,n,r=e.getAttribute("data-list-id");0<(t="id",n=r,o.filter(function(e){return e[t]===n})).length?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}),t.bindEventToElements(r,"change",a),a(),{getSelectedLists:function(){return o}}}},{}],5:[function(e,t,n){"use strict";var d=e("./url.js");t.exports=function(i){var o=window.jQuery,e=o(i),r=e.find(".tab"),a=e.find(".nav-tab"),l=i.querySelector('input[name="_wp_http_referer"]'),s=[];function u(e){for(var t=0;t<s.length;t++)if(s[t].id===e)return s[t]}function c(e,t){if("string"==typeof e&&(e=u(e)),!e)return!1;null==t&&(t=!0),r.removeClass("tab-active").css("display","none"),a.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var n=d.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),l.value=n,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function t(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var n=this.className.match(/nav-tab-(\w+)?/);n&&(t=n[1])}if(!t){var r=d.parse(this.href);if(!r.tab)return;t=r.tab}return!c(t)||(e.preventDefault(),e.returnValue=!1)}return o.each(r,function(e,t){var n=t.id.substring(4),r=o(t).find("h2").first().text();s.push({id:n,title:r,element:t,nav:i.querySelectorAll(".nav-tab-"+n),open:function(){return c(n)}})}),a.click(t),o(document.body).on("click",".tab-link",t),function(){if(history.pushState){var e=r.filter(":visible").get(0);if(e){var t=u(e.id.substring(4));t&&(history.replaceState&&null===history.state&&history.replaceState(t.id,""),f(t))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||c(e.state,!1)}),{open:c,get:u}}},{"./url.js":6}],6:[function(e,t,n){"use strict";var i={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var r=i.parse(e);return r[t]=n,i.build(r)}};t.exports=i},{}],7:[function(e,L,t){(function(k,S){!function(){"use strict";function z(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}z.normalize=function(e){return Array.isArray(e)?z("[",void 0,void 0,z.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?z("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},z.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=z.normalize(e[t]);return e};var s=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},c={}.hasOwnProperty;function f(e){for(var t in e)if(c.call(e,t))return!1;return!0}function e(e){var t,n=arguments[1],r=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var i=u[e]||function(e){for(var t,n="div",r=[],i={};t=s.exec(e);){var o=t[1],a=t[2];if(""===o&&""!==a)n=a;else if("#"===o)i.id=a;else if("."===o)r.push(a);else if("["===t[3][0]){var l=t[6];l&&(l=l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(l):i[t[4]]=""===l?l:l||!0}}return 0<r.length&&(i.className=r.join(" ")),u[e]={tag:n,attrs:i}}(e);if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},r=1),arguments.length===r+1)t=arguments[r],Array.isArray(t)||(t=[t]);else for(t=[];r<arguments.length;)t.push(arguments[r++]);var o=z.normalizeChildren(t);return"string"==typeof e?function(e,t,n){var r,i,o=!1,a=t.className||t.class;if(!f(e.attrs)&&!f(t)){var l={};for(var s in t)c.call(t,s)&&(l[s]=t[s]);t=l}for(var s in e.attrs)c.call(e.attrs,s)&&(t[s]=e.attrs[s]);for(var s in void 0!==a&&(void 0!==t.class&&(t.class=void 0,t.className=a),null!=e.attrs.className&&(t.className=e.attrs.className+" "+a)),t)if(c.call(t,s)&&"key"!==s){o=!0;break}return Array.isArray(n)&&1===n.length&&null!=n[0]&&"#"===n[0].tag?i=n[0].children:r=n,z(e.tag,t.key,o?t:void 0,r,i)}(i,n,o):z(e,n.key,n,o)}e.trust=function(e){return null==e&&(e=""),z("<",void 0,void 0,e,void 0,void 0)},e.fragment=function(e,t){return z("[",e.key,e,z.normalizeChildren(t),void 0,void 0)};var t=e;if((d=function(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var o=this,a=[],l=[],i=t(a,!0),s=t(l,!1),u=o._instance={resolvers:a,rejectors:l},c="function"==typeof S?S:setTimeout;function t(r,i){return function t(n){var e;try{if(!i||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){i||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);a.length=0,l.length=0,u.state=i,u.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){s(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(s);try{e(t(i),r)}catch(e){r(e)}}f(e)}).prototype.then=function(e,t){var i,o,a=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(e){o&&o(e)}}),"function"==typeof a.retry&&r===a.state&&a.retry()}var r=new d(function(e,t){i=e,o=t});return n(e,a.resolvers,i,!0),n(t,a.rejectors,o,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(l){return new d(function(n,r){var i=l.length,o=0,a=[];if(0===l.length)n([]);else for(var e=0;e<l.length;e++)!function(t){function e(e){o++,a[t]=e,o===i&&n(a)}null==l[t]||"object"!=typeof l[t]&&"function"!=typeof l[t]||"function"!=typeof l[t].then?e(l[t]):l[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=d);var d=window.Promise}else if(void 0!==k){void 0===k.Promise&&(k.Promise=d);d=k.Promise}var p=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)i(t,e[t]);return r.join("&");function i(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)i(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)i(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}},m=new RegExp("^file://","i"),n=function(s,r){var t,o=0;function a(){var i=0;function o(){0==--i&&"function"==typeof t&&t()}return function t(n){var r=n.then;return n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)},n}}function u(e,t){if("string"==typeof e){var n=e;null==(e=t||{}).url&&(e.url=n)}return e}function c(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function f(e,t){var n=p(t);if(""!==n){var r=e.indexOf("?")<0?"?":"&";e+=r+n}return e}function d(t){try{return""!==t?JSON.parse(t):null}catch(e){throw new Error(t)}}function h(e){return e.responseText}function v(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}return{request:function(l,e){var t=a();l=u(l,e);var n=new r(function(r,i){null==l.method&&(l.method="GET"),l.method=l.method.toUpperCase();var e="GET"!==l.method&&"TRACE"!==l.method&&("boolean"!=typeof l.useBody||l.useBody);"function"!=typeof l.serialize&&(l.serialize="undefined"!=typeof FormData&&l.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof l.deserialize&&(l.deserialize=d),"function"!=typeof l.extract&&(l.extract=h),l.url=c(l.url,l.data),e?l.data=l.serialize(l.data):l.url=f(l.url,l.data);var o=new s.XMLHttpRequest,a=!1,t=o.abort;for(var n in o.abort=function(){a=!0,t.call(o)},o.open(l.method,l.url,"boolean"!=typeof l.async||l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),l.serialize!==JSON.stringify||!e||l.headers&&l.headers.hasOwnProperty("Content-Type")||o.setRequestHeader("Content-Type","application/json; charset=utf-8"),l.deserialize!==d||l.headers&&l.headers.hasOwnProperty("Accept")||o.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(o.withCredentials=l.withCredentials),l.headers)({}).hasOwnProperty.call(l.headers,n)&&o.setRequestHeader(n,l.headers[n]);"function"==typeof l.config&&(o=l.config(o,l)||o),o.onreadystatechange=function(){if(!a&&4===o.readyState)try{var e=l.extract!==h?l.extract(o,l):l.deserialize(l.extract(o,l));if(200<=o.status&&o.status<300||304===o.status||m.test(l.url))r(v(l.type,e));else{var t=new Error(o.responseText);for(var n in e)t[n]=e[n];i(t)}}catch(e){i(e)}},e&&null!=l.data?o.send(l.data):o.send()});return!0===l.background?n:t(n)},jsonp:function(i,e){var t=a();i=u(i,e);var n=new r(function(t,e){var n=i.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+o++,r=s.document.createElement("script");s[n]=function(e){r.parentNode.removeChild(r),t(v(i.type,e)),delete s[n]},r.onerror=function(){r.parentNode.removeChild(r),e(new Error("JSONP request failed")),delete s[n]},null==i.data&&(i.data={}),i.url=c(i.url,i.data),i.data[i.callbackKey||"callback"]=n,r.src=f(i.url,i.data),s.document.documentElement.appendChild(r)});return!0===i.background?n:t(n)},setCompletionCallback:function(e){t=e}}}(window,d),r=function(e){var a,d=e.document,u=d.createDocumentFragment(),t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function h(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function b(e,t,n,r,i,o,a){for(var l=n;l<r;l++){var s=t[l];null!=s&&x(e,s,i,a,o)}}function x(e,t,n,r,i){var o,a,l,s=t.tag;if("string"!=typeof s)return function(e,t,n,r,i){{if(p(t,n),null==t.instance)return t.domSize=0,u;var o=x(e,t.instance,n,r,i);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,k(e,o,i),o}}(e,t,n,r,i);switch(t.state={},null!=t.attrs&&j(t.attrs,t,n),s){case"#":return o=e,l=i,(a=t).dom=d.createTextNode(a.children),k(o,a.dom,l),a.dom;case"<":return v(e,t,i);case"[":return function(e,t,n,r,i){var o=d.createDocumentFragment();if(null!=t.children){var a=t.children;b(o,a,0,a.length,n,null,r)}return t.dom=o.firstChild,t.domSize=o.childNodes.length,k(e,o,i),o}(e,t,n,r,i);default:return function(e,t,n,r,i){var o=t.tag,a=t.attrs,l=a&&a.is,s=(r=h(t)||r)?l?d.createElementNS(r,o,{is:l}):d.createElementNS(r,o):l?d.createElement(o,{is:l}):d.createElement(o);t.dom=s,null!=a&&function(e,t,n){for(var r in t)w(e,r,null,t[r],n)}(t,a,r);if(k(e,s,i),null!=t.attrs&&null!=t.attrs.contenteditable)y(t);else if(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var u=t.children;b(s,u,0,u.length,n,null,r),f=(c=t).attrs,"select"===c.tag&&null!=f&&("value"in f&&w(c,"value",null,f.value,void 0),"selectedIndex"in f&&w(c,"selectedIndex",null,f.selectedIndex,void 0))}var c,f;return s}(e,t,n,r,i)}}function v(e,t,n){var r={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[(t.children.match(/^\s*?<(\w+)/im)||[])[1]]||"div",i=d.createElement(r);i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length;for(var o,a=d.createDocumentFragment();o=i.firstChild;)a.appendChild(o);return k(e,a,n),a}function p(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return u;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&j(e.attrs,e,t),j(e._state,e,t),e.instance=z.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}function m(e,t,n,r,i,o,a){if(t!==n&&(null!=t||null!=n))if(null==t)b(e,n,0,n.length,i,o,a);else if(null==n)S(t,0,t.length,n);else{if(t.length===n.length){for(var l=!1,s=0;s<n.length;s++)if(null!=n[s]&&null!=t[s]){l=null==n[s].key&&null==t[s].key;break}if(l){for(s=0;s<t.length;s++)t[s]!==n[s]&&(null==t[s]&&null!=n[s]?x(e,n[s],i,a,T(t,s+1,o)):null==n[s]?S(t,s,s+1,n):E(e,t[s],n[s],i,T(t,s+1,o),r,a));return}}if(r=r||function(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}(t,n)){var u=t.pool;t=t.concat(t.pool)}for(var c,f=0,d=0,h=t.length-1,v=n.length-1;f<=h&&d<=v;){if((m=t[f])!==(y=n[d])||r)if(null==m)f++;else if(null==y)d++;else if(m.key===y.key){var p=null!=u&&f>=t.length-u.length||null==u&&r;d++,E(e,m,y,i,T(t,++f,o),p,a),r&&m.tag===y.tag&&k(e,_(m),o)}else{if((m=t[h])!==y||r)if(null==m)h--;else if(null==y)d++;else{if(m.key!==y.key)break;p=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,T(t,h+1,o),p,a),(r||d<v)&&k(e,_(m),T(t,f,o)),h--,d++}else h--,d++}else f++,d++}for(;f<=h&&d<=v;){var m,y;if((m=t[h])!==(y=n[v])||r)if(null==m)h--;else if(null==y)v--;else if(m.key===y.key){p=null!=u&&h>=t.length-u.length||null==u&&r;E(e,m,y,i,T(t,h+1,o),p,a),r&&m.tag===y.tag&&k(e,_(m),o),null!=m.dom&&(o=m.dom),h--,v--}else{if(c||(c=A(t,h)),null!=y){var g=c[y.key];if(null!=g){var w=t[g];p=null!=u&&g>=t.length-u.length||null==u&&r;E(e,w,y,i,T(t,h+1,o),r,a),k(e,_(w),o),t[g].skip=!0,null!=w.dom&&(o=w.dom)}else{o=x(e,y,i,a,o)}}v--}else h--,v--;if(v<d)break}b(e,n,d,v+1,i,o,a),S(t,f,h+1,n)}}function E(e,t,n,r,i,o,a){var l,s,u,c,f=t.tag;if(f===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!o&&function(e,t){var n,r;null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t));"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t));return!(void 0===n&&void 0===r||n||r||(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,0))}(n,t))return;if("string"==typeof f)switch(null!=n.attrs&&(o?(n.state={},j(n.attrs,n,r)):O(n.attrs,n,r)),f){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":l=e,u=n,c=i,(s=t).children!==u.children?(_(s),v(l,u,c)):(u.dom=s.dom,u.domSize=s.domSize);break;case"[":!function(e,t,n,r,i,o,a){m(e,t.children,n.children,r,i,o,a);var l=0,s=n.children;if((n.dom=null)!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,o,r,i,a);break;default:!function(e,t,n,r,i){var o=t.dom=e.dom;i=h(t)||i,"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0));(function(e,t,n,r){if(null!=n)for(var i in n)w(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||L(i)?"key"!==i&&e.dom.removeAttribute(i):C(e,i,void 0))})(t,e.attrs,t.attrs,i),null!=t.attrs&&null!=t.attrs.contenteditable?y(t):null!=e.text&&null!=t.text&&""!==t.text?e.text.toString()!==t.text.toString()&&(e.dom.firstChild.nodeValue=t.text):(null!=e.text&&(e.children=[z("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[z("#",void 0,void 0,t.text,void 0,void 0)]),m(o,e.children,t.children,n,r,null,i))}(t,n,o,r,a)}else!function(e,t,n,r,i,o,a){if(o)p(n,r);else{if(n.instance=z.normalize(n._state.view.call(n.state,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");null!=n.attrs&&O(n.attrs,n,r),O(n._state,n,r)}null!=n.instance?(null==t.instance?x(e,n.instance,r,a,i):E(e,t.instance,n.instance,r,i,o,a),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(g(t.instance,null),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o,a)}else g(t,null),x(e,n,r,a,i)}function A(e,t){var n={},r=0;for(r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function _(e){var t=e.domSize;if(null==t&&null!=e.dom)return e.dom;var n=d.createDocumentFragment();if(0<t){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}function T(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function k(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function y(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function S(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:g(o,r))}}function g(r,i){var e,o=1,a=0;r.attrs&&"function"==typeof r.attrs.onbeforeremove&&(null!=(e=r.attrs.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));"string"!=typeof r.tag&&"function"==typeof r._state.onbeforeremove&&(null!=(e=r._state.onbeforeremove.call(r.state,r))&&"function"==typeof e.then&&(o++,e.then(t,t)));function t(){if(++a===o&&(function e(t){t.attrs&&"function"==typeof t.attrs.onremove&&t.attrs.onremove.call(t.state,t);if("string"!=typeof t.tag)"function"==typeof t._state.onremove&&t._state.onremove.call(t.state,t),null!=t.instance&&e(t.instance);else{var n=t.children;if(Array.isArray(n))for(var r=0;r<n.length;r++){var i=n[r];null!=i&&e(i)}}}(r),r.dom)){var e=r.domSize||1;if(1<e)for(var t=r.dom;--e;)l(t.nextSibling);l(r.dom),null==i||null!=r.domSize||null!=(n=r.attrs)&&(n.oncreate||n.onupdate||n.onbeforeremove||n.onremove)||"string"!=typeof r.tag||(i.pool?i.pool.push(r):i.pool=[r])}var n}t()}function l(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function w(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||(a=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&a.dom===d.activeElement)||"object"==typeof r)&&void 0!==r&&!L(t)){var a,l,s,u,c=t.indexOf(":");if(-1<c&&"xlink"===t.substr(0,c))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(c+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)C(e,t,r);else if("style"===t)!function(e,t,n){t===n&&(e.style.cssText="",t=null);if(null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{for(var r in"string"==typeof t&&(e.style.cssText=""),n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}(o,n,r);else if(t in o&&("href"!==(u=t)&&"list"!==u&&"form"!==u&&"width"!==u&&"height"!==u)&&void 0===i&&!((s=e).attrs.is||-1<s.tag.indexOf("-"))){if("value"===t){var f=""+r;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===f&&e.dom===d.activeElement)return;if("select"===e.tag)if(null===r){if(-1===e.dom.selectedIndex&&e.dom===d.activeElement)return}else if(null!==n&&e.dom.value===f&&e.dom===d.activeElement)return;if("option"===e.tag&&null!=n&&e.dom.value===f)return}if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function L(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function C(e,t,n){var r=e.dom,i="function"!=typeof a?n:function(e){var t=n.call(r,e);return a.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function j(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function O(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}return{render:function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=[],r=d.activeElement,i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),m(e,e.vnodes,z.normalizeChildren(t),!1,n,null,"http://www.w3.org/1999/xhtml"===i?void 0:i),e.vnodes=t,null!=r&&d.activeElement!==r&&r.focus();for(var o=0;o<n.length;o++)n[o]()},setEventCallback:function(e){return a=e}}};var i=function(e){var t=r(e);t.setEventCallback(function(e){!1===e.redraw?e.redraw=void 0:n()});var a=[];function l(e){var t=a.indexOf(e);-1<t&&a.splice(t,2)}function n(){for(var e=1;e<a.length;e+=2)a[e]()}return{subscribe:function(e,t){var n,r,i,o;l(e),a.push(e,(n=t,r=0,i=null,o="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout,function(){var e=Date.now();0===r||16<=e-r?(r=e,n()):null===i&&(i=o(function(){i=null,n(),r=Date.now()},16-(e-r)))}))},unsubscribe:l,redraw:n,render:t.render}}(window);n.setCompletionCallback(i.redraw);var o;t.mount=(o=i,function(e,t){if(null===t)return o.render(e,[]),void o.unsubscribe(e);if(null==t.view&&"function"!=typeof t)throw new Error("m.mount(element, component) expects a component, not a vnode");o.subscribe(e,function(){o.render(e,z(t))}),o.redraw()});var a,l,h,v,y,g,w,b,x,E=d,A=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),a=decodeURIComponent(o[0]),l=2===o.length?decodeURIComponent(o[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var s=a.split(/\]\[?|\[/),u=n;-1<a.indexOf("[")&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),v=c===s.length-1;if(""===f)null==r[a=s.slice(0,c).join()]&&(r[a]=0),f=r[a]++;null==u[f]&&(u[f]=v?l:h?[]:{}),u=u[f]}}return n},_=function(c){var n,f="function"==typeof c.history.pushState,r="function"==typeof S?S:setTimeout;function e(e){var t=c.location[e].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===e&&"/"!==t[0]&&(t="/"+t),t}function d(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=-1<r?r:-1<i?i:e.length;if(-1<r){var a=-1<i?i:e.length,l=A(e.slice(r+1,a));for(var s in l)t[s]=l[s]}if(-1<i){var u=A(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var h={prefix:"#!",getPath:function(){switch(h.prefix.charAt(0)){case"#":return e("hash").slice(h.prefix.length);case"?":return e("search").slice(h.prefix.length)+e("hash");default:return e("pathname").slice(h.prefix.length)+e("search")+e("hash")}},setPath:function(e,n,t){var r={},i={};if(e=d(e,r,i),null!=n){for(var o in n)r[o]=n[o];e=e.replace(/:([^\/]+)/g,function(e,t){return delete r[t],n[t]})}var a=p(r);a&&(e+="?"+a);var l=p(i);if(l&&(e+="#"+l),f){var s=t?t.state:null,u=t?t.title:null;c.onpopstate(),t&&t.replace?c.history.replaceState(s,u,h.prefix+e):c.history.pushState(s,u,h.prefix+e)}else c.location.href=h.prefix+e}};return h.defineRoutes=function(l,s,u){function e(){var r=h.getPath(),i={},e=d(r,i,i),t=c.history.state;if(null!=t)for(var n in t)i[n]=t[n];for(var o in l){var a=new RegExp("^"+o.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(a.test(e))return void e.replace(a,function(){for(var e=o.match(/:[^\/]+/g)||[],t=[].slice.call(arguments,1,-2),n=0;n<e.length;n++)i[e[n].replace(/:|\./g,"")]=decodeURIComponent(t[n]);s(l[o],i,r,o)})}u(r,i)}var t;f?c.onpopstate=(t=e,function(){null==n&&(n=r(function(){n=null,t()}))}):"#"===h.prefix.charAt(0)&&(c.onhashchange=e),e()},h};t.route=(a=window,l=i,b=_(a),(x=function(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var o=function(){null!=h&&l.render(e,h(z(v,y.key,y)))},a=function(e){if(e===t)throw new Error("Could not resolve default route "+t);b.setPath(t,null,{replace:!0})};b.defineRoutes(n,function(t,n,r){var i=w=function(e,t){i===w&&(v=null==t||"function"!=typeof t.view&&"function"!=typeof t?"div":t,y=n,g=r,w=null,h=(e.render||function(e){return e}).bind(e),o())};t.view||"function"==typeof t?i({},t):t.onmatch?E.resolve(t.onmatch(n,r)).then(function(e){i(t,e)},a):i(t,"div")},a),l.subscribe(e,o)}).set=function(e,t,n){null!=w&&((n=n||{}).replace=!0),w=null,b.setPath(e,t,n)},x.get=function(){return g},x.prefix=function(e){b.prefix=e},x.link=function(e){e.dom.setAttribute("href",b.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(b.prefix)&&(t=t.slice(b.prefix.length)),x.set(t,void 0,void 0)}}},x.param=function(e){return void 0!==y&&void 0!==e?y[e]:y},x),t.withAttr=function(t,n,r){return function(e){n.call(r||this,t in e.currentTarget?e.currentTarget[t]:e.currentTarget.getAttribute(t))}};var T=r(window);t.render=T.render,t.redraw=i.redraw,t.request=n.request,t.jsonp=n.jsonp,t.parseQueryString=A,t.buildQueryString=p,t.version="1.1.6",t.vnode=z,void 0!==L?L.exports=t:window.m=t}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{timers:9}],8:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:l}catch(e){i=l}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&v())}function v(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||s(v)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],9:[function(s,e,u){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function l(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new l(n.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new l(n.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},u.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},u.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},u._unrefActive=u.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},u.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[t]=!0,r(function(){o[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":8,timers:9}],10:[function(e,t,n){function u(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);n||(n=(t=t.parentElement)&&r(t)),n&&u.show(t,n,!0)})}u.show=function(e,t,l){var s="data-tlite";t=t||{},(e.tooltip||function(e,t){var n,r,i;function o(){u.hide(e,!0)}function a(){n||(n=function(l,e,t){var s=document.createElement("span"),n=t.grav||l.getAttribute("data-tlite")||"n";s.innerHTML=e,l.appendChild(s);var u=n[0]||"",c=n[1]||"";function r(){s.className="tlite tlite-"+u+c;var e=l.offsetTop,t=l.offsetLeft;s.offsetParent===l&&(e=t=0);var n=l.offsetWidth,r=l.offsetHeight,i=s.offsetHeight,o=s.offsetWidth,a=t+n/2;s.style.top=("s"===u?e-i-10:"n"===u?e+r+10:e+r/2-i/2)+"px",s.style.left=("w"===c?t:"e"===c?t+n-o:"w"===u?t+n+10:"e"===u?t-o-10:a-o/2)+"px"}r();var i=s.getBoundingClientRect();"s"===u&&i.top<0?(u="n",r()):"n"===u&&i.bottom>window.innerHeight?(u="s",r()):"e"===u&&i.left<0?(u="w",r()):"w"===u&&i.right>window.innerWidth&&(u="e",r());return s.className+=" tlite-visible",s}(e,i,t))}return e.addEventListener("mousedown",o),e.addEventListener("mouseleave",o),e.tooltip={show:function(){i=e.title||e.getAttribute(s)||i,e.title="",e.setAttribute(s,""),i&&!r&&(r=setTimeout(a,l?150:1))},hide:function(e){if(l===e){r=clearTimeout(r);var t=n&&n.parentNode;t&&t.removeChild(n),n=void 0}}}}(e,t)).show()},u.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=u)},{}],11:[function(e,a,t){!function(e){"use strict";function t(){}var n=t.prototype,r=e.EventEmitter;function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}n.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp)for(n in t={},r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n]);else t=r[e]||(r[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},n.addListener=function(e,t){if(!function e(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&e(t.listener)}(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],t)&&r[n].push(i?t:{listener:t,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,t){var n,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],t))&&i[r].splice(n,1);return this},n.off=i("removeListener"),n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},n.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e);for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},n.trigger=i("emitEvent"),n.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=r,t},"function"==typeof l&&l.amd?l(function(){return t}):"object"==typeof a&&a.exports?a.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=admin.min.js.map
|
assets/js/admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["admin.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_tlite","_tlite2","__esModule","default","m","window","EventEmitter","context","document","getElementById","events","tabs","helpers","settings","el","className","indexOf","ListFetcher","mount","mc4wp","deps","mithril","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","tlite","wolfy87-eventemitter","2","showIfElements","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","addEventListener","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","callNow","clearTimeout","setTimeout","apply","config","JSON","parse","getAttribute","parentElements","inputs","hide","checked","conditionMet","value","visibility","opacity","inputElement","removeAttribute","setAttribute","parentElement","3","$","jQuery","mc4wp_vars","i18n","working","done","mailchimp","api_connected","lists","fetch","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","4","_typeof","Symbol","iterator","constructor","querySelector","listInputs","selectedLists","updateSelectedLists","input","push","trigger","on","rows","searchKey","searchValue","listId","filter","replace","getSelectedLists","5","URL","$context","$tabs","find","$tabNavs","refererField","get","id","_open","tab","updateState","removeClass","css","nav","blur","url","setParameter","href","history","pushState","title","tb_remove","forms","editor","refresh","split","switchTab","tabId","match","urlParams","returnValue","each","substring","first","text","open","click","body","activeTab","replaceState","state","init","./url.js","6","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","7","global","setImmediate","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","normalize","node","isArray","normalizeChildren","selectorParser","selectorCache","hasOwn","isEmpty","object","hyperscript","start","cached","classes","exec","attrValue","compileSelector","normalized","childList","hasAttrs","class","newAttrs","execSelector","html","fragment","attrs1","PromisePolyfill","executor","TypeError","self","resolvers","rejectors","resolveCurrent","rejectCurrent","_instance","callAsync","list","shouldAbsorb","execute","then","console","error","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","next","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","Object","toString","key0","destructure","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","oncompletion","callbackCount","finalizer","complete","finalize","promise0","then0","extra","interpolate","tokens","slice","assemble","querystring","prefix","deserialize","extract","xhr","responseText","cast","type0","request","toUpperCase","useBody","serialize","FormData","stringify","XMLHttpRequest","aborted","_abort","abort","async","user","password","headers","setRequestHeader","withCredentials","onreadystatechange","readyState","response","status","test","send","background","jsonp","callbackName","Math","round","random","script","createElement","parentNode","removeChild","callbackKey","src","documentElement","appendChild","setCompletionCallback","_8","coreRenderer","onevent","$doc","$emptyFragment","createDocumentFragment","nameSpace","svg","math","getNameSpace","vnode","xmlns","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initComponent","insertNode","createComponent","initLifecycle","createTextNode","createHTML","firstChild","childNodes","createFragment","attrs2","is","createElementNS","key2","setAttr","setAttrs","contenteditable","setContentEditable","textContent","selectedIndex","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","child","sentinel","create","$$reentrantLock$$","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","pool","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","isRecyclable","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","shouldNotUpdate","updateLifecycle","nodeValue","updateText","updateFragment","isLifecycleMethod","updateEvent","updateAttrs","updateElement","removeNode","updateComponent","count0","insertBefore","content","result","expected","called","onbeforeremove","continuation","onremove","removeNodeFromDOM","source","oncreate","onupdate","attr","activeElement","nsLastIndex","substr","setAttributeNS","cssText","updateStyle","normalized0","eventName","removeEventListener","oninit","render","active","namespace","namespaceURI","focus","setEventCallback","redrawService","renderService","callbacks","unsubscribe","key1","index","splice","subscribe","last","pending","requestAnimationFrame","now","Date","_11","redrawService0","root","component","render1","attrs3","currentPath","lastUpdate","routeService","route","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","asyncId","supportsPushState","callAsync0","normalize1","fragment0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","router","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","callback0","onhashchange","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","timers","8","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","versions","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","9","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","10","getTooltipOpts","target","opts","isAuto","fallbackAttrib","tooltip","tooltipEl","showTimer","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","offsetParent","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","isAutoHiding","Tooltip","11","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","evt","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EA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AG3BA,EAASA,SAASxlB,MAAMN,KAAMC,GAAQ,MAEhCD,KAAKsnB,uBAClBtnB,KAAKmhB,eAAe8E,EAAKH,EAASA,UAMlD,OAAO9lB,MAMX2lB,EAAMvhB,QAAU2hB,EAAM,aAUtBJ,EAAMtE,KAAO,SAAc4E,GACvB,IAAIhmB,EAAOT,MAAMC,UAAU4O,MAAMhS,KAAK6D,UAAW,GACjD,OAAOF,KAAKonB,UAAUnB,EAAKhmB,IAW/B0lB,EAAM4B,mBAAqB,SAA4BvmB,GAEnD,OADAhB,KAAKwnB,iBAAmBxmB,EACjBhB,MAWX2lB,EAAM2B,oBAAsB,WACxB,OAAItnB,KAAK2H,eAAe,qBACb3H,KAAKwnB,kBAapB7B,EAAMO,WAAa,WACf,OAAOlmB,KAAKmnB,UAAYnnB,KAAKmnB,QAAU,KAQ3ClqB,EAAawqB,WAAa,WAEtB,OADArrB,EAAQa,aAAe2oB,EAChB3oB,GAIW,mBAAX5B,GAAyBA,EAAOqsB,IACvCrsB,EAAO,WACH,OAAO4B,IAGY,iBAAXR,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUa,EAGjBb,EAAQa,aAAeA,EA5d9B,CA8dmB,oBAAXD,OAAyBA,OAASgD,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAlkFX","file":"admin.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n'use strict';\n\n// dependencies\n\nvar _tlite = require('tlite');\n\nvar _tlite2 = _interopRequireDefault(_tlite);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar m = window.m = require('mithril');\nvar EventEmitter = require('wolfy87-eventemitter');\n\n// vars\nvar context = document.getElementById('mc4wp-admin');\nvar events = new EventEmitter();\nvar tabs = require('./admin/tabs.js')(context);\nvar helpers = require('./admin/helpers.js');\nvar settings = require('./admin/settings.js')(context, helpers, events);\n\n(0, _tlite2.default)(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n});\n\n// list fetcher\nvar ListFetcher = require('./admin/list-fetcher.js');\nvar mount = document.getElementById('mc4wp-list-fetcher');\nif (mount) {\n m.mount(mount, new ListFetcher());\n}\n\n// expose some things\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/helpers.js\":2,\"./admin/list-fetcher.js\":3,\"./admin/settings.js\":4,\"./admin/tabs.js\":5,\"mithril\":7,\"tlite\":10,\"wolfy87-eventemitter\":11}],2:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n\tvar elements = document.querySelectorAll(selector);\n\tfor (var i = 0; i < elements.length; i++) {\n\t\tvar show = elements[i].clientHeight <= 0;\n\t\telements[i].style.display = show ? '' : 'none';\n\t}\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n\tif (element.addEventListener) {\n\t\telement.addEventListener(event, handler);\n\t} else if (element.attachEvent) {\n\t\telement.attachEvent('on' + event, handler);\n\t}\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n\tArray.prototype.forEach.call(elements, function (element) {\n\t\thelpers.bindEventToElement(element, event, handler);\n\t});\n};\n\n// polling\nhelpers.debounce = function (func, wait, immediate) {\n\tvar timeout;\n\treturn function () {\n\t\tvar context = this,\n\t\t args = arguments;\n\t\tvar later = function later() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n};\n\n/**\n * Showif.js\n */\n(function () {\n\tvar showIfElements = document.querySelectorAll('[data-showif]');\n\n\t// dependent elements\n\tArray.prototype.forEach.call(showIfElements, function (element) {\n\t\tvar config = JSON.parse(element.getAttribute('data-showif'));\n\t\tvar parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n\t\tvar inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n\t\tvar hide = config.hide === undefined || config.hide;\n\n\t\tfunction toggleElement() {\n\n\t\t\t// do nothing with unchecked radio inputs\n\t\t\tif (this.getAttribute('type') === \"radio\" && !this.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n\t\t\tvar conditionMet = value == config.value;\n\n\t\t\tif (hide) {\n\t\t\t\telement.style.display = conditionMet ? '' : 'none';\n\t\t\t\telement.style.visibility = conditionMet ? '' : 'hidden';\n\t\t\t} else {\n\t\t\t\telement.style.opacity = conditionMet ? '' : '0.4';\n\t\t\t}\n\n\t\t\t// disable input fields to stop sending their values to server\n\t\t\tArray.prototype.forEach.call(inputs, function (inputElement) {\n\t\t\t\tconditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n\t\t\t});\n\t\t}\n\n\t\t// find checked element and call toggleElement function\n\t\tArray.prototype.forEach.call(parentElements, function (parentElement) {\n\t\t\ttoggleElement.call(parentElement);\n\t\t});\n\n\t\t// bind on all changes\n\t\thelpers.bindEventToElements(parentElements, 'change', toggleElement);\n\t});\n})();\n\nmodule.exports = helpers;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false;\n\n // start fetching right away when no lists but api key given\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n\n this.working = true;\n this.done = false;\n\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\",\n timeout: 180000\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar Settings = function Settings(context, helpers, events) {\n\t'use strict';\n\n\t// vars\n\n\tvar form = context.querySelector('form');\n\tvar listInputs = context.querySelectorAll('.mc4wp-list-input');\n\tvar lists = mc4wp_vars.mailchimp.lists;\n\tvar selectedLists = [];\n\n\t// functions\n\tfunction getSelectedListsWhere(searchKey, searchValue) {\n\t\treturn selectedLists.filter(function (el) {\n\t\t\treturn el[searchKey] === searchValue;\n\t\t});\n\t}\n\n\tfunction getSelectedLists() {\n\t\treturn selectedLists;\n\t}\n\n\tfunction updateSelectedLists() {\n\t\tselectedLists = [];\n\n\t\tArray.prototype.forEach.call(listInputs, function (input) {\n\t\t\t// skip unchecked checkboxes\n\t\t\tif (typeof input.checked === \"boolean\" && !input.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_typeof(lists[input.value]) === \"object\") {\n\t\t\t\tselectedLists.push(lists[input.value]);\n\t\t\t}\n\t\t});\n\n\t\tevents.trigger('selectedLists.change', [selectedLists]);\n\t\treturn selectedLists;\n\t}\n\n\tfunction toggleVisibleLists() {\n\t\tvar rows = document.querySelectorAll('.lists--only-selected > *');\n\t\tArray.prototype.forEach.call(rows, function (el) {\n\n\t\t\tvar listId = el.getAttribute('data-list-id');\n\t\t\tvar isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n\t\t\tif (isSelected) {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n\t\t\t} else {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class') + \" hidden\");\n\t\t\t}\n\t\t});\n\t}\n\n\tevents.on('selectedLists.change', toggleVisibleLists);\n\thelpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n\n\tupdateSelectedLists();\n\n\treturn {\n\t\tgetSelectedLists: getSelectedLists\n\t};\n};\n\nmodule.exports = Settings;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js');\n\n// Tabs\nvar Tabs = function Tabs(context) {\n\n\t// TODO: last piece of jQuery... can we get rid of it?\n\tvar $ = window.jQuery;\n\n\tvar $context = $(context);\n\tvar $tabs = $context.find('.tab');\n\tvar $tabNavs = $context.find('.nav-tab');\n\tvar refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n\tvar tabs = [];\n\n\t$.each($tabs, function (i, t) {\n\t\tvar id = t.id.substring(4);\n\t\tvar title = $(t).find('h2').first().text();\n\n\t\ttabs.push({\n\t\t\tid: id,\n\t\t\ttitle: title,\n\t\t\telement: t,\n\t\t\tnav: context.querySelectorAll('.nav-tab-' + id),\n\t\t\topen: function open() {\n\t\t\t\treturn _open(id);\n\t\t\t}\n\t\t});\n\t});\n\n\tfunction get(id) {\n\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tif (tabs[i].id === id) {\n\t\t\t\treturn tabs[i];\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction _open(tab, updateState) {\n\n\t\t// make sure we have a tab object\n\t\tif (typeof tab === \"string\") {\n\t\t\ttab = get(tab);\n\t\t}\n\n\t\tif (!tab) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// should we update state?\n\t\tif (updateState == undefined) {\n\t\t\tupdateState = true;\n\t\t}\n\n\t\t// hide all tabs & remove active class\n\t\t$tabs.removeClass('tab-active').css('display', 'none');\n\t\t$tabNavs.removeClass('nav-tab-active');\n\n\t\t// add `nav-tab-active` to this tab\n\t\tArray.prototype.forEach.call(tab.nav, function (nav) {\n\t\t\tnav.className += \" nav-tab-active\";\n\t\t\tnav.blur();\n\t\t});\n\n\t\t// show target tab\n\t\ttab.element.style.display = 'block';\n\t\ttab.element.className += \" tab-active\";\n\n\t\t// create new URL\n\t\tvar url = URL.setParameter(window.location.href, \"tab\", tab.id);\n\n\t\t// update hash\n\t\tif (history.pushState && updateState) {\n\t\t\thistory.pushState(tab.id, '', url);\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\n\t\t// update referer field\n\t\trefererField.value = url;\n\n\t\t// if thickbox is open, close it.\n\t\tif (typeof tb_remove === \"function\") {\n\t\t\ttb_remove();\n\t\t}\n\n\t\t// refresh editor after switching tabs\n\t\t// TODO: decouple this! law of demeter etc.\n\t\tif (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n\t\t\tmc4wp.forms.editor.refresh();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction title(tab) {\n\t\tvar title = document.title.split('-');\n\t\tdocument.title = document.title.replace(title[0], tab.title + \" \");\n\t}\n\n\tfunction switchTab(e) {\n\t\te = e || window.event;\n\n\t\t// get from data attribute\n\t\tvar tabId = this.getAttribute('data-tab');\n\n\t\t// get from classname\n\t\tif (!tabId) {\n\t\t\tvar match = this.className.match(/nav-tab-(\\w+)?/);\n\t\t\tif (match) {\n\t\t\t\ttabId = match[1];\n\t\t\t}\n\t\t}\n\n\t\t// get from href\n\t\tif (!tabId) {\n\t\t\tvar urlParams = URL.parse(this.href);\n\t\t\tif (!urlParams.tab) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttabId = urlParams.tab;\n\t\t}\n\n\t\tvar opened = _open(tabId);\n\n\t\tif (opened) {\n\t\t\te.preventDefault();\n\t\t\te.returnValue = false;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction init() {\n\n\t\t// check for current tab\n\t\tif (!history.pushState) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar activeTab = $tabs.filter(':visible').get(0);\n\t\tif (!activeTab) {\n\t\t\treturn;\n\t\t}\n\t\tvar tab = get(activeTab.id.substring(4));\n\t\tif (!tab) return;\n\n\t\t// check if tab is in html5 history\n\t\tif (history.replaceState && history.state === null) {\n\t\t\thistory.replaceState(tab.id, '');\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\t}\n\n\t$tabNavs.click(switchTab);\n\t$(document.body).on('click', '.tab-link', switchTab);\n\tinit();\n\n\tif (window.addEventListener && history.pushState) {\n\t\twindow.addEventListener('popstate', function (e) {\n\t\t\tif (!e.state) return true;\n\t\t\tvar tabId = e.state;\n\t\t\treturn _open(tabId, false);\n\t\t});\n\t}\n\n\treturn {\n\t\topen: _open,\n\t\tget: get\n\t};\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":6}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n\tparse: function parse(url) {\n\t\tvar query = {};\n\t\tvar a = url.split('&');\n\t\tfor (var i in a) {\n\t\t\tif (!a.hasOwnProperty(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar b = a[i].split('=');\n\t\t\tquery[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n\t\t}\n\n\t\treturn query;\n\t},\n\tbuild: function build(data) {\n\t\tvar ret = [];\n\t\tfor (var d in data) {\n\t\t\tret.push(d + \"=\" + encodeURIComponent(data[d]));\n\t\t}return ret.join(\"&\");\n\t},\n\tsetParameter: function setParameter(url, key, value) {\n\t\tvar data = URL.parse(url);\n\t\tdata[key] = value;\n\t\treturn URL.build(data);\n\t}\n};\n\nmodule.exports = URL;\n\n},{}],7:[function(require,module,exports){\n(function (global,setImmediate){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\t\tfor(var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) {\n\t\t\t\tnewAttrs[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty(\"Content-Type\"))) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty(\"Accept\"))) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tns = getNameSpace(vnode) || ns\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\tif (key2 === \"value\") {\n\t\t\t\tvar normalized0 = \"\" + value // eslint-disable-line no-implicit-coercion\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\") {\n\t\t\t\t\tif (value === null) {\n\t\t\t\t\t\tif (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old != null && vnode.dom.value === normalized0) return\n\t\t\t}\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\tvar namespace = dom.namespaceURI\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\tdom.vnodes = vnodes\n\t\t// document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n\t\tif (active != null && $doc.activeElement !== active) active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw === false) e.redraw = undefined\n\t\telse redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.6\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},require(\"timers\").setImmediate)\n},{\"timers\":9}],8:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],9:[function(require,module,exports){\n(function (setImmediate,clearImmediate){\nvar nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};\n}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":8,\"timers\":9}],10:[function(require,module,exports){\nfunction tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n\n},{}],11:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.5 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n })();"]}
|
1 |
+
{"version":3,"sources":["admin.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_tlite","__esModule","default","m","window","EventEmitter","context","document","getElementById","events","tabs","helpers","settings","el","className","indexOf","ListFetcher","mount","mc4wp","deps","mithril","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","tlite","wolfy87-eventemitter","2","showIfElements","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","addEventListener","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","callNow","clearTimeout","setTimeout","apply","config","JSON","parse","getAttribute","parentElements","inputs","hide","checked","conditionMet","value","visibility","opacity","inputElement","removeAttribute","setAttribute","parentElement","3","$","jQuery","mc4wp_vars","i18n","working","done","mailchimp","api_connected","lists","fetch","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","4","_typeof","Symbol","iterator","constructor","querySelector","listInputs","selectedLists","updateSelectedLists","input","push","trigger","on","rows","searchKey","searchValue","listId","filter","replace","getSelectedLists","5","URL","$context","$tabs","find","$tabNavs","refererField","get","id","_open","tab","updateState","removeClass","css","nav","blur","url","setParameter","href","history","pushState","title","tb_remove","forms","editor","refresh","split","switchTab","tabId","match","urlParams","returnValue","each","substring","first","text","open","click","body","activeTab","replaceState","state","init","./url.js","6","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","7","global","setImmediate","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","normalize","node","isArray","normalizeChildren","selectorParser","selectorCache","hasOwn","isEmpty","object","hyperscript","start","cached","classes","exec","attrValue","compileSelector","normalized","childList","hasAttrs","class","newAttrs","execSelector","html","fragment","attrs1","PromisePolyfill","executor","TypeError","self","resolvers","rejectors","resolveCurrent","rejectCurrent","_instance","callAsync","list","shouldAbsorb","execute","then","console","error","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","next","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","Object","toString","key0","destructure","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","oncompletion","callbackCount","finalizer","complete","finalize","promise0","then0","extra","interpolate","tokens","slice","assemble","querystring","prefix","deserialize","extract","xhr","responseText","cast","type0","request","toUpperCase","useBody","serialize","FormData","stringify","XMLHttpRequest","aborted","_abort","abort","async","user","password","headers","setRequestHeader","withCredentials","onreadystatechange","readyState","response","status","test","send","background","jsonp","callbackName","Math","round","random","script","createElement","parentNode","removeChild","callbackKey","src","documentElement","appendChild","setCompletionCallback","_8","coreRenderer","onevent","$doc","$emptyFragment","createDocumentFragment","nameSpace","svg","math","getNameSpace","vnode","xmlns","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initComponent","insertNode","createComponent","initLifecycle","createTextNode","createHTML","firstChild","childNodes","createFragment","attrs2","is","createElementNS","key2","setAttr","setAttrs","contenteditable","setContentEditable","textContent","selectedIndex","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","child","sentinel","create","$$reentrantLock$$","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","pool","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","isRecyclable","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","shouldNotUpdate","updateLifecycle","nodeValue","updateText","updateFragment","isLifecycleMethod","updateEvent","updateAttrs","updateElement","removeNode","updateComponent","count0","insertBefore","content","result","expected","called","onbeforeremove","continuation","onremove","removeNodeFromDOM","source","oncreate","onupdate","attr","activeElement","nsLastIndex","substr","setAttributeNS","cssText","updateStyle","normalized0","eventName","removeEventListener","oninit","render","active","namespace","namespaceURI","focus","setEventCallback","redrawService","renderService","callbacks","unsubscribe","key1","index","splice","subscribe","last","pending","requestAnimationFrame","now","Date","_11","redrawService0","root","component","render1","attrs3","currentPath","lastUpdate","routeService","route","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","asyncId","supportsPushState","callAsync0","normalize1","fragment0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","router","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","callback0","onhashchange","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","timers","8","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","versions","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","9","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","10","getTooltipOpts","target","opts","isAuto","fallbackAttrib","tooltip","tooltipEl","showTimer","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","offsetParent","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","isAutoHiding","Tooltip","11","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","evt","_getEvents","flattenListeners","flatListeners","getListenersAsObject","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,E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,MAMX2lB,EAAMvhB,QAAU2hB,EAAM,aAUtBJ,EAAMtE,KAAO,SAAc4E,GACvB,IAAIhmB,EAAOT,MAAMC,UAAU4O,MAAM/R,KAAK4D,UAAW,GACjD,OAAOF,KAAKonB,UAAUnB,EAAKhmB,IAW/B0lB,EAAM4B,mBAAqB,SAA4BvmB,GAEnD,OADAhB,KAAKwnB,iBAAmBxmB,EACjBhB,MAWX2lB,EAAM2B,oBAAsB,WACxB,OAAItnB,KAAK2H,eAAe,qBACb3H,KAAKwnB,kBAapB7B,EAAMO,WAAa,WACf,OAAOlmB,KAAKmnB,UAAYnnB,KAAKmnB,QAAU,KAQ3ClqB,EAAawqB,WAAa,WAEtB,OADAprB,EAAQY,aAAe2oB,EAChB3oB,GAIW,mBAAX3B,GAAyBA,EAAOosB,IACvCpsB,EAAO,WACH,OAAO2B,IAGY,iBAAXP,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUY,EAGjBZ,EAAQY,aAAeA,EA5d9B,CA8dmB,oBAAXD,OAAyBA,OAASgD,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAjjFX","file":"admin.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n'use strict'; // dependencies\n\nvar _tlite = _interopRequireDefault(require(\"tlite\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar m = window.m = require('mithril');\n\nvar EventEmitter = require('wolfy87-eventemitter'); // vars\n\n\nvar context = document.getElementById('mc4wp-admin');\nvar events = new EventEmitter();\n\nvar tabs = require('./admin/tabs.js')(context);\n\nvar helpers = require('./admin/helpers.js');\n\nvar settings = require('./admin/settings.js')(context, helpers, events);\n\n(0, _tlite.default)(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n}); // list fetcher\n\nvar ListFetcher = require('./admin/list-fetcher.js');\n\nvar mount = document.getElementById('mc4wp-list-fetcher');\n\nif (mount) {\n m.mount(mount, new ListFetcher());\n} // expose some things\n\n\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/helpers.js\":2,\"./admin/list-fetcher.js\":3,\"./admin/settings.js\":4,\"./admin/tabs.js\":5,\"mithril\":7,\"tlite\":10,\"wolfy87-eventemitter\":11}],2:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n var elements = document.querySelectorAll(selector);\n\n for (var i = 0; i < elements.length; i++) {\n var show = elements[i].clientHeight <= 0;\n elements[i].style.display = show ? '' : 'none';\n }\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n if (element.addEventListener) {\n element.addEventListener(event, handler);\n } else if (element.attachEvent) {\n element.attachEvent('on' + event, handler);\n }\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n Array.prototype.forEach.call(elements, function (element) {\n helpers.bindEventToElement(element, event, handler);\n });\n}; // polling\n\n\nhelpers.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n/**\n * Showif.js\n */\n\n\n(function () {\n var showIfElements = document.querySelectorAll('[data-showif]'); // dependent elements\n\n Array.prototype.forEach.call(showIfElements, function (element) {\n var config = JSON.parse(element.getAttribute('data-showif'));\n var parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n var inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n var hide = config.hide === undefined || config.hide;\n\n function toggleElement() {\n // do nothing with unchecked radio inputs\n if (this.getAttribute('type') === \"radio\" && !this.checked) {\n return;\n }\n\n var value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n var conditionMet = value == config.value;\n\n if (hide) {\n element.style.display = conditionMet ? '' : 'none';\n element.style.visibility = conditionMet ? '' : 'hidden';\n } else {\n element.style.opacity = conditionMet ? '' : '0.4';\n } // disable input fields to stop sending their values to server\n\n\n Array.prototype.forEach.call(inputs, function (inputElement) {\n conditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n });\n } // find checked element and call toggleElement function\n\n\n Array.prototype.forEach.call(parentElements, function (parentElement) {\n toggleElement.call(parentElement);\n }); // bind on all changes\n\n helpers.bindEventToElements(parentElements, 'change', toggleElement);\n });\n})();\n\nmodule.exports = helpers;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false; // start fetching right away when no lists but api key given\n\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n this.working = true;\n this.done = false;\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\",\n timeout: 180000\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],4:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Settings = function Settings(context, helpers, events) {\n 'use strict'; // vars\n\n var form = context.querySelector('form');\n var listInputs = context.querySelectorAll('.mc4wp-list-input');\n var lists = mc4wp_vars.mailchimp.lists;\n var selectedLists = []; // functions\n\n function getSelectedListsWhere(searchKey, searchValue) {\n return selectedLists.filter(function (el) {\n return el[searchKey] === searchValue;\n });\n }\n\n function getSelectedLists() {\n return selectedLists;\n }\n\n function updateSelectedLists() {\n selectedLists = [];\n Array.prototype.forEach.call(listInputs, function (input) {\n // skip unchecked checkboxes\n if (typeof input.checked === \"boolean\" && !input.checked) {\n return;\n }\n\n if (_typeof(lists[input.value]) === \"object\") {\n selectedLists.push(lists[input.value]);\n }\n });\n events.trigger('selectedLists.change', [selectedLists]);\n return selectedLists;\n }\n\n function toggleVisibleLists() {\n var rows = document.querySelectorAll('.lists--only-selected > *');\n Array.prototype.forEach.call(rows, function (el) {\n var listId = el.getAttribute('data-list-id');\n var isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n if (isSelected) {\n el.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n } else {\n el.setAttribute('class', el.getAttribute('class') + \" hidden\");\n }\n });\n }\n\n events.on('selectedLists.change', toggleVisibleLists);\n helpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n updateSelectedLists();\n return {\n getSelectedLists: getSelectedLists\n };\n};\n\nmodule.exports = Settings;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js'); // Tabs\n\n\nvar Tabs = function Tabs(context) {\n // TODO: last piece of jQuery... can we get rid of it?\n var $ = window.jQuery;\n var $context = $(context);\n var $tabs = $context.find('.tab');\n var $tabNavs = $context.find('.nav-tab');\n var refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n var tabs = [];\n $.each($tabs, function (i, t) {\n var id = t.id.substring(4);\n var title = $(t).find('h2').first().text();\n tabs.push({\n id: id,\n title: title,\n element: t,\n nav: context.querySelectorAll('.nav-tab-' + id),\n open: function open() {\n return _open(id);\n }\n });\n });\n\n function get(id) {\n for (var i = 0; i < tabs.length; i++) {\n if (tabs[i].id === id) {\n return tabs[i];\n }\n }\n\n return undefined;\n }\n\n function _open(tab, updateState) {\n // make sure we have a tab object\n if (typeof tab === \"string\") {\n tab = get(tab);\n }\n\n if (!tab) {\n return false;\n } // should we update state?\n\n\n if (updateState == undefined) {\n updateState = true;\n } // hide all tabs & remove active class\n\n\n $tabs.removeClass('tab-active').css('display', 'none');\n $tabNavs.removeClass('nav-tab-active'); // add `nav-tab-active` to this tab\n\n Array.prototype.forEach.call(tab.nav, function (nav) {\n nav.className += \" nav-tab-active\";\n nav.blur();\n }); // show target tab\n\n tab.element.style.display = 'block';\n tab.element.className += \" tab-active\"; // create new URL\n\n var url = URL.setParameter(window.location.href, \"tab\", tab.id); // update hash\n\n if (history.pushState && updateState) {\n history.pushState(tab.id, '', url);\n } // update document title\n\n\n title(tab); // update referer field\n\n refererField.value = url; // if thickbox is open, close it.\n\n if (typeof tb_remove === \"function\") {\n tb_remove();\n } // refresh editor after switching tabs\n // TODO: decouple this! law of demeter etc.\n\n\n if (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n mc4wp.forms.editor.refresh();\n }\n\n return true;\n }\n\n function title(tab) {\n var title = document.title.split('-');\n document.title = document.title.replace(title[0], tab.title + \" \");\n }\n\n function switchTab(e) {\n e = e || window.event; // get from data attribute\n\n var tabId = this.getAttribute('data-tab'); // get from classname\n\n if (!tabId) {\n var match = this.className.match(/nav-tab-(\\w+)?/);\n\n if (match) {\n tabId = match[1];\n }\n } // get from href\n\n\n if (!tabId) {\n var urlParams = URL.parse(this.href);\n\n if (!urlParams.tab) {\n return;\n }\n\n tabId = urlParams.tab;\n }\n\n var opened = _open(tabId);\n\n if (opened) {\n e.preventDefault();\n e.returnValue = false;\n return false;\n }\n\n return true;\n }\n\n function init() {\n // check for current tab\n if (!history.pushState) {\n return;\n }\n\n var activeTab = $tabs.filter(':visible').get(0);\n\n if (!activeTab) {\n return;\n }\n\n var tab = get(activeTab.id.substring(4));\n if (!tab) return; // check if tab is in html5 history\n\n if (history.replaceState && history.state === null) {\n history.replaceState(tab.id, '');\n } // update document title\n\n\n title(tab);\n }\n\n $tabNavs.click(switchTab);\n $(document.body).on('click', '.tab-link', switchTab);\n init();\n\n if (window.addEventListener && history.pushState) {\n window.addEventListener('popstate', function (e) {\n if (!e.state) return true;\n var tabId = e.state;\n return _open(tabId, false);\n });\n }\n\n return {\n open: _open,\n get: get\n };\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":6}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n parse: function parse(url) {\n var query = {};\n var a = url.split('&');\n\n for (var i in a) {\n if (!a.hasOwnProperty(i)) {\n continue;\n }\n\n var b = a[i].split('=');\n query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n }\n\n return query;\n },\n build: function build(data) {\n var ret = [];\n\n for (var d in data) {\n ret.push(d + \"=\" + encodeURIComponent(data[d]));\n }\n\n return ret.join(\"&\");\n },\n setParameter: function setParameter(url, key, value) {\n var data = URL.parse(url);\n data[key] = value;\n return URL.build(data);\n }\n};\nmodule.exports = URL;\n\n},{}],7:[function(require,module,exports){\n(function (global,setImmediate){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\t\tfor(var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) {\n\t\t\t\tnewAttrs[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty(\"Content-Type\"))) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty(\"Accept\"))) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tns = getNameSpace(vnode) || ns\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\tif (key2 === \"value\") {\n\t\t\t\tvar normalized0 = \"\" + value // eslint-disable-line no-implicit-coercion\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\") {\n\t\t\t\t\tif (value === null) {\n\t\t\t\t\t\tif (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old != null && vnode.dom.value === normalized0) return\n\t\t\t}\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\tvar namespace = dom.namespaceURI\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\tdom.vnodes = vnodes\n\t\t// document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n\t\tif (active != null && $doc.activeElement !== active) active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw === false) e.redraw = undefined\n\t\telse redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.6\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},require(\"timers\").setImmediate)\n},{\"timers\":9}],8:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],9:[function(require,module,exports){\n(function (setImmediate,clearImmediate){\nvar nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};\n}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":8,\"timers\":9}],10:[function(require,module,exports){\nfunction tlite(getTooltipOpts) {\n document.addEventListener('mouseover', function (e) {\n var el = e.target;\n var opts = getTooltipOpts(el);\n\n if (!opts) {\n el = el.parentElement;\n opts = el && getTooltipOpts(el);\n }\n\n opts && tlite.show(el, opts, true);\n });\n}\n\ntlite.show = function (el, opts, isAuto) {\n var fallbackAttrib = 'data-tlite';\n opts = opts || {};\n\n (el.tooltip || Tooltip(el, opts)).show();\n\n function Tooltip(el, opts) {\n var tooltipEl;\n var showTimer;\n var text;\n\n el.addEventListener('mousedown', autoHide);\n el.addEventListener('mouseleave', autoHide);\n\n function show() {\n text = el.title || el.getAttribute(fallbackAttrib) || text;\n el.title = '';\n el.setAttribute(fallbackAttrib, '');\n text && !showTimer && (showTimer = setTimeout(fadeIn, isAuto ? 150 : 1))\n }\n\n function autoHide() {\n tlite.hide(el, true);\n }\n\n function hide(isAutoHiding) {\n if (isAuto === isAutoHiding) {\n showTimer = clearTimeout(showTimer);\n var parent = tooltipEl && tooltipEl.parentNode;\n parent && parent.removeChild(tooltipEl);\n tooltipEl = undefined;\n }\n }\n\n function fadeIn() {\n if (!tooltipEl) {\n tooltipEl = createTooltip(el, text, opts);\n }\n }\n\n return el.tooltip = {\n show: show,\n hide: hide\n };\n }\n\n function createTooltip(el, text, opts) {\n var tooltipEl = document.createElement('span');\n var grav = opts.grav || el.getAttribute('data-tlite') || 'n';\n\n tooltipEl.innerHTML = text;\n\n el.appendChild(tooltipEl);\n\n var vertGrav = grav[0] || '';\n var horzGrav = grav[1] || '';\n\n function positionTooltip() {\n tooltipEl.className = 'tlite ' + 'tlite-' + vertGrav + horzGrav;\n\n var arrowSize = 10;\n var top = el.offsetTop;\n var left = el.offsetLeft;\n\n if (tooltipEl.offsetParent === el) {\n top = left = 0;\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var tooltipHeight = tooltipEl.offsetHeight;\n var tooltipWidth = tooltipEl.offsetWidth;\n var centerEl = left + (width / 2);\n\n tooltipEl.style.top = (\n vertGrav === 's' ? (top - tooltipHeight - arrowSize) :\n vertGrav === 'n' ? (top + height + arrowSize) :\n (top + (height / 2) - (tooltipHeight / 2))\n ) + 'px';\n\n tooltipEl.style.left = (\n horzGrav === 'w' ? left :\n horzGrav === 'e' ? left + width - tooltipWidth :\n vertGrav === 'w' ? (left + width + arrowSize) :\n vertGrav === 'e' ? (left - tooltipWidth - arrowSize) :\n (centerEl - tooltipWidth / 2)\n ) + 'px';\n }\n\n positionTooltip();\n\n var rect = tooltipEl.getBoundingClientRect();\n\n if (vertGrav === 's' && rect.top < 0) {\n vertGrav = 'n';\n positionTooltip();\n } else if (vertGrav === 'n' && rect.bottom > window.innerHeight) {\n vertGrav = 's';\n positionTooltip();\n } else if (vertGrav === 'e' && rect.left < 0) {\n vertGrav = 'w';\n positionTooltip();\n } else if (vertGrav === 'w' && rect.right > window.innerWidth) {\n vertGrav = 'e';\n positionTooltip();\n }\n\n tooltipEl.className += ' tlite-visible';\n\n return tooltipEl;\n }\n};\n\ntlite.hide = function (el, isAuto) {\n el.tooltip && el.tooltip.hide(isAuto);\n};\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = tlite;\n}\n\n},{}],11:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.5 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n })();"]}
|
assets/js/forms-admin.js
CHANGED
@@ -2,219 +2,220 @@
|
|
2 |
'use strict';
|
3 |
|
4 |
var rows = function rows(m, i18n) {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
142 |
};
|
143 |
|
144 |
module.exports = rows;
|
145 |
|
146 |
},{}],2:[function(require,module,exports){
|
147 |
-
|
148 |
|
149 |
var forms = function forms(m, i18n) {
|
150 |
-
|
151 |
-
var rows = require('./field-forms-rows.js')(m, i18n);
|
152 |
|
153 |
-
|
154 |
-
forms.render = function (config) {
|
155 |
|
156 |
-
var type = config.type();
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
case 'checkbox':
|
166 |
-
return forms.choice(config);
|
167 |
-
break;
|
168 |
-
}
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
|
|
173 |
|
174 |
-
forms.text = function (config) {
|
175 |
-
return [rows.label(config), rows.placeholder(config), rows.value(config), rows.isRequired(config), rows.useParagraphs(config)];
|
176 |
-
};
|
177 |
|
178 |
-
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
-
|
|
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
|
191 |
-
|
192 |
-
};
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
config.wrap(false);
|
198 |
|
199 |
-
|
200 |
-
|
201 |
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
|
|
205 |
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
|
217 |
-
|
218 |
};
|
219 |
|
220 |
module.exports = forms;
|
@@ -225,517 +226,524 @@ module.exports = forms;
|
|
225 |
var htmlutil = require('html');
|
226 |
|
227 |
var setAttributes = function setAttributes(vnode) {
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
};
|
240 |
|
241 |
var g = function g(m) {
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
hasSelection = true;
|
260 |
-
}
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
}
|
344 |
-
|
345 |
-
if (config.max()) {
|
346 |
-
attributes.max = config.max();
|
347 |
-
}
|
348 |
-
|
349 |
-
if (config.value().length > 0) {
|
350 |
-
attributes.value = config.value();
|
351 |
-
}
|
352 |
-
|
353 |
-
if (config.placeholder().length > 0) {
|
354 |
-
attributes.placeholder = config.placeholder();
|
355 |
-
}
|
356 |
-
|
357 |
-
attributes.required = config.required();
|
358 |
-
attributes.oncreate = setAttributes;
|
359 |
-
|
360 |
-
return m('input', attributes);
|
361 |
-
};
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Generates an HTML string based on a field (config) object
|
365 |
-
*
|
366 |
-
* @param config
|
367 |
-
* @returns {*}
|
368 |
-
*/
|
369 |
-
function generate(config) {
|
370 |
-
var label = void 0,
|
371 |
-
field = void 0,
|
372 |
-
htmlTemplate = void 0,
|
373 |
-
html = void 0,
|
374 |
-
vdom = document.createElement('div');
|
375 |
-
|
376 |
-
label = config.label().length > 0 && config.showLabel() ? m("label", {}, config.label()) : '';
|
377 |
-
field = typeof generators[config.type()] === "function" ? generators[config.type()](config) : generators['default'](config);
|
378 |
-
htmlTemplate = config.wrap() ? m('p', [label, field]) : [label, field];
|
379 |
-
|
380 |
-
// render in vdom
|
381 |
-
m.render(vdom, htmlTemplate);
|
382 |
-
|
383 |
-
// prettify html
|
384 |
-
html = htmlutil.prettyPrint(vdom.innerHTML);
|
385 |
-
|
386 |
-
return html + "\n";
|
387 |
-
}
|
388 |
|
389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
};
|
391 |
|
392 |
module.exports = g;
|
393 |
|
394 |
},{"html":22}],4:[function(require,module,exports){
|
395 |
-
|
396 |
|
397 |
var FieldHelper = function FieldHelper(m, tabs, editor, fields, events, i18n) {
|
398 |
-
|
399 |
|
400 |
-
|
401 |
-
var overlay = require('./overlay.js')(m, i18n);
|
402 |
-
var forms = require('./field-forms.js')(m, i18n);
|
403 |
-
var fieldConfig;
|
404 |
|
405 |
-
|
406 |
|
407 |
-
|
408 |
-
* Choose a field to open the helper form for
|
409 |
-
*
|
410 |
-
* @param index
|
411 |
-
* @returns {*}
|
412 |
-
*/
|
413 |
-
function setActiveField(index) {
|
414 |
|
415 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
|
417 |
-
|
418 |
-
|
419 |
-
fieldConfig.value(fieldConfig.choices().map(function (c) {
|
420 |
-
return c.label();
|
421 |
-
}).join('|'));
|
422 |
-
}
|
423 |
|
424 |
-
|
425 |
-
|
|
|
|
|
|
|
426 |
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
|
|
431 |
|
432 |
-
/**
|
433 |
-
* Create HTML based on current config object
|
434 |
-
*/
|
435 |
-
function createFieldHTMLAndAddToForm() {
|
436 |
|
437 |
-
|
438 |
-
|
|
|
|
|
439 |
|
440 |
-
// add to editor
|
441 |
-
editor.insert(html);
|
442 |
|
443 |
-
|
444 |
-
|
|
|
445 |
|
446 |
-
|
447 |
-
m.redraw();
|
448 |
-
}
|
449 |
|
450 |
-
|
451 |
-
* View
|
452 |
-
* @returns {*}
|
453 |
-
*/
|
454 |
-
function view() {
|
455 |
|
456 |
-
|
457 |
-
|
458 |
-
|
|
|
|
|
|
|
459 |
|
460 |
-
var fieldsChoice = m("div.available-fields.small-margin", [m("h4", i18n.chooseField), fieldCategories.map(function (category) {
|
461 |
-
var categoryFields = availableFields.filter(function (f) {
|
462 |
-
return f.category === category;
|
463 |
-
});
|
464 |
|
465 |
-
|
466 |
-
|
467 |
-
|
|
|
|
|
|
|
|
|
|
|
468 |
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
categoryFields.map(function (field) {
|
473 |
-
var className = "button";
|
474 |
-
if (field.forceRequired()) {
|
475 |
-
className += " is-required";
|
476 |
-
}
|
477 |
-
|
478 |
-
var inForm = field.inFormContent();
|
479 |
-
if (inForm !== null) {
|
480 |
-
className += " " + (inForm ? 'in-form' : 'not-in-form');
|
481 |
-
}
|
482 |
-
|
483 |
-
return m("button", {
|
484 |
-
className: className,
|
485 |
-
type: 'button',
|
486 |
-
onclick: m.withAttr("value", setActiveField),
|
487 |
-
value: field.index
|
488 |
-
}, field.title());
|
489 |
-
})]);
|
490 |
-
})]);
|
491 |
-
|
492 |
-
// build DOM for overlay
|
493 |
-
var form = null;
|
494 |
-
if (fieldConfig) {
|
495 |
-
form = m(overlay(
|
496 |
-
// field wizard
|
497 |
-
m("div.field-wizard", [
|
498 |
-
|
499 |
-
//heading
|
500 |
-
m("h3", [fieldConfig.title(), fieldConfig.forceRequired() ? m('span.red', '*') : '', fieldConfig.name().length ? m("code", fieldConfig.name()) : '']),
|
501 |
-
|
502 |
-
// help text
|
503 |
-
fieldConfig.help().length ? m('p', m.trust(fieldConfig.help())) : '',
|
504 |
-
|
505 |
-
// actual form
|
506 |
-
forms.render(fieldConfig),
|
507 |
-
|
508 |
-
// add to form button
|
509 |
-
m("p", [m("button", {
|
510 |
-
"class": "button-primary",
|
511 |
-
type: "button",
|
512 |
-
onkeydown: function onkeydown(e) {
|
513 |
-
e = e || window.event;
|
514 |
-
if (e.keyCode == 13) {
|
515 |
-
createFieldHTMLAndAddToForm();
|
516 |
-
}
|
517 |
-
},
|
518 |
-
onclick: createFieldHTMLAndAddToForm
|
519 |
-
}, i18n.addToForm)])]), setActiveField));
|
520 |
-
}
|
521 |
|
522 |
-
|
523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
};
|
531 |
|
532 |
module.exports = FieldHelper;
|
533 |
|
534 |
},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(require,module,exports){
|
535 |
-
|
536 |
|
537 |
var FieldFactory = function FieldFactory(fields, i18n) {
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
|
585 |
-
return typeof map[type] !== "undefined" ? map[type] : type;
|
586 |
-
}
|
587 |
-
|
588 |
-
/**
|
589 |
-
* Register the various fields for a merge var
|
590 |
-
*
|
591 |
-
* @param mergeField
|
592 |
-
* @returns {boolean}
|
593 |
-
*/
|
594 |
-
function registerMergeField(mergeField) {
|
595 |
-
|
596 |
-
var category = i18n.listFields;
|
597 |
-
var fieldType = getFieldType(mergeField.field_type);
|
598 |
-
|
599 |
-
// name, type, title, value, required, label, placeholder, choices, wrap
|
600 |
-
var data = {
|
601 |
-
name: mergeField.tag,
|
602 |
-
title: mergeField.name,
|
603 |
-
required: mergeField.required,
|
604 |
-
forceRequired: mergeField.required,
|
605 |
-
type: fieldType,
|
606 |
-
choices: mergeField.choices,
|
607 |
-
acceptsMultipleValues: false // merge fields never accept multiple values.
|
608 |
-
};
|
609 |
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
}
|
641 |
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
|
|
654 |
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
|
659 |
-
|
660 |
-
|
661 |
|
662 |
-
|
663 |
-
list.merge_fields.forEach(registerMergeField);
|
664 |
|
665 |
-
|
666 |
-
|
667 |
-
|
|
|
|
|
|
|
|
|
668 |
|
669 |
-
/**
|
670 |
-
* Register all lists fields
|
671 |
-
*
|
672 |
-
* @param lists
|
673 |
-
*/
|
674 |
-
function registerListsFields(lists) {
|
675 |
-
reset();
|
676 |
-
lists.forEach(registerListFields);
|
677 |
-
}
|
678 |
|
679 |
-
|
|
|
|
|
|
|
680 |
|
681 |
-
|
682 |
-
|
|
|
683 |
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
}, true);
|
691 |
|
692 |
-
|
693 |
-
choices = {};
|
694 |
-
for (var key in lists) {
|
695 |
-
choices[lists[key].id] = lists[key].name;
|
696 |
-
}
|
697 |
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
title: i18n.listChoice,
|
702 |
-
choices: choices,
|
703 |
-
help: i18n.listChoiceDescription,
|
704 |
-
acceptsMultipleValues: true
|
705 |
-
}, true);
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
}, true);
|
719 |
-
|
720 |
-
register(category, {
|
721 |
-
name: 'AGREE_TO_TERMS',
|
722 |
-
value: 1,
|
723 |
-
type: "terms-checkbox",
|
724 |
-
label: i18n.agreeToTerms,
|
725 |
-
title: i18n.agreeToTermsShort,
|
726 |
-
showLabel: false,
|
727 |
-
required: true
|
728 |
-
}, true);
|
729 |
-
}
|
730 |
-
|
731 |
-
/**
|
732 |
-
* Expose some methods
|
733 |
-
*/
|
734 |
-
return {
|
735 |
-
'registerCustomFields': registerCustomFields,
|
736 |
-
'registerListFields': registerListFields,
|
737 |
-
'registerListsFields': registerListsFields
|
738 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
};
|
740 |
|
741 |
module.exports = FieldFactory;
|
@@ -746,435 +754,444 @@ module.exports = FieldFactory;
|
|
746 |
var prop = require("mithril/stream");
|
747 |
|
748 |
module.exports = function (m, events) {
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
}
|
792 |
-
}
|
793 |
-
|
794 |
-
return choice;
|
795 |
-
}));
|
796 |
-
};
|
797 |
-
};
|
798 |
|
799 |
-
|
800 |
-
|
801 |
-
*
|
802 |
-
* @param data
|
803 |
-
* @constructor
|
804 |
-
*/
|
805 |
-
var FieldChoice = function FieldChoice(data) {
|
806 |
-
this.label = prop(data.label);
|
807 |
-
this.title = prop(data.title || data.label);
|
808 |
-
this.selected = prop(data.selected || false);
|
809 |
-
this.value = prop(data.value || data.label);
|
810 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
811 |
|
812 |
-
/**
|
813 |
-
* Creates FieldChoice objects from an (associative) array of data objects
|
814 |
-
*
|
815 |
-
* @param data
|
816 |
-
* @returns {Array}
|
817 |
-
*/
|
818 |
-
function createChoices(data) {
|
819 |
-
var choices = [];
|
820 |
-
if (typeof data.map === "function") {
|
821 |
-
choices = data.map(function (choiceLabel) {
|
822 |
-
return new FieldChoice({ label: choiceLabel });
|
823 |
-
});
|
824 |
-
} else {
|
825 |
-
choices = Object.keys(data).map(function (key) {
|
826 |
-
var choiceLabel = data[key];
|
827 |
-
return new FieldChoice({ label: choiceLabel, value: key });
|
828 |
-
});
|
829 |
-
}
|
830 |
|
831 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
}
|
833 |
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
|
|
843 |
|
844 |
-
var field;
|
845 |
-
var existingField = getAllWhere('name', data.name).shift();
|
846 |
|
847 |
-
|
848 |
-
|
|
|
849 |
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
|
|
854 |
|
855 |
-
// bail
|
856 |
-
return undefined;
|
857 |
-
}
|
858 |
|
859 |
-
|
860 |
-
|
861 |
-
data.choices = createChoices(data.choices);
|
862 |
|
863 |
-
if (data.value) {
|
864 |
-
data.choices = data.choices.map(function (choice) {
|
865 |
-
if (choice.value() === data.value) {
|
866 |
-
choice.selected(true);
|
867 |
-
}
|
868 |
-
return choice;
|
869 |
-
});
|
870 |
-
}
|
871 |
-
}
|
872 |
|
873 |
-
|
874 |
-
|
875 |
-
categories.push(category);
|
876 |
-
}
|
877 |
|
878 |
-
|
879 |
-
|
880 |
-
|
|
|
|
|
881 |
|
882 |
-
|
883 |
-
|
|
|
|
|
884 |
|
885 |
-
// redraw view
|
886 |
-
timeout && window.clearTimeout(timeout);
|
887 |
-
timeout = window.setTimeout(m.redraw, 200);
|
888 |
|
889 |
-
|
890 |
-
|
|
|
891 |
|
892 |
-
return field;
|
893 |
-
}
|
894 |
|
895 |
-
|
896 |
-
|
897 |
-
*
|
898 |
-
* @param field
|
899 |
-
*/
|
900 |
-
function deregister(field) {
|
901 |
-
var index = fields.indexOf(field);
|
902 |
-
if (index > -1) {
|
903 |
-
delete fields[index];
|
904 |
-
m.redraw();
|
905 |
-
}
|
906 |
-
}
|
907 |
|
908 |
-
|
909 |
-
* Get a field config object
|
910 |
-
*
|
911 |
-
* @param name
|
912 |
-
* @returns {*}
|
913 |
-
*/
|
914 |
-
function get(name) {
|
915 |
-
return fields[name];
|
916 |
-
}
|
917 |
|
918 |
-
|
919 |
-
|
920 |
-
*
|
921 |
-
* @returns {Array|*}
|
922 |
-
*/
|
923 |
-
function getAll() {
|
924 |
-
// rebuild index property on all fields
|
925 |
-
fields = fields.map(function (f, i) {
|
926 |
-
f.index = i;
|
927 |
-
return f;
|
928 |
-
});
|
929 |
|
930 |
-
|
931 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
932 |
|
933 |
-
function getCategories() {
|
934 |
-
return categories;
|
935 |
-
}
|
936 |
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
*/
|
944 |
-
function getAllWhere(searchKey, searchValue) {
|
945 |
-
return fields.filter(function (field) {
|
946 |
-
return field[searchKey]() === searchValue;
|
947 |
-
});
|
948 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
949 |
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
961 |
};
|
962 |
|
963 |
},{"mithril/stream":23}],7:[function(require,module,exports){
|
964 |
-
'use strict';
|
965 |
-
|
966 |
-
// load CodeMirror & plugins
|
967 |
|
968 |
var CodeMirror = require('codemirror');
|
|
|
969 |
require('codemirror/mode/xml/xml');
|
|
|
970 |
require('codemirror/mode/javascript/javascript');
|
|
|
971 |
require('codemirror/mode/css/css');
|
|
|
972 |
require('codemirror/mode/htmlmixed/htmlmixed');
|
|
|
973 |
require('codemirror/addon/fold/xml-fold.js');
|
|
|
974 |
require('codemirror/addon/edit/matchtags.js');
|
|
|
975 |
require('codemirror/addon/edit/closetag.js');
|
|
|
976 |
require('codemirror/addon/selection/active-line.js');
|
977 |
-
require('codemirror/addon/edit/matchbrackets.js');
|
978 |
|
|
|
979 |
/* variables */
|
|
|
|
|
980 |
var FormEditor = {};
|
|
|
981 |
var _dom = document.createElement('form');
|
|
|
982 |
var domDirty = false;
|
983 |
var editor;
|
984 |
var element = document.getElementById('mc4wp-form-content');
|
985 |
var previewFrame = document.getElementById('mc4wp-form-preview');
|
986 |
var previewDom;
|
987 |
var templateRegex = /\{[^{}]+\}/g;
|
988 |
-
|
989 |
/* functions */
|
|
|
990 |
function setPreviewDom() {
|
991 |
-
|
992 |
-
|
993 |
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
}
|
998 |
|
999 |
function updatePreview() {
|
1000 |
-
|
1001 |
|
1002 |
-
|
1003 |
-
markup = markup.replace(templateRegex, '').replace(templateRegex, '');
|
1004 |
|
1005 |
-
|
1006 |
-
|
1007 |
-
previewDom.dispatchEvent(new Event('mc4wp-refresh'));
|
1008 |
}
|
1009 |
|
1010 |
window.addEventListener('load', function () {
|
1011 |
-
|
1012 |
-
});
|
1013 |
|
1014 |
-
// set domDirty to true everytime the "change" event fires (a lot..)
|
1015 |
element.addEventListener('change', function () {
|
1016 |
-
|
1017 |
-
|
1018 |
});
|
1019 |
|
1020 |
function dom() {
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
|
1026 |
-
|
1027 |
}
|
1028 |
|
1029 |
FormEditor.getValue = function () {
|
1030 |
-
|
1031 |
};
|
1032 |
|
1033 |
FormEditor.query = function (query) {
|
1034 |
-
|
1035 |
};
|
1036 |
|
1037 |
FormEditor.containsField = function (fieldName) {
|
1038 |
-
|
1039 |
};
|
1040 |
|
1041 |
FormEditor.insert = function (html) {
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
};
|
1049 |
|
1050 |
FormEditor.on = function (event, callback) {
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
|
1057 |
-
|
1058 |
};
|
1059 |
|
1060 |
FormEditor.refresh = function () {
|
1061 |
-
|
1062 |
};
|
1063 |
-
|
1064 |
/* bootstrap */
|
|
|
|
|
1065 |
_dom.innerHTML = element.value.toLowerCase();
|
1066 |
|
1067 |
if (CodeMirror) {
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
|
|
|
|
|
|
1087 |
}
|
1088 |
|
1089 |
previewFrame.addEventListener('load', setPreviewDom);
|
1090 |
setPreviewDom.call();
|
1091 |
-
|
1092 |
/* exports */
|
|
|
1093 |
module.exports = FormEditor;
|
1094 |
|
1095 |
},{"codemirror":17,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchbrackets.js":13,"codemirror/addon/edit/matchtags.js":14,"codemirror/addon/fold/xml-fold.js":15,"codemirror/addon/selection/active-line.js":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(require,module,exports){
|
1096 |
-
|
1097 |
|
1098 |
var FormWatcher = function FormWatcher(m, editor, settings, fields, events, helpers) {
|
1099 |
-
|
1100 |
|
1101 |
-
|
1102 |
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
|
|
1107 |
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
}
|
1112 |
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
// if form contains 1 address field of group, mark all fields in this group as "required"
|
1117 |
-
if (field.mailchimpType() === 'address') {
|
1118 |
-
field.originalRequiredValue = field.originalRequiredValue === undefined ? field.forceRequired() : field.originalRequiredValue;
|
1119 |
-
|
1120 |
-
// query other fields for this address group
|
1121 |
-
var nameGroup = field.name().replace(/\[(\w+)\]/g, '');
|
1122 |
-
if (editor.query('[name^="' + nameGroup + '"]').length > 0) {
|
1123 |
-
if (field.originalRequiredValue === undefined) {
|
1124 |
-
field.originalRequiredValue = field.forceRequired();
|
1125 |
-
}
|
1126 |
-
field.forceRequired(true);
|
1127 |
-
} else {
|
1128 |
-
field.forceRequired(field.originalRequiredValue);
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
-
});
|
1132 |
|
1133 |
-
|
1134 |
-
|
1135 |
-
}
|
1136 |
|
1137 |
-
|
1138 |
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
|
|
|
|
|
|
|
|
|
|
1148 |
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
|
|
1153 |
|
1154 |
-
|
1155 |
-
|
|
|
1156 |
|
1157 |
-
|
1158 |
-
|
|
|
1159 |
|
1160 |
-
// uppercase everything before the .
|
1161 |
-
var pos = name.indexOf('.');
|
1162 |
-
pos = pos > 0 ? pos : name.length;
|
1163 |
-
name = name.substr(0, pos).toUpperCase() + name.substr(pos);
|
1164 |
|
1165 |
-
|
1166 |
-
if (requiredFields.indexOf(name) === -1) {
|
1167 |
-
requiredFields.push(name);
|
1168 |
-
}
|
1169 |
-
});
|
1170 |
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
|
|
|
|
1174 |
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1178 |
};
|
1179 |
|
1180 |
module.exports = FormWatcher;
|
@@ -1185,188 +1202,181 @@ module.exports = FormWatcher;
|
|
1185 |
var notices = {};
|
1186 |
|
1187 |
function show(id, text) {
|
1188 |
-
|
1189 |
-
|
1190 |
}
|
1191 |
|
1192 |
function hide(id) {
|
1193 |
-
|
1194 |
-
|
1195 |
}
|
1196 |
|
1197 |
function render() {
|
1198 |
-
|
1199 |
-
for (var key in notices) {
|
1200 |
-
html += '<div class="notice notice-warning inline"><p>' + notices[key] + '</p></div>';
|
1201 |
-
}
|
1202 |
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
container.className = 'mc4wp-notices';
|
1207 |
-
var heading = document.querySelector('h1, h2');
|
1208 |
-
heading.parentNode.insertBefore(container, heading.nextSibling);
|
1209 |
-
}
|
1210 |
|
1211 |
-
|
1212 |
-
}
|
1213 |
|
1214 |
-
|
|
|
|
|
|
|
|
|
|
|
1215 |
|
1216 |
-
|
1217 |
-
|
1218 |
-
var formCode = editor.getValue().toLowerCase();
|
1219 |
-
formCode.indexOf('name="groupings') > -1 ? show('deprecated_groupings', text) : hide('deprecated_groupings');
|
1220 |
-
};
|
1221 |
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
|
|
1227 |
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1232 |
|
1233 |
-
missingFields.length > 0 ? show('required_fields_missing', text) : hide('required_fields_missing');
|
1234 |
-
};
|
1235 |
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
editor.on('blur', groupingsNotice);
|
1240 |
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
editor.on('focus', requiredFieldsNotice);
|
1245 |
}
|
1246 |
|
1247 |
module.exports = {
|
1248 |
-
|
1249 |
};
|
1250 |
|
1251 |
},{}],10:[function(require,module,exports){
|
1252 |
-
|
1253 |
|
1254 |
var overlay = function overlay(m, i18n) {
|
1255 |
-
|
1256 |
|
1257 |
-
|
1258 |
-
_onCloseCallback = void 0;
|
1259 |
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
_onCloseCallback();
|
1264 |
-
}
|
1265 |
|
1266 |
-
|
1267 |
-
|
1268 |
|
1269 |
-
|
1270 |
-
|
1271 |
-
close();
|
1272 |
-
}
|
1273 |
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
}
|
1278 |
-
}
|
1279 |
|
1280 |
-
function position() {
|
1281 |
-
if (!_element) return;
|
1282 |
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
|
|
1286 |
|
1287 |
-
|
1288 |
-
|
1289 |
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
|
|
|
|
|
|
|
|
1293 |
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
};
|
1326 |
|
1327 |
module.exports = overlay;
|
1328 |
|
1329 |
},{}],11:[function(require,module,exports){
|
1330 |
-
'use strict';
|
1331 |
-
|
1332 |
-
// deps
|
1333 |
|
1334 |
var i18n = window.mc4wp_forms_i18n;
|
1335 |
var m = window.mc4wp.deps.mithril;
|
1336 |
var events = mc4wp.events;
|
1337 |
var settings = mc4wp.settings;
|
1338 |
var helpers = mc4wp.helpers;
|
1339 |
-
|
1340 |
var tabs = mc4wp.tabs;
|
|
|
1341 |
var FormWatcher = require('./admin/form-watcher.js');
|
|
|
1342 |
var FormEditor = require('./admin/form-editor.js');
|
|
|
1343 |
var FieldHelper = require('./admin/field-helper.js');
|
|
|
1344 |
var FieldsFactory = require('./admin/fields-factory.js');
|
1345 |
-
var fields = require('./admin/fields.js')(m, events);
|
1346 |
|
1347 |
-
// vars
|
|
|
|
|
1348 |
var editor = window.formEditor = FormEditor;
|
1349 |
var watcher = new FormWatcher(m, formEditor, settings, fields, events, helpers);
|
1350 |
var fieldHelper = new FieldHelper(m, tabs, formEditor, fields, events, i18n);
|
1351 |
-
var notices = require('./admin/notices');
|
1352 |
|
1353 |
-
// mount field helper on element
|
1354 |
-
|
|
|
|
|
1355 |
|
1356 |
-
// register fields and redraw screen in 2 seconds (fixes IE8 bug)
|
1357 |
var fieldsFactory = new FieldsFactory(fields, i18n);
|
1358 |
events.on('selectedLists.change', fieldsFactory.registerListsFields);
|
1359 |
fieldsFactory.registerListsFields(settings.getSelectedLists());
|
1360 |
fieldsFactory.registerCustomFields(mc4wp_vars.mailchimp.lists);
|
1361 |
-
|
1362 |
window.setTimeout(function () {
|
1363 |
m.redraw();
|
1364 |
-
}, 2000);
|
1365 |
|
1366 |
-
//
|
1367 |
-
notices.init(editor, fields);
|
1368 |
|
1369 |
-
// expose some methods
|
1370 |
window.mc4wp = window.mc4wp || {};
|
1371 |
window.mc4wp.forms = window.mc4wp.forms || {};
|
1372 |
window.mc4wp.forms.editor = editor;
|
@@ -3905,7 +3915,7 @@ window.mc4wp.forms.fields = fields;
|
|
3905 |
|
3906 |
// Build up the DOM representation for a single token, and add it to
|
3907 |
// the line map. Takes care to render special characters separately.
|
3908 |
-
function buildToken(builder, text, style, startStyle, endStyle,
|
3909 |
if (!text) { return }
|
3910 |
var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;
|
3911 |
var special = builder.cm.state.specialChars, mustWrap = false;
|
@@ -3961,7 +3971,10 @@ window.mc4wp.forms.fields = fields;
|
|
3961 |
if (startStyle) { fullStyle += startStyle; }
|
3962 |
if (endStyle) { fullStyle += endStyle; }
|
3963 |
var token = elt("span", [content], fullStyle, css);
|
3964 |
-
if (
|
|
|
|
|
|
|
3965 |
return builder.content.appendChild(token)
|
3966 |
}
|
3967 |
builder.content.appendChild(content);
|
@@ -3985,7 +3998,7 @@ window.mc4wp.forms.fields = fields;
|
|
3985 |
// Work around nonsense dimensions being reported for stretches of
|
3986 |
// right-to-left text.
|
3987 |
function buildTokenBadBidi(inner, order) {
|
3988 |
-
return function (builder, text, style, startStyle, endStyle,
|
3989 |
style = style ? style + " cm-force-border" : "cm-force-border";
|
3990 |
var start = builder.pos, end = start + text.length;
|
3991 |
for (;;) {
|
@@ -3995,8 +4008,8 @@ window.mc4wp.forms.fields = fields;
|
|
3995 |
part = order[i];
|
3996 |
if (part.to > start && part.from <= start) { break }
|
3997 |
}
|
3998 |
-
if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle,
|
3999 |
-
inner(builder, text.slice(0, part.to - start), style, startStyle, null,
|
4000 |
startStyle = null;
|
4001 |
text = text.slice(part.to - start);
|
4002 |
start = part.to;
|
@@ -4031,10 +4044,11 @@ window.mc4wp.forms.fields = fields;
|
|
4031 |
}
|
4032 |
|
4033 |
var len = allText.length, pos = 0, i = 1, text = "", style, css;
|
4034 |
-
var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle,
|
4035 |
for (;;) {
|
4036 |
if (nextChange == pos) { // Update current marker set
|
4037 |
-
spanStyle = spanEndStyle = spanStartStyle =
|
|
|
4038 |
collapsed = null; nextChange = Infinity;
|
4039 |
var foundBookmarks = [], endStyles = (void 0);
|
4040 |
for (var j = 0; j < spans.length; ++j) {
|
@@ -4050,7 +4064,13 @@ window.mc4wp.forms.fields = fields;
|
|
4050 |
if (m.css) { css = (css ? css + ";" : "") + m.css; }
|
4051 |
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
|
4052 |
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
|
4053 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4054 |
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
4055 |
{ collapsed = sp; }
|
4056 |
} else if (sp.from > pos && nextChange > sp.from) {
|
@@ -4078,7 +4098,7 @@ window.mc4wp.forms.fields = fields;
|
|
4078 |
if (!collapsed) {
|
4079 |
var tokenText = end > upto ? text.slice(0, upto - pos) : text;
|
4080 |
builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
|
4081 |
-
spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "",
|
4082 |
}
|
4083 |
if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
|
4084 |
pos = end;
|
@@ -5287,7 +5307,8 @@ window.mc4wp.forms.fields = fields;
|
|
5287 |
var display = cm.display;
|
5288 |
var prevBottom = display.lineDiv.offsetTop;
|
5289 |
for (var i = 0; i < display.view.length; i++) {
|
5290 |
-
var cur = display.view[i],
|
|
|
5291 |
if (cur.hidden) { continue }
|
5292 |
if (ie && ie_version < 8) {
|
5293 |
var bot = cur.node.offsetTop + cur.node.offsetHeight;
|
@@ -5296,6 +5317,10 @@ window.mc4wp.forms.fields = fields;
|
|
5296 |
} else {
|
5297 |
var box = cur.node.getBoundingClientRect();
|
5298 |
height = box.bottom - box.top;
|
|
|
|
|
|
|
|
|
5299 |
}
|
5300 |
var diff = cur.line.height - height;
|
5301 |
if (height < 2) { height = textHeight(display); }
|
@@ -5305,6 +5330,14 @@ window.mc4wp.forms.fields = fields;
|
|
5305 |
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
|
5306 |
{ updateWidgetHeight(cur.rest[j]); } }
|
5307 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5308 |
}
|
5309 |
}
|
5310 |
|
@@ -7971,7 +8004,8 @@ window.mc4wp.forms.fields = fields;
|
|
7971 |
if (updateMaxLine) { cm.curOp.updateMaxLine = true; }
|
7972 |
if (marker.collapsed)
|
7973 |
{ regChange(cm, from.line, to.line + 1); }
|
7974 |
-
else if (marker.className || marker.
|
|
|
7975 |
{ for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } }
|
7976 |
if (marker.atomic) { reCheckSelection(cm.doc); }
|
7977 |
signalLater(cm, "markerAdded", cm, marker);
|
@@ -8589,11 +8623,14 @@ window.mc4wp.forms.fields = fields;
|
|
8589 |
|
8590 |
function forEachCodeMirror(f) {
|
8591 |
if (!document.getElementsByClassName) { return }
|
8592 |
-
var byClass = document.getElementsByClassName("CodeMirror");
|
8593 |
for (var i = 0; i < byClass.length; i++) {
|
8594 |
var cm = byClass[i].CodeMirror;
|
8595 |
-
if (cm) {
|
8596 |
}
|
|
|
|
|
|
|
8597 |
}
|
8598 |
|
8599 |
var globalsRegistered = false;
|
@@ -11718,7 +11755,7 @@ window.mc4wp.forms.fields = fields;
|
|
11718 |
|
11719 |
addLegacyProps(CodeMirror);
|
11720 |
|
11721 |
-
CodeMirror.version = "5.
|
11722 |
|
11723 |
return CodeMirror;
|
11724 |
|
@@ -13370,6 +13407,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
13370 |
if (type == "variable") cx.marked = "property";
|
13371 |
if (type == "spread") return cont(pattern);
|
13372 |
if (type == "}") return pass();
|
|
|
13373 |
return cont(expect(":"), pattern, maybeAssign);
|
13374 |
}
|
13375 |
function eltpattern() {
|
2 |
'use strict';
|
3 |
|
4 |
var rows = function rows(m, i18n) {
|
5 |
+
var r = {};
|
6 |
+
|
7 |
+
r.showType = function (config) {
|
8 |
+
// ucfirst
|
9 |
+
var fieldType = config.type();
|
10 |
+
fieldType = fieldType.charAt(0).toUpperCase() + fieldType.slice(1);
|
11 |
+
return m('div', [m("label", i18n.fieldType), m('span', fieldType)]);
|
12 |
+
};
|
13 |
+
|
14 |
+
r.label = function (config) {
|
15 |
+
// label row
|
16 |
+
return m("div", [m("label", i18n.fieldLabel), m("input.widefat", {
|
17 |
+
type: "text",
|
18 |
+
value: config.label(),
|
19 |
+
onchange: m.withAttr('value', config.label),
|
20 |
+
placeholder: config.title()
|
21 |
+
})]);
|
22 |
+
};
|
23 |
+
|
24 |
+
r.value = function (config) {
|
25 |
+
var isHidden = config.type() === 'hidden';
|
26 |
+
return m("div", [m("label", [isHidden ? i18n.value : i18n.initialValue, " ", isHidden ? '' : m('small', {
|
27 |
+
"style": "float: right; font-weight: normal;"
|
28 |
+
}, i18n.optional)]), m("input.widefat", {
|
29 |
+
type: "text",
|
30 |
+
value: config.value(),
|
31 |
+
onchange: m.withAttr('value', config.value)
|
32 |
+
}), isHidden ? '' : m('p.help', i18n.valueHelp)]);
|
33 |
+
};
|
34 |
+
|
35 |
+
r.numberMinMax = function (config) {
|
36 |
+
return m('div', [m('div.row', [m('div.col.col-3', [m('label', i18n.min), m('input', {
|
37 |
+
type: 'number',
|
38 |
+
onchange: m.withAttr('value', config.min)
|
39 |
+
})]), m('div.col.col-3', [m('label', i18n.max), m('input', {
|
40 |
+
type: 'number',
|
41 |
+
onchange: m.withAttr('value', config.max)
|
42 |
+
})])])]);
|
43 |
+
};
|
44 |
+
|
45 |
+
r.isRequired = function (config) {
|
46 |
+
var inputAtts = {
|
47 |
+
type: 'checkbox',
|
48 |
+
checked: config.required(),
|
49 |
+
onchange: m.withAttr('checked', config.required)
|
50 |
+
};
|
51 |
+
var desc;
|
52 |
+
|
53 |
+
if (config.forceRequired()) {
|
54 |
+
inputAtts.required = true;
|
55 |
+
inputAtts.disabled = true;
|
56 |
+
desc = m('p.help', i18n.forceRequired);
|
57 |
+
}
|
58 |
+
|
59 |
+
return m('div', [m('label.cb-wrap', [m('input', inputAtts), i18n.isFieldRequired]), desc]);
|
60 |
+
};
|
61 |
+
|
62 |
+
r.placeholder = function (config) {
|
63 |
+
return m("div", [m("label", [i18n.placeholder, " ", m('small', {
|
64 |
+
"style": "float: right; font-weight: normal;"
|
65 |
+
}, i18n.optional)]), m("input.widefat", {
|
66 |
+
type: "text",
|
67 |
+
value: config.placeholder(),
|
68 |
+
onchange: m.withAttr('value', config.placeholder),
|
69 |
+
placeholder: ""
|
70 |
+
}), m("p.help", i18n.placeholderHelp)]);
|
71 |
+
};
|
72 |
+
|
73 |
+
r.useParagraphs = function (config) {
|
74 |
+
return m('div', [m('label.cb-wrap', [m('input', {
|
75 |
+
type: 'checkbox',
|
76 |
+
checked: config.wrap(),
|
77 |
+
onchange: m.withAttr('checked', config.wrap)
|
78 |
+
}), i18n.wrapInParagraphTags])]);
|
79 |
+
};
|
80 |
+
|
81 |
+
r.choiceType = function (config) {
|
82 |
+
var options = [m('option', {
|
83 |
+
value: 'select',
|
84 |
+
selected: config.type() === 'select' ? 'selected' : false
|
85 |
+
}, i18n.dropdown), m('option', {
|
86 |
+
value: 'radio',
|
87 |
+
selected: config.type() === 'radio' ? 'selected' : false
|
88 |
+
}, i18n.radioButtons)]; // only add checkbox choice if field accepts multiple values
|
89 |
+
|
90 |
+
if (config.acceptsMultipleValues) {
|
91 |
+
options.push(m('option', {
|
92 |
+
value: 'checkbox',
|
93 |
+
selected: config.type() === 'checkbox' ? 'selected' : false
|
94 |
+
}, i18n.checkboxes));
|
95 |
+
}
|
96 |
+
|
97 |
+
return m('div', [m('label', i18n.choiceType), m('select', {
|
98 |
+
value: config.type(),
|
99 |
+
onchange: m.withAttr('value', config.type)
|
100 |
+
}, options)]);
|
101 |
+
};
|
102 |
+
|
103 |
+
r.choices = function (config) {
|
104 |
+
var html = [];
|
105 |
+
html.push(m('div', [m('label', i18n.choices), m('div.limit-height', [m("table", [// table body
|
106 |
+
config.choices().map(function (choice, index) {
|
107 |
+
return m('tr', {
|
108 |
+
'data-id': index
|
109 |
+
}, [m('td.cb', m('input', {
|
110 |
+
name: 'selected',
|
111 |
+
type: config.type() === 'checkbox' ? 'checkbox' : 'radio',
|
112 |
+
onchange: m.withAttr('value', config.selectChoice.bind(config)),
|
113 |
+
checked: choice.selected(),
|
114 |
+
value: choice.value(),
|
115 |
+
title: i18n.preselect
|
116 |
+
})), m('td.stretch', m('input.widefat', {
|
117 |
+
type: 'text',
|
118 |
+
value: choice.label(),
|
119 |
+
placeholder: choice.title(),
|
120 |
+
onchange: m.withAttr('value', choice.label)
|
121 |
+
})), m('td', m('span', {
|
122 |
+
"title": i18n.remove,
|
123 |
+
"class": 'dashicons dashicons-no-alt hover-activated',
|
124 |
+
"onclick": function (key) {
|
125 |
+
this.choices().splice(key, 1);
|
126 |
+
}.bind(config, index)
|
127 |
+
}, ''))]);
|
128 |
+
})]) // end of table
|
129 |
+
]) // end of limit-height div
|
130 |
+
]));
|
131 |
+
return html;
|
132 |
+
};
|
133 |
+
|
134 |
+
r.linkToTerms = function (config) {
|
135 |
+
// label row
|
136 |
+
return m("div", [m("label", i18n.agreeToTermsLink), m("input.widefat", {
|
137 |
+
type: "text",
|
138 |
+
value: config.link,
|
139 |
+
onchange: m.withAttr('value', config.link),
|
140 |
+
placeholder: 'https://...'
|
141 |
+
})]);
|
142 |
+
};
|
143 |
+
|
144 |
+
return r;
|
145 |
};
|
146 |
|
147 |
module.exports = rows;
|
148 |
|
149 |
},{}],2:[function(require,module,exports){
|
150 |
+
"use strict";
|
151 |
|
152 |
var forms = function forms(m, i18n) {
|
153 |
+
var forms = {};
|
|
|
154 |
|
155 |
+
var rows = require('./field-forms-rows.js')(m, i18n); // route to one of the other form configs, default to "text"
|
|
|
156 |
|
|
|
157 |
|
158 |
+
forms.render = function (config) {
|
159 |
+
var type = config.type();
|
|
|
160 |
|
161 |
+
if (typeof forms[type] === "function") {
|
162 |
+
return forms[type](config);
|
163 |
+
}
|
|
|
|
|
|
|
|
|
164 |
|
165 |
+
switch (type) {
|
166 |
+
case 'select':
|
167 |
+
case 'radio':
|
168 |
+
case 'checkbox':
|
169 |
+
return forms.choice(config);
|
170 |
+
break;
|
171 |
+
} // fallback to good old text field
|
172 |
|
|
|
|
|
|
|
173 |
|
174 |
+
return forms.text(config);
|
175 |
+
};
|
176 |
|
177 |
+
forms.text = function (config) {
|
178 |
+
return [rows.label(config), rows.placeholder(config), rows.value(config), rows.isRequired(config), rows.useParagraphs(config)];
|
179 |
+
};
|
180 |
|
181 |
+
forms.choice = function (config) {
|
182 |
+
var visibleRows = [rows.label(config), rows.choiceType(config), rows.choices(config)];
|
183 |
|
184 |
+
if (config.type() === 'select') {
|
185 |
+
visibleRows.push(rows.placeholder(config));
|
186 |
+
}
|
187 |
|
188 |
+
visibleRows.push(rows.useParagraphs(config));
|
|
|
189 |
|
190 |
+
if (config.type() === 'select' || config.type() === 'radio') {
|
191 |
+
visibleRows.push(rows.isRequired(config));
|
192 |
+
}
|
|
|
193 |
|
194 |
+
return visibleRows;
|
195 |
+
};
|
196 |
|
197 |
+
forms.hidden = function (config) {
|
198 |
+
config.placeholder('');
|
199 |
+
config.label('');
|
200 |
+
config.wrap(false);
|
201 |
+
return [rows.showType(config), rows.value(config)];
|
202 |
+
};
|
203 |
|
204 |
+
forms.submit = function (config) {
|
205 |
+
config.label('');
|
206 |
+
config.placeholder('');
|
207 |
+
return [rows.value(config), rows.useParagraphs(config)];
|
208 |
+
};
|
209 |
|
210 |
+
forms['terms-checkbox'] = function (config) {
|
211 |
+
return [rows.label(config), rows.linkToTerms(config), rows.isRequired(config), rows.useParagraphs(config)];
|
212 |
+
};
|
213 |
|
214 |
+
forms.number = function (config) {
|
215 |
+
return [forms.text(config), rows.numberMinMax(config)];
|
216 |
+
};
|
217 |
|
218 |
+
return forms;
|
219 |
};
|
220 |
|
221 |
module.exports = forms;
|
226 |
var htmlutil = require('html');
|
227 |
|
228 |
var setAttributes = function setAttributes(vnode) {
|
229 |
+
if (vnode.dom.checked) {
|
230 |
+
vnode.dom.setAttribute("checked", "true");
|
231 |
+
}
|
232 |
|
233 |
+
if (vnode.dom.value) {
|
234 |
+
vnode.dom.setAttribute('value', vnode.dom.value);
|
235 |
+
}
|
236 |
|
237 |
+
if (vnode.dom.selected) {
|
238 |
+
vnode.dom.setAttribute("selected", "true");
|
239 |
+
}
|
240 |
};
|
241 |
|
242 |
var g = function g(m) {
|
243 |
+
var generators = {};
|
244 |
+
/**
|
245 |
+
* Generates a <select> field
|
246 |
+
* @param config
|
247 |
+
* @returns {*}
|
248 |
+
*/
|
249 |
+
|
250 |
+
generators.select = function (config) {
|
251 |
+
var attributes = {
|
252 |
+
name: config.name(),
|
253 |
+
required: config.required()
|
254 |
+
};
|
255 |
+
var hasSelection = false;
|
256 |
+
var options = config.choices().map(function (choice) {
|
257 |
+
if (choice.selected()) {
|
258 |
+
hasSelection = true;
|
259 |
+
}
|
|
|
|
|
260 |
|
261 |
+
return m('option', {
|
262 |
+
value: choice.value() !== choice.label() ? choice.value() : undefined,
|
263 |
+
"selected": choice.selected(),
|
264 |
+
oncreate: setAttributes
|
265 |
+
}, choice.label());
|
266 |
+
});
|
267 |
+
var placeholder = config.placeholder();
|
268 |
+
|
269 |
+
if (placeholder.length > 0) {
|
270 |
+
options.unshift(m('option', {
|
271 |
+
'disabled': true,
|
272 |
+
'value': '',
|
273 |
+
'selected': !hasSelection,
|
274 |
+
oncreate: setAttributes
|
275 |
+
}, placeholder));
|
276 |
+
}
|
277 |
+
|
278 |
+
return m('select', attributes, options);
|
279 |
+
};
|
280 |
+
|
281 |
+
generators['terms-checkbox'] = function (config) {
|
282 |
+
var label;
|
283 |
+
|
284 |
+
if (config.link().length > 0) {
|
285 |
+
label = m('a', {
|
286 |
+
href: config.link(),
|
287 |
+
target: "_blank"
|
288 |
+
}, config.label());
|
289 |
+
} else {
|
290 |
+
label = config.label();
|
291 |
+
}
|
292 |
+
|
293 |
+
return m('label', [m('input', {
|
294 |
+
name: config.name(),
|
295 |
+
type: 'checkbox',
|
296 |
+
value: config.value(),
|
297 |
+
required: config.required()
|
298 |
+
}), ' ', label]);
|
299 |
+
};
|
300 |
+
/**
|
301 |
+
* Generates a checkbox or radio type input field.
|
302 |
+
*
|
303 |
+
* @param config
|
304 |
+
* @returns {*}
|
305 |
+
*/
|
306 |
+
|
307 |
+
|
308 |
+
generators.checkbox = function (config) {
|
309 |
+
var fields = config.choices().map(function (choice) {
|
310 |
+
var name = config.name() + (config.type() === 'checkbox' ? '[]' : '');
|
311 |
+
var required = config.required() && config.type() === 'radio';
|
312 |
+
return m('label', [m('input', {
|
313 |
+
name: name,
|
314 |
+
type: config.type(),
|
315 |
+
value: choice.value(),
|
316 |
+
checked: choice.selected(),
|
317 |
+
required: required,
|
318 |
+
oncreate: setAttributes
|
319 |
+
}), ' ', m('span', choice.label())]);
|
320 |
+
});
|
321 |
+
return fields;
|
322 |
+
};
|
323 |
+
|
324 |
+
generators.radio = generators.checkbox;
|
325 |
+
/**
|
326 |
+
* Generates a default field
|
327 |
+
*
|
328 |
+
* - text, url, number, email, date
|
329 |
+
*
|
330 |
+
* @param config
|
331 |
+
* @returns {*}
|
332 |
+
*/
|
333 |
+
|
334 |
+
generators['default'] = function (config) {
|
335 |
+
var attributes = {
|
336 |
+
type: config.type()
|
337 |
+
};
|
338 |
+
|
339 |
+
if (config.name()) {
|
340 |
+
attributes.name = config.name();
|
341 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
+
if (config.min()) {
|
344 |
+
attributes.min = config.min();
|
345 |
+
}
|
346 |
+
|
347 |
+
if (config.max()) {
|
348 |
+
attributes.max = config.max();
|
349 |
+
}
|
350 |
+
|
351 |
+
if (config.value().length > 0) {
|
352 |
+
attributes.value = config.value();
|
353 |
+
}
|
354 |
+
|
355 |
+
if (config.placeholder().length > 0) {
|
356 |
+
attributes.placeholder = config.placeholder();
|
357 |
+
}
|
358 |
+
|
359 |
+
attributes.required = config.required();
|
360 |
+
attributes.oncreate = setAttributes;
|
361 |
+
return m('input', attributes);
|
362 |
+
};
|
363 |
+
/**
|
364 |
+
* Generates an HTML string based on a field (config) object
|
365 |
+
*
|
366 |
+
* @param config
|
367 |
+
* @returns {*}
|
368 |
+
*/
|
369 |
+
|
370 |
+
|
371 |
+
function generate(config) {
|
372 |
+
var label,
|
373 |
+
field,
|
374 |
+
htmlTemplate,
|
375 |
+
html,
|
376 |
+
vdom = document.createElement('div');
|
377 |
+
label = config.label().length > 0 && config.showLabel() ? m("label", {}, config.label()) : '';
|
378 |
+
field = typeof generators[config.type()] === "function" ? generators[config.type()](config) : generators['default'](config);
|
379 |
+
htmlTemplate = config.wrap() ? m('p', [label, field]) : [label, field]; // render in vdom
|
380 |
+
|
381 |
+
m.render(vdom, htmlTemplate); // prettify html
|
382 |
+
|
383 |
+
html = htmlutil.prettyPrint(vdom.innerHTML);
|
384 |
+
return html + "\n";
|
385 |
+
}
|
386 |
+
|
387 |
+
return generate;
|
388 |
};
|
389 |
|
390 |
module.exports = g;
|
391 |
|
392 |
},{"html":22}],4:[function(require,module,exports){
|
393 |
+
"use strict";
|
394 |
|
395 |
var FieldHelper = function FieldHelper(m, tabs, editor, fields, events, i18n) {
|
396 |
+
'use strict';
|
397 |
|
398 |
+
var generate = require('./field-generator.js')(m);
|
|
|
|
|
|
|
399 |
|
400 |
+
var overlay = require('./overlay.js')(m, i18n);
|
401 |
|
402 |
+
var forms = require('./field-forms.js')(m, i18n);
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
+
var fieldConfig;
|
405 |
+
editor.on('blur', m.redraw);
|
406 |
+
/**
|
407 |
+
* Choose a field to open the helper form for
|
408 |
+
*
|
409 |
+
* @param index
|
410 |
+
* @returns {*}
|
411 |
+
*/
|
412 |
|
413 |
+
function setActiveField(index) {
|
414 |
+
fieldConfig = fields.get(index); // if this hidden field has choices (hidden groups), glue them together by their label.
|
|
|
|
|
|
|
|
|
415 |
|
416 |
+
if (fieldConfig && fieldConfig.choices().length > 0) {
|
417 |
+
fieldConfig.value(fieldConfig.choices().map(function (c) {
|
418 |
+
return c.label();
|
419 |
+
}).join('|'));
|
420 |
+
}
|
421 |
|
422 |
+
m.redraw();
|
423 |
+
}
|
424 |
+
/**
|
425 |
+
* Controller
|
426 |
+
*/
|
427 |
|
|
|
|
|
|
|
|
|
428 |
|
429 |
+
function controller() {}
|
430 |
+
/**
|
431 |
+
* Create HTML based on current config object
|
432 |
+
*/
|
433 |
|
|
|
|
|
434 |
|
435 |
+
function createFieldHTMLAndAddToForm() {
|
436 |
+
// generate html
|
437 |
+
var html = generate(fieldConfig); // add to editor
|
438 |
|
439 |
+
editor.insert(html); // reset field form
|
|
|
|
|
440 |
|
441 |
+
setActiveField(''); // redraw
|
|
|
|
|
|
|
|
|
442 |
|
443 |
+
m.redraw();
|
444 |
+
}
|
445 |
+
/**
|
446 |
+
* View
|
447 |
+
* @returns {*}
|
448 |
+
*/
|
449 |
|
|
|
|
|
|
|
|
|
450 |
|
451 |
+
function view() {
|
452 |
+
// build DOM for fields choice
|
453 |
+
var fieldCategories = fields.getCategories();
|
454 |
+
var availableFields = fields.getAll();
|
455 |
+
var fieldsChoice = m("div.available-fields.small-margin", [m("h4", i18n.chooseField), fieldCategories.map(function (category) {
|
456 |
+
var categoryFields = availableFields.filter(function (f) {
|
457 |
+
return f.category === category;
|
458 |
+
});
|
459 |
|
460 |
+
if (!categoryFields.length) {
|
461 |
+
return;
|
462 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
|
464 |
+
return m("div.tiny-margin", [m("strong", category), // render fields
|
465 |
+
categoryFields.map(function (field) {
|
466 |
+
var className = "button";
|
467 |
+
|
468 |
+
if (field.forceRequired()) {
|
469 |
+
className += " is-required";
|
470 |
+
}
|
471 |
+
|
472 |
+
var inForm = field.inFormContent();
|
473 |
+
|
474 |
+
if (inForm !== null) {
|
475 |
+
className += " " + (inForm ? 'in-form' : 'not-in-form');
|
476 |
+
}
|
477 |
+
|
478 |
+
return m("button", {
|
479 |
+
className: className,
|
480 |
+
type: 'button',
|
481 |
+
onclick: m.withAttr("value", setActiveField),
|
482 |
+
value: field.index
|
483 |
+
}, field.title());
|
484 |
+
})]);
|
485 |
+
})]); // build DOM for overlay
|
486 |
+
|
487 |
+
var form = null;
|
488 |
+
|
489 |
+
if (fieldConfig) {
|
490 |
+
form = m(overlay( // field wizard
|
491 |
+
m("div.field-wizard", [//heading
|
492 |
+
m("h3", [fieldConfig.title(), fieldConfig.forceRequired() ? m('span.red', '*') : '', fieldConfig.name().length ? m("code", fieldConfig.name()) : '']), // help text
|
493 |
+
fieldConfig.help().length ? m('p', m.trust(fieldConfig.help())) : '', // actual form
|
494 |
+
forms.render(fieldConfig), // add to form button
|
495 |
+
m("p", [m("button", {
|
496 |
+
"class": "button-primary",
|
497 |
+
type: "button",
|
498 |
+
onkeydown: function onkeydown(e) {
|
499 |
+
e = e || window.event;
|
500 |
+
|
501 |
+
if (e.keyCode == 13) {
|
502 |
+
createFieldHTMLAndAddToForm();
|
503 |
+
}
|
504 |
+
},
|
505 |
+
onclick: createFieldHTMLAndAddToForm
|
506 |
+
}, i18n.addToForm)])]), setActiveField));
|
507 |
+
}
|
508 |
+
|
509 |
+
return [fieldsChoice, form];
|
510 |
+
} // expose some variables
|
511 |
|
512 |
+
|
513 |
+
return {
|
514 |
+
view: view,
|
515 |
+
controller: controller
|
516 |
+
};
|
517 |
};
|
518 |
|
519 |
module.exports = FieldHelper;
|
520 |
|
521 |
},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(require,module,exports){
|
522 |
+
"use strict";
|
523 |
|
524 |
var FieldFactory = function FieldFactory(fields, i18n) {
|
525 |
+
'use strict';
|
526 |
+
/**
|
527 |
+
* Array of registered fields
|
528 |
+
*
|
529 |
+
* @type {Array}
|
530 |
+
*/
|
531 |
+
|
532 |
+
var registeredFields = [];
|
533 |
+
/**
|
534 |
+
* Reset all previously registered fields
|
535 |
+
*/
|
536 |
+
|
537 |
+
function reset() {
|
538 |
+
// clear all of our fields
|
539 |
+
registeredFields.forEach(fields.deregister);
|
540 |
+
}
|
541 |
+
/**
|
542 |
+
* Helper function to quickly register a field and store it in local scope
|
543 |
+
*
|
544 |
+
* @param {object} data
|
545 |
+
* @param {boolean} sticky
|
546 |
+
*/
|
547 |
+
|
548 |
+
|
549 |
+
function register(category, data, sticky) {
|
550 |
+
var field = fields.register(category, data);
|
551 |
+
|
552 |
+
if (!sticky) {
|
553 |
+
registeredFields.push(field);
|
554 |
+
}
|
555 |
+
}
|
556 |
+
/**
|
557 |
+
* Normalizes the field type which is passed by MailChimp
|
558 |
+
*
|
559 |
+
* @param type
|
560 |
+
* @returns {*}
|
561 |
+
*/
|
562 |
+
|
563 |
+
|
564 |
+
function getFieldType(type) {
|
565 |
+
var map = {
|
566 |
+
'phone': 'tel',
|
567 |
+
'dropdown': 'select',
|
568 |
+
'checkboxes': 'checkbox',
|
569 |
+
'birthday': 'text'
|
570 |
+
};
|
571 |
+
return typeof map[type] !== "undefined" ? map[type] : type;
|
572 |
+
}
|
573 |
+
/**
|
574 |
+
* Register the various fields for a merge var
|
575 |
+
*
|
576 |
+
* @param mergeField
|
577 |
+
* @returns {boolean}
|
578 |
+
*/
|
579 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
+
function registerMergeField(mergeField) {
|
582 |
+
var category = i18n.listFields;
|
583 |
+
var fieldType = getFieldType(mergeField.field_type); // name, type, title, value, required, label, placeholder, choices, wrap
|
584 |
+
|
585 |
+
var data = {
|
586 |
+
name: mergeField.tag,
|
587 |
+
title: mergeField.name,
|
588 |
+
required: mergeField.required,
|
589 |
+
forceRequired: mergeField.required,
|
590 |
+
type: fieldType,
|
591 |
+
choices: mergeField.choices,
|
592 |
+
acceptsMultipleValues: false // merge fields never accept multiple values.
|
593 |
+
|
594 |
+
};
|
595 |
+
|
596 |
+
if (data.type !== 'address') {
|
597 |
+
register(category, data, false);
|
598 |
+
} else {
|
599 |
+
register(category, {
|
600 |
+
name: data.name + '[addr1]',
|
601 |
+
type: 'text',
|
602 |
+
mailchimpType: 'address',
|
603 |
+
title: i18n.streetAddress
|
604 |
+
});
|
605 |
+
register(category, {
|
606 |
+
name: data.name + '[city]',
|
607 |
+
type: 'text',
|
608 |
+
mailchimpType: 'address',
|
609 |
+
title: i18n.city
|
610 |
+
});
|
611 |
+
register(category, {
|
612 |
+
name: data.name + '[state]',
|
613 |
+
type: 'text',
|
614 |
+
mailchimpType: 'address',
|
615 |
+
title: i18n.state
|
616 |
+
});
|
617 |
+
register(category, {
|
618 |
+
name: data.name + '[zip]',
|
619 |
+
type: 'text',
|
620 |
+
mailchimpType: 'address',
|
621 |
+
title: i18n.zip
|
622 |
+
});
|
623 |
+
register(category, {
|
624 |
+
name: data.name + '[country]',
|
625 |
+
type: 'select',
|
626 |
+
mailchimpType: 'address',
|
627 |
+
title: i18n.country,
|
628 |
+
choices: mc4wp_vars.countries
|
629 |
+
});
|
630 |
}
|
631 |
|
632 |
+
return true;
|
633 |
+
}
|
634 |
+
/**
|
635 |
+
* Register a field for a MailChimp grouping
|
636 |
+
*
|
637 |
+
* @param interestCategory
|
638 |
+
*/
|
639 |
+
|
640 |
+
|
641 |
+
function registerInterestCategory(interestCategory) {
|
642 |
+
var category = i18n.interestCategories;
|
643 |
+
var fieldType = getFieldType(interestCategory.field_type);
|
644 |
+
var data = {
|
645 |
+
title: interestCategory.name,
|
646 |
+
name: 'INTERESTS[' + interestCategory.id + ']',
|
647 |
+
type: fieldType,
|
648 |
+
choices: interestCategory.interests,
|
649 |
+
acceptsMultipleValues: fieldType === 'checkbox'
|
650 |
+
};
|
651 |
+
register(category, data, false);
|
652 |
+
}
|
653 |
+
/**
|
654 |
+
* Register all fields belonging to a list
|
655 |
+
*
|
656 |
+
* @param list
|
657 |
+
*/
|
658 |
+
|
659 |
|
660 |
+
function registerListFields(list) {
|
661 |
+
// make sure EMAIL && public fields come first
|
662 |
+
list.merge_fields = list.merge_fields.sort(function (a, b) {
|
663 |
+
if (a.tag === 'EMAIL' || a.public && !b.public) {
|
664 |
+
return -1;
|
665 |
+
}
|
666 |
|
667 |
+
if (!a.public && b.public) {
|
668 |
+
return 1;
|
669 |
+
}
|
670 |
|
671 |
+
return 0;
|
672 |
+
}); // loop through merge vars
|
673 |
|
674 |
+
list.merge_fields.forEach(registerMergeField); // loop through groupings
|
|
|
675 |
|
676 |
+
list.interest_categories.forEach(registerInterestCategory);
|
677 |
+
}
|
678 |
+
/**
|
679 |
+
* Register all lists fields
|
680 |
+
*
|
681 |
+
* @param lists
|
682 |
+
*/
|
683 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
|
685 |
+
function registerListsFields(lists) {
|
686 |
+
reset();
|
687 |
+
lists.forEach(registerListFields);
|
688 |
+
}
|
689 |
|
690 |
+
function registerCustomFields(lists) {
|
691 |
+
var choices,
|
692 |
+
category = i18n.formFields; // register submit button
|
693 |
|
694 |
+
register(category, {
|
695 |
+
name: '',
|
696 |
+
value: i18n.subscribe,
|
697 |
+
type: "submit",
|
698 |
+
title: i18n.submitButton
|
699 |
+
}, true); // register lists choice field
|
|
|
700 |
|
701 |
+
choices = {};
|
|
|
|
|
|
|
|
|
702 |
|
703 |
+
for (var key in lists) {
|
704 |
+
choices[lists[key].id] = lists[key].name;
|
705 |
+
}
|
|
|
|
|
|
|
|
|
|
|
706 |
|
707 |
+
register(category, {
|
708 |
+
name: '_mc4wp_lists',
|
709 |
+
type: 'checkbox',
|
710 |
+
title: i18n.listChoice,
|
711 |
+
choices: choices,
|
712 |
+
help: i18n.listChoiceDescription,
|
713 |
+
acceptsMultipleValues: true
|
714 |
+
}, true);
|
715 |
+
choices = {
|
716 |
+
'subscribe': "Subscribe",
|
717 |
+
'unsubscribe': "Unsubscribe"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
718 |
};
|
719 |
+
register(category, {
|
720 |
+
name: '_mc4wp_action',
|
721 |
+
type: 'radio',
|
722 |
+
title: i18n.formAction,
|
723 |
+
choices: choices,
|
724 |
+
value: 'subscribe',
|
725 |
+
help: i18n.formActionDescription
|
726 |
+
}, true);
|
727 |
+
register(category, {
|
728 |
+
name: 'AGREE_TO_TERMS',
|
729 |
+
value: 1,
|
730 |
+
type: "terms-checkbox",
|
731 |
+
label: i18n.agreeToTerms,
|
732 |
+
title: i18n.agreeToTermsShort,
|
733 |
+
showLabel: false,
|
734 |
+
required: true
|
735 |
+
}, true);
|
736 |
+
}
|
737 |
+
/**
|
738 |
+
* Expose some methods
|
739 |
+
*/
|
740 |
+
|
741 |
+
|
742 |
+
return {
|
743 |
+
'registerCustomFields': registerCustomFields,
|
744 |
+
'registerListFields': registerListFields,
|
745 |
+
'registerListsFields': registerListsFields
|
746 |
+
};
|
747 |
};
|
748 |
|
749 |
module.exports = FieldFactory;
|
754 |
var prop = require("mithril/stream");
|
755 |
|
756 |
module.exports = function (m, events) {
|
757 |
+
var timeout;
|
758 |
+
var fields = [];
|
759 |
+
var categories = [];
|
760 |
+
/**
|
761 |
+
* @internal
|
762 |
+
*
|
763 |
+
*
|
764 |
+
* @param data
|
765 |
+
* @constructor
|
766 |
+
*/
|
767 |
+
|
768 |
+
var Field = function Field(data) {
|
769 |
+
this.name = prop(data.name);
|
770 |
+
this.title = prop(data.title || data.name);
|
771 |
+
this.type = prop(data.type);
|
772 |
+
this.mailchimpType = prop(data.mailchimpType || '');
|
773 |
+
this.label = prop(data.label || data.title || '');
|
774 |
+
this.showLabel = prop(data.showLabel !== undefined ? data.showLabel : true);
|
775 |
+
this.value = prop(data.value || '');
|
776 |
+
this.placeholder = prop(data.placeholder || '');
|
777 |
+
this.required = prop(data.required || false);
|
778 |
+
this.forceRequired = prop(data.forceRequired || false);
|
779 |
+
this.wrap = prop(data.wrap !== undefined ? data.wrap : true);
|
780 |
+
this.min = prop(data.min || null);
|
781 |
+
this.max = prop(data.max || null);
|
782 |
+
this.help = prop(data.help || '');
|
783 |
+
this.choices = prop(data.choices || []);
|
784 |
+
this.inFormContent = prop(null);
|
785 |
+
this.acceptsMultipleValues = data.acceptsMultipleValues;
|
786 |
+
this.link = prop(data.link || '');
|
787 |
+
|
788 |
+
this.selectChoice = function (value) {
|
789 |
+
var field = this;
|
790 |
+
this.choices(this.choices().map(function (choice) {
|
791 |
+
if (choice.value() === value) {
|
792 |
+
choice.selected(true);
|
793 |
+
} else {
|
794 |
+
// only checkboxes allow for multiple selections
|
795 |
+
if (field.type() !== 'checkbox') {
|
796 |
+
choice.selected(false);
|
797 |
+
}
|
798 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
799 |
|
800 |
+
return choice;
|
801 |
+
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
};
|
803 |
+
};
|
804 |
+
/**
|
805 |
+
* @internal
|
806 |
+
*
|
807 |
+
* @param data
|
808 |
+
* @constructor
|
809 |
+
*/
|
810 |
+
|
811 |
+
|
812 |
+
var FieldChoice = function FieldChoice(data) {
|
813 |
+
this.label = prop(data.label);
|
814 |
+
this.title = prop(data.title || data.label);
|
815 |
+
this.selected = prop(data.selected || false);
|
816 |
+
this.value = prop(data.value || data.label);
|
817 |
+
};
|
818 |
+
/**
|
819 |
+
* Creates FieldChoice objects from an (associative) array of data objects
|
820 |
+
*
|
821 |
+
* @param data
|
822 |
+
* @returns {Array}
|
823 |
+
*/
|
824 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
825 |
|
826 |
+
function createChoices(data) {
|
827 |
+
var choices = [];
|
828 |
+
|
829 |
+
if (typeof data.map === "function") {
|
830 |
+
choices = data.map(function (choiceLabel) {
|
831 |
+
return new FieldChoice({
|
832 |
+
label: choiceLabel
|
833 |
+
});
|
834 |
+
});
|
835 |
+
} else {
|
836 |
+
choices = Object.keys(data).map(function (key) {
|
837 |
+
var choiceLabel = data[key];
|
838 |
+
return new FieldChoice({
|
839 |
+
label: choiceLabel,
|
840 |
+
value: key
|
841 |
+
});
|
842 |
+
});
|
843 |
}
|
844 |
|
845 |
+
return choices;
|
846 |
+
}
|
847 |
+
/**
|
848 |
+
* Factory method
|
849 |
+
*
|
850 |
+
* @api
|
851 |
+
*
|
852 |
+
* @param data
|
853 |
+
* @returns {Field}
|
854 |
+
*/
|
855 |
|
|
|
|
|
856 |
|
857 |
+
function register(category, data) {
|
858 |
+
var field;
|
859 |
+
var existingField = getAllWhere('name', data.name).shift(); // a field with the same "name" already exists
|
860 |
|
861 |
+
if (existingField) {
|
862 |
+
// update "required" status
|
863 |
+
if (!existingField.forceRequired() && data.forceRequired) {
|
864 |
+
existingField.forceRequired(true);
|
865 |
+
} // bail
|
866 |
|
|
|
|
|
|
|
867 |
|
868 |
+
return undefined;
|
869 |
+
} // array of choices given? convert to FieldChoice objects
|
|
|
870 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
|
872 |
+
if (data.choices) {
|
873 |
+
data.choices = createChoices(data.choices);
|
|
|
|
|
874 |
|
875 |
+
if (data.value) {
|
876 |
+
data.choices = data.choices.map(function (choice) {
|
877 |
+
if (choice.value() === data.value) {
|
878 |
+
choice.selected(true);
|
879 |
+
}
|
880 |
|
881 |
+
return choice;
|
882 |
+
});
|
883 |
+
}
|
884 |
+
} // register category
|
885 |
|
|
|
|
|
|
|
886 |
|
887 |
+
if (categories.indexOf(category) < 0) {
|
888 |
+
categories.push(category);
|
889 |
+
} // create Field object
|
890 |
|
|
|
|
|
891 |
|
892 |
+
field = new Field(data);
|
893 |
+
field.category = category; // add to array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
|
895 |
+
fields.push(field); // redraw view
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
896 |
|
897 |
+
timeout && window.clearTimeout(timeout);
|
898 |
+
timeout = window.setTimeout(m.redraw, 200); // trigger event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
899 |
|
900 |
+
events.trigger('fields.change');
|
901 |
+
return field;
|
902 |
+
}
|
903 |
+
/**
|
904 |
+
* @api
|
905 |
+
*
|
906 |
+
* @param field
|
907 |
+
*/
|
908 |
|
|
|
|
|
|
|
909 |
|
910 |
+
function deregister(field) {
|
911 |
+
var index = fields.indexOf(field);
|
912 |
+
|
913 |
+
if (index > -1) {
|
914 |
+
delete fields[index];
|
915 |
+
m.redraw();
|
|
|
|
|
|
|
|
|
|
|
916 |
}
|
917 |
+
}
|
918 |
+
/**
|
919 |
+
* Get a field config object
|
920 |
+
*
|
921 |
+
* @param name
|
922 |
+
* @returns {*}
|
923 |
+
*/
|
924 |
|
925 |
+
|
926 |
+
function get(name) {
|
927 |
+
return fields[name];
|
928 |
+
}
|
929 |
+
/**
|
930 |
+
* Get all field config objects
|
931 |
+
*
|
932 |
+
* @returns {Array|*}
|
933 |
+
*/
|
934 |
+
|
935 |
+
|
936 |
+
function getAll() {
|
937 |
+
// rebuild index property on all fields
|
938 |
+
fields = fields.map(function (f, i) {
|
939 |
+
f.index = i;
|
940 |
+
return f;
|
941 |
+
});
|
942 |
+
return fields;
|
943 |
+
}
|
944 |
+
|
945 |
+
function getCategories() {
|
946 |
+
return categories;
|
947 |
+
}
|
948 |
+
/**
|
949 |
+
* Get all fields where a property matches the given value
|
950 |
+
*
|
951 |
+
* @param searchKey
|
952 |
+
* @param searchValue
|
953 |
+
* @returns {Array|*}
|
954 |
+
*/
|
955 |
+
|
956 |
+
|
957 |
+
function getAllWhere(searchKey, searchValue) {
|
958 |
+
return fields.filter(function (field) {
|
959 |
+
return field[searchKey]() === searchValue;
|
960 |
+
});
|
961 |
+
}
|
962 |
+
/**
|
963 |
+
* Exposed methods
|
964 |
+
*/
|
965 |
+
|
966 |
+
|
967 |
+
return {
|
968 |
+
'get': get,
|
969 |
+
'getAll': getAll,
|
970 |
+
'getCategories': getCategories,
|
971 |
+
'deregister': deregister,
|
972 |
+
'register': register,
|
973 |
+
'getAllWhere': getAllWhere
|
974 |
+
};
|
975 |
};
|
976 |
|
977 |
},{"mithril/stream":23}],7:[function(require,module,exports){
|
978 |
+
'use strict'; // load CodeMirror & plugins
|
|
|
|
|
979 |
|
980 |
var CodeMirror = require('codemirror');
|
981 |
+
|
982 |
require('codemirror/mode/xml/xml');
|
983 |
+
|
984 |
require('codemirror/mode/javascript/javascript');
|
985 |
+
|
986 |
require('codemirror/mode/css/css');
|
987 |
+
|
988 |
require('codemirror/mode/htmlmixed/htmlmixed');
|
989 |
+
|
990 |
require('codemirror/addon/fold/xml-fold.js');
|
991 |
+
|
992 |
require('codemirror/addon/edit/matchtags.js');
|
993 |
+
|
994 |
require('codemirror/addon/edit/closetag.js');
|
995 |
+
|
996 |
require('codemirror/addon/selection/active-line.js');
|
|
|
997 |
|
998 |
+
require('codemirror/addon/edit/matchbrackets.js');
|
999 |
/* variables */
|
1000 |
+
|
1001 |
+
|
1002 |
var FormEditor = {};
|
1003 |
+
|
1004 |
var _dom = document.createElement('form');
|
1005 |
+
|
1006 |
var domDirty = false;
|
1007 |
var editor;
|
1008 |
var element = document.getElementById('mc4wp-form-content');
|
1009 |
var previewFrame = document.getElementById('mc4wp-form-preview');
|
1010 |
var previewDom;
|
1011 |
var templateRegex = /\{[^{}]+\}/g;
|
|
|
1012 |
/* functions */
|
1013 |
+
|
1014 |
function setPreviewDom() {
|
1015 |
+
var frameContent = previewFrame.contentDocument || previewFrame.contentWindow.document;
|
1016 |
+
previewDom = frameContent.querySelector('.mc4wp-form-fields');
|
1017 |
|
1018 |
+
if (previewDom) {
|
1019 |
+
updatePreview();
|
1020 |
+
}
|
1021 |
}
|
1022 |
|
1023 |
function updatePreview() {
|
1024 |
+
var markup = FormEditor.getValue(); // replace template tags (twice, to allow for nested tags)
|
1025 |
|
1026 |
+
markup = markup.replace(templateRegex, '').replace(templateRegex, ''); // update dom
|
|
|
1027 |
|
1028 |
+
previewDom.innerHTML = markup;
|
1029 |
+
previewDom.dispatchEvent(new Event('mc4wp-refresh'));
|
|
|
1030 |
}
|
1031 |
|
1032 |
window.addEventListener('load', function () {
|
1033 |
+
CodeMirror.signal(editor, "change");
|
1034 |
+
}); // set domDirty to true everytime the "change" event fires (a lot..)
|
1035 |
|
|
|
1036 |
element.addEventListener('change', function () {
|
1037 |
+
domDirty = true;
|
1038 |
+
updatePreview();
|
1039 |
});
|
1040 |
|
1041 |
function dom() {
|
1042 |
+
if (domDirty) {
|
1043 |
+
_dom.innerHTML = FormEditor.getValue().toLowerCase();
|
1044 |
+
domDirty = false;
|
1045 |
+
}
|
1046 |
|
1047 |
+
return _dom;
|
1048 |
}
|
1049 |
|
1050 |
FormEditor.getValue = function () {
|
1051 |
+
return editor ? editor.getValue() : element.value;
|
1052 |
};
|
1053 |
|
1054 |
FormEditor.query = function (query) {
|
1055 |
+
return dom().querySelectorAll(query.toLowerCase());
|
1056 |
};
|
1057 |
|
1058 |
FormEditor.containsField = function (fieldName) {
|
1059 |
+
return dom().elements.namedItem(fieldName.toLowerCase()) !== null;
|
1060 |
};
|
1061 |
|
1062 |
FormEditor.insert = function (html) {
|
1063 |
+
if (editor) {
|
1064 |
+
editor.replaceSelection(html);
|
1065 |
+
editor.focus();
|
1066 |
+
} else {
|
1067 |
+
element.value += html;
|
1068 |
+
}
|
1069 |
};
|
1070 |
|
1071 |
FormEditor.on = function (event, callback) {
|
1072 |
+
if (editor) {
|
1073 |
+
// translate "input" event for CodeMirror
|
1074 |
+
event = event === 'input' ? 'changes' : event;
|
1075 |
+
return editor.on(event, callback);
|
1076 |
+
}
|
1077 |
|
1078 |
+
return element.addEventListener(event, callback);
|
1079 |
};
|
1080 |
|
1081 |
FormEditor.refresh = function () {
|
1082 |
+
editor && editor.refresh();
|
1083 |
};
|
|
|
1084 |
/* bootstrap */
|
1085 |
+
|
1086 |
+
|
1087 |
_dom.innerHTML = element.value.toLowerCase();
|
1088 |
|
1089 |
if (CodeMirror) {
|
1090 |
+
editor = CodeMirror.fromTextArea(element, {
|
1091 |
+
selectionPointer: true,
|
1092 |
+
mode: "htmlmixed",
|
1093 |
+
htmlMode: true,
|
1094 |
+
autoCloseTags: true,
|
1095 |
+
autoRefresh: true,
|
1096 |
+
styleActiveLine: true,
|
1097 |
+
matchBrackets: true,
|
1098 |
+
matchTags: {
|
1099 |
+
bothTags: true
|
1100 |
+
}
|
1101 |
+
}); // dispatch regular "change" on element event every time editor changes (IE9+ only)
|
1102 |
+
|
1103 |
+
window.dispatchEvent && editor.on('change', function () {
|
1104 |
+
if (typeof Event === "function") {
|
1105 |
+
// Create a new 'change' event
|
1106 |
+
var event = new Event('change', {
|
1107 |
+
bubbles: true
|
1108 |
+
});
|
1109 |
+
element.dispatchEvent(event);
|
1110 |
+
}
|
1111 |
+
});
|
1112 |
}
|
1113 |
|
1114 |
previewFrame.addEventListener('load', setPreviewDom);
|
1115 |
setPreviewDom.call();
|
|
|
1116 |
/* exports */
|
1117 |
+
|
1118 |
module.exports = FormEditor;
|
1119 |
|
1120 |
},{"codemirror":17,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchbrackets.js":13,"codemirror/addon/edit/matchtags.js":14,"codemirror/addon/fold/xml-fold.js":15,"codemirror/addon/selection/active-line.js":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(require,module,exports){
|
1121 |
+
"use strict";
|
1122 |
|
1123 |
var FormWatcher = function FormWatcher(m, editor, settings, fields, events, helpers) {
|
1124 |
+
'use strict';
|
1125 |
|
1126 |
+
var requiredFieldsInput = document.getElementById('required-fields');
|
1127 |
|
1128 |
+
function updateFields() {
|
1129 |
+
fields.getAll().forEach(function (field) {
|
1130 |
+
// don't run for empty field names
|
1131 |
+
if (field.name().length <= 0) return;
|
1132 |
+
var fieldName = field.name();
|
1133 |
|
1134 |
+
if (field.type() === 'checkbox') {
|
1135 |
+
fieldName += '[]';
|
1136 |
+
}
|
|
|
1137 |
|
1138 |
+
var inForm = editor.containsField(fieldName);
|
1139 |
+
field.inFormContent(inForm); // if form contains 1 address field of group, mark all fields in this group as "required"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1140 |
|
1141 |
+
if (field.mailchimpType() === 'address') {
|
1142 |
+
field.originalRequiredValue = field.originalRequiredValue === undefined ? field.forceRequired() : field.originalRequiredValue; // query other fields for this address group
|
|
|
1143 |
|
1144 |
+
var nameGroup = field.name().replace(/\[(\w+)\]/g, '');
|
1145 |
|
1146 |
+
if (editor.query('[name^="' + nameGroup + '"]').length > 0) {
|
1147 |
+
if (field.originalRequiredValue === undefined) {
|
1148 |
+
field.originalRequiredValue = field.forceRequired();
|
1149 |
+
}
|
1150 |
|
1151 |
+
field.forceRequired(true);
|
1152 |
+
} else {
|
1153 |
+
field.forceRequired(field.originalRequiredValue);
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
});
|
1157 |
+
findRequiredFields();
|
1158 |
+
m.redraw();
|
1159 |
+
}
|
1160 |
|
1161 |
+
function findRequiredFields() {
|
1162 |
+
// query fields required by MailChimp
|
1163 |
+
var requiredFields = fields.getAllWhere('forceRequired', true).map(function (f) {
|
1164 |
+
return f.name().toUpperCase().replace(/\[(\w+)\]/g, '.$1');
|
1165 |
+
}); // query fields in form with [required] attribute
|
1166 |
|
1167 |
+
var requiredFieldElements = editor.query('[required]');
|
1168 |
+
Array.prototype.forEach.call(requiredFieldElements, function (el) {
|
1169 |
+
var name = el.name; // bail if name attr empty or starts with underscore
|
1170 |
|
1171 |
+
if (!name || name.length < 0 || name[0] === '_') {
|
1172 |
+
return;
|
1173 |
+
} // replace array brackets with dot style notation
|
1174 |
|
|
|
|
|
|
|
|
|
1175 |
|
1176 |
+
name = name.replace(/\[(\w+)\]/g, '.$1'); // replace array-style fields
|
|
|
|
|
|
|
|
|
1177 |
|
1178 |
+
name = name.replace(/\[\]$/, ''); // uppercase everything before the .
|
1179 |
+
|
1180 |
+
var pos = name.indexOf('.');
|
1181 |
+
pos = pos > 0 ? pos : name.length;
|
1182 |
+
name = name.substr(0, pos).toUpperCase() + name.substr(pos); // only add field if it's not already in it
|
1183 |
|
1184 |
+
if (requiredFields.indexOf(name) === -1) {
|
1185 |
+
requiredFields.push(name);
|
1186 |
+
}
|
1187 |
+
}); // update meta
|
1188 |
+
|
1189 |
+
requiredFieldsInput.value = requiredFields.join(',');
|
1190 |
+
} // events
|
1191 |
+
|
1192 |
+
|
1193 |
+
editor.on('change', helpers.debounce(updateFields, 500));
|
1194 |
+
events.on('fields.change', helpers.debounce(updateFields, 500));
|
1195 |
};
|
1196 |
|
1197 |
module.exports = FormWatcher;
|
1202 |
var notices = {};
|
1203 |
|
1204 |
function show(id, text) {
|
1205 |
+
notices[id] = text;
|
1206 |
+
render();
|
1207 |
}
|
1208 |
|
1209 |
function hide(id) {
|
1210 |
+
delete notices[id];
|
1211 |
+
render();
|
1212 |
}
|
1213 |
|
1214 |
function render() {
|
1215 |
+
var html = '';
|
|
|
|
|
|
|
1216 |
|
1217 |
+
for (var key in notices) {
|
1218 |
+
html += '<div class="notice notice-warning inline"><p>' + notices[key] + '</p></div>';
|
1219 |
+
}
|
|
|
|
|
|
|
|
|
1220 |
|
1221 |
+
var container = document.querySelector('.mc4wp-notices');
|
|
|
1222 |
|
1223 |
+
if (!container) {
|
1224 |
+
container = document.createElement('div');
|
1225 |
+
container.className = 'mc4wp-notices';
|
1226 |
+
var heading = document.querySelector('h1, h2');
|
1227 |
+
heading.parentNode.insertBefore(container, heading.nextSibling);
|
1228 |
+
}
|
1229 |
|
1230 |
+
container.innerHTML = html;
|
1231 |
+
}
|
|
|
|
|
|
|
1232 |
|
1233 |
+
function init(editor, fields) {
|
1234 |
+
var groupingsNotice = function groupingsNotice() {
|
1235 |
+
var text = "Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly.";
|
1236 |
+
var formCode = editor.getValue().toLowerCase();
|
1237 |
+
formCode.indexOf('name="groupings') > -1 ? show('deprecated_groupings', text) : hide('deprecated_groupings');
|
1238 |
+
};
|
1239 |
|
1240 |
+
var requiredFieldsNotice = function requiredFieldsNotice() {
|
1241 |
+
var requiredFields = fields.getAllWhere('forceRequired', true);
|
1242 |
+
var missingFields = requiredFields.filter(function (f) {
|
1243 |
+
return !editor.containsField(f.name().toUpperCase());
|
1244 |
+
});
|
1245 |
+
var text = '<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.';
|
1246 |
+
text += "<br /><ul class=\"ul-square\" style=\"margin-bottom: 0;\"><li>" + missingFields.map(function (f) {
|
1247 |
+
return f.title();
|
1248 |
+
}).join('</li><li>') + '</li></ul>';
|
1249 |
+
missingFields.length > 0 ? show('required_fields_missing', text) : hide('required_fields_missing');
|
1250 |
+
}; // old groupings
|
1251 |
|
|
|
|
|
1252 |
|
1253 |
+
groupingsNotice();
|
1254 |
+
editor.on('focus', groupingsNotice);
|
1255 |
+
editor.on('blur', groupingsNotice); // missing required fields
|
|
|
1256 |
|
1257 |
+
requiredFieldsNotice();
|
1258 |
+
editor.on('blur', requiredFieldsNotice);
|
1259 |
+
editor.on('focus', requiredFieldsNotice);
|
|
|
1260 |
}
|
1261 |
|
1262 |
module.exports = {
|
1263 |
+
"init": init
|
1264 |
};
|
1265 |
|
1266 |
},{}],10:[function(require,module,exports){
|
1267 |
+
"use strict";
|
1268 |
|
1269 |
var overlay = function overlay(m, i18n) {
|
1270 |
+
'use strict';
|
1271 |
|
1272 |
+
var _element, _onCloseCallback;
|
|
|
1273 |
|
1274 |
+
function close() {
|
1275 |
+
document.removeEventListener('keydown', onKeyDown);
|
1276 |
+
window.removeEventListener('resize', position);
|
|
|
|
|
1277 |
|
1278 |
+
_onCloseCallback();
|
1279 |
+
}
|
1280 |
|
1281 |
+
function onKeyDown(e) {
|
1282 |
+
e = e || window.event; // close overlay when pressing ESC
|
|
|
|
|
1283 |
|
1284 |
+
if (e.keyCode == 27) {
|
1285 |
+
close();
|
1286 |
+
} // prevent ENTER
|
|
|
|
|
1287 |
|
|
|
|
|
1288 |
|
1289 |
+
if (e.keyCode == 13) {
|
1290 |
+
e.preventDefault();
|
1291 |
+
}
|
1292 |
+
}
|
1293 |
|
1294 |
+
function position() {
|
1295 |
+
if (!_element) return; // fix for window width in IE8
|
1296 |
|
1297 |
+
var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
1298 |
+
var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
|
1299 |
+
var marginLeft = (windowWidth - _element.clientWidth - 40) / 2;
|
1300 |
+
var marginTop = (windowHeight - _element.clientHeight - 40) / 2;
|
1301 |
+
_element.style.left = (marginLeft > 0 ? marginLeft : 0) + "px";
|
1302 |
+
_element.style.top = (marginTop > 0 ? marginTop : 0) + "px";
|
1303 |
+
}
|
1304 |
|
1305 |
+
function storeElementReference(vnode) {
|
1306 |
+
_element = vnode.dom;
|
1307 |
+
position();
|
1308 |
+
}
|
1309 |
|
1310 |
+
return function (content, onCloseCallback) {
|
1311 |
+
_onCloseCallback = onCloseCallback;
|
1312 |
+
return {
|
1313 |
+
oncreate: function oncreate() {
|
1314 |
+
document.addEventListener('keydown', onKeyDown);
|
1315 |
+
window.addEventListener('resize', position);
|
1316 |
+
},
|
1317 |
+
onremove: function onremove() {
|
1318 |
+
document.removeEventListener('keydown', onKeyDown);
|
1319 |
+
window.removeEventListener('resize', position);
|
1320 |
+
},
|
1321 |
+
view: function view() {
|
1322 |
+
return [m('div.overlay-wrap', m("div.overlay", {
|
1323 |
+
oncreate: storeElementReference
|
1324 |
+
}, [// close icon
|
1325 |
+
m('span', {
|
1326 |
+
"class": 'close dashicons dashicons-no',
|
1327 |
+
title: i18n.close,
|
1328 |
+
onclick: close
|
1329 |
+
}), content])), m('div.overlay-background', {
|
1330 |
+
title: i18n.close,
|
1331 |
+
onclick: close
|
1332 |
+
})];
|
1333 |
+
}
|
1334 |
+
};
|
1335 |
+
};
|
1336 |
};
|
1337 |
|
1338 |
module.exports = overlay;
|
1339 |
|
1340 |
},{}],11:[function(require,module,exports){
|
1341 |
+
'use strict'; // deps
|
|
|
|
|
1342 |
|
1343 |
var i18n = window.mc4wp_forms_i18n;
|
1344 |
var m = window.mc4wp.deps.mithril;
|
1345 |
var events = mc4wp.events;
|
1346 |
var settings = mc4wp.settings;
|
1347 |
var helpers = mc4wp.helpers;
|
|
|
1348 |
var tabs = mc4wp.tabs;
|
1349 |
+
|
1350 |
var FormWatcher = require('./admin/form-watcher.js');
|
1351 |
+
|
1352 |
var FormEditor = require('./admin/form-editor.js');
|
1353 |
+
|
1354 |
var FieldHelper = require('./admin/field-helper.js');
|
1355 |
+
|
1356 |
var FieldsFactory = require('./admin/fields-factory.js');
|
|
|
1357 |
|
1358 |
+
var fields = require('./admin/fields.js')(m, events); // vars
|
1359 |
+
|
1360 |
+
|
1361 |
var editor = window.formEditor = FormEditor;
|
1362 |
var watcher = new FormWatcher(m, formEditor, settings, fields, events, helpers);
|
1363 |
var fieldHelper = new FieldHelper(m, tabs, formEditor, fields, events, i18n);
|
|
|
1364 |
|
1365 |
+
var notices = require('./admin/notices'); // mount field helper on element
|
1366 |
+
|
1367 |
+
|
1368 |
+
m.mount(document.getElementById('mc4wp-field-wizard'), fieldHelper); // register fields and redraw screen in 2 seconds (fixes IE8 bug)
|
1369 |
|
|
|
1370 |
var fieldsFactory = new FieldsFactory(fields, i18n);
|
1371 |
events.on('selectedLists.change', fieldsFactory.registerListsFields);
|
1372 |
fieldsFactory.registerListsFields(settings.getSelectedLists());
|
1373 |
fieldsFactory.registerCustomFields(mc4wp_vars.mailchimp.lists);
|
|
|
1374 |
window.setTimeout(function () {
|
1375 |
m.redraw();
|
1376 |
+
}, 2000); // init notices
|
1377 |
|
1378 |
+
notices.init(editor, fields); // expose some methods
|
|
|
1379 |
|
|
|
1380 |
window.mc4wp = window.mc4wp || {};
|
1381 |
window.mc4wp.forms = window.mc4wp.forms || {};
|
1382 |
window.mc4wp.forms.editor = editor;
|
3915 |
|
3916 |
// Build up the DOM representation for a single token, and add it to
|
3917 |
// the line map. Takes care to render special characters separately.
|
3918 |
+
function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {
|
3919 |
if (!text) { return }
|
3920 |
var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;
|
3921 |
var special = builder.cm.state.specialChars, mustWrap = false;
|
3971 |
if (startStyle) { fullStyle += startStyle; }
|
3972 |
if (endStyle) { fullStyle += endStyle; }
|
3973 |
var token = elt("span", [content], fullStyle, css);
|
3974 |
+
if (attributes) {
|
3975 |
+
for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class")
|
3976 |
+
{ token.setAttribute(attr, attributes[attr]); } }
|
3977 |
+
}
|
3978 |
return builder.content.appendChild(token)
|
3979 |
}
|
3980 |
builder.content.appendChild(content);
|
3998 |
// Work around nonsense dimensions being reported for stretches of
|
3999 |
// right-to-left text.
|
4000 |
function buildTokenBadBidi(inner, order) {
|
4001 |
+
return function (builder, text, style, startStyle, endStyle, css, attributes) {
|
4002 |
style = style ? style + " cm-force-border" : "cm-force-border";
|
4003 |
var start = builder.pos, end = start + text.length;
|
4004 |
for (;;) {
|
4008 |
part = order[i];
|
4009 |
if (part.to > start && part.from <= start) { break }
|
4010 |
}
|
4011 |
+
if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }
|
4012 |
+
inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);
|
4013 |
startStyle = null;
|
4014 |
text = text.slice(part.to - start);
|
4015 |
start = part.to;
|
4044 |
}
|
4045 |
|
4046 |
var len = allText.length, pos = 0, i = 1, text = "", style, css;
|
4047 |
+
var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;
|
4048 |
for (;;) {
|
4049 |
if (nextChange == pos) { // Update current marker set
|
4050 |
+
spanStyle = spanEndStyle = spanStartStyle = css = "";
|
4051 |
+
attributes = null;
|
4052 |
collapsed = null; nextChange = Infinity;
|
4053 |
var foundBookmarks = [], endStyles = (void 0);
|
4054 |
for (var j = 0; j < spans.length; ++j) {
|
4064 |
if (m.css) { css = (css ? css + ";" : "") + m.css; }
|
4065 |
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
|
4066 |
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
|
4067 |
+
// support for the old title property
|
4068 |
+
// https://github.com/codemirror/CodeMirror/pull/5673
|
4069 |
+
if (m.title) { (attributes || (attributes = {})).title = m.title; }
|
4070 |
+
if (m.attributes) {
|
4071 |
+
for (var attr in m.attributes)
|
4072 |
+
{ (attributes || (attributes = {}))[attr] = m.attributes[attr]; }
|
4073 |
+
}
|
4074 |
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
4075 |
{ collapsed = sp; }
|
4076 |
} else if (sp.from > pos && nextChange > sp.from) {
|
4098 |
if (!collapsed) {
|
4099 |
var tokenText = end > upto ? text.slice(0, upto - pos) : text;
|
4100 |
builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
|
4101 |
+
spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes);
|
4102 |
}
|
4103 |
if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
|
4104 |
pos = end;
|
5307 |
var display = cm.display;
|
5308 |
var prevBottom = display.lineDiv.offsetTop;
|
5309 |
for (var i = 0; i < display.view.length; i++) {
|
5310 |
+
var cur = display.view[i], wrapping = cm.options.lineWrapping;
|
5311 |
+
var height = (void 0), width = 0;
|
5312 |
if (cur.hidden) { continue }
|
5313 |
if (ie && ie_version < 8) {
|
5314 |
var bot = cur.node.offsetTop + cur.node.offsetHeight;
|
5317 |
} else {
|
5318 |
var box = cur.node.getBoundingClientRect();
|
5319 |
height = box.bottom - box.top;
|
5320 |
+
// Check that lines don't extend past the right of the current
|
5321 |
+
// editor width
|
5322 |
+
if (!wrapping && cur.text.firstChild)
|
5323 |
+
{ width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }
|
5324 |
}
|
5325 |
var diff = cur.line.height - height;
|
5326 |
if (height < 2) { height = textHeight(display); }
|
5330 |
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
|
5331 |
{ updateWidgetHeight(cur.rest[j]); } }
|
5332 |
}
|
5333 |
+
if (width > cm.display.sizerWidth) {
|
5334 |
+
var chWidth = Math.ceil(width / charWidth(cm.display));
|
5335 |
+
if (chWidth > cm.display.maxLineLength) {
|
5336 |
+
cm.display.maxLineLength = chWidth;
|
5337 |
+
cm.display.maxLine = cur.line;
|
5338 |
+
cm.display.maxLineChanged = true;
|
5339 |
+
}
|
5340 |
+
}
|
5341 |
}
|
5342 |
}
|
5343 |
|
8004 |
if (updateMaxLine) { cm.curOp.updateMaxLine = true; }
|
8005 |
if (marker.collapsed)
|
8006 |
{ regChange(cm, from.line, to.line + 1); }
|
8007 |
+
else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||
|
8008 |
+
marker.attributes || marker.title)
|
8009 |
{ for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } }
|
8010 |
if (marker.atomic) { reCheckSelection(cm.doc); }
|
8011 |
signalLater(cm, "markerAdded", cm, marker);
|
8623 |
|
8624 |
function forEachCodeMirror(f) {
|
8625 |
if (!document.getElementsByClassName) { return }
|
8626 |
+
var byClass = document.getElementsByClassName("CodeMirror"), editors = [];
|
8627 |
for (var i = 0; i < byClass.length; i++) {
|
8628 |
var cm = byClass[i].CodeMirror;
|
8629 |
+
if (cm) { editors.push(cm); }
|
8630 |
}
|
8631 |
+
if (editors.length) { editors[0].operation(function () {
|
8632 |
+
for (var i = 0; i < editors.length; i++) { f(editors[i]); }
|
8633 |
+
}); }
|
8634 |
}
|
8635 |
|
8636 |
var globalsRegistered = false;
|
11755 |
|
11756 |
addLegacyProps(CodeMirror);
|
11757 |
|
11758 |
+
CodeMirror.version = "5.42.0";
|
11759 |
|
11760 |
return CodeMirror;
|
11761 |
|
13407 |
if (type == "variable") cx.marked = "property";
|
13408 |
if (type == "spread") return cont(pattern);
|
13409 |
if (type == "}") return pass();
|
13410 |
+
if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
|
13411 |
return cont(expect(":"), pattern, maybeAssign);
|
13412 |
}
|
13413 |
function eltpattern() {
|
assets/js/forms-admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){var o=void 0;!function o(a,l,s){function c(t,e){if(!l[t]){if(!a[t]){var r=!1;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return c(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var u=!1,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,r){"use strict";t.exports=function(n,i){var e={showType:function(e){var t=e.type();return t=t.charAt(0).toUpperCase()+t.slice(1),n("div",[n("label",i.fieldType),n("span",t)])},label:function(e){return n("div",[n("label",i.fieldLabel),n("input.widefat",{type:"text",value:e.label(),onchange:n.withAttr("value",e.label),placeholder:e.title()})])},value:function(e){var t="hidden"===e.type();return n("div",[n("label",[t?i.value:i.initialValue," ",t?"":n("small",{style:"float: right; font-weight: normal;"},i.optional)]),n("input.widefat",{type:"text",value:e.value(),onchange:n.withAttr("value",e.value)}),t?"":n("p.help",i.valueHelp)])},numberMinMax:function(e){return n("div",[n("div.row",[n("div.col.col-3",[n("label",i.min),n("input",{type:"number",onchange:n.withAttr("value",e.min)})]),n("div.col.col-3",[n("label",i.max),n("input",{type:"number",onchange:n.withAttr("value",e.max)})])])])},isRequired:function(e){var t={type:"checkbox",checked:e.required(),onchange:n.withAttr("checked",e.required)},r=void 0;return e.forceRequired()&&(t.required=!0,t.disabled=!0,r=n("p.help",i.forceRequired)),n("div",[n("label.cb-wrap",[n("input",t),i.isFieldRequired]),r])},placeholder:function(e){return n("div",[n("label",[i.placeholder," ",n("small",{style:"float: right; font-weight: normal;"},i.optional)]),n("input.widefat",{type:"text",value:e.placeholder(),onchange:n.withAttr("value",e.placeholder),placeholder:""}),n("p.help",i.placeholderHelp)])},useParagraphs:function(e){return n("div",[n("label.cb-wrap",[n("input",{type:"checkbox",checked:e.wrap(),onchange:n.withAttr("checked",e.wrap)}),i.wrapInParagraphTags])])},choiceType:function(e){var t=[n("option",{value:"select",selected:"select"===e.type()&&"selected"},i.dropdown),n("option",{value:"radio",selected:"radio"===e.type()&&"selected"},i.radioButtons)];return e.acceptsMultipleValues&&t.push(n("option",{value:"checkbox",selected:"checkbox"===e.type()&&"selected"},i.checkboxes)),n("div",[n("label",i.choiceType),n("select",{value:e.type(),onchange:n.withAttr("value",e.type)},t)])},choices:function(r){var e=[];return e.push(n("div",[n("label",i.choices),n("div.limit-height",[n("table",[r.choices().map(function(e,t){return n("tr",{"data-id":t},[n("td.cb",n("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:n.withAttr("value",r.selectChoice.bind(r)),checked:e.selected(),value:e.value(),title:i.preselect})),n("td.stretch",n("input.widefat",{type:"text",value:e.label(),placeholder:e.title(),onchange:n.withAttr("value",e.label)})),n("td",n("span",{title:i.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,t)},""))])})])])])),e},linkToTerms:function(e){return n("div",[n("label",i.agreeToTermsLink),n("input.widefat",{type:"text",value:e.link,onchange:n.withAttr("value",e.link),placeholder:"https://..."})])}};return e}},{}],2:[function(i,e,t){"use strict";e.exports=function(e,t){var r={},n=i("./field-forms-rows.js")(e,t);return r.render=function(e){var t=e.type();if("function"==typeof r[t])return r[t](e);switch(t){case"select":case"radio":case"checkbox":return r.choice(e)}return r.text(e)},r.text=function(e){return[n.label(e),n.placeholder(e),n.value(e),n.isRequired(e),n.useParagraphs(e)]},r.choice=function(e){var t=[n.label(e),n.choiceType(e),n.choices(e)];return"select"===e.type()&&t.push(n.placeholder(e)),t.push(n.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(n.isRequired(e)),t},r.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[n.showType(e),n.value(e)]},r.submit=function(e){return e.label(""),e.placeholder(""),[n.value(e),n.useParagraphs(e)]},r["terms-checkbox"]=function(e){return[n.label(e),n.linkToTerms(e),n.isRequired(e),n.useParagraphs(e)]},r.number=function(e){return[r.text(e),n.numberMinMax(e)]},r}},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var l=e("html"),s=function(e){e.dom.checked&&e.dom.setAttribute("checked","true"),e.dom.value&&e.dom.setAttribute("value",e.dom.value),e.dom.selected&&e.dom.setAttribute("selected","true")};t.exports=function(o){var a={};return a.select=function(e){var t={name:e.name(),required:e.required()},r=!1,n=e.choices().map(function(e){return e.selected()&&(r=!0),o("option",{value:e.value()!==e.label()?e.value():void 0,selected:e.selected(),oncreate:s},e.label())}),i=e.placeholder();return 0<i.length&&n.unshift(o("option",{disabled:!0,value:"",selected:!r,oncreate:s},i)),o("select",t,n)},a["terms-checkbox"]=function(e){var t=void 0;return t=0<e.link().length?o("a",{href:e.link(),target:"_blank"},e.label()):e.label(),o("label",[o("input",{name:e.name(),type:"checkbox",value:e.value(),required:e.required()})," ",t])},a.checkbox=function(n){return n.choices().map(function(e){var t=n.name()+("checkbox"===n.type()?"[]":""),r=n.required()&&"radio"===n.type();return o("label",[o("input",{name:t,type:n.type(),value:e.value(),checked:e.selected(),required:r,oncreate:s})," ",o("span",e.label())])})},a.radio=a.checkbox,a.default=function(e){var t={type:e.type()};return e.name()&&(t.name=e.name()),e.min()&&(t.min=e.min()),e.max()&&(t.max=e.max()),0<e.value().length&&(t.value=e.value()),0<e.placeholder().length&&(t.placeholder=e.placeholder()),t.required=e.required(),t.oncreate=s,o("input",t)},function(e){var t,r,n,i=document.createElement("div");return t=0<e.label().length&&e.showLabel()?o("label",{},e.label()):"",r="function"==typeof a[e.type()]?a[e.type()](e):a.default(e),n=e.wrap()?o("p",[t,r]):[t,r],o.render(i,n),l.prettyPrint(i.innerHTML)+"\n"}}},{html:22}],4:[function(f,e,t){"use strict";e.exports=function(i,e,t,o,r,a){var l,n=f("./field-generator.js")(i),s=f("./overlay.js")(i,a),c=f("./field-forms.js")(i,a);function u(e){(l=o.get(e))&&0<l.choices().length&&l.value(l.choices().map(function(e){return e.label()}).join("|")),i.redraw()}function d(){var e=n(l);t.insert(e),u(""),i.redraw()}return t.on("blur",i.redraw),{view:function(){var e=o.getCategories(),r=o.getAll(),t=i("div.available-fields.small-margin",[i("h4",a.chooseField),e.map(function(t){var e=r.filter(function(e){return e.category===t});if(e.length)return i("div.tiny-margin",[i("strong",t),e.map(function(e){var t="button";e.forceRequired()&&(t+=" is-required");var r=e.inFormContent();return null!==r&&(t+=" "+(r?"in-form":"not-in-form")),i("button",{className:t,type:"button",onclick:i.withAttr("value",u),value:e.index},e.title())})])})]),n=null;return l&&(n=i(s(i("div.field-wizard",[i("h3",[l.title(),l.forceRequired()?i("span.red","*"):"",l.name().length?i("code",l.name()):""]),l.help().length?i("p",i.trust(l.help())):"",c.render(l),i("p",[i("button",{class:"button-primary",type:"button",onkeydown:function(e){13==(e=e||window.event).keyCode&&d()},onclick:d},a.addToForm)])]),u))),[t,n]},controller:function(){}}}},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){"use strict";t.exports=function(i,o){var a=[];function l(e,t,r){var n=i.register(e,t);r||a.push(n)}function s(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function t(e){var t=o.listFields,r=s(e.field_type),n={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:r,choices:e.choices,acceptsMultipleValues:!1};return"address"!==n.type?l(t,n,!1):(l(t,{name:n.name+"[addr1]",type:"text",mailchimpType:"address",title:o.streetAddress}),l(t,{name:n.name+"[city]",type:"text",mailchimpType:"address",title:o.city}),l(t,{name:n.name+"[state]",type:"text",mailchimpType:"address",title:o.state}),l(t,{name:n.name+"[zip]",type:"text",mailchimpType:"address",title:o.zip}),l(t,{name:n.name+"[country]",type:"select",mailchimpType:"address",title:o.country,choices:mc4wp_vars.countries})),!0}function r(e){var t=o.interestCategories,r=s(e.field_type);l(t,{title:e.name,name:"INTERESTS["+e.id+"]",type:r,choices:e.interests,acceptsMultipleValues:"checkbox"===r},!1)}function n(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e.public&&!t.public?-1:!e.public&&t.public?1:0}),e.merge_fields.forEach(t),e.interest_categories.forEach(r)}return{registerCustomFields:function(e){var t,r=o.formFields;for(var n in l(r,{name:"",value:o.subscribe,type:"submit",title:o.submitButton},!0),t={},e)t[e[n].id]=e[n].name;l(r,{name:"_mc4wp_lists",type:"checkbox",title:o.listChoice,choices:t,help:o.listChoiceDescription,acceptsMultipleValues:!0},!0),t={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},l(r,{name:"_mc4wp_action",type:"radio",title:o.formAction,choices:t,value:"subscribe",help:o.formActionDescription},!0),l(r,{name:"AGREE_TO_TERMS",value:1,type:"terms-checkbox",label:o.agreeToTerms,title:o.agreeToTermsShort,showLabel:!1,required:!0},!0)},registerListFields:n,registerListsFields:function(e){a.forEach(i.deregister),e.forEach(n)}}}},{}],6:[function(e,t,r){"use strict";var n=e("mithril/stream");t.exports=function(o,a){var l,s=[],c=[],u=function(e){this.name=n(e.name),this.title=n(e.title||e.name),this.type=n(e.type),this.mailchimpType=n(e.mailchimpType||""),this.label=n(e.label||e.title||""),this.showLabel=n(void 0===e.showLabel||e.showLabel),this.value=n(e.value||""),this.placeholder=n(e.placeholder||""),this.required=n(e.required||!1),this.forceRequired=n(e.forceRequired||!1),this.wrap=n(void 0===e.wrap||e.wrap),this.min=n(e.min||null),this.max=n(e.max||null),this.help=n(e.help||""),this.choices=n(e.choices||[]),this.inFormContent=n(null),this.acceptsMultipleValues=e.acceptsMultipleValues,this.link=n(e.link||""),this.selectChoice=function(t){var r=this;this.choices(this.choices().map(function(e){return e.value()===t?e.selected(!0):"checkbox"!==r.type()&&e.selected(!1),e}))}},d=function(e){this.label=n(e.label),this.title=n(e.title||e.label),this.selected=n(e.selected||!1),this.value=n(e.value||e.label)};function f(t,r){return s.filter(function(e){return e[t]()===r})}return{get:function(e){return s[e]},getAll:function(){return s=s.map(function(e,t){return e.index=t,e})},getCategories:function(){return c},deregister:function(e){var t=s.indexOf(e);-1<t&&(delete s[t],o.redraw())},register:function(e,t){var r,n,i=f("name",t.name).shift();if(!i)return t.choices&&(t.choices="function"==typeof(n=t.choices).map?n.map(function(e){return new d({label:e})}):Object.keys(n).map(function(e){var t=n[e];return new d({label:t,value:e})}),t.value&&(t.choices=t.choices.map(function(e){return e.value()===t.value&&e.selected(!0),e}))),c.indexOf(e)<0&&c.push(e),(r=new u(t)).category=e,s.push(r),l&&window.clearTimeout(l),l=window.setTimeout(o.redraw,200),a.trigger("fields.change"),r;!i.forceRequired()&&t.forceRequired&&i.forceRequired(!0)},getAllWhere:f}}},{"mithril/stream":23}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold.js"),e("codemirror/addon/edit/matchtags.js"),e("codemirror/addon/edit/closetag.js"),e("codemirror/addon/selection/active-line.js"),e("codemirror/addon/edit/matchbrackets.js");var i,o,a={},l=document.createElement("form"),s=!1,c=document.getElementById("mc4wp-form-content"),u=document.getElementById("mc4wp-form-preview"),d=/\{[^{}]+\}/g;function f(){var e=u.contentDocument||u.contentWindow.document;(o=e.querySelector(".mc4wp-form-fields"))&&h()}function h(){var e=a.getValue();e=e.replace(d,"").replace(d,""),o.innerHTML=e,o.dispatchEvent(new Event("mc4wp-refresh"))}function p(){return s&&(l.innerHTML=a.getValue().toLowerCase(),s=!1),l}window.addEventListener("load",function(){n.signal(i,"change")}),c.addEventListener("change",function(){s=!0,h()}),a.getValue=function(){return i?i.getValue():c.value},a.query=function(e){return p().querySelectorAll(e.toLowerCase())},a.containsField=function(e){return null!==p().elements.namedItem(e.toLowerCase())},a.insert=function(e){i?(i.replaceSelection(e),i.focus()):c.value+=e},a.on=function(e,t){return i?(e="input"===e?"changes":e,i.on(e,t)):c.addEventListener(e,t)},a.refresh=function(){i&&i.refresh()},l.innerHTML=c.value.toLowerCase(),n&&(i=n.fromTextArea(c,{selectionPointer:!0,mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0,styleActiveLine:!0,matchBrackets:!0,matchTags:{bothTags:!0}}),window.dispatchEvent&&i.on("change",function(){if("function"==typeof Event){var e=new Event("change",{bubbles:!0});c.dispatchEvent(e)}})),u.addEventListener("load",f),f.call(),t.exports=a},{codemirror:17,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchbrackets.js":13,"codemirror/addon/edit/matchtags.js":14,"codemirror/addon/fold/xml-fold.js":15,"codemirror/addon/selection/active-line.js":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(e,t,r){"use strict";t.exports=function(t,i,e,r,n,o){var a=document.getElementById("required-fields");function l(){var n,e;r.getAll().forEach(function(e){if(!(e.name().length<=0)){var t=e.name();"checkbox"===e.type()&&(t+="[]");var r=i.containsField(t);if(e.inFormContent(r),"address"===e.mailchimpType()){e.originalRequiredValue=void 0===e.originalRequiredValue?e.forceRequired():e.originalRequiredValue;var n=e.name().replace(/\[(\w+)\]/g,"");0<i.query('[name^="'+n+'"]').length?(void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired()),e.forceRequired(!0)):e.forceRequired(e.originalRequiredValue)}}}),n=r.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase().replace(/\[(\w+)\]/g,".$1")}),e=i.query("[required]"),Array.prototype.forEach.call(e,function(e){var t=e.name;if(t&&!(t.length<0)&&"_"!==t[0]){var r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/\[\]$/,"")).indexOf(".");r=0<r?r:t.length,t=t.substr(0,r).toUpperCase()+t.substr(r),-1===n.indexOf(t)&&n.push(t)}}),a.value=n.join(","),t.redraw()}i.on("change",o.debounce(l,500)),n.on("fields.change",o.debounce(l,500))}},{}],9:[function(e,t,r){"use strict";var i={};function o(e,t){i[e]=t,n()}function a(e){delete i[e],n()}function n(){var e="";for(var t in i)e+='<div class="notice notice-warning inline"><p>'+i[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){(r=document.createElement("div")).className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}t.exports={init:function(r,n){var e=function(){-1<r.getValue().toLowerCase().indexOf('name="groupings')?o("deprecated_groupings","Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly."):a("deprecated_groupings")},t=function(){var e=n.getAllWhere("forceRequired",!0).filter(function(e){return!r.containsField(e.name().toUpperCase())}),t="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";t+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+e.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",0<e.length?o("required_fields_missing",t):a("required_fields_missing")};e(),r.on("focus",e),r.on("blur",e),t(),r.on("blur",t),r.on("focus",t)}}},{}],10:[function(e,t,r){"use strict";t.exports=function(r,n){var i=void 0,o=void 0;function a(){document.removeEventListener("keydown",l),window.removeEventListener("resize",s),o()}function l(e){27==(e=e||window.event).keyCode&&a(),13==e.keyCode&&e.preventDefault()}function s(){if(i){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-i.clientWidth-40)/2,n=(t-i.clientHeight-40)/2;i.style.left=(0<r?r:0)+"px",i.style.top=(0<n?n:0)+"px"}}function c(e){i=e.dom,s()}return function(e,t){return o=t,{oncreate:function(){document.addEventListener("keydown",l),window.addEventListener("resize",s)},onremove:function(){document.removeEventListener("keydown",l),window.removeEventListener("resize",s)},view:function(){return[r("div.overlay-wrap",r("div.overlay",{oncreate:c},[r("span",{class:"close dashicons dashicons-no",title:n.close,onclick:a}),e])),r("div.overlay-background",{title:n.close,onclick:a})]}}}}},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=window.formEditor=u,m=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),g=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),m);var v=new f(h,n);o.on("selectedLists.change",v.registerListsFields),v.registerListsFields(a.getSelectedLists()),v.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),g.init(p,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=p,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,t,r){var n;n=function(y){y.defineOption("autoCloseTags",!1,function(e,t,r){if(r!=y.Init&&r&&e.removeKeyMap("autoCloseTags"),t){var n={name:"autoCloseTags"};("object"!=typeof t||t.whenClosing)&&(n["'/'"]=function(e){return(t=e).getOption("disableInput")?y.Pass:i(t,!0);var t}),("object"!=typeof t||t.whenOpening)&&(n["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return y.Pass;for(var t=e.listSelections(),r=[],n=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return y.Pass;var o=t[i].head,a=e.getTokenAt(o),l=y.innerMode(e.getMode(),a.state),s=l.state;if("xml"!=l.mode.name||!s.tagName)return y.Pass;var c="html"==l.mode.configuration,u="object"==typeof n&&n.dontCloseTags||c&&b,d="object"==typeof n&&n.indentTags||c&&w,f=s.tagName;a.end>o.ch&&(f=f.slice(0,f.length-a.end+o.ch));var h=f.toLowerCase();if(!f||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&"closeTag"==s.type||a.string.indexOf("/")==a.string.length-1||u&&-1<x(u,h)||k(e,f,o,s,!0))return y.Pass;var p=d&&-1<x(d,h);r[i]={indent:p,text:">"+(p?"\n\n":"")+"</"+f+">",newPos:p?y.Pos(o.line+1,0):y.Pos(o.line,o.ch+1)}}for(var m="object"==typeof n&&n.dontIndentOnAutoClose,i=t.length-1;0<=i;i--){var g=r[i];e.replaceRange(g.text,t[i].head,t[i].anchor,"+insert");var v=e.listSelections().slice(0);v[i]={head:g.newPos,anchor:g.newPos},e.setSelections(v),!m&&g.indent&&(e.indentLine(g.newPos.line,null,!0),e.indentLine(g.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(n)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],w=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(e,t){for(var r=e.listSelections(),n=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,l=0;l<r.length;l++){if(!r[l].empty())return y.Pass;var s,c=r[l].head,u=e.getTokenAt(c),d=y.innerMode(e.getMode(),u.state),f=d.state;if(t&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=c.ch-1))return y.Pass;if("xml"!=d.mode.name)if("htmlmixed"==e.getMode().name&&"javascript"==d.mode.name)s=i+"script";else{if("htmlmixed"!=e.getMode().name||"css"!=d.mode.name)return y.Pass;s=i+"style"}else{if(!f.context||!f.context.tagName||k(e,f.context.tagName,c,f))return y.Pass;s=i+f.context.tagName}">"!=e.getLine(c.line).charAt(u.end)&&(s+=">"),n[l]=s}if(e.replaceSelections(n),r=e.listSelections(),!a)for(l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&e.indentLine(r[l].head.line)}function x(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function k(e,t,r,n,i){if(!y.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=y.scanForClosingTag(e,r,null,o);if(!a||a.tag!=t)return!1;for(var l=n.context,s=i?1:0;l&&l.tagName==t;l=l.prev)++s;r=a.to;for(var c=1;c<s;c++){var u=y.scanForClosingTag(e,r,null,o);if(!u||u.tag!=t)return!1;r=u.to}return!0}y.commands.closeTag=function(e){return i(e)}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../fold/xml-fold"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../fold/xml-fold":15}],13:[function(e,t,r){var n;n=function(n){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),m=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function d(e,t,r){var n=e.getLineHandle(t.line),i=t.ch-1,o=r&&r.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=!o&&0<=i&&g[n.text.charAt(i)]||g[n.text.charAt(++i)];if(!a)return null;var l=">"==a.charAt(1)?1:-1;if(r&&r.strict&&0<l!=(i==t.ch))return null;var s=e.getTokenTypeAt(m(t.line,i+1)),c=f(e,m(t.line,i+(0<l?1:0)),l,s||null,r);return null==c?null:{from:m(t.line,i),to:c&&c.pos,match:c&&c.ch==a.charAt(0),forward:0<l}}function f(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,l=[],s=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,c=0<r?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=r){var d=e.getLine(u);if(d){var f=0<r?0:d.length-1,h=0<r?d.length:-1;if(!(d.length>o))for(u==t.line&&(f=t.ch-(r<0?1:0));f!=h;f+=r){var p=d.charAt(f);if(s.test(p)&&(void 0===n||e.getTokenTypeAt(m(u,f+1))==n))if(">"==g[p].charAt(1)==0<r)l.push(p);else{if(!l.length)return{pos:m(u,f),ch:p};l.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),a=0;a<o.length;a++){var l=o[a].empty()&&d(e,o[a].head,r);if(l&&e.getLine(l.from.line).length<=n){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(l.from,m(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=n&&i.push(e.markText(l.to,m(l.to.line,l.to.ch+1),{className:s}))}}if(i.length){u&&e.state.focused&&e.focus();var c=function(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})};if(!t)return c;setTimeout(c,800)}}function i(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=t(e,!1,e.state.matchBrackets)})}n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",i),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(t=r?(r.strict=t,r):t?{strict:!0}:null),d(this,e,t)}),n.defineExtension("scanForBracket",function(e,t,r,n){return f(this,e,t,r,n)})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],14:[function(e,t,r){var n;n=function(a){"use strict";function l(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(o){o.state.failedTagMatch=!1,o.operation(function(){if(l(o),!o.somethingSelected()){var e=o.getCursor(),t=o.getViewport();t.from=Math.min(t.from,e.line),t.to=Math.max(e.line+1,t.to);var r=a.findMatchingTag(o,e,t);if(r){if(o.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(o.state.tagHit=o.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var i="close"==r.at?r.open:r.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}a.defineOption("matchTags",!1,function(e,t,r){r&&r!=a.Init&&(e.off("cursorActivity",n),e.off("viewportChange",i),l(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",n),e.on("viewportChange",i),n(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var r="close"==t.at?t.open:t.close;r&&e.extendSelection(r.to,r.from)}}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../fold/xml-fold"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../fold/xml-fold":15}],15:[function(e,t,r){var n;n=function(e){"use strict";var s=e.Pos;function c(e,t){return e.line-t.line||e.ch-t.ch}var t="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("<(/?)(["+t+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function i(e,t){var r=e.cm.getTokenTypeAt(s(e.line,t));return r&&/\btag\b/.test(r)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function d(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(o(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var r=[];;){var n,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(n=d(e)))return;if("selfClose"!=n)if(i[1]){for(var l=r.length-1;0<=l;--l)if(r[l]==i[2]){r.length=l;break}if(l<0&&(!t||t==i[2]))return{tag:i[2],from:s(o,a),to:s(e.line,e.ch)}}else r.push(i[2])}}function g(e,t){for(var r=[];;){var n=p(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=f(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;0<=l;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!t||t==a[2]))return{tag:a[2],from:s(e.line,e.ch),to:s(i,o)}}}else f(e)}}e.registerHelper("fold","xml",function(e,t){for(var r=new u(e,t.line,0);;){var n=h(r);if(!n||r.line!=t.line)return;var i=d(r);if(!i)return;if(!n[1]&&"selfClose"!=i){var o=s(r.line,r.ch),a=m(r,n[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,r){var n=new u(e,t.line,t.ch,r);if(-1!=n.text.indexOf(">")||-1!=n.text.indexOf("<")){var i=d(n),o=i&&s(n.line,n.ch),a=i&&f(n);if(i&&a&&!(0<c(n,t))){var l={from:s(n.line,n.ch),to:o,tag:a[2]};return"selfClose"==i?{open:l,close:null,at:"open"}:a[1]?{open:g(n,a[2]),close:l,at:"close"}:{open:l,close:m(n=new u(e,o.line,o.ch,r),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new u(e,t.line,t.ch,r);;){var o=g(i,n);if(!o)break;var a=m(new u(e,t.line,t.ch,r),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,r,n){return m(new u(e,t.line,t.ch,n?{from:0,to:n}:null),r)}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],16:[function(e,t,r){var n;n=function(i){"use strict";var l="CodeMirror-activeline",s="CodeMirror-activeline-background",c="CodeMirror-activeline-gutter";function u(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",l),e.removeLineClass(e.state.activeLines[t],"background",s),e.removeLineClass(e.state.activeLines[t],"gutter",c)}function o(t,e){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=t.getOption("styleActiveLine");if("object"==typeof o&&o.nonEmpty?i.anchor.line==i.head.line:i.empty()){var a=t.getLineHandleVisualStart(i.head.line);r[r.length-1]!=a&&r.push(a)}}(function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0})(t.state.activeLines,r)||t.operation(function(){u(t);for(var e=0;e<r.length;e++)t.addLineClass(r[e],"wrap",l),t.addLineClass(r[e],"background",s),t.addLineClass(r[e],"gutter",c);t.state.activeLines=r})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,r){var n=r!=i.Init&&r;t!=n&&(n&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],17:[function(e,t,r){var n,i;n=this,i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=r||n||i,k=x&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),a=!i&&/Chrome\//.test(e),g=/Opera\//.test(e),s=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),c=/PhantomJS/.test(e),u=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),d=/Android/.test(e),f=u||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),w=u||/Mac/.test(t),h=/\bCrOS\b/.test(e),p=/win/i.test(t),v=g&&e.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&15<=v&&(b=!(g=!1));var y=w&&(o||g&&(null==v||v<12.11)),C=m||x&&9<=k;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,L=function(e,t){var r=e.className,n=T(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function A(e,t){return M(e).appendChild(t)}function N(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,r,n){var i=N(e,t,r,n);return i.setAttribute("role","presentation"),i}function _(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function E(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function D(e,t){var r=e.className;T(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!T(r[n]).test(t)&&(t+=" "+r[n]);return t}S=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var z=function(e){e.select()};function W(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function P(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function H(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}u?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(z=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function j(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}I.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var R=30,B={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},U={origin:"*mouse"},K={origin:"+move"};function V(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var G=[""];function $(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function J(e,t){var r;return r=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&P(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var n=r<t?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function le(e,t,r){var n=this;this.input=r,n.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=O("div",null,"CodeMirror-code"),n.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=N("div",null,"CodeMirror-cursors"),n.measure=N("div",null,"CodeMirror-measure"),n.lineMeasure=N("div",null,"CodeMirror-measure"),n.lineSpace=O("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var i=O("div",[n.lineSpace],"CodeMirror-lines");n.mover=N("div",[i],null,"position: relative"),n.sizer=N("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=N("div",null,null,"position: absolute; height: "+R+"px; width: 1px;"),n.gutters=N("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=N("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=N("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),x&&k<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),b||m&&f||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function ce(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function ue(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function de(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function fe(e){if(null==e.parent)return null;for(var t=e.parent,r=j(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function we(e,t){return ve(e,t)<0?t:e}function xe(e,t){return ve(e,t)<0?e:t}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return ge(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?ge(o,se(e,o).text.length):(n=se(e,(r=t).line).text.length,null==(i=r.ch)||n<i?ge(r.line,n):i<0?ge(r.line,0):r)}function Te(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Ce(e,t[n]);return r}var Se=!1,Le=!1;function Me(e,t,r){this.marker=e,this.from=t,this.to=r}function Ae(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Oe(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ne(e,t){if(t.full)return null;var r=pe(e,t.from.line)&&se(e,t.from.line).markedSpans,n=pe(e,t.to.line)&&se(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Me(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Me(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=Y(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Ae(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=u),null==m.from)Ae(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m));else m.from+=u,c&&(l||(l=[])).push(m)}l&&(l=_e(l)),s&&s!=l&&(s=_e(s));var g=[l];if(!c){var v,y=t.text.length-2;if(0<y&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new Me(l[b].marker,null,null));for(var w=0;w<y;++w)g.push(v);g.push(s)}return g}function _e(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ee(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function De(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Fe(e){return e.inclusiveLeft?-1:0}function ze(e){return e.inclusiveRight?1:0}function We(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||Fe(e)-Fe(t);if(o)return-o;var a=ve(n.to,i.to)||ze(e)-ze(t);return a||t.id-e.id}function Pe(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||We(r,i.marker)<0)&&(r=i.marker);return r}function He(e){return Pe(e,!0)}function Ie(e){return Pe(e,!1)}function je(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||We(r,o.marker)<0)&&(r=o.marker)}return r}function Re(e,t,r,n,i){var o=se(e,t),a=Le&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=ve(c.from,r)||Fe(s.marker)-Fe(i),d=ve(c.to,n)||ze(s.marker)-ze(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=ve(c.to,r):0<ve(c.to,r))||0<=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,n)<=0:ve(c.from,n)<0)))return!0}}}function Be(e){for(var t;t=He(e);)e=t.find(-1,!0).line;return e}function qe(e,t){var r=se(e,t),n=Be(r);return r==n?t:fe(n)}function Ue(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!Ke(e,n))return t;for(;r=Ie(n);)n=r.find(1,!0).line;return fe(n)+1}function Ke(e,t){var r=Le&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Ve(e,t,n))return!0}}function Ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Ve(e,n.line,Ae(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ve(e,t,i))return!0}function Ge(e){for(var t=0,r=(e=Be(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function $e(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=He(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Ie(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Ye(e){var r=e.display,t=e.doc;r.maxLine=se(t,t.first),r.maxLineLength=$e(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=$e(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var Xe=null;function Ze(e,t,r){var n;Xe=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Xe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Xe=i)}return null!=n?n:Xe}var Je=function(){var P="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",H="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var I=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,j=/[stwN]/,R=/[LRr]/,B=/[Lb1n]/,q=/[1n]/;function U(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!I.test(e))return!1;for(var n,i=e.length,o=[],a=0;a<i;++a)o.push((n=e.charCodeAt(a))<=247?P.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?H.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var l=0,s=r;l<i;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=r;u<i;++u){var f=o[u];"1"==f&&"r"==d?o[u]="n":R.test(f)&&"r"==(d=f)&&(o[u]="R")}for(var h=1,p=o[0];h<i-1;++h){var m=o[h];"+"==m&&"1"==p&&"1"==o[h+1]?o[h]="1":","!=m||p!=o[h+1]||"1"!=p&&"n"!=p||(o[h]=p),p=m}for(var g=0;g<i;++g){var v=o[g];if(","==v)o[g]="N";else if("%"==v){var y=void 0;for(y=g+1;y<i&&"%"==o[y];++y);for(var b=g&&"!"==o[g-1]||y<i&&"1"==o[y]?"1":"N",w=g;w<y;++w)o[w]=b;g=y-1}}for(var x=0,k=r;x<i;++x){var C=o[x];"L"==k&&"1"==C?o[x]="L":R.test(C)&&(k=C)}for(var T=0;T<i;++T)if(j.test(o[T])){var S=void 0;for(S=T+1;S<i&&j.test(o[S]);++S);for(var L="L"==(T?o[T-1]:r),M=L==("L"==(S<i?o[S]:r))?L?"L":"R":r,A=T;A<S;++A)o[A]=M;T=S-1}for(var O,N=[],_=0;_<i;)if(B.test(o[_])){var E=_;for(++_;_<i&&B.test(o[_]);++_);N.push(new U(0,E,_))}else{var D=_,F=N.length;for(++_;_<i&&"L"!=o[_];++_);for(var z=D;z<_;)if(q.test(o[z])){D<z&&N.splice(F,0,new U(1,D,z));var W=z;for(++z;z<_&&q.test(o[z]);++z);N.splice(F,0,new U(2,W,z)),D=z}else++z;D<_&&N.splice(F,0,new U(1,D,_))}return"ltr"==t&&(1==N[0].level&&(O=e.match(/^\s+/))&&(N[0].from=O[0].length,N.unshift(new U(0,0,O[0].length))),1==Y(N).level&&(O=e.match(/\s+$/))&&(Y(N).to-=O[0].length,N.push(new U(0,i-O[0].length,i)))),"rtl"==t?N.reverse():N}}();function Qe(e,t){var r=e.order;return null==r&&(r=e.order=Je(e.text,t)),r}var et=[],tt=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||et).concat(r)}};function rt(e,t){return e._handlers&&e._handlers[t]||et}function nt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=j(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var r=rt(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ot(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,r||t.type,e,t),dt(t)||t.codemirrorIgnore}function at(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==j(r,t[n])&&r.push(t[n])}function lt(e,t){return 0<rt(e,t).length}function st(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){ct(e),ut(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),w&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(x&&k<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=N("span","");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&k<8))}var r=mt?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function bt(e){if(null!=gt)return gt;var t=A(e,document.createTextNode("AخA")),r=S(t,0,1).getBoundingClientRect(),n=S(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(gt=n.right-r.right<3)}var wt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},kt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ct="oncopy"in(wt=N("div"))||(wt.setAttribute("oncopy","return;"),"function"==typeof wt.oncopy),Tt=null;var St={},Lt={};function Mt(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function At(e,t){t=Mt(t);var r=St[t.name];if(!r)return At(e,"text/plain");var n=r(e,t);if(Ot.hasOwnProperty(t.name)){var i=Ot[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Ot={};function Nt(e,t){P(t,Ot.hasOwnProperty(e)?Ot[e]:Ot[e]={})}function _t(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Et(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Dt(e,t,r){return!e.startState||e.startState(t,r)}var Ft=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var zt=function(e,t){this.state=e,this.lookAhead=t},Wt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Pt(t,r,n,e){var s=[t.state.modeGen],i={};Vt(t,r.text,t.doc.mode,n,function(e,t){return s.push(e,t)},i,e);for(var c=n.state,o=function(e){n.baseTokens=s;var o=t.state.overlays[e],a=1,l=0;n.state=!0,Vt(t,r.text,o.mode,n,function(e,t){for(var r=a;l<e;){var n=s[a];e<n&&s.splice(a,1,e,s[a+1],n),a+=2,l=Math.min(e,n)}if(t)if(o.opaque)s.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var i=s[r+1];s[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=c,n.baseTokens=null,n.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:s,classes:i.bgClass||i.textClass?i:null}}function Ht(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=It(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&_t(e.doc.mode,n.state),o=Pt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new Wt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=se(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof zt?c.lookAhead:0)<=o.modeFrontier))return l;var u=H(s.text,null,e.options.tabSize);(null==i||u<n)&&(i=l-1,n=u)}return i}(r,n,e),a=o>t.first&&se(t,o-1).stateAfter,l=a?Wt.fromSaved(t,a,o):new Wt(t,Dt(t.mode),o);return t.iter(o,n,function(e){jt(r,e.text,l);var t=l.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?l.save():null,l.nextLine()}),e&&(t.modeFrontier=l.line),l}function jt(e,t,r,n){var i=e.doc.mode,o=new Ft(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Rt(i,r.state);!o.eol();)Bt(i,o,r.state),o.start=o.pos}function Rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Et(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Bt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Et(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Wt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},Wt.fromSaved=function(e,t,r){return t instanceof zt?new Wt(e,_t(e.mode,t.state),r,t.lookAhead):new Wt(e,_t(e.mode,t),r)},Wt.prototype.save=function(e){var t=!1!==e?_t(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new zt(t,this.maxLookAhead):t};var qt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ut(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=se(a,(t=Ce(a,t)).line),c=It(e,t.line,r),u=new Ft(s.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Bt(l,u,c.state),n&&o.push(new qt(u,i,_t(a.mode,c.state)));return n?o:new qt(u,i,c.state)}function Kt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Vt(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ft(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Kt(Rt(r,n.state),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&jt(e,t,n,d.pos),d.pos=t.length,null):Kt(Bt(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var Gt=function(e,t,r){this.text=e,De(this,t),this.height=r?r(this):1};Gt.prototype.lineNo=function(){return fe(this)},st(Gt);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Yt:$t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=O("span",null,null,b?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=Qt,bt(e.display.measure)&&(a=Qe(o,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(o,n,Ht(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Jt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,r,n,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){l=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var f=c.exec(t),h=f?f.index-d:t.length-d;if(h){var p=document.createTextNode(s.slice(d,d+h));x&&k<9?l.appendChild(N("span",[p])):l.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!f)break;d+=h+1;var m=void 0;if("\t"==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g;(m=l.appendChild(N("span",$(v),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=v}else"\r"==f[0]||"\n"==f[0]?(m=l.appendChild(N("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((m=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),x&&k<9?l.appendChild(N("span",[m])):l.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,l=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,l),x&&k<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==s.charCodeAt(t.length-1),r||n||i||u||a){var y=r||"";n&&(y+=n),i&&(y+=i);var b=N("span",[l],y,a);return o&&(b.title=o),e.content.appendChild(b)}e.content.appendChild(l)}}function er(d,f){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var l=e.pos,s=l+t.length;;){for(var c=void 0,u=0;u<f.length&&!((c=f[u]).to>l&&c.from<=l);u++);if(c.to>=s)return d(e,t,r,n,i,o,a);d(e,t.slice(0,c.to-l),r,n,null,o,a),n=null,t=t.slice(c.to-l),l=c.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==p&&k.widgetNode?y.push(k):x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||We(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==p)for(var T=0;T<y.length;++T)tr(t,0,y[T]);if(f&&(f.from||0)==p){if(tr(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(h<=p)break;for(var S=Math.min(h,v);;){if(g){var L=p+g.length;if(!f){var M=S<L?g.slice(0,S-p):g;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",d,l)}if(S<=L){g=g.slice(S-p),p=S;break}p=L,u=""}g=i.slice(o,o=r[m++]),a=Xt(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),Xt(r[A+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Ie(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?fe(Y(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ke(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new nr(e.doc,se(e.doc,o),o);n=o+a.size,i.push(a)}return i}var or=null;var ar=null;function lr(e,t){var r=rt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(sr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function sr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?hr(e,t):"widget"==o&&mr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),x&&k<8&&(e.node.style.zIndex=2)),e.node}function dr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zt(e,t)}function fr(e,t){var r=t.text.className,n=dr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,hr(e,t)):r&&(t.text.className=r)}function hr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ur(t);t.background=n.insertBefore(N("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function pr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ur(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ur(t),l=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(N("div",me(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var c=e.options.gutters[s],u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function mr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);gr(e,t,r)}function gr(e,t,r){if(vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)vr(e,t.rest[n],t,r,!1)}function vr(e,t,r,n,i){if(t.widgets)for(var o=ur(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),yr(s,c,r,n),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),lr(s,"redraw")}}function yr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function br(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,N("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function wr(e,t){for(var r=ht(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function xr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,N("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Tr(e){return R-e.display.nativeBarWidth}function Sr(e){return e.display.scroller.clientWidth-Tr(e)-e.display.barWidth}function Lr(e){return e.display.scroller.clientHeight-Tr(e)-e.display.barHeight}function Mr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(fe(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ar(e,t,r,n){return _r(e,Nr(e,t),r,n)}function Or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ln(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Nr(e,t){var r=fe(t),n=Or(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,tn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=fe(t=Be(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Zt(e,n);return n.text=i.pre,A(e.display.lineMeasure,i.pre),n}(e,t));var i=Mr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _r(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&Sr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];2<Math.abs(s.bottom-c.bottom)&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Fr(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+s));)++s;if((i=x&&k<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():zr(S(a,l,s).getClientRects(),n)).left||i.right||0==l)break;s=l,l-=1,c="right"}x&&k<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Tt)return Tt;var t=A(e,N("span","x")),r=t.getBoundingClientRect(),n=S(t,0,1).getBoundingClientRect();return Tt=1<Math.abs(r.left-n.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;0<l&&(c=n="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(x&&k<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+en(e.display),top:f.top,bottom:f.bottom}:Dr}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(h+p)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};i.left||i.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p);return w}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Er,Dr={left:0,right:0,top:0,bottom:0};function Fr(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=(i=t-l)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,s<=t&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function zr(e,t){var r=Dr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function Wr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Pr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wr(e.display.view[t])}function Hr(e){Pr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ir(){return a&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jr(){return a&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Rr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Br(e,t,r,n,i){if(!i){var o=Rr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=Ge(t);if("local"==n?a+=xr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:jr());var s=l.left+("window"==n?0:Ir());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function qr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Ir(),i-=jr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Ur(e,t,r,n,i){return n||(n=se(e.doc,t.line)),Br(e,n,Ar(e,n,t.ch,i),r)}function Kr(n,e,i,o,a,l){function s(e,t){var r=_r(n,a,e,t?"right":"left",l);return t?r.left=r.right:r.right=r.left,Br(n,o,r,i)}o=o||se(n.doc,e.line),a||(a=Nr(n,o));var c=Qe(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!c)return s("before"==r?t-1:t,"before"==r);function u(e,t,r){return s(r?e-1:e,1==c[t].level!=r)}var d=Ze(c,t,r),f=Xe,h=u(t,d,"before"==r);return null!=f&&(h.other=u(t,f,"before"!=r)),h}function Vr(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=se(e.doc,t.line),i=Ge(n)+xr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Gr(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function $r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Gr(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(o<i)return Gr(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=se(n,i);;){var l=Jr(e,a,i,t,r),s=je(a,l.ch+(0<l.xRel?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=se(n,i=c.line)}}function Yr(t,e,r,n){n-=Rr(e);var i=e.text.length,o=ae(function(e){return _r(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=ae(function(e){return _r(t,r,e).top>n},o,i)}}function Xr(e,t,r,n){return r||(r=Nr(e,t)),Yr(e,t,r,Br(e,t,_r(e,r,n),"line").top)}function Zr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(r,e,t,n,i){i-=Ge(e);var o=Nr(r,e),a=Rr(e),l=0,s=e.text.length,c=!0,u=Qe(e,r.doc.direction);if(u){var d=(r.options.lineWrapping?function(e,t,r,n,i,o,a){var l=Yr(e,t,n,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=s)){var p=1!=h.level,m=_r(e,n,p?Math.min(c,h.to)-1:Math.max(s,h.from)).right,g=m<o?o-m+1e9:m-o;(!u||g<d)&&(u=h,d=g)}}u||(u=i[i.length-1]);u.from<s&&(u={from:s,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(n,i,o,a,l,s,c){var e=ae(function(e){var t=l[e],r=1!=t.level;return Zr(Kr(n,ge(o,r?t.to:t.from,r?"before":"after"),"line",i,a),s,c,!0)},0,l.length-1),t=l[e];if(0<e){var r=1!=t.level,u=Kr(n,ge(o,r?t.from:t.to,r?"after":"before"),"line",i,a);Zr(u,s,c,!0)&&u.top>c&&(t=l[e-1])}return t})(r,e,t,o,u,n,i);l=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(e){var t=_r(r,o,e);return t.top+=a,t.bottom+=a,!!Zr(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,m=t),!0)},l,s),v=!1;if(m){var y=n-m.left<m.right-n,b=y==c;g=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||g!=s&&g!=l||g++,h=0==g?"after":g==e.text.length?"before":_r(r,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Kr(r,ge(t,g,h),"line",e,o);f=w.left,v=i<w.top||i>=w.bottom}return Gr(t,g=oe(e.text,g,1),h,v,n-f)}function Qr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Er){Er=N("pre");for(var t=0;t<49;++t)Er.appendChild(document.createTextNode("x")),Er.appendChild(N("br"));Er.appendChild(document.createTextNode("x"))}A(e.measure,Er);var r=Er.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function en(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t]);A(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function tn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nn(n){var i=Qr(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/en(n.display)-3);return function(e){if(Ke(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function on(e){var t=e.doc,r=nn(e);t.iter(function(e){var t=r(e);t!=e.height&&de(e,t)})}function an(e,t,r,n){var i=e.display;if(!r&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=$r(e,o,a);if(n&&1==c.xRel&&(s=se(e.doc,c.line).text).length==c.ch){var u=H(s,s.length,e.options.tabSize)-s.length;c=ge(c.line,Math.max(0,Math.round((o-Cr(e.display).left)/en(e.display))-u))}return c}function ln(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function cn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&un(e,l.head,i),s||fn(e,l,o)}}return n}function un(e,t,r){var n=Kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function dn(e,t){return e.top-t.top||e.left-t.left}function fn(a,e,t){var r=a.display,n=a.doc,i=document.createDocumentFragment(),o=Cr(a.display),L=o.left,M=Math.max(r.sizerWidth,Sr(a)-r.sizer.offsetLeft)-o.right,A="ltr"==n.direction;function O(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function l(r,y,b){var w,x,o=se(n,r),k=o.text.length;function C(e,t){return Ur(a,ge(r,e),"div",o,t)}function T(e,t,r){var n=Xr(a,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return C("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var S=Qe(o,n.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(S,y||0,null==b?k:b,function(e,t,r,n){var i="ltr"==r,o=C(e,i?"left":"right"),a=C(t-1,i?"right":"left"),l=null==y&&0==e,s=null==b&&t==k,c=0==n,u=!S||n==S.length-1;if(a.top-o.top<=3){var d=(A?s:l)&&u,f=(A?l:s)&&c?L:(i?o:a).left,h=d?M:(i?a:o).right;O(f,o.top,h-f,o.bottom)}else{var p,m,g,v;v=i?(p=A&&l&&c?L:o.left,m=A?M:T(e,r,"before"),g=A?L:T(t,r,"after"),A&&s&&u?M:a.right):(p=A?T(e,r,"before"):L,m=!A&&l&&c?M:o.right,g=!A&&s&&u?L:a.left,A?T(t,r,"after"):M),O(p,o.top,m-p,o.bottom),o.bottom<a.top&&O(L,o.bottom,null,a.top),O(g,a.top,v-g,a.bottom)}(!w||dn(o,w)<0)&&(w=o),dn(a,w)<0&&(w=a),(!x||dn(o,x)<0)&&(x=o),dn(a,x)<0&&(x=a)}),{start:w,end:x}}var s=e.from(),c=e.to();if(s.line==c.line)l(s.line,s.ch,c.ch);else{var u=se(n,s.line),d=se(n,c.line),f=Be(u)==Be(d),h=l(s.line,s.ch,f?u.text.length+1:null).end,p=l(c.line,f?0:null,c.ch).start;f&&(h.top<p.top-2?(O(h.right,h.top,null,h.bottom),O(L,p.top,p.left,p.bottom)):O(h.right,h.top,p.left-h.right,h.bottom)),h.bottom<p.top&&O(L,h.bottom,null,p.top)}t.appendChild(i)}function hn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function pn(e){e.state.focused||(e.display.input.focus(),gn(e))}function mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vn(e))},100)}function gn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function vn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(x&&k<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=Qr(t)),(.005<s||s<-.005)&&(de(i.line,o),bn(i.line),i.rest))for(var c=0;c<i.rest.length;c++)bn(i.rest[c])}}}function bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function wn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-xr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),a=he(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?a=he(t,Ge(se(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=he(t,Ge(se(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function xn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function kn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=me(e.options,t.first+t.size-1),n=e.display;if(r.length==n.lineNumChars)return!1;var i=n.measure.appendChild(N("div",[N("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",li(e),!0}function Cn(e,t){var r=e.display,n=Qr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Lr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+kr(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Sr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Tn(e,t){null!=t&&(Mn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Sn(e){Mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||Mn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Mn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,An(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function An(e,t,r,n){var i=Cn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,i.scrollLeft,i.scrollTop)}function On(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||ai(e,{top:t}),Nn(e,t,!0),m&&ai(e),ti(e,100))}function Nn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function _n(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,xn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function En(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Dn=function(e,t,r){this.cm=r;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),tt(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Dn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dn.prototype.zeroWidthHack=function(){var e=w&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},Dn.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},Dn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fn=function(){};function zn(e,t){t||(t=En(e));var r=e.display.barWidth,n=e.display.barHeight;Wn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&yn(e),Wn(e,En(e)),r=e.display.barWidth,n=e.display.barHeight}function Wn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Fn.prototype.update=function(){return{bottom:0,right:0}},Fn.prototype.setScrollLeft=function(){},Fn.prototype.setScrollTop=function(){},Fn.prototype.clear=function(){};var Pn={native:Dn,null:Fn};function Hn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&L(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Pn[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),tt(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?_n(r,e):On(r,e)},r),r.display.scrollbars.addClass&&D(r.display.wrapper,r.display.scrollbars.addClass)}var In=0;function jn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++In},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function Rn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{or=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Bn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ii(i.cm,i.update);var i;for(var o=0;o<t.length;o++)qn(t[o]);for(var a=0;a<t.length;a++)Un(t[a]);for(var l=0;l<t.length;l++)Kn(t[l])}(e)})}function Bn(e){var t,r,n=e.cm,i=n.display;!(r=(t=n).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Tr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Tr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Ye(n),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ni(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qn(e){var t=e.cm,r=t.display;e.updatedDisplay&&yn(t),e.barMeasure=En(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Sr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Un(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_n(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zn(t,e.barMeasure),e.updatedDisplay&&si(t,e.barMeasure),e.selectionChanged&&hn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&pn(e.cm)}function Kn(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&oi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Nn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&_n(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=N("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-xr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Kr(e,t),s=r&&r!=t?Kr(e,r):l,c=Cn(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(On(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(_n(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||it(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&it(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vn(e,t){if(e.curOp)return t();jn(e);try{return t()}finally{Rn(e)}}function Gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);jn(e);try{return t.apply(e,arguments)}finally{Rn(e)}}}function $n(e){return function(){if(this.curOp)return e.apply(this,arguments);jn(this);try{return e.apply(this,arguments)}finally{Rn(this)}}}function Yn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);jn(e);try{return t.apply(this,arguments)}finally{Rn(e)}}}function Xn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&qe(e.doc,t)<i.viewTo&&Jn(e);else if(r<=i.viewFrom)Le&&Ue(e.doc,r+n)>i.viewFrom?Jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Jn(e);else if(t<=i.viewFrom){var o=Qn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Jn(e)}else if(r>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jn(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(ir(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Jn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Zn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[ln(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==j(a,r)&&a.push(r)}}}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,r,n){var i,o=ln(e,t),a=e.display.view;if(!Le||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<n){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;qe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function ei(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,W(ri,e))}function ri(s){var c=s.doc;if(!(c.highlightFrontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=It(s,c.highlightFrontier),f=[];c.iter(d.line,Math.min(c.first+c.size,s.display.viewTo+500),function(e){if(d.line>=s.display.viewFrom){var t=e.styles,r=e.text.length>s.options.maxHighlightLength?_t(c.mode,d.state):null,n=Pt(s,e,d,!0);r&&(d.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),l=0;!a&&l<t.length;++l)a=t[l]!=e.styles[l];a&&f.push(d.line),e.stateAfter=d.save(),d.nextLine()}else e.text.length<=s.options.maxHighlightLength&&jt(s,e.text,d),e.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>u)return ti(s,s.options.workDelay),!0}),c.highlightFrontier=d.line,c.modeFrontier=Math.max(c.modeFrontier,d.line),f.length&&Vn(s,function(){for(var e=0;e<f.length;e++)Zn(s,f[e],"text")})}}var ni=function(e,t,r){var n=e.display;this.viewport=t,this.visible=wn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Sr(e),this.force=r,this.dims=tn(e),this.events=[]};function ii(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==ei(e))return!1;kn(e)&&(Jn(e),t.dims=tn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Le&&(o=qe(e.doc,o),a=Ue(e.doc,a));var l,s,c,u,d=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;s=o,c=a,0==(u=(l=e).display).view.length||s>=u.viewTo||c<=u.viewFrom?(u.view=ir(l,s,c),u.viewFrom=s):(u.viewFrom>s?u.view=ir(l,s,u.viewFrom).concat(u.view):u.viewFrom<s&&(u.view=u.view.slice(ln(l,s))),u.viewFrom=s,u.viewTo<c?u.view=u.view.concat(ir(l,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,ln(l,c)))),u.viewTo=c,r.viewOffset=Ge(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=ei(e);if(!d&&0==f&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=function(e){if(e.hasFocus())return null;var t=E();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<f&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(e){var t=e.nextSibling;return b&&w&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var s=n.view,c=n.viewFrom,u=0;u<s.length;u++){var d=s[u];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var f=i&&null!=e&&e<=c&&d.lineNumber;d.changes&&(-1<j(d.changes,"gutter")&&(f=!1),cr(r,d,c,t)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(me(r.options,c)))),a=d.node.nextSibling}else{var h=(g=c,v=t,void 0,y=dr(p=r,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),hr(p,m),pr(p,m,g,v),gr(p,m,v),m.node);o.insertBefore(h,a)}c+=d.size}var p,m,g,v,y;for(;a;)a=l(a)}(e,r.updateLineNumbers,t.dims),4<f&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=E()&&(e.activeElt.focus(),e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(h),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,d&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ti(e,400)),!(r.updateLineNumbers=null)}function oi(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Sr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Lr(e),r.top)}),t.visible=wn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ii(e,t);n=!1){yn(e);var i=En(e);sn(e),zn(e,i),si(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ai(e,t){var r=new ni(e,t);if(ii(e,r)){yn(e),oi(e,r);var n=En(e);sn(e),zn(e,n),si(e,n),r.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function si(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function ci(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(N("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",li(e)}function ui(e){var t=j(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ni.prototype.signal=function(e,t){lt(e,t)&&this.events.push(arguments)},ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var di=0,fi=null;function hi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function pi(e){var t=hi(e);return t.x*=fi,t.y*=fi,t}function mi(e,t){var r=hi(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&w&&b)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!m&&!g&&null!=fi)return i&&s&&On(e,Math.max(0,a.scrollTop+i*fi)),_n(e,Math.max(0,a.scrollLeft+n*fi)),(!i||i&&s)&&ct(t),void(o.wheelStartX=null);if(i&&null!=fi){var f=i*fi,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):p=Math.min(e.doc.height,p+f+50),ai(e,{top:h,bottom:p})}di<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(fi=(fi*di+r)/(di+1),++di)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}x?fi=-.53:m?fi=15:a?fi=-.7:s&&(fi=-1/3);var gi=function(e,t){this.ranges=e,this.primIndex=t};gi.prototype.primary=function(){return this.ranges[this.primIndex]},gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ye(r.anchor,n.anchor)||!ye(r.head,n.head))return!1}return!0},gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new gi(e,this.primIndex)},gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},gi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ve(t,n.from())&&ve(e,n.to())<=0)return r}return-1};var vi=function(e,t){this.anchor=e,this.head=t};function yi(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ve(e.from(),t.from())}),r=j(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ve(l.to(),a.from());if(n&&!a.empty()?0<s:0<=s){var c=xe(l.from(),a.from()),u=we(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new vi(d?u:c,d?c:u))}}return new gi(t,r)}function bi(e,t){return new gi([new vi(e,t||e)],0)}function wi(e){return e.text?ge(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function xi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return wi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=wi(t).ch-t.to.ch),ge(r,n)}function ki(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new vi(xi(i.anchor,t),xi(i.head,t)))}return yi(e.cm,r,e.sel.primIndex)}function Ci(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function Ti(e){e.doc.mode=At(e.options,e.doc.modeOption),Si(e)}function Si(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Xn(e)}function Li(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ee(e),De(e,r);var i=n?n(e):1;i!=e.height&&de(e,i)}(e,t,r,i),lr(e,"change",e,n)}function a(e,t){for(var r=[],n=e;n<t;++n)r.push(new Gt(c[n],o(n),i));return r}var l=n.from,s=n.to,c=n.text,u=se(e,l.line),d=se(e,s.line),f=Y(c),h=o(c.length-1),p=s.line-l.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Li(e,n)){var m=a(0,c.length-1);r(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)r(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var g=a(1,c.length-1);g.push(new Gt(f+u.text.slice(s.ch),h,i)),r(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,g)}else if(1==c.length)r(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{r(u,u.text.slice(0,l.ch)+c[0],o(0)),r(d,f+d.text.slice(s.ch),h);var v=a(1,c.length-1);1<p&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}lr(e,"change",e,n)}function Ai(e,l,s){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Oi(e,t){if(t.cm)throw new Error("This document is already in use.");on((e.doc=t).cm=e),Ti(e),Ni(e),e.options.lineWrapping||Ye(e),e.options.mode=t.modeOption,Xn(e)}function Ni(e){("rtl"==e.doc.direction?D:L)(e.display.lineDiv,"CodeMirror-rtl")}function _i(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ei(e,t){var r={from:be(t.from),to:wi(t),text:ce(e,t.from,t.to)};return Pi(e,r,t.from.line,t.to.line+1),Ai(e,function(e){return Pi(e,r,t.from.line,t.to.line+1)},!0),r}function Di(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function Fi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(l=i).lastOp==n?(Di(l.done),Y(l.done)):l.done.length&&!Y(l.done).ranges?Y(l.done):1<l.done.length&&!l.done[l.done.length-2].ranges?(l.done.pop(),Y(l.done)):void 0))a=Y(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=wi(t):o.changes.push(Ei(e,t));else{var c=Y(i.done);for(c&&c.ranges||Wi(e.sel,i.done),o={changes:[Ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||it(e,"historyAdded")}function zi(e,t,r,n){var i,o,a,l,s,c=e.history,u=n&&n.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(i=e,o=u,a=Y(c.done),l=t,"*"==(s=o.charAt(0))||"+"==s&&a.ranges.length==l.ranges.length&&a.somethingSelected()==l.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:Wi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,n&&!1!==n.clearRedo&&Di(c.undone)}function Wi(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Pi(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Hi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Ii(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Hi(r[i]));return n}(e,t),n=Ne(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function ji(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?gi.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<j(t,Number(u[1]))&&(Y(l)[d]=c[d],delete c[d])}}}return n}function Ri(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new vi(i,t)}return new vi(r||t,t)}function Bi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Gi(e,new gi([Ri(e.sel.primary(),t,r,i)],0),n)}function qi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Ri(e.sel.ranges[o],t[o],null,i);Gi(e,yi(e.cm,n,e.sel.primIndex),r)}function Ui(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Gi(e,yi(e.cm,i,e.sel.primIndex),n)}function Ki(e,t,r,n){Gi(e,bi(t,r),n)}function Vi(e,t,r){var n=e.history.done,i=Y(n);i&&i.ranges?$i(e,n[n.length-1]=t,r):Gi(e,t,r)}function Gi(e,t,r){$i(e,t,r),zi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $i(e,t,r){var n,i,o,a;(lt(e,"beforeSelectionChange")||e.cm&<(e.cm,"beforeSelectionChange"))&&(n=e,o=r,a={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new vi(Ce(n,e[t].anchor),Ce(n,e[t].head))},origin:o&&o.origin},it(n,"beforeSelectionChange",n,a),n.cm&&it(n.cm,"beforeSelectionChange",n.cm,a),t=a.ranges!=i.ranges?yi(n.cm,a.ranges,a.ranges.length-1):i),Yi(e,Zi(e,t,r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||Sn(e.cm)}function Yi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,at(e.cm)),lr(e,"cursorActivity",e))}function Xi(e){Yi(e,Zi(e,e.sel,null,!1))}function Zi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Qi(e,a.anchor,l&&l.anchor,r,n),c=Qi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new vi(s,c))}return i?yi(e.cm,i,t.primIndex):t}function Ji(e,t,r,n,i){var o=se(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(it(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=eo(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,r))&&(n<0?u<0:0<u))return Ji(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=eo(e,d,n,d.line==t.line?o:null)),d?Ji(e,d,t,n,i):null}}return t}function Qi(e,t,r,n,i){var o=n||1,a=Ji(e,t,r,o,i)||!i&&Ji(e,t,r,o,!0)||Ji(e,t,r,-o,i)||!i&&Ji(e,t,r,-o,!0);return a||(e.cantEdit=!0,ge(e.first,0))}function eo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:0<r&&t.ch==(n||se(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function to(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),q)}function ro(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=Ce(i,e)),t&&(o.to=Ce(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),it(i,"beforeChange",i,o),i.cm&&it(i.cm,"beforeChange",i.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function no(e,t,r){if(e.cm){if(!e.cm.curOp)return Gn(e.cm,no)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(lt(e,"beforeChange")||e.cm&<(e.cm,"beforeChange"))||(t=ro(e,t,!0))){var n=Se&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=j(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ve(c.to,l.from)<0||0<ve(c.from,l.to))){var u=[s,1],d=ve(c.from,l.from),f=ve(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(0<f||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)io(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else io(e,t)}}function io(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ve(r.from,r.to)){var t=ki(e,r);Fi(e,r,t,e.cm?e.cm.curOp.id:NaN),lo(e,r,t,Ne(e,r));var n=[];Ai(e,function(e,t){t||-1!=j(n,e.history)||(fo(e.history,r),n.push(e.history)),lo(e,r,null,Ne(e,r))})}}function oo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,r=i.history,n=i.sel,l="undo"==o?r.done:r.undone,s="undo"==o?r.undone:r.done,c=0;c<l.length&&(a=l[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=l.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(a=l.pop()).ranges){if(t)return void l.push(a);break}if(Wi(a,s),e&&!a.equals(i.sel))return void Gi(i,a,{clearRedo:!1});n=a}var u=[];Wi(n,s),s.push({changes:u,generation:r.generation}),r.generation=a.generation||++r.maxGeneration;for(var d=lt(i,"beforeChange")||i.cm&<(i.cm,"beforeChange"),f=function(e){var r=a.changes[e];if(r.origin=o,d&&!ro(i,r,!1))return l.length=0,{};u.push(Ei(i,r));var t=e?ki(i,r):Y(l);lo(i,r,t,Ii(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:wi(r)});var n=[];Ai(i,function(e,t){t||-1!=j(n,e.history)||(fo(e.history,r),n.push(e.history)),lo(e,r,null,Ii(e,r))})},h=a.changes.length-1;0<=h;--h){var p=f(h);if(p)return p.v}}}}function ao(e,t){if(0!=t&&(e.first+=t,e.sel=new gi(X(e.sel.ranges,function(e){return new vi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Xn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Zn(e.cm,n,"gutter")}}function lo(e,t,r,n){if(e.cm&&!e.cm.curOp)return Gn(e.cm,lo)(e,t,r,n);if(t.to.line<e.first)ao(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ao(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),r||(r=ki(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=fe(Be(se(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0}));-1<n.sel.contains(t.from,t.to)&&at(e);Mi(n,t,r,nn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=$e(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;r<n;n--){var i=se(e,n).stateAfter;if(i&&(!(i instanceof zt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ti(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Xn(e):o.line!=a.line||1!=t.text.length||Li(e.doc,t)?Xn(e,o.line,a.line+1,c):Zn(e,o.line,"text");var u=lt(e,"changes"),d=lt(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&lr(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Mi(e,t,n),$i(e,r,q)}}function so(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),no(e,{from:r,to:n,text:t,origin:i})}function co(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function uo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)co(o.ranges[l].anchor,t,r,n),co(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=ge(c.from.line+n,c.from.ch),c.to=ge(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function fo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;uo(e.done,r,n,i),uo(e.undone,r,n,i)}function ho(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=se(e,ke(e,t)):i=fe(t),null==i?null:(n(o,i)&&e.cm&&Zn(e.cm,i,r),o)}function po(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function mo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}vi.prototype.from=function(){return xe(this.anchor,this.head)},vi.prototype.to=function(){return we(this.anchor,this.head)},vi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,n=e,i=e+t;n<i;++n){var o=this.lines[n];this.height-=o.height,(r=o).parent=null,Ee(r),lr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof po))){var l=[];this.collapse(l),this.children=[new po(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new po(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++n,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=j(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new mo(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var go=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function vo(e,t,r){Ge(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Tn(e,r)}go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=fe(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=br(this);de(r,Math.max(0,r.height-o)),e&&(Vn(e,function(){vo(e,r,-o),Zn(e,n,"widget")}),lr(e,"lineWidgetCleared",e,this,n))}},go.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=br(this)-t;i&&(Ke(this.doc,n)||de(n,n.height+i),r&&Vn(r,function(){r.curOp.forceUpdate=!0,vo(r,n,i),lr(r,"lineWidgetChanged",r,e,fe(n))}))},st(go);var yo=0,bo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};function wo(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=P(i)).shared=!1;var a=[wo(e,r,n,i,o)],l=a[0],s=i.widgetNode;return Ai(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(wo(e,Ce(e,r),Ce(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=Y(a)}),new xo(a,l)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return Gn(t.cm,wo)(t,n,i,e,r);var o=new bo(t,r),a=ve(n,i);if(e&&P(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Re(t,n.line,n,i,o)||n.line!=i.line&&Re(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Fi(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var l,s=n.line,c=t.cm;if(t.iter(s,i.line+1,function(e){var t,r;c&&o.collapsed&&!c.options.lineWrapping&&Be(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&de(e,0),t=e,r=new Me(o,s==n.line?n.ch:null,s==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++s}),o.collapsed&&t.iter(n.line,i.line+1,function(e){Ke(t,e)&&de(e,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Se=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++yo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Xn(c,n.line,i.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=n.line;u<=i.line;u++)Zn(c,u,"text");o.atomic&&Xi(c.doc),lr(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&jn(t),lt(this,"clear")){var n=this.find();n&&lr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Ae(l.markedSpans,e);t&&!e.collapsed?Zn(t,fe(l),"text"):t&&(null!=s.to&&(o=fe(l)),null!=s.from&&(i=fe(l))),l.markedSpans=Oe(l.markedSpans,s),null==s.from&&e.collapsed&&!Ke(e.doc,l)&&t&&de(l,Qr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=Be(e.lines[c]),d=$e(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Xn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Xi(t.doc)),t&&lr(t,"markerCleared",t,this,i,o),r&&Rn(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ae(o.markedSpans,this);if(null!=a.from&&(r=ge(t?o:fe(o),a.from),-1==e))return r;if(null!=a.to&&(n=ge(t?o:fe(o),a.to),1==e))return n}return r&&{from:r,to:n}},bo.prototype.changed=function(){var o=this,a=this.find(-1,!0),l=this,s=this.doc.cm;a&&s&&Vn(s,function(){var e=a.line,t=fe(a.line),r=Or(s,t);if(r&&(Wr(r),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Ke(l.doc,e)&&null!=l.height){var n=l.height;l.height=null;var i=br(l)-n;i&&de(e,e.height+i)}lr(s,"markerChanged",s,o)})},bo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=j(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bo.prototype.detachLine=function(e){if(this.lines.splice(j(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},st(bo);var xo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ko(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function Co(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];Ai(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==j(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();lr(this,"clear")}},xo.prototype.find=function(e,t){return this.primary.find(e,t)},st(xo);var To=0,So=function(e,t,r,n,i){if(!(this instanceof So))return new So(e,t,r,n,i);null==r&&(r=0),mo.call(this,[new po([new Gt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=bi(o),this.history=new _i(null),this.id=++To,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:o,to:o,text:e}),Gi(this,bi(o),q)};So.prototype=J(mo.prototype,{constructor:So,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Yn(function(e){var t=ge(this.first,0),r=this.first+this.size-1;no(this,{from:t,to:ge(r,se(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),Gi(this,bi(t),q)}),replaceRange:function(e,t,r,n){so(this,e,t=Ce(this,t),r=r?Ce(this,r):t,n)},getRange:function(e,t,r){var n=ce(this,Ce(this,e),Ce(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return se(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=se(this,e)),Be(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yn(function(e,t,r){Ki(this,Ce(this,"number"==typeof e?ge(e,t||0):e),null,r)}),setSelection:Yn(function(e,t,r){Ki(this,Ce(this,e),Ce(this,t||e),r)}),extendSelection:Yn(function(e,t,r){Bi(this,Ce(this,e),t&&Ce(this,t),r)}),extendSelections:Yn(function(e,t){qi(this,Te(this,e),t)}),extendSelectionsBy:Yn(function(e,t){qi(this,Te(this,X(this.sel.ranges,e)),t)}),setSelections:Yn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new vi(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Gi(this,yi(this.cm,n,t),r)}}),addSelection:Yn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new vi(Ce(this,e),Ce(this,t||e))),Gi(this,yi(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Yn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ci(l.from,i,o),c=Ci(wi(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=ve(u.head,u.anchor)<0;n[a]=new vi(d?c:s,d?s:c)}else n[a]=new vi(s,s)}return new gi(n,e.sel.primIndex)}(this,n,t),s=n.length-1;0<=s;s--)no(this,n[s]);l?Vi(this,l):this.cm&&Sn(this.cm)}),undo:Yn(function(){oo(this,"undo")}),redo:Yn(function(){oo(this,"redo")}),undoSelection:Yn(function(){oo(this,"undo",!0)}),redoSelection:Yn(function(){oo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new _i(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ji(this.history.done),undone:ji(this.history.undone)}},setHistory:function(e){var t=this.history=new _i(this.history.maxGeneration);t.done=ji(e.done.slice(0),null,!0),t.undone=ji(e.undone.slice(0),null,!0)},setGutterMarker:Yn(function(e,r,n){return ho(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),!0})}),clearGutter:Yn(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ho(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(!(e=se(this,t=e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Yn(function(e,r,n){return ho(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(T(n).test(e[t]))return!1;e[t]+=" "+n}else e[t]=n;return!0})}),removeLineClass:Yn(function(e,o,a){return ho(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(!r)return!1;if(null==a)e[t]=null;else{var n=r.match(T(a));if(!n)return!1;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return!0})}),addLineWidget:Yn(function(e,t,r){return i=e,o=new go(n=this,t,r),(a=n.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),ho(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ke(n,e)){var r=Ge(e)<n.scrollTop;de(e,e.height+br(o)),r&&Tn(a,o.height),a.curOp.forceUpdate=!0}return!0}),a&&lr(a,"lineWidgetAdded",a,o,"number"==typeof i?i:fe(i)),o;var n,i,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return wo(this,Ce(this,e),Ce(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return wo(this,e=Ce(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=se(this,(e=Ce(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,a){i=Ce(this,i),o=Ce(this,o);var l=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&s==i.line&&i.ch>=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||a&&!a(n.marker)||l.push(n.marker.parent||n.marker)}++s}),l},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),Ce(this,ge(i,n))},indexFromPos:function(e){var t=(e=Ce(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new So(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new So(ue(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ve(o,a)){var l=wo(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,ko(this)),n},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Co(ko(this));break}}if(e.history==this.history){var r=[e.id];Ai(e,function(e){return r.push(e.id)},!0),e.history=new _i(null),e.history.done=ji(this.history.done,r),e.history.undone=ji(this.history.undone,r)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Yn(function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vn(t=this.cm,function(){Ni(t),Xn(t)}))})}),So.prototype.eachLine=So.prototype.iter;var Lo=0;function Mo(e){var i=this;if(Ao(i),!ot(i,e)&&!wr(i.display,e)){ct(e),x&&(Lo=+new Date);var o=an(i,e,!0),t=e.dataTransfer.files;if(o&&!i.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var a=t.length,l=Array(a),s=0,r=function(e,r){if(!i.options.allowDropFileTypes||-1!=j(i.options.allowDropFileTypes,e.type)){var n=new FileReader;n.onload=Gn(i,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),l[r]=e,++s==a){var t={from:o=Ce(i.doc,o),to:o,text:i.doc.splitLines(l.join(i.doc.lineSeparator())),origin:"paste"};no(i.doc,t),Vi(i.doc,bi(o,wi(t)))}}),n.readAsText(e)}},n=0;n<a;++n)r(t[n],n);else{if(i.state.draggingText&&-1<i.doc.sel.contains(o))return i.state.draggingText(e),void setTimeout(function(){return i.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(i.state.draggingText&&!i.state.draggingText.copy&&(u=i.listSelections()),$i(i.doc,bi(o,o)),u)for(var d=0;d<u.length;++d)so(i.doc,"",u[d].anchor,u[d].head,"drag");i.replaceSelection(c,"around","paste"),i.display.input.focus()}}catch(e){}}}}function Ao(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oo(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}var No=!1;function _o(){var e;No||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Oo(Eo)},100))}),tt(window,"blur",function(){return Oo(vn)}),No=!0)}function Eo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Do={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fo=0;Fo<10;Fo++)Do[Fo+48]=Do[Fo+96]=String(Fo);for(var zo=65;zo<=90;zo++)Do[zo]=String.fromCharCode(zo);for(var Wo=1;Wo<=12;Wo++)Do[Wo+111]=Do[Wo+63235]="F"+Wo;var Po={};function Ho(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Io(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=X(r.split(" "),Ho),o=0;o<i.length;o++){var a=void 0,l=void 0;a=o==i.length-1?(l=i.join(" "),n):(l=i.slice(0,o+1).join(" "),"...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function jo(e,t,r,n){var i=(t=Uo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return jo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=jo(e,t.fallthrough[o],r,n);if(a)return a}}}function Ro(e){var t="string"==typeof e?e:Do[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Bo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function qo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var r=Do[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Bo(r,e,t))}function Uo(e){return"string"==typeof e?Po[e]:e}function Ko(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ve(o.from,Y(n).to)<=0;){var a=n.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Vn(t,function(){for(var e=n.length-1;0<=e;e--)so(t.doc,"",n[e].from,n[e].to,"+delete");Sn(t)})}function Vo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Go(e,t,r){var n=Vo(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function $o(e,t,r,n,i){if(e){var o=Qe(r,t.doc.direction);if(o){var a,l=i<0?Y(o):o[0],s=i<0==(1==l.level)?"after":"before";if(0<l.level||"rtl"==t.doc.direction){var c=Nr(t,r);a=i<0?r.text.length-1:0;var u=_r(t,c,a).top;a=ae(function(e){return _r(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Vo(r,a,1))}else a=i<0?l.to:l.from;return new ge(n,a,s)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}Po.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Po.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Po.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Po.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Po.default=w?Po.macDefault:Po.pcDefault;var Yo={selectAll:to,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(r){return Ko(r,function(e){if(e.empty()){var t=se(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:ge(e.head.line+1,0)}:{from:e.head,to:ge(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Ko(t,function(e){return{from:ge(e.from().line,0),to:Ce(t.doc,ge(e.to().line+1,0))}})},delLineLeft:function(e){return Ko(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return Ko(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return Ko(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Xo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Zo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=se(e.doc,t),n=function(e){for(var t;t=Ie(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=fe(n));return $o(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},K)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},K)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?Zo(n,e.head):r},K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=H(e.getLine(o.line),o.ch,n);t.push($(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return Vn(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=se(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new ge(n.line,n.ch-1)),0<n.ch)n=new ge(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),ge(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=se(a.doc,n.line-1).text;o&&(n=new ge(n.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),ge(n.line-1,o.length-1),n,"+transpose"))}t.push(new vi(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){return Vn(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);Sn(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xo(e,t){var r=se(e.doc,t),n=Be(r);return n!=r&&(t=fe(n)),$o(!0,e,n,t,1)}function Zo(e,t){var r=Xo(e,t.line),n=se(e.doc,r.line),i=Qe(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Yo[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var Qo=new I;function ea(e,t,r,n){var i=e.state.keySeq;if(i){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Qo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ta(e,i+" "+t,r,n))return!0}return ta(e,t,r,n)}function ta(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=jo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&jo(t,e.options.extraKeys,r,e)||jo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&lr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(ct(r),hn(e)),!!i}function ra(t,e){var r=qo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?ea(t,"Shift-"+r,e,function(e){return Jo(t,e,!0)})||ea(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Jo(t,e)}):ea(t,r,e,function(e){return Jo(t,e)}))}var na=null;function ia(e){if(this.curOp.focus=E(),!ot(this,e)){x&&k<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var r=ra(this,e);g&&(na=r?t:null,!r&&88==t&&!Ct&&(w?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}D(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r)}(this)}}function oa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function aa(e){if(!(wr(this.display,e)||ot(this,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var t=e.keyCode,r=e.charCode;if(g&&t==na)return na=null,void ct(e);if(!g||e.which&&!(e.which<10)||!ra(this,e)){var n,i=String.fromCharCode(null==r?t:r);if("\b"!=i)if(!ea(n=this,"'"+i+"'",e,function(e){return Jo(n,e,!0)}))this.display.input.onKeyPress(e)}}}var la,sa,ca=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ua(e){var t=this,r=t.display;if(!(ot(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,wr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ha(t,e)){var n,i,o,a=an(t,e),l=pt(e),s=a?(n=a,i=l,o=+new Date,sa&&sa.compare(o,n,i)?(la=sa=null,"triple"):la&&la.compare(o,n,i)?(sa=new ca(o,n,i),la=null,"double"):(la=new ca(o,n,i),sa=null,"single")):"single";window.focus(),1==l&&t.state.selectingText&&t.state.selectingText(e),a&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ea(r,Bo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=Yo[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=B}finally{r.state.suppressEdits=!1}return t})}(t,l,a,s,e)||(1==l?a?function(e,t,r,n){x?setTimeout(W(pn,e),0):e.curOp.focus=E();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=w?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&-1<(i=a.contains(t))&&(ve((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ve(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,a=!1,l=Gn(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,nt(o.wrapper.ownerDocument,"mouseup",l),nt(o.wrapper.ownerDocument,"mousemove",s),nt(o.scroller,"dragstart",c),nt(o.scroller,"drop",l),a||(ct(e),i.addNew||Bi(t.doc,n,null,null,i.extend),b||x&&9==k?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),s=function(e){a=a||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},c=function(){return a=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=l).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();tt(o.wrapper.ownerDocument,"mouseup",l),tt(o.wrapper.ownerDocument,"mousemove",s),tt(o.scroller,"dragstart",c),tt(o.scroller,"drop",l),mn(t),setTimeout(function(){return o.input.focus()},20)}(e,n,t,o):function(g,e,v,y){var a=g.display,b=g.doc;ct(e);var w,x,k=b.sel,t=k.ranges;y.addNew&&!y.extend?(x=b.sel.contains(v),w=-1<x?t[x]:new vi(v,v)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new vi(v,v)),v=an(g,e,!0,!0),x=-1;else{var r=da(g,v,y.unit);w=y.extend?Ri(w,r.anchor,r.head,y.extend):r}y.addNew?-1==x?(x=t.length,Gi(b,yi(g,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(Gi(b,yi(g,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Ui(b,x,w,U):(Gi(b,new gi([w],x=0),U),k=b.sel);var C=v;function l(e){if(0!=ve(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],r=g.options.tabSize,n=H(se(b,v.line).text,v.ch,r),i=H(se(b,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),l=Math.min(v.line,e.line),s=Math.min(g.lastLine(),Math.max(v.line,e.line));l<=s;l++){var c=se(b,l).text,u=V(c,o,r);o==a?t.push(new vi(ge(l,u),ge(l,u))):c.length>u&&t.push(new vi(ge(l,u),ge(l,V(c,a,r))))}t.length||t.push(new vi(v,v)),Gi(b,yi(g,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var d,f=w,h=da(g,e,y.unit),p=f.anchor;p=0<ve(h.anchor,p)?(d=h.head,xe(f.from(),h.anchor)):(d=h.anchor,we(f.to(),h.head));var m=k.ranges.slice(0);m[x]=function(e,t){var r=t.anchor,n=t.head,i=se(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Qe(i);if(!o)return t;var a=Ze(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,c=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)s=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var u=Ze(o,n.ch,n.sticky),d=u-a||(n.ch-r.ch)*(1==l.level?-1:1);s=u==c-1||u==c?d<0:0<d}var f=o[c+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new vi(new ge(r.line,p,m),n)}(g,new vi(Ce(b,p),d)),Gi(b,yi(g,m,x),U)}}var s=a.wrapper.getBoundingClientRect(),c=0;function n(e){g.state.selectingText=!1,c=1/0,ct(e),a.input.focus(),nt(a.wrapper.ownerDocument,"mousemove",i),nt(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=Gn(g,function(e){0!==e.buttons&&pt(e)?function e(t){var r=++c;var n=an(g,t,!0,"rectangle"==y.unit);if(!n)return;if(0!=ve(n,C)){g.curOp.focus=E(),l(n);var i=wn(a,b);(n.line>=i.to||n.line<i.from)&&setTimeout(Gn(g,function(){c==r&&e(t)}),150)}else{var o=t.clientY<s.top?-20:t.clientY>s.bottom?20:0;o&&setTimeout(Gn(g,function(){c==r&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):n(e)}),o=Gn(g,n);g.state.selectingText=o,tt(a.wrapper.ownerDocument,"mousemove",i),tt(a.wrapper.ownerDocument,"mouseup",o)}(e,n,t,o)}(t,a,s,e):ht(e)==r.scroller&&ct(e):2==l?(a&&Bi(t.doc,a),setTimeout(function(){return r.input.focus()},20)):3==l&&(C?t.display.input.onContextMenu(e):mn(t)))}}function da(e,t,r){if("char"==r)return new vi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new vi(ge(t.line,0),Ce(e.doc,ge(t.line+1,0)));var n=r(e,t);return new vi(n.from,n.to)}function fa(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ct(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!lt(e,r))return dt(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return it(e,r,e,he(e.doc,o),e.options.gutters[s],t),dt(t)}}function ha(e,t){return fa(e,t,"gutterClick",!0)}function pa(e,t){var r,n;wr(e.display,t)||(n=t,lt(r=e,"gutterContextMenu")&&fa(r,n,"gutterContextMenu",!1))||(ot(e,t,"contextmenu")||C||e.display.input.onContextMenu(t))}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hr(e)}ca.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var ga={toString:function(){return"CodeMirror.Init"}},va={},ya={};function ba(e){ci(e),Xn(e),xn(e)}function wa(e,t,r){if(!t!=!(r&&r!=ga)){var n=e.display.dragFunctions,i=t?tt:nt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function xa(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Ye(e)),on(e),Xn(e),Hr(e),setTimeout(function(){return zn(e)},100)}function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?P(t):{},P(va,t,!1),ui(t);var n=t.value;"string"==typeof n?n=new So(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new le(e,n,i);for(var a in ci(o.wrapper.CodeMirror=this),ma(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&k<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;tt(o.scroller,"mousedown",Gn(i,ua)),tt(o.scroller,"dblclick",x&&k<11?Gn(i,function(e){if(!ot(i,e)){var t=an(i,e);if(t&&!ha(i,e)&&!wr(i.display,e)){ct(e);var r=i.findWordAt(t);Bi(i.doc,r.anchor,r.head)}}}):function(e){return ot(i,e)||ct(e)});tt(o.scroller,"contextmenu",function(e){return pa(i,e)});var r,n={end:0};function a(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function l(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}tt(o.scroller,"touchstart",function(e){if(!ot(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ha(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),tt(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),tt(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!wr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||l(t,t.prev)?new vi(n,n):!t.prev.prev||l(t,t.prev.prev)?i.findWordAt(n):new vi(ge(n.line,0),Ce(i.doc,ge(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),ct(e)}a()}),tt(o.scroller,"touchcancel",a),tt(o.scroller,"scroll",function(){o.scroller.clientHeight&&(On(i,o.scroller.scrollTop),_n(i,o.scroller.scrollLeft,!0),it(i,"scroll",i))}),tt(o.scroller,"mousewheel",function(e){return mi(i,e)}),tt(o.scroller,"DOMMouseScroll",function(e){return mi(i,e)}),tt(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){ot(i,e)||ft(e)},over:function(e){ot(i,e)||(!function(e,t){var r=an(e,t);if(r){var n=document.createDocumentFragment();un(e,r,n),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,n)}}(i,e),ft(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||+new Date-Lo<100))ft(t);else if(!ot(e,t)&&!wr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s)){var r=N("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}(i,e)},drop:Gn(i,Mo),leave:function(e){ot(i,e)||Ao(i)}};var e=o.input.getField();tt(e,"keyup",function(e){return oa.call(i,e)}),tt(e,"keydown",Gn(i,ia)),tt(e,"keypress",Gn(i,aa)),tt(e,"focus",function(e){return gn(i,e)}),tt(e,"blur",function(e){return vn(i,e)})}(this),_o(),jn(this),this.curOp.forceUpdate=!0,Oi(this,n),t.autofocus&&!f||this.hasFocus()?setTimeout(W(gn,this),20):vn(this),ya)ya.hasOwnProperty(a)&&ya[a](r,t[a],ga);kn(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Ca.length;++l)Ca[l](r);Rn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=va,ka.optionHandlers=ya;var Ca=[];function Ta(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=It(e,t).state:r="prev");var a=e.options.tabSize,l=se(o,t),s=H(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==B||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?H(se(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=$(c-f)),d!=u)return so(o,d,ge(t,0),ge(t,u.length),"+input"),!(l.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);Ui(o,p,new vi(g,g));break}}}ka.defineInitHook=function(e){return Ca.push(e)};var Sa=null;function La(e){Sa=e}function Ma(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a,l=e.state.pasteIncoming||"paste"==i,s=xt(t),c=null;if(l&&1<n.ranges.length)if(Sa&&Sa.text.join("\n")==t){if(n.ranges.length%Sa.text.length==0){c=[];for(var u=0;u<Sa.text.length;u++)c.push(o.splitLines(Sa.text[u]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,function(e){return[e]}));for(var d=n.ranges.length-1;0<=d;d--){var f=n.ranges[d],h=f.from(),p=f.to();f.empty()&&(r&&0<r?h=ge(h.line,h.ch-r):e.state.overwrite&&!l?p=ge(p.line,Math.min(se(o,p.line).text.length,p.ch+Y(s).length)):l&&Sa&&Sa.lineWise&&Sa.text.join("\n")==t&&(h=p=ge(h.line,0))),a=e.curOp.updateInput;var m={from:h,to:p,text:c?c[d%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};no(e.doc,m),lr(e,"inputRead",e,m)}t&&!l&&Oa(e,t),Sn(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Aa(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vn(t,function(){return Ma(t,r,0,null,"paste")}),!0}function Oa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(-1<t.indexOf(o.electricChars.charAt(l))){a=Ta(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ta(e,i.head.line,"smart"));a&&lr(e,"electricInput",e,i.head.line)}}}function Na(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function _a(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ea(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),u&&(e.style.border="1px solid black"),_a(e),t}function Da(n,i,o,e,a){var t=i,r=o,l=se(n,i.line);function s(e){var t,r;if(null==(t=a?function(t,r,l,e){var s=Qe(r,t.doc.direction);if(!s)return Go(r,l,e);l.ch>=r.text.length?(l.ch=r.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var n=Ze(s,l.ch,l.sticky),i=s[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>l.ch:i.from<l.ch))return Go(r,l,e);var o,c=function(e,t){return Vo(r,e instanceof ge?e.ch:e,t)},a=function(e){return t.options.lineWrapping?(o=o||Nr(t,r),Xr(t,r,o,e)):{begin:0,end:r.text.length}},u=a("before"==l.sticky?c(l,-1):l.ch);if("rtl"==t.doc.direction||1==i.level){var d=1==i.level==e<0,f=c(l,d?1:-1);if(null!=f&&(d?f<=i.to&&f<=u.end:f>=i.from&&f>=u.begin)){var h=d?"before":"after";return new ge(l.line,f,h)}}var p=function(e,t,r){for(var n=function(e,t){return t?new ge(l.line,c(e,1),"before"):new ge(l.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),a=o?r.begin:c(r.end,-1);if(i.from<=a&&a<i.to)return n(a,o);if(a=o?i.from:c(i.to,-1),r.begin<=a&&a<r.end)return n(a,o)}},m=p(n+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==r.text.length||!(m=p(0<e?0:s.length-1,e,a(g)))?null:m}(n.cm,l,i,o):Go(l,i,o))){if(e||(r=i.line+o)<n.first||r>=n.first+n.size||(i=new ge(r,i.ch,i.sticky),!(l=se(n,r))))return!1;i=$o(a,n.cm,l,i.line,o)}else i=t;return!0}if("char"==e)s();else if("column"==e)s(!0);else if("word"==e||"group"==e)for(var c=null,u="group"==e,d=n.cm&&n.cm.getHelper(i,"wordChars"),f=!0;!(o<0)||s(!f);f=!1){var h=l.text.charAt(i.ch)||"\n",p=te(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){o<0&&(o=1,s(),i.sticky="after");break}if(p&&(c=p),0<o&&!s(!f))break}var m=Qi(n,i,t,r,!0);return ye(t,m)&&(m.hitSide=!0),m}function Fa(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*Qr(e.display),3);i=(0<r?t.bottom:t.top)+r*c}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=$r(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var za=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Wa(e,t){var r=Or(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Mr(r,n,t.line),o=Qe(n,e.doc.direction),a="left";o&&(a=Ze(o,t.ch)%2?"right":"left");var l=Fr(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Pa(e,t){return t&&(e.bad=!0),e}function Ha(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Pa(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Ia(o,t,r)}}function Ia(c,e,t){var r=c.text.firstChild,n=!1;if(!e||!_(r,e))return Pa(ge(fe(c.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=c.rest?Y(c.rest):c.line;return Pa(ge(fe(i),i.text.length),n)}var o=3==e.nodeType?e:null,a=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t&&(t=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=c.measure,d=u.maps;function l(e,t,r){for(var n=-1;n<(d?d.length:0);n++)for(var i=n<0?u.map:d[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=fe(n<0?c.line:c.rest[n]),s=i[o]+r;return(r<0||a!=e)&&(s=i[o+(r?1:0)]),ge(l,s)}}}var s=l(o,a,t);if(s)return Pa(s,n);for(var f=a.nextSibling,h=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(s=l(f,f.firstChild,0))return Pa(ge(s.line,s.ch-h),n);h+=f.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(s=l(p,p.firstChild,-1))return Pa(ge(s.line,s.ch+m),n);m+=p.textContent.length}}za.prototype.init=function(e){var t=this,a=this,l=a.cm,s=a.div=e.lineDiv;function r(e){if(!ot(l,e)){if(l.somethingSelected())La({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=Na(l);La({lineWise:!0,text:t.text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,q),l.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Sa.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Ea(),i=n.firstChild;l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),i.value=Sa.text.join("\n");var o=document.activeElement;z(i),setTimeout(function(){l.display.lineSpace.removeChild(n),o.focus(),o==s&&a.showPrimarySelection()},50)}}_a(s,l.options.spellcheck),tt(s,"paste",function(e){ot(l,e)||Aa(e,l)||k<=11&&setTimeout(Gn(l,function(){return t.updateFromDOM()}),20)}),tt(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(s,"touchstart",function(){return a.forceCompositionEnd()}),tt(s,"input",function(){t.composing||t.readFromDOMSoon()}),tt(s,"copy",r),tt(s,"cut",r)},za.prototype.prepareSelection=function(){var e=cn(this.cm,!1);return e.focus=this.cm.state.focused,e},za.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},za.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Ha(t,e.anchorNode,e.anchorOffset),a=Ha(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ve(xe(o,a),n)||0!=ve(we(o,a),i)){var l=t.display.view,s=n.line>=t.display.viewFrom&&Wa(t,n)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Wa(t,i);if(!c){var u=l[l.length-1].measure,d=u.maps?u.maps[u.maps.length-1]:u.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(s&&c){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=S(s.node,s.offset,c.offset,c.node)}catch(e){}f&&(!m&&t.state.focused?(e.collapse(s.node,s.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):m&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},za.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},za.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},za.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},za.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},za.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},za.prototype.blur=function(){this.div.blur()},za.prototype.getField=function(){return this.div},za.prototype.supportsTouch=function(){return!0},za.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Vn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},za.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},za.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(d&&a&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Ha(t,e.anchorNode,e.anchorOffset),n=Ha(t,e.focusNode,e.focusOffset);r&&n&&Vn(t,function(){Gi(t.doc,bi(r,n),q),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},za.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ge(a.line-1,se(n.doc,a.line-1).length)),l.ch==se(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=ge(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;r=a.line==i.viewFrom||0==(e=ln(n,a.line))?(t=fe(i.view[0].line),i.view[0].node):(t=fe(i.view[e].line),i.view[e-1].node.nextSibling);var s,c,u=ln(n,l.line);if(c=u==i.view.length-1?(s=i.viewTo-1,i.lineDiv.lastChild):(s=fe(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(function(s,e,t,c,u){var r="",d=!1,f=s.doc.lineSeparator(),h=!1;function p(){d&&(r+=f,h&&(r+=f),d=h=!1)}function m(e){e&&(p(),r+=e)}function g(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void m(t);var r,n=e.getAttribute("cm-marker");if(n){var i=s.findMarks(ge(c,0),ge(u+1,0),(l=+n,function(e){return e.id==l}));return void(i.length&&(r=i[0].find(0))&&m(ce(s.doc,r.from,r.to).join(f)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&p();for(var a=0;a<e.childNodes.length;a++)g(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(h=!0),o&&(d=!0)}else 3==e.nodeType&&m(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var l}for(;g(e),e!=t;)e=e.nextSibling,h=!1;return r}(n,r,c,t,s)),f=ce(n.doc,ge(t,0),ge(s,se(n.doc,s).text.length));1<d.length&&1<f.length;)if(Y(d)==Y(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=Y(d),b=Y(f),w=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var x=ge(t,h),k=ge(s,f.length?Y(f).length-p:0);return 1<d.length||d[0]||ve(x,k)?(so(n.doc,d,x,k,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},za.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vn(this.cm,function(){return Xn(e.cm)})},za.prototype.setUneditable=function(e){e.contentEditable="false"},za.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var ja,Ra,Ba,qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(t){var e=this,r=this,n=this.cm;this.createField(t);var i=this.textarea;function o(e){if(!ot(n,e)){if(n.somethingSelected())La({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Na(n);La({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,q):(r.prevInput="",i.value=t.text.join("\n"),z(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),u&&(i.style.width="0px"),tt(i,"input",function(){x&&9<=k&&e.hasSelection&&(e.hasSelection=null),r.poll()}),tt(i,"paste",function(e){ot(n,e)||Aa(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),tt(i,"cut",o),tt(i,"copy",o),tt(t.scroller,"paste",function(e){wr(t,e)||ot(n,e)||(n.state.pasteIncoming=!0,r.focus())}),tt(t.lineSpace,"selectstart",function(e){wr(t,e)||ct(e)}),tt(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},qa.prototype.createField=function(e){this.wrapper=Ea(),this.textarea=this.wrapper.firstChild},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=cn(e);if(e.options.moveInputWithCursor){var i=Kr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},qa.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&z(this.textarea),x&&9<=k&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",x&&9<=k&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qa.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},qa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||kt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(x&&9<=k&&this.hasSelection===i||w&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Vn(t,function(){Ma(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){x&&9<=k&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea,t=an(n,e),a=i.scroller.scrollTop;if(t&&!g){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&Gn(n,Gi)(n.doc,bi(t),q);var l=o.style.cssText,s=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var c,u=r.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(x?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(c=window.scrollY),i.input.focus(),b&&window.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=!0,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=k&&f(),C){ft(e);var d=function(){nt(window,"mouseup",d),setTimeout(h,20)};tt(window,"mouseup",d)}else setTimeout(h,50)}function f(){if(null!=o.selectionStart){var e=n.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function h(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=s,o.style.cssText=l,x&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),null!=o.selectionStart){(!x||x&&k<9)&&f();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?Gn(n,to)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(i){var o=i.optionHandlers;function e(e,t,n,r){i.defaults[e]=t,n&&(o[e]=r?function(e,t,r){r!=ga&&n(e,t,r)}:n)}i.defineOption=e,i.Init=ga,e("value","",function(e,t){return e.setValue(t)},!0),e("mode",null,function(e,t){e.doc.modeOption=t,Ti(e)},!0),e("indentUnit",2,Ti,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(e){Si(e),Hr(e),Xn(e)},!0),e("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(ge(o,r))}o++});for(var t=i.length-1;0<=t;t--)so(e.doc,n,i[t],ge(i[t].line,i[t].ch+n.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=ga&&e.refresh()}),e("specialCharPlaceholder",Jt,function(e){return e.refresh()},!0),e("electricChars",!0),e("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),e("rtlMoveVisually",!p),e("wholeLineUpdateBefore",!0),e("theme","default",function(e){ma(e),ba(e)},!0),e("keyMap","default",function(e,t,r){var n=Uo(t),i=r!=ga&&Uo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,xa,!0),e("gutters",[],function(e){ui(e.options),ba(e)},!0),e("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rn(e.display)+"px":"0",e.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(e){return zn(e)},!0),e("scrollbarStyle","native",function(e){Hn(e),zn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),e("lineNumbers",!1,function(e){ui(e.options),ba(e)},!0),e("firstLineNumber",1,ba,!0),e("lineNumberFormatter",function(e){return e},ba,!0),e("showCursorWhenSelecting",!1,sn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,function(e,t){"nocursor"==t&&(vn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),e("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),e("dragDrop",!0,wa),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,sn,!0),e("singleCursorHeightPerLine",!0,sn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Si,!0),e("addModeClass",!1,Si,!0),e("pollInterval",100),e("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),e("historyEventDelay",1250),e("viewportMargin",10,function(e){return e.refresh()},!0),e("maxHighlightLength",1e4,Si,!0),e("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),e("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),e("autofocus",null),e("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),e("phrases",null)}(ka),Ra=(ja=ka).optionHandlers,Ba=ja.helpers={},ja.prototype={constructor:ja,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,Ra.hasOwnProperty(e)&&Gn(this,Ra[e])(this,t,n),it(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Uo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:$n(function(e,t){var r=e.token?e:ja.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,Xn(this)}),removeOverlay:$n(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Xn(this)}}),indentLine:$n(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&Ta(this,e,t,r)}),indentSelection:$n(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Ta(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Sn(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<r;++s)Ta(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&0<c[n].from().ch&&Ui(this.doc,n,new vi(o,c[n].to()),q)}}}),getTokenAt:function(e,t){return Ut(this,e,t)},getLineTokens:function(e,t){return Ut(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=Ht(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?ja.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ba.hasOwnProperty(t))return r;var n=Ba[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var l=0;l<n._global.length;l++){var s=n._global[l];s.pred(i,this)&&-1==j(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return It(this,(e=ke(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Kr(this,null==e?r.head:"object"==typeof e?Ce(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Ur(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return $r(this,(e=qr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=qr(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:o<e&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Br(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Ge(n):0)},defaultTextHeight:function(){return Qr(this.display)},defaultCharWidth:function(){return en(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,l,s=this.display,c=(e=Kr(this,Ce(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var d=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=Cn(o,a)).scrollTop&&On(o,l.scrollTop),null!=l.scrollLeft&&_n(o,l.scrollLeft))},triggerOnKeyDown:$n(ia),triggerOnKeyPress:$n(aa),triggerOnKeyUp:oa,triggerOnMouseDown:$n(ua),execCommand:function(e){if(Yo.hasOwnProperty(e))return Yo[e].call(null,this)},triggerElectric:$n(function(e){Oa(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),a=0;a<t&&!(o=Da(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:$n(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Da(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},K)}),deleteH:$n(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):Ko(this,function(e){var t=Da(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=Ce(this.doc,e),l=0;l<t;++l){var s=Kr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Fa(this,s,i,r)).hitSide)break}return a},moveV:$n(function(n,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(s)return n<0?e.from():e.to();var t=Kr(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var r=Fa(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Tn(o,Ur(o,r,"div").top-t.top),r},K),l.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=l[e]}),findWordAt:function(e){var t=se(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new vi(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:$n(function(e,t){Ln(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tr(this)-this.display.barHeight,width:e.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:Lr(this),clientWidth:Sr(this)}},scrollIntoView:$n(function(e,t){var r,n;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(n=e,Mn(r=this),r.curOp.scrollToPos=n):An(this,e.from,e.to,e.margin)}),setSize:$n(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Pr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Zn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return Vn(this,e)},startOperation:function(){return jn(this)},endOperation:function(){return Rn(this)},refresh:$n(function(){var e=this.display.cachedTextHeight;Xn(this),this.curOp.forceUpdate=!0,Hr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),li(this),(null==e||.5<Math.abs(e-Qr(this.display)))&&on(this),it(this,"refresh",this)}),swapDoc:$n(function(e){var t=this.doc;return t.cm=null,Oi(this,e),Hr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},st(ja),ja.registerHelper=function(e,t,r){Ba.hasOwnProperty(e)||(Ba[e]=ja[e]={_global:[]}),Ba[e][t]=r},ja.registerGlobalHelper=function(e,t,r,n){ja.registerHelper(e,t,n),Ba[e]._global.push({pred:r,val:n})};var Ua,Ka="iter insert remove copy getEditor constructor".split(" ");for(var Va in So.prototype)So.prototype.hasOwnProperty(Va)&&j(Ka,Va)<0&&(ka.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(So.prototype[Va]));return st(So),ka.inputStyles={textarea:qa,contenteditable:za},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){Lt[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){So.prototype[e]=t},ka.fromTextArea=function(t,e){if((e=e?P(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=E();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=l.getValue()}var i;if(t.form&&(tt(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(nt(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var l=ka(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return l},(Ua=ka).off=nt,Ua.on=tt,Ua.wheelEventPixels=pi,Ua.Doc=So,Ua.splitLines=xt,Ua.countColumn=H,Ua.findColumn=V,Ua.isWordChar=ee,Ua.Pass=B,Ua.signal=it,Ua.Line=Gt,Ua.changeEnd=wi,Ua.scrollbarModel=Pn,Ua.Pos=ge,Ua.cmpPos=ve,Ua.modes=St,Ua.mimeModes=Lt,Ua.resolveMode=Mt,Ua.getMode=At,Ua.modeExtensions=Ot,Ua.extendMode=Nt,Ua.copyState=_t,Ua.startState=Dt,Ua.innerMode=Et,Ua.commands=Yo,Ua.keyMap=Po,Ua.keyName=qo,Ua.isModifierKey=Ro,Ua.lookupKey=jo,Ua.normalizeKeyMap=Io,Ua.StringStream=Ft,Ua.SharedTextMarker=xo,Ua.TextMarker=bo,Ua.LineWidget=go,Ua.e_preventDefault=ct,Ua.e_stopPropagation=ut,Ua.e_stop=ft,Ua.addClass=D,Ua.contains=_,Ua.rmClass=L,Ua.keyNames=Do,ka.version="5.41.0",ka},"object"==typeof r&&void 0!==t?t.exports=i():"function"==typeof o&&o.amd?o(i):n.CodeMirror=i()},{}],18:[function(e,t,r){var n;n=function(N){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}N.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=N.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,l=t.documentTypes||{},s=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},d=t.propertyKeywords||{},f=t.nonStandardPropertyKeywords||{},h=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,y=t.lineComment,b=!0===t.supportsAtComponent;function w(e,t){return n=t,e}function x(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return(r==i||!n&&")"!=i)&&(t.tokenize=null),w("string","string")}}function k(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=x(")"),w(null,"(")}function C(e,t,r){this.type=e,this.indent=t,this.prev=r}function T(e,t,r,n){return e.context=new C(r,t.indentation()+(!1===n?0:o),e.context),r}function S(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,r){return O[r.context.type](e,t,r)}function M(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return L(e,t,r)}function A(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,r){if("{"==e)return T(r,t,"block");if("}"==e&&r.context.prev)return S(r);if(b&&/@component/i.test(e))return T(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return T(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(i="error","block");var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(i="property","maybeprop"):f.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?T(r,t,"prop"):L(e,t,r)},prop:function(e,t,r){if(";"==e)return S(r);if("{"==e&&v)return T(r,t,"propBlock");if("}"==e||"{"==e)return M(e,t,r);if("("==e)return T(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return T(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?S(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?M(e,t,r):")"==e?S(r):"("==e?T(r,t,"parens"):"interpolation"==e?T(r,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):L(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",r.context.type):O.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return T(r,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,r);if("{"==e)return S(r)&&T(r,t,v?"block":"top");if("interpolation"==e)return T(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":f.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?M(e,t,r):"{"==e?S(r)&&T(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?S(r):"{"==e||"}"==e?M(e,t,r,2):O.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?T(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,S(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?T(r,t,"top"):L(e,t,r)},at:function(e,t,r){return";"==e?S(r):"{"==e||"}"==e?M(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?S(r):"{"==e||";"==e?M(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=x(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=k,w("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=O[t.state](n,e,t)),i},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(n),o=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],a=e(o),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],s=e(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=e(c),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=e(d),h=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=e(m),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=e(v),b=t.concat(n).concat(o).concat(l).concat(c).concat(d).concat(m).concat(v);function w(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}N.registerHelper("hintWords","css",b),N.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),N.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),N.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),N.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],19:[function(e,t,r){var n;n=function(p){"use strict";var i={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function m(e,t){var r,n=e.match(o[r=t]||(o[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;0<=o;o--)n.unshift(i[o])}p.defineMode("htmlmixed",function(u,e){var d=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),f={},t=e&&e.tags,r=e&&e.scriptTypes;if(a(i,f),t&&a(t,f),r)for(var n=r.length-1;0<=n;n--)f.script.unshift(["type",r[n].matches,r[n].mode]);function h(e,t){var r,n=d.token(e,t.htmlState),i=/\btag\b/.test(n);if(i&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&i&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var a=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(m(t,n[0])))return n[2]}}(f[o[1]],o[2]),l=p.getMode(u,a),s=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(s,!1)?(t.token=h,t.localState=t.localMode=null,null):(r=e,n=c,i=t.localMode.token(e,t.localState),o=r.current(),-1<(a=o.search(n))?r.backUp(o.length-a):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),i);var r,n,i,o,a},t.localMode=l,t.localState=p.startState(l,d.indent(t.htmlState,""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:p.startState(d)}},copyState:function(e){var t;return e.localState&&(t=p.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:p.copyState(d,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t):e.localMode.indent?e.localMode.indent(e.localState,t,r):p.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||d}}}},"xml","javascript","css"),p.defineMIME("text/html","htmlmixed")},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../css/css":18,"../javascript/javascript":20,"../xml/xml":21}],20:[function(e,t,r){var n;n=function(Ge){"use strict";Ge.defineMode("javascript",function(e,d){var n,i,f=e.indentUnit,h=d.statementIndent,a=d.jsonld,l=d.json||a,c=d.typescript,u=d.wordCharacters||/[\w$\xa1-\uffff]/,s=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,i=r,t}function v(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(a&&"@"==e.peek()&&e.match(m))return t.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=v),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return g("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y)(e,t):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Ve(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return(t.tokenize=b)(e,t);if("#"==r)return e.skipToEnd(),g("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),g("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current();if("."!=t.lastType){if(s.propertyIsEnumerable(n)){var o=s[n];return g(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var w="([{}])";function o(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;0<=a;--a){var l=e.string.charAt(a),s=w.indexOf(l);if(0<=s&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(u.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var x={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function C(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var T={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;0<=e;e--)T.cc.push(arguments[e])}function L(){return S.apply(null,arguments),!0}function M(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function r(e){var t=T.state;if(T.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new O(n,r.vars,!0):null}return M(t,r.vars)?r:new O(r.prev,new N(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!M(e,t.localVars))return void(t.localVars=new N(e,t.localVars));d.globalVars&&!M(e,t.globalVars)&&(t.globalVars=new N(e,t.globalVars))}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function O(e,t,r){this.prev=e,this.vars=t,this.block=r}function N(e,t){this.name=e,this.next=t}var t=new N("this",new N("arguments",null));function _(){T.state.context=new O(T.state.context,T.state.localVars,!1),T.state.localVars=t}function E(){T.state.context=new O(T.state.context,T.state.localVars,!0),T.state.localVars=null}function D(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function F(n,i){var e=function(){var e=T.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new k(t,T.stream.column(),n,null,e.lexical,i)};return e.lex=!0,e}function z(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function W(r){return function e(t){return t==r?L():";"==r||"}"==t||")"==t||"]"==t?S():L(e)}}function P(e,t){return"var"==e?L(F("vardef",t),ve,W(";"),z):"keyword a"==e?L(F("form"),R,P,z):"keyword b"==e?L(F("form"),P,z):"keyword d"==e?T.stream.match(/^\s*$/,!1)?L():L(F("stat"),q,W(";"),z):"debugger"==e?L(W(";")):"{"==e?L(F("}"),E,oe,z,D):";"==e?L():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==z&&T.state.cc.pop()(),L(F("form"),R,P,z,Ce)):"function"==e?L(Oe):"for"==e?L(F("form"),Te,P,z):"class"==e||c&&"interface"==t?(T.marked="keyword",L(F("form"),Ee,z)):"variable"==e?c&&"declare"==t?(T.marked="keyword",L(P)):c&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?L(Ue):"type"==t?L(ce,W("operator"),ce,W(";")):L(F("form"),ye,W("{"),F("}"),oe,z,z)):c&&"namespace"==t?(T.marked="keyword",L(F("form"),I,oe,z)):c&&"abstract"==t?(T.marked="keyword",L(P)):L(F("stat"),J):"switch"==e?L(F("form"),R,W("{"),F("}","switch"),E,oe,z,z,D):"case"==e?L(I,W(":")):"default"==e?L(W(":")):"catch"==e?L(F("form"),_,H,P,z,D):"export"==e?L(F("stat"),We,z):"import"==e?L(F("stat"),He,z):"async"==e?L(P):"@"==t?L(I,P):S(F("stat"),I,W(";"),z)}function H(e){if("("==e)return L(Ne,W(")"))}function I(e,t){return B(e,t,!1)}function j(e,t){return B(e,t,!0)}function R(e){return"("!=e?S():L(F(")"),I,W(")"),z)}function B(e,t,r){if(T.state.fatArrowAt==T.stream.start){var n=r?Y:$;if("("==e)return L(_,F(")"),ne(Ne,")"),z,W("=>"),n,D);if("variable"==e)return S(_,ye,W("=>"),n,D)}var i,o=r?K:U;return x.hasOwnProperty(e)?L(o):"function"==e?L(Oe,o):"class"==e||c&&"interface"==t?(T.marked="keyword",L(F("form"),_e,z)):"keyword c"==e||"async"==e?L(r?j:I):"("==e?L(F(")"),q,W(")"),z,o):"operator"==e||"spread"==e?L(r?j:I):"["==e?L(F("]"),qe,z,o):"{"==e?ie(ee,"}",null,o):"quasi"==e?S(V,o):"new"==e?L((i=r,function(e){return"."==e?L(i?Z:X):"variable"==e&&c?L(pe,i?K:U):S(i?j:I)})):"import"==e?L(I):L()}function q(e){return e.match(/[;\}\)\],]/)?S():S(I)}function U(e,t){return","==e?L(I):K(e,t,!1)}function K(e,t,r){var n=0==r?U:K,i=0==r?I:j;return"=>"==e?L(_,r?Y:$,D):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&T.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?L(F(">"),ne(ce,">"),z,n):"?"==t?L(I,W(":"),i):L(i):"quasi"==e?S(V,n):";"!=e?"("==e?ie(j,")","call",n):"."==e?L(Q,n):"["==e?L(F("]"),q,W("]"),z,n):c&&"as"==t?(T.marked="keyword",L(ce,n)):"regexp"==e?(T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),L(i)):void 0:void 0}function V(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?L(V):L(I,G)}function G(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,L(V)}function $(e){return o(T.stream,T.state),S("{"==e?P:I)}function Y(e){return o(T.stream,T.state),S("{"==e?P:j)}function X(e,t){if("target"==t)return T.marked="keyword",L(U)}function Z(e,t){if("target"==t)return T.marked="keyword",L(K)}function J(e){return":"==e?L(z,P):S(U,W(";"),z)}function Q(e){if("variable"==e)return T.marked="property",L()}function ee(e,t){if("async"==e)return T.marked="property",L(ee);if("variable"==e||"keyword"==T.style){return T.marked="property","get"==t||"set"==t?L(te):(c&&T.state.fatArrowAt==T.stream.start&&(r=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+r[0].length),L(re));var r}else{if("number"==e||"string"==e)return T.marked=a?"property":T.style+" property",L(re);if("jsonld-keyword"==e)return L(re);if(c&&A(t))return T.marked="keyword",L(ee);if("["==e)return L(I,ae,W("]"),re);if("spread"==e)return L(j,re);if("*"==t)return T.marked="keyword",L(ee);if(":"==e)return S(re)}}function te(e){return"variable"!=e?S(re):(T.marked="property",L(Oe))}function re(e){return":"==e?L(j):"("==e?S(Oe):void 0}function ne(n,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var r=T.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),L(function(e,t){return e==i||t==i?S():S(n)},a)}return e==i||t==i?L():L(W(i))}return function(e,t){return e==i||t==i?L():S(n,a)}}function ie(e,t,r){for(var n=3;n<arguments.length;n++)T.cc.push(arguments[n]);return L(F(t,r),ne(e,t),z)}function oe(e){return"}"==e?L():S(P,oe)}function ae(e,t){if(c){if(":"==e)return L(ce);if("?"==t)return L(ae)}}function le(e){if(c&&":"==e)return T.stream.match(/^\s*\w+\s+is\b/,!1)?L(I,se,ce):L(ce)}function se(e,t){if("is"==t)return T.marked="keyword",L()}function ce(e,t){return"keyof"==t||"typeof"==t?(T.marked="keyword",L("keyof"==t?ce:j)):"variable"==e||"void"==t?(T.marked="type",L(he)):"string"==e||"number"==e||"atom"==e?L(he):"["==e?L(F("]"),ne(ce,"]",","),z,he):"{"==e?L(F("}"),ne(de,"}",",;"),z,he):"("==e?L(ne(fe,")"),ue):"<"==e?L(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return L(ce)}function de(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",L(de)):"?"==t?L(de):":"==e?L(ce):"["==e?L(I,ae,W("]"),de):void 0}function fe(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?L(fe):":"==e?L(ce):S(ce)}function he(e,t){return"<"==t?L(F(">"),ne(ce,">"),z,he):"|"==t||"."==e||"&"==t?L(ce):"["==e?L(W("]"),he):"extends"==t||"implements"==t?(T.marked="keyword",L(ce)):void 0}function pe(e,t){if("<"==t)return L(F(">"),ne(ce,">"),z,he)}function me(){return S(ce,ge)}function ge(e,t){if("="==t)return L(ce)}function ve(e,t){return"enum"==t?(T.marked="keyword",L(Ue)):S(ye,ae,xe,ke)}function ye(e,t){return c&&A(t)?(T.marked="keyword",L(ye)):"variable"==e?(r(t),L()):"spread"==e?L(ye):"["==e?ie(we,"]"):"{"==e?ie(be,"}"):void 0}function be(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?L(ye):"}"==e?S():L(W(":"),ye,xe)):(r(t),L(xe))}function we(){return S(ye,xe)}function xe(e,t){if("="==t)return L(j)}function ke(e){if(","==e)return L(ve)}function Ce(e,t){if("keyword b"==e&&"else"==t)return L(F("form","else"),P,z)}function Te(e,t){return"await"==t?L(Te):"("==e?L(F(")"),Se,W(")"),z):void 0}function Se(e){return"var"==e?L(ve,W(";"),Me):";"==e?L(Me):"variable"==e?L(Le):S(I,W(";"),Me)}function Le(e,t){return"in"==t||"of"==t?(T.marked="keyword",L(I)):L(U,Me)}function Me(e,t){return";"==e?L(Ae):"in"==t||"of"==t?(T.marked="keyword",L(I)):S(I,W(";"),Ae)}function Ae(e){")"!=e&&L(I)}function Oe(e,t){return"*"==t?(T.marked="keyword",L(Oe)):"variable"==e?(r(t),L(Oe)):"("==e?L(_,F(")"),ne(Ne,")"),z,le,P,D):c&&"<"==t?L(F(">"),ne(me,">"),z,Oe):void 0}function Ne(e,t){return"@"==t&&L(I,Ne),"spread"==e?L(Ne):c&&A(t)?(T.marked="keyword",L(Ne)):S(ye,ae,xe)}function _e(e,t){return"variable"==e?Ee(e,t):De(e,t)}function Ee(e,t){if("variable"==e)return r(t),L(De)}function De(e,t){return"<"==t?L(F(">"),ne(me,">"),z,De):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(T.marked="keyword"),L(c?ce:I,De)):"{"==e?L(F("}"),Fe,z):void 0}function Fe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&A(t))&&T.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",L(Fe)):"variable"==e||"keyword"==T.style?(T.marked="property",L(c?ze:Oe,Fe)):"["==e?L(I,ae,W("]"),c?ze:Oe,Fe):"*"==t?(T.marked="keyword",L(Fe)):";"==e?L(Fe):"}"==e?L():"@"==t?L(I,Fe):void 0}function ze(e,t){return"?"==t?L(ze):":"==e?L(ce,xe):"="==t?L(j):S(Oe)}function We(e,t){return"*"==t?(T.marked="keyword",L(Be,W(";"))):"default"==t?(T.marked="keyword",L(I,W(";"))):"{"==e?L(ne(Pe,"}"),Be,W(";")):S(P)}function Pe(e,t){return"as"==t?(T.marked="keyword",L(W("variable"))):"variable"==e?S(j,Pe):void 0}function He(e){return"string"==e?L():"("==e?S(I):S(Ie,je,Be)}function Ie(e,t){return"{"==e?ie(Ie,"}"):("variable"==e&&r(t),"*"==t&&(T.marked="keyword"),L(Re))}function je(e){if(","==e)return L(Ie,je)}function Re(e,t){if("as"==t)return T.marked="keyword",L(Ie)}function Be(e,t){if("from"==t)return T.marked="keyword",L(I)}function qe(e){return"]"==e?L():S(ne(j,"]"))}function Ue(){return S(F("form"),ye,W("{"),F("}"),ne(Ke,"}"),z,z)}function Ke(){return S(ye,xe)}function Ve(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return z.lex=D.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-f,0,"block",!1),localVars:d.localVars,context:d.localVars&&new O(null,null,!1),indented:e||0};return d.globalVars&&"object"==typeof d.globalVars&&(t.globalVars=d.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),o(e,t)),t.tokenize!=y&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?I:P)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==r&&C(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(e,t){if(e.tokenize==y)return Ge.Pass;if(e.tokenize!=v)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var a=e.cc[o];if(a==z)i=i.prev;else if(a!=Ce)break}for(;("stat"==i.type||"form"==i.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==U||r==K)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;h&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l,s,c=i.type,u=n==c;return"vardef"==c?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==c&&"{"==n?i.indented:"form"==c?i.indented+f:"stat"==c?i.indented+(s=t,"operator"==(l=e).lastType||","==l.lastType||p.test(s.charAt(0))||/[,.]/.test(s.charAt(0))?h||f:0):"switch"!=i.info||u||0==d.doubleIndentSwitch?i.align?i.column+(u?0:1):i.indented+(u?0:f):i.indented+(/^(?:case|default)\b/.test(t)?f:2*f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:Ve,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=I&&t!=j||e.cc.pop()}}}),Ge.registerHelper("wordChars","javascript",/[\w$]/),Ge.defineMIME("text/javascript","javascript"),Ge.defineMIME("text/ecmascript","javascript"),Ge.defineMIME("application/javascript","javascript"),Ge.defineMIME("application/x-javascript","javascript"),Ge.defineMIME("application/ecmascript","javascript"),Ge.defineMIME("application/json",{name:"javascript",json:!0}),Ge.defineMIME("application/x-json",{name:"javascript",json:!0}),Ge.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),Ge.defineMIME("text/typescript",{name:"javascript",typescript:!0}),Ge.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],21:[function(e,t,r){var n;n=function(C){"use strict";var T={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};C.defineMode("xml",function(e,t){var a,o,l=e.indentUnit,s={},r=t.htmlMode?T:S;for(var n in r)s[n]=r[n];for(var n in t)s[n]=t[n];function c(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",r.tokenize=u,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function u(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=c,a=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return a="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=c;break}e.next()}return r}}function d(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(r)||!s.contextGrabbers[r].hasOwnProperty(t))return;f(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",b):s.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",m)}function g(e,t,r){if("word"!=e)return s.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,r)):(o="error",y);var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(r.context.tagName)&&f(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,r){return"endTag"!=e?(o="error",v):(f(r),p)}function y(e,t,r){return o="error",v(e,0,r)}function b(e,t,r){if("word"==e)return o="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(n)?h(r,n):(h(r,n),r.context=new d(r,n,i==r.indented)),p}function w(e,t,r){return"equals"==e?x:(s.allowMissing||(o="error"),b(e,0,r))}function x(e,t,r){return"string"==e?k:"word"==e&&s.allowUnquoted?(o="string",b):(o="error",b(e,0,r))}function k(e,t,r){return"string"==e?k:b(e,0,r)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!=r&&(o=null,t.state=t.state(a||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+l;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=u&&e.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!s.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=s.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+l:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],22:[function(e,t,r){t.exports={prettyPrint:function(e,t){var r,n,i,o,a,c;for(n=(t=t||{}).indent_size||4,i=t.indent_char||" ",a=t.brace_style||"collapse",o=0==t.max_char?1/0:t.max_char||70,c=t.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],(r=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace))t.length&&(r=!0),this.line_char_count--;else{if(r){if(this.line_char_count>=this.max_char){t.push("\n");for(var n=0;n<this.indent_level;n++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;r=!1}t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,r="",n=[],i=!1;do{if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];r=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(r,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==r&&'"'!==r||n[1]&&"!"===n[1]||(r+=this.get_unformatted(r),i=!0),"="===r&&(i=!1),n.length&&"="!==n[n.length-1]&&">"!==r&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,n),this.line_char_count=0):(n.push(" "),this.line_char_count++),i=!1),"<"===r&&(e=this.pos-1),n.push(r))}while(">"!==r);var o,a=n.join("");o=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var l=a.substring(1,o).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(l,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===l)this.record_tag(l),this.tag_type="SCRIPT";else if("style"===l)this.record_tag(l),this.tag_type="STYLE";else if(this.Utils.in_array(l,c)){var s=this.get_unformatted("</"+l+">",a);n.push(s),0<e&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&n.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(t+1),this.Utils.whitespace)&&n.push(this.input.charAt(t+1)),this.tag_type="SINGLE"}else"!"===l.charAt(0)?-1!=l.indexOf("[if")?(-1!=a.indexOf("!IE")&&(s=this.get_unformatted("--\x3e",a),n.push(s)),this.tag_type="START"):-1!=l.indexOf("[endif")?(this.tag_type="END",this.unindent()):(s=-1!=l.indexOf("[cdata[")?this.get_unformatted("]]>",a):this.get_unformatted("--\x3e",a),n.push(s),this.tag_type="SINGLE"):("/"===l.charAt(0)?(this.retrieve_tag(l.substring(1)),this.tag_type="END"):(this.record_tag(l),this.tag_type="START"),this.Utils.in_array(l,this.Utils.extra_liners)&&this.print_newline(!0,this.output));return n.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var r="",n="",i=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,i=!0}while(-1==n.toLowerCase().indexOf(e));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,r,n,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=r,this.brace_style=i,this.indent_level=0,this.max_char=n;for(var o=this.line_char_count=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,i,n,o,a);;){var l=r.get_token();if(r.token_text=l[0],r.token_type=l[1],"TK_EOF"===r.token_type)break;switch(r.token_type){case"TK_TAG_START":r.print_newline(!1,r.output),r.print_token(r.token_text),r.indent(),r.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":r.print_newline(!1,r.output),r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===r.last_token&&""===r.last_text){var s=r.token_text.match(/\w+/)[0],u=r.output[r.output.length-1].match(/<\s*(\w+)/);null!==u&&u[1]===s||r.print_newline(!0,r.output)}r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var d=r.token_text.match(/^\s*<([a-z]+)/i);d&&r.Utils.in_array(d[1],c)||r.print_newline(!1,r.output),r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_CONTENT":""!==r.token_text&&r.print_token(r.token_text),r.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==r.token_text){r.output.push("\n");var f=r.token_text;if("TK_SCRIPT"==r.token_type)var h="function"==typeof js_beautify&&js_beautify;else"TK_STYLE"==r.token_type&&(h="function"==typeof css_beautify&&css_beautify);if("keep"==t.indent_scripts)var p=0;else p="separate"==t.indent_scripts?-r.indent_level:1;var m=r.get_full_indent(p);if(h)f=h(f.replace(/^\s*/,m),t);else{var g=f.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(r.indent_string).length-1,v=r.get_full_indent(p-g);f=f.replace(/^\s*/,m).replace(/\r\n|\r|\n/g,"\n"+v).replace(/\s*$/,"")}f&&(r.print_token(f),r.print_newline(!0,r.output))}r.current_mode="TAG"}r.last_token=r.token_type,r.last_text=r.token_text}return r.output.join("")}}},{}],23:[function(e,t,r){"use strict";t.exports=e("./stream/stream")},{"./stream/stream":24}],24:[function(e,r,t){!function(){"use strict";var t=0,i={};function a(){function e(){return 0<arguments.length&&arguments[0]!==i&&n(e,arguments[0]),e._state.value}var r;return(r=e).constructor=a,r._state={id:t++,value:void 0,state:0,derive:void 0,recover:void 0,deps:{},parents:[],endStream:void 0,unregister:void 0},r.map=r["fantasy-land/map"]=u,r["fantasy-land/ap"]=d,r["fantasy-land/of"]=a,r.valueOf=f,r.toJSON=h,r.toString=f,Object.defineProperties(r,{end:{get:function(){if(!r._state.endStream){var t=a();t.map(function(e){return!0===e&&(c(r),t._state.unregister=function(){c(t)}),e}),r._state.endStream=t}return r._state.endStream}}}),0<arguments.length&&arguments[0]!==i&&n(e,arguments[0]),e}function n(e,t){for(var r in o(e,t),e._state.deps)l(e._state.deps[r],!1);null!=e._state.unregister&&e._state.unregister(),function(e){for(var t in e._state.changed=!1,e._state.deps)e._state.deps[t]._state.changed=!1}(e)}function o(e,t){e._state.value=t,e._state.changed=!0,2!==e._state.state&&(e._state.state=1)}function l(e,t){var r=e._state.parents;if(0<r.length&&r.every(m)&&(t||r.some(g))){var n=e._state.derive();if(n===i)return!1;o(e,n)}}function s(e,t){if(!t.every(p))throw new Error("Ensure that each item passed to stream.combine/stream.merge is a stream");return r=a(),n=t,i=function(){return e.apply(this,t.concat([t.filter(g)]))},(o=r._state).derive=i,o.parents=n.filter(v),function e(t,r){for(var n=0;n<r.length;n++)r[n]._state.deps[t._state.id]=t,e(t,r[n]._state.parents)}(r,o.parents),l(r,!0),r;var r,n,i,o}function c(e){for(var t=0;t<e._state.parents.length;t++){delete e._state.parents[t]._state.deps[e._state.id]}for(var r in e._state.deps){var n=e._state.deps[r],i=n._state.parents.indexOf(e);-1<i&&n._state.parents.splice(i,1)}e._state.state=2,e._state.deps={}}function u(t){return s(function(e){return t(e())},[this])}function d(e){return s(function(e,t){return e()(t())},[e,this])}function f(){return this._state.value}function h(){return null!=this._state.value&&"function"==typeof this._state.value.toJSON?this._state.value.toJSON():this._state.value}function p(e){return e._state}function m(e){return 1===e._state.state}function g(e){return e._state.changed}function v(e){return 2!==e._state.state}(a["fantasy-land/of"]=a).merge=function(e){return s(function(){return e.map(function(e){return e()})},e)},a.combine=s,a.scan=function(t,r,e){var n=s(function(e){return r=t(r,e._state.value)},[e]);return 0===n._state.state&&n(r),n},a.scanMerge=function(n,i){var e=n.map(function(e){var t=e[0];return 0===t._state.state&&t(void 0),t});return s(function(){var r=arguments[arguments.length-1];return e.forEach(function(e,t){-1<r.indexOf(e)&&(i=n[t][1](i,e._state.value))}),i},e)},a.HALT=i,void 0!==r?r.exports=a:"function"!=typeof window.m||"stream"in window.m?window.m={stream:a}:window.m.stream=a}()},{}]},{},[11])}();
|
2 |
//# sourceMappingURL=forms-admin.min.js.map
|
1 |
+
!function(){var o=void 0;!function o(a,l,s){function c(t,e){if(!l[t]){if(!a[t]){var r=!1;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return c(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var u=!1,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,r){"use strict";t.exports=function(n,i){var e={showType:function(e){var t=e.type();return t=t.charAt(0).toUpperCase()+t.slice(1),n("div",[n("label",i.fieldType),n("span",t)])},label:function(e){return n("div",[n("label",i.fieldLabel),n("input.widefat",{type:"text",value:e.label(),onchange:n.withAttr("value",e.label),placeholder:e.title()})])},value:function(e){var t="hidden"===e.type();return n("div",[n("label",[t?i.value:i.initialValue," ",t?"":n("small",{style:"float: right; font-weight: normal;"},i.optional)]),n("input.widefat",{type:"text",value:e.value(),onchange:n.withAttr("value",e.value)}),t?"":n("p.help",i.valueHelp)])},numberMinMax:function(e){return n("div",[n("div.row",[n("div.col.col-3",[n("label",i.min),n("input",{type:"number",onchange:n.withAttr("value",e.min)})]),n("div.col.col-3",[n("label",i.max),n("input",{type:"number",onchange:n.withAttr("value",e.max)})])])])},isRequired:function(e){var t,r={type:"checkbox",checked:e.required(),onchange:n.withAttr("checked",e.required)};return e.forceRequired()&&(r.required=!0,r.disabled=!0,t=n("p.help",i.forceRequired)),n("div",[n("label.cb-wrap",[n("input",r),i.isFieldRequired]),t])},placeholder:function(e){return n("div",[n("label",[i.placeholder," ",n("small",{style:"float: right; font-weight: normal;"},i.optional)]),n("input.widefat",{type:"text",value:e.placeholder(),onchange:n.withAttr("value",e.placeholder),placeholder:""}),n("p.help",i.placeholderHelp)])},useParagraphs:function(e){return n("div",[n("label.cb-wrap",[n("input",{type:"checkbox",checked:e.wrap(),onchange:n.withAttr("checked",e.wrap)}),i.wrapInParagraphTags])])},choiceType:function(e){var t=[n("option",{value:"select",selected:"select"===e.type()&&"selected"},i.dropdown),n("option",{value:"radio",selected:"radio"===e.type()&&"selected"},i.radioButtons)];return e.acceptsMultipleValues&&t.push(n("option",{value:"checkbox",selected:"checkbox"===e.type()&&"selected"},i.checkboxes)),n("div",[n("label",i.choiceType),n("select",{value:e.type(),onchange:n.withAttr("value",e.type)},t)])},choices:function(r){var e=[];return e.push(n("div",[n("label",i.choices),n("div.limit-height",[n("table",[r.choices().map(function(e,t){return n("tr",{"data-id":t},[n("td.cb",n("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:n.withAttr("value",r.selectChoice.bind(r)),checked:e.selected(),value:e.value(),title:i.preselect})),n("td.stretch",n("input.widefat",{type:"text",value:e.label(),placeholder:e.title(),onchange:n.withAttr("value",e.label)})),n("td",n("span",{title:i.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,t)},""))])})])])])),e},linkToTerms:function(e){return n("div",[n("label",i.agreeToTermsLink),n("input.widefat",{type:"text",value:e.link,onchange:n.withAttr("value",e.link),placeholder:"https://..."})])}};return e}},{}],2:[function(i,e,t){"use strict";e.exports=function(e,t){var r={},n=i("./field-forms-rows.js")(e,t);return r.render=function(e){var t=e.type();if("function"==typeof r[t])return r[t](e);switch(t){case"select":case"radio":case"checkbox":return r.choice(e)}return r.text(e)},r.text=function(e){return[n.label(e),n.placeholder(e),n.value(e),n.isRequired(e),n.useParagraphs(e)]},r.choice=function(e){var t=[n.label(e),n.choiceType(e),n.choices(e)];return"select"===e.type()&&t.push(n.placeholder(e)),t.push(n.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(n.isRequired(e)),t},r.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[n.showType(e),n.value(e)]},r.submit=function(e){return e.label(""),e.placeholder(""),[n.value(e),n.useParagraphs(e)]},r["terms-checkbox"]=function(e){return[n.label(e),n.linkToTerms(e),n.isRequired(e),n.useParagraphs(e)]},r.number=function(e){return[r.text(e),n.numberMinMax(e)]},r}},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var l=e("html"),s=function(e){e.dom.checked&&e.dom.setAttribute("checked","true"),e.dom.value&&e.dom.setAttribute("value",e.dom.value),e.dom.selected&&e.dom.setAttribute("selected","true")};t.exports=function(o){var a={};return a.select=function(e){var t={name:e.name(),required:e.required()},r=!1,n=e.choices().map(function(e){return e.selected()&&(r=!0),o("option",{value:e.value()!==e.label()?e.value():void 0,selected:e.selected(),oncreate:s},e.label())}),i=e.placeholder();return 0<i.length&&n.unshift(o("option",{disabled:!0,value:"",selected:!r,oncreate:s},i)),o("select",t,n)},a["terms-checkbox"]=function(e){var t;return t=0<e.link().length?o("a",{href:e.link(),target:"_blank"},e.label()):e.label(),o("label",[o("input",{name:e.name(),type:"checkbox",value:e.value(),required:e.required()})," ",t])},a.checkbox=function(n){return n.choices().map(function(e){var t=n.name()+("checkbox"===n.type()?"[]":""),r=n.required()&&"radio"===n.type();return o("label",[o("input",{name:t,type:n.type(),value:e.value(),checked:e.selected(),required:r,oncreate:s})," ",o("span",e.label())])})},a.radio=a.checkbox,a.default=function(e){var t={type:e.type()};return e.name()&&(t.name=e.name()),e.min()&&(t.min=e.min()),e.max()&&(t.max=e.max()),0<e.value().length&&(t.value=e.value()),0<e.placeholder().length&&(t.placeholder=e.placeholder()),t.required=e.required(),t.oncreate=s,o("input",t)},function(e){var t,r,n,i=document.createElement("div");return t=0<e.label().length&&e.showLabel()?o("label",{},e.label()):"",r="function"==typeof a[e.type()]?a[e.type()](e):a.default(e),n=e.wrap()?o("p",[t,r]):[t,r],o.render(i,n),l.prettyPrint(i.innerHTML)+"\n"}}},{html:22}],4:[function(f,e,t){"use strict";e.exports=function(i,e,t,o,r,a){var l,n=f("./field-generator.js")(i),s=f("./overlay.js")(i,a),c=f("./field-forms.js")(i,a);function u(e){(l=o.get(e))&&0<l.choices().length&&l.value(l.choices().map(function(e){return e.label()}).join("|")),i.redraw()}function d(){var e=n(l);t.insert(e),u(""),i.redraw()}return t.on("blur",i.redraw),{view:function(){var e=o.getCategories(),r=o.getAll(),t=i("div.available-fields.small-margin",[i("h4",a.chooseField),e.map(function(t){var e=r.filter(function(e){return e.category===t});if(e.length)return i("div.tiny-margin",[i("strong",t),e.map(function(e){var t="button";e.forceRequired()&&(t+=" is-required");var r=e.inFormContent();return null!==r&&(t+=" "+(r?"in-form":"not-in-form")),i("button",{className:t,type:"button",onclick:i.withAttr("value",u),value:e.index},e.title())})])})]),n=null;return l&&(n=i(s(i("div.field-wizard",[i("h3",[l.title(),l.forceRequired()?i("span.red","*"):"",l.name().length?i("code",l.name()):""]),l.help().length?i("p",i.trust(l.help())):"",c.render(l),i("p",[i("button",{class:"button-primary",type:"button",onkeydown:function(e){13==(e=e||window.event).keyCode&&d()},onclick:d},a.addToForm)])]),u))),[t,n]},controller:function(){}}}},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){"use strict";t.exports=function(i,o){var a=[];function l(e,t,r){var n=i.register(e,t);r||a.push(n)}function s(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function t(e){var t=o.listFields,r=s(e.field_type),n={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:r,choices:e.choices,acceptsMultipleValues:!1};return"address"!==n.type?l(t,n,!1):(l(t,{name:n.name+"[addr1]",type:"text",mailchimpType:"address",title:o.streetAddress}),l(t,{name:n.name+"[city]",type:"text",mailchimpType:"address",title:o.city}),l(t,{name:n.name+"[state]",type:"text",mailchimpType:"address",title:o.state}),l(t,{name:n.name+"[zip]",type:"text",mailchimpType:"address",title:o.zip}),l(t,{name:n.name+"[country]",type:"select",mailchimpType:"address",title:o.country,choices:mc4wp_vars.countries})),!0}function r(e){var t=o.interestCategories,r=s(e.field_type);l(t,{title:e.name,name:"INTERESTS["+e.id+"]",type:r,choices:e.interests,acceptsMultipleValues:"checkbox"===r},!1)}function n(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e.public&&!t.public?-1:!e.public&&t.public?1:0}),e.merge_fields.forEach(t),e.interest_categories.forEach(r)}return{registerCustomFields:function(e){var t,r=o.formFields;for(var n in l(r,{name:"",value:o.subscribe,type:"submit",title:o.submitButton},!0),t={},e)t[e[n].id]=e[n].name;l(r,{name:"_mc4wp_lists",type:"checkbox",title:o.listChoice,choices:t,help:o.listChoiceDescription,acceptsMultipleValues:!0},!0),t={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},l(r,{name:"_mc4wp_action",type:"radio",title:o.formAction,choices:t,value:"subscribe",help:o.formActionDescription},!0),l(r,{name:"AGREE_TO_TERMS",value:1,type:"terms-checkbox",label:o.agreeToTerms,title:o.agreeToTermsShort,showLabel:!1,required:!0},!0)},registerListFields:n,registerListsFields:function(e){a.forEach(i.deregister),e.forEach(n)}}}},{}],6:[function(e,t,r){"use strict";var n=e("mithril/stream");t.exports=function(o,a){var l,s=[],c=[],u=function(e){this.name=n(e.name),this.title=n(e.title||e.name),this.type=n(e.type),this.mailchimpType=n(e.mailchimpType||""),this.label=n(e.label||e.title||""),this.showLabel=n(void 0===e.showLabel||e.showLabel),this.value=n(e.value||""),this.placeholder=n(e.placeholder||""),this.required=n(e.required||!1),this.forceRequired=n(e.forceRequired||!1),this.wrap=n(void 0===e.wrap||e.wrap),this.min=n(e.min||null),this.max=n(e.max||null),this.help=n(e.help||""),this.choices=n(e.choices||[]),this.inFormContent=n(null),this.acceptsMultipleValues=e.acceptsMultipleValues,this.link=n(e.link||""),this.selectChoice=function(t){var r=this;this.choices(this.choices().map(function(e){return e.value()===t?e.selected(!0):"checkbox"!==r.type()&&e.selected(!1),e}))}},d=function(e){this.label=n(e.label),this.title=n(e.title||e.label),this.selected=n(e.selected||!1),this.value=n(e.value||e.label)};function f(t,r){return s.filter(function(e){return e[t]()===r})}return{get:function(e){return s[e]},getAll:function(){return s=s.map(function(e,t){return e.index=t,e})},getCategories:function(){return c},deregister:function(e){var t=s.indexOf(e);-1<t&&(delete s[t],o.redraw())},register:function(e,t){var r,n,i=f("name",t.name).shift();if(!i)return t.choices&&(t.choices="function"==typeof(n=t.choices).map?n.map(function(e){return new d({label:e})}):Object.keys(n).map(function(e){var t=n[e];return new d({label:t,value:e})}),t.value&&(t.choices=t.choices.map(function(e){return e.value()===t.value&&e.selected(!0),e}))),c.indexOf(e)<0&&c.push(e),(r=new u(t)).category=e,s.push(r),l&&window.clearTimeout(l),l=window.setTimeout(o.redraw,200),a.trigger("fields.change"),r;!i.forceRequired()&&t.forceRequired&&i.forceRequired(!0)},getAllWhere:f}}},{"mithril/stream":23}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold.js"),e("codemirror/addon/edit/matchtags.js"),e("codemirror/addon/edit/closetag.js"),e("codemirror/addon/selection/active-line.js"),e("codemirror/addon/edit/matchbrackets.js");var i,o,a={},l=document.createElement("form"),s=!1,c=document.getElementById("mc4wp-form-content"),u=document.getElementById("mc4wp-form-preview"),d=/\{[^{}]+\}/g;function f(){var e=u.contentDocument||u.contentWindow.document;(o=e.querySelector(".mc4wp-form-fields"))&&h()}function h(){var e=a.getValue();e=e.replace(d,"").replace(d,""),o.innerHTML=e,o.dispatchEvent(new Event("mc4wp-refresh"))}function p(){return s&&(l.innerHTML=a.getValue().toLowerCase(),s=!1),l}window.addEventListener("load",function(){n.signal(i,"change")}),c.addEventListener("change",function(){s=!0,h()}),a.getValue=function(){return i?i.getValue():c.value},a.query=function(e){return p().querySelectorAll(e.toLowerCase())},a.containsField=function(e){return null!==p().elements.namedItem(e.toLowerCase())},a.insert=function(e){i?(i.replaceSelection(e),i.focus()):c.value+=e},a.on=function(e,t){return i?(e="input"===e?"changes":e,i.on(e,t)):c.addEventListener(e,t)},a.refresh=function(){i&&i.refresh()},l.innerHTML=c.value.toLowerCase(),n&&(i=n.fromTextArea(c,{selectionPointer:!0,mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0,styleActiveLine:!0,matchBrackets:!0,matchTags:{bothTags:!0}}),window.dispatchEvent&&i.on("change",function(){if("function"==typeof Event){var e=new Event("change",{bubbles:!0});c.dispatchEvent(e)}})),u.addEventListener("load",f),f.call(),t.exports=a},{codemirror:17,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchbrackets.js":13,"codemirror/addon/edit/matchtags.js":14,"codemirror/addon/fold/xml-fold.js":15,"codemirror/addon/selection/active-line.js":16,"codemirror/mode/css/css":18,"codemirror/mode/htmlmixed/htmlmixed":19,"codemirror/mode/javascript/javascript":20,"codemirror/mode/xml/xml":21}],8:[function(e,t,r){"use strict";t.exports=function(t,i,e,r,n,o){var a=document.getElementById("required-fields");function l(){var n,e;r.getAll().forEach(function(e){if(!(e.name().length<=0)){var t=e.name();"checkbox"===e.type()&&(t+="[]");var r=i.containsField(t);if(e.inFormContent(r),"address"===e.mailchimpType()){e.originalRequiredValue=void 0===e.originalRequiredValue?e.forceRequired():e.originalRequiredValue;var n=e.name().replace(/\[(\w+)\]/g,"");0<i.query('[name^="'+n+'"]').length?(void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired()),e.forceRequired(!0)):e.forceRequired(e.originalRequiredValue)}}}),n=r.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase().replace(/\[(\w+)\]/g,".$1")}),e=i.query("[required]"),Array.prototype.forEach.call(e,function(e){var t=e.name;if(t&&!(t.length<0)&&"_"!==t[0]){var r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/\[\]$/,"")).indexOf(".");r=0<r?r:t.length,t=t.substr(0,r).toUpperCase()+t.substr(r),-1===n.indexOf(t)&&n.push(t)}}),a.value=n.join(","),t.redraw()}i.on("change",o.debounce(l,500)),n.on("fields.change",o.debounce(l,500))}},{}],9:[function(e,t,r){"use strict";var i={};function o(e,t){i[e]=t,n()}function a(e){delete i[e],n()}function n(){var e="";for(var t in i)e+='<div class="notice notice-warning inline"><p>'+i[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){(r=document.createElement("div")).className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}t.exports={init:function(r,n){var e=function(){-1<r.getValue().toLowerCase().indexOf('name="groupings')?o("deprecated_groupings","Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly."):a("deprecated_groupings")},t=function(){var e=n.getAllWhere("forceRequired",!0).filter(function(e){return!r.containsField(e.name().toUpperCase())}),t="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";t+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+e.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",0<e.length?o("required_fields_missing",t):a("required_fields_missing")};e(),r.on("focus",e),r.on("blur",e),t(),r.on("blur",t),r.on("focus",t)}}},{}],10:[function(e,t,r){"use strict";t.exports=function(r,n){var i,o;function a(){document.removeEventListener("keydown",l),window.removeEventListener("resize",s),o()}function l(e){27==(e=e||window.event).keyCode&&a(),13==e.keyCode&&e.preventDefault()}function s(){if(i){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-i.clientWidth-40)/2,n=(t-i.clientHeight-40)/2;i.style.left=(0<r?r:0)+"px",i.style.top=(0<n?n:0)+"px"}}function c(e){i=e.dom,s()}return function(e,t){return o=t,{oncreate:function(){document.addEventListener("keydown",l),window.addEventListener("resize",s)},onremove:function(){document.removeEventListener("keydown",l),window.removeEventListener("resize",s)},view:function(){return[r("div.overlay-wrap",r("div.overlay",{oncreate:c},[r("span",{class:"close dashicons dashicons-no",title:n.close,onclick:a}),e])),r("div.overlay-background",{title:n.close,onclick:a})]}}}}},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=window.formEditor=u,m=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),g=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),m);var v=new f(h,n);o.on("selectedLists.change",v.registerListsFields),v.registerListsFields(a.getSelectedLists()),v.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),g.init(p,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=p,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,t,r){var n;n=function(y){y.defineOption("autoCloseTags",!1,function(e,t,r){if(r!=y.Init&&r&&e.removeKeyMap("autoCloseTags"),t){var n={name:"autoCloseTags"};("object"!=typeof t||t.whenClosing)&&(n["'/'"]=function(e){return(t=e).getOption("disableInput")?y.Pass:i(t,!0);var t}),("object"!=typeof t||t.whenOpening)&&(n["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return y.Pass;for(var t=e.listSelections(),r=[],n=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return y.Pass;var o=t[i].head,a=e.getTokenAt(o),l=y.innerMode(e.getMode(),a.state),s=l.state;if("xml"!=l.mode.name||!s.tagName)return y.Pass;var c="html"==l.mode.configuration,u="object"==typeof n&&n.dontCloseTags||c&&b,d="object"==typeof n&&n.indentTags||c&&w,f=s.tagName;a.end>o.ch&&(f=f.slice(0,f.length-a.end+o.ch));var h=f.toLowerCase();if(!f||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&"closeTag"==s.type||a.string.indexOf("/")==a.string.length-1||u&&-1<x(u,h)||k(e,f,o,s,!0))return y.Pass;var p=d&&-1<x(d,h);r[i]={indent:p,text:">"+(p?"\n\n":"")+"</"+f+">",newPos:p?y.Pos(o.line+1,0):y.Pos(o.line,o.ch+1)}}for(var m="object"==typeof n&&n.dontIndentOnAutoClose,i=t.length-1;0<=i;i--){var g=r[i];e.replaceRange(g.text,t[i].head,t[i].anchor,"+insert");var v=e.listSelections().slice(0);v[i]={head:g.newPos,anchor:g.newPos},e.setSelections(v),!m&&g.indent&&(e.indentLine(g.newPos.line,null,!0),e.indentLine(g.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(n)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],w=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(e,t){for(var r=e.listSelections(),n=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,l=0;l<r.length;l++){if(!r[l].empty())return y.Pass;var s,c=r[l].head,u=e.getTokenAt(c),d=y.innerMode(e.getMode(),u.state),f=d.state;if(t&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=c.ch-1))return y.Pass;if("xml"!=d.mode.name)if("htmlmixed"==e.getMode().name&&"javascript"==d.mode.name)s=i+"script";else{if("htmlmixed"!=e.getMode().name||"css"!=d.mode.name)return y.Pass;s=i+"style"}else{if(!f.context||!f.context.tagName||k(e,f.context.tagName,c,f))return y.Pass;s=i+f.context.tagName}">"!=e.getLine(c.line).charAt(u.end)&&(s+=">"),n[l]=s}if(e.replaceSelections(n),r=e.listSelections(),!a)for(l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&e.indentLine(r[l].head.line)}function x(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function k(e,t,r,n,i){if(!y.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=y.scanForClosingTag(e,r,null,o);if(!a||a.tag!=t)return!1;for(var l=n.context,s=i?1:0;l&&l.tagName==t;l=l.prev)++s;r=a.to;for(var c=1;c<s;c++){var u=y.scanForClosingTag(e,r,null,o);if(!u||u.tag!=t)return!1;r=u.to}return!0}y.commands.closeTag=function(e){return i(e)}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../fold/xml-fold"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../fold/xml-fold":15}],13:[function(e,t,r){var n;n=function(n){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),m=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function d(e,t,r){var n=e.getLineHandle(t.line),i=t.ch-1,o=r&&r.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=!o&&0<=i&&g[n.text.charAt(i)]||g[n.text.charAt(++i)];if(!a)return null;var l=">"==a.charAt(1)?1:-1;if(r&&r.strict&&0<l!=(i==t.ch))return null;var s=e.getTokenTypeAt(m(t.line,i+1)),c=f(e,m(t.line,i+(0<l?1:0)),l,s||null,r);return null==c?null:{from:m(t.line,i),to:c&&c.pos,match:c&&c.ch==a.charAt(0),forward:0<l}}function f(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,l=[],s=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,c=0<r?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=r){var d=e.getLine(u);if(d){var f=0<r?0:d.length-1,h=0<r?d.length:-1;if(!(d.length>o))for(u==t.line&&(f=t.ch-(r<0?1:0));f!=h;f+=r){var p=d.charAt(f);if(s.test(p)&&(void 0===n||e.getTokenTypeAt(m(u,f+1))==n))if(">"==g[p].charAt(1)==0<r)l.push(p);else{if(!l.length)return{pos:m(u,f),ch:p};l.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),a=0;a<o.length;a++){var l=o[a].empty()&&d(e,o[a].head,r);if(l&&e.getLine(l.from.line).length<=n){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(l.from,m(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=n&&i.push(e.markText(l.to,m(l.to.line,l.to.ch+1),{className:s}))}}if(i.length){u&&e.state.focused&&e.focus();var c=function(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})};if(!t)return c;setTimeout(c,800)}}function i(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=t(e,!1,e.state.matchBrackets)})}n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",i),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(t=r?(r.strict=t,r):t?{strict:!0}:null),d(this,e,t)}),n.defineExtension("scanForBracket",function(e,t,r,n){return f(this,e,t,r,n)})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],14:[function(e,t,r){var n;n=function(a){"use strict";function l(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(o){o.state.failedTagMatch=!1,o.operation(function(){if(l(o),!o.somethingSelected()){var e=o.getCursor(),t=o.getViewport();t.from=Math.min(t.from,e.line),t.to=Math.max(e.line+1,t.to);var r=a.findMatchingTag(o,e,t);if(r){if(o.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(o.state.tagHit=o.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var i="close"==r.at?r.open:r.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}a.defineOption("matchTags",!1,function(e,t,r){r&&r!=a.Init&&(e.off("cursorActivity",n),e.off("viewportChange",i),l(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",n),e.on("viewportChange",i),n(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var r="close"==t.at?t.open:t.close;r&&e.extendSelection(r.to,r.from)}}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../fold/xml-fold"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../fold/xml-fold":15}],15:[function(e,t,r){var n;n=function(e){"use strict";var s=e.Pos;function c(e,t){return e.line-t.line||e.ch-t.ch}var t="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("<(/?)(["+t+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function i(e,t){var r=e.cm.getTokenTypeAt(s(e.line,t));return r&&/\btag\b/.test(r)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function d(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(o(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var r=[];;){var n,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(n=d(e)))return;if("selfClose"!=n)if(i[1]){for(var l=r.length-1;0<=l;--l)if(r[l]==i[2]){r.length=l;break}if(l<0&&(!t||t==i[2]))return{tag:i[2],from:s(o,a),to:s(e.line,e.ch)}}else r.push(i[2])}}function g(e,t){for(var r=[];;){var n=p(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=f(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;0<=l;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!t||t==a[2]))return{tag:a[2],from:s(e.line,e.ch),to:s(i,o)}}}else f(e)}}e.registerHelper("fold","xml",function(e,t){for(var r=new u(e,t.line,0);;){var n=h(r);if(!n||r.line!=t.line)return;var i=d(r);if(!i)return;if(!n[1]&&"selfClose"!=i){var o=s(r.line,r.ch),a=m(r,n[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,r){var n=new u(e,t.line,t.ch,r);if(-1!=n.text.indexOf(">")||-1!=n.text.indexOf("<")){var i=d(n),o=i&&s(n.line,n.ch),a=i&&f(n);if(i&&a&&!(0<c(n,t))){var l={from:s(n.line,n.ch),to:o,tag:a[2]};return"selfClose"==i?{open:l,close:null,at:"open"}:a[1]?{open:g(n,a[2]),close:l,at:"close"}:{open:l,close:m(n=new u(e,o.line,o.ch,r),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new u(e,t.line,t.ch,r);;){var o=g(i,n);if(!o)break;var a=m(new u(e,t.line,t.ch,r),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,r,n){return m(new u(e,t.line,t.ch,n?{from:0,to:n}:null),r)}},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],16:[function(e,t,r){var n;n=function(i){"use strict";var l="CodeMirror-activeline",s="CodeMirror-activeline-background",c="CodeMirror-activeline-gutter";function u(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",l),e.removeLineClass(e.state.activeLines[t],"background",s),e.removeLineClass(e.state.activeLines[t],"gutter",c)}function o(t,e){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=t.getOption("styleActiveLine");if("object"==typeof o&&o.nonEmpty?i.anchor.line==i.head.line:i.empty()){var a=t.getLineHandleVisualStart(i.head.line);r[r.length-1]!=a&&r.push(a)}}(function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0})(t.state.activeLines,r)||t.operation(function(){u(t);for(var e=0;e<r.length;e++)t.addLineClass(r[e],"wrap",l),t.addLineClass(r[e],"background",s),t.addLineClass(r[e],"gutter",c);t.state.activeLines=r})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,r){var n=r!=i.Init&&r;t!=n&&(n&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],17:[function(e,t,r){var n,i;n=this,i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=r||n||i,k=x&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),a=!i&&/Chrome\//.test(e),g=/Opera\//.test(e),s=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),c=/PhantomJS/.test(e),u=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),d=/Android/.test(e),f=u||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),w=u||/Mac/.test(t),h=/\bCrOS\b/.test(e),p=/win/i.test(t),v=g&&e.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&15<=v&&(b=!(g=!1));var y=w&&(o||g&&(null==v||v<12.11)),C=m||x&&9<=k;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,L=function(e,t){var r=e.className,n=T(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function A(e,t){return M(e).appendChild(t)}function N(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,r,n){var i=N(e,t,r,n);return i.setAttribute("role","presentation"),i}function _(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function E(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function D(e,t){var r=e.className;T(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!T(r[n]).test(t)&&(t+=" "+r[n]);return t}S=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var W=function(e){e.select()};function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function P(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function H(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}u?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(W=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function R(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}I.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var j=30,B={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},U={origin:"*mouse"},K={origin:"+move"};function V(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var G=[""];function $(e){for(;G.length<=e;)G.push(Y(G)+" ");return G[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function J(e,t){var r;return r=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&P(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var n=r<t?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function le(e,t,r){var n=this;this.input=r,n.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=O("div",null,"CodeMirror-code"),n.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=N("div",null,"CodeMirror-cursors"),n.measure=N("div",null,"CodeMirror-measure"),n.lineMeasure=N("div",null,"CodeMirror-measure"),n.lineSpace=O("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var i=O("div",[n.lineSpace],"CodeMirror-lines");n.mover=N("div",[i],null,"position: relative"),n.sizer=N("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=N("div",null,null,"position: absolute; height: "+j+"px; width: 1px;"),n.gutters=N("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=N("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=N("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),x&&k<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),b||m&&f||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function ce(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function ue(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function de(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function fe(e){if(null==e.parent)return null;for(var t=e.parent,r=R(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function pe(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ge(e,t,r){if(void 0===r&&(r=null),!(this instanceof ge))return new ge(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return ge(e.line,e.ch)}function we(e,t){return ve(e,t)<0?t:e}function xe(e,t){return ve(e,t)<0?e:t}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return ge(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?ge(o,se(e,o).text.length):(n=se(e,(r=t).line).text.length,null==(i=r.ch)||n<i?ge(r.line,n):i<0?ge(r.line,0):r)}function Te(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Ce(e,t[n]);return r}var Se=!1,Le=!1;function Me(e,t,r){this.marker=e,this.from=t,this.to=r}function Ae(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Oe(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ne(e,t){if(t.full)return null;var r=pe(e,t.from.line)&&se(e,t.from.line).markedSpans,n=pe(e,t.to.line)&&se(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ve(t.from,t.to),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Me(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Me(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=Y(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Ae(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=u),null==m.from)Ae(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m));else m.from+=u,c&&(l||(l=[])).push(m)}l&&(l=_e(l)),s&&s!=l&&(s=_e(s));var g=[l];if(!c){var v,y=t.text.length-2;if(0<y&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new Me(l[b].marker,null,null));for(var w=0;w<y;++w)g.push(v);g.push(s)}return g}function _e(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ee(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function De(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Fe(e){return e.inclusiveLeft?-1:0}function We(e){return e.inclusiveRight?1:0}function ze(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||Fe(e)-Fe(t);if(o)return-o;var a=ve(n.to,i.to)||We(e)-We(t);return a||t.id-e.id}function Pe(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||ze(r,i.marker)<0)&&(r=i.marker);return r}function He(e){return Pe(e,!0)}function Ie(e){return Pe(e,!1)}function Re(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||ze(r,o.marker)<0)&&(r=o.marker)}return r}function je(e,t,r,n,i){var o=se(e,t),a=Le&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=ve(c.from,r)||Fe(s.marker)-Fe(i),d=ve(c.to,n)||We(s.marker)-We(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=ve(c.to,r):0<ve(c.to,r))||0<=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?ve(c.from,n)<=0:ve(c.from,n)<0)))return!0}}}function Be(e){for(var t;t=He(e);)e=t.find(-1,!0).line;return e}function qe(e,t){var r=se(e,t),n=Be(r);return r==n?t:fe(n)}function Ue(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!Ke(e,n))return t;for(;r=Ie(n);)n=r.find(1,!0).line;return fe(n)+1}function Ke(e,t){var r=Le&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Ve(e,t,n))return!0}}function Ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Ve(e,n.line,Ae(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ve(e,t,i))return!0}function Ge(e){for(var t=0,r=(e=Be(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function $e(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=He(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Ie(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Ye(e){var r=e.display,t=e.doc;r.maxLine=se(t,t.first),r.maxLineLength=$e(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=$e(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var Xe=null;function Ze(e,t,r){var n;Xe=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Xe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Xe=i)}return null!=n?n:Xe}var Je=function(){var P="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",H="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var I=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,R=/[stwN]/,j=/[LRr]/,B=/[Lb1n]/,q=/[1n]/;function U(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!I.test(e))return!1;for(var n,i=e.length,o=[],a=0;a<i;++a)o.push((n=e.charCodeAt(a))<=247?P.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?H.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var l=0,s=r;l<i;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=r;u<i;++u){var f=o[u];"1"==f&&"r"==d?o[u]="n":j.test(f)&&"r"==(d=f)&&(o[u]="R")}for(var h=1,p=o[0];h<i-1;++h){var m=o[h];"+"==m&&"1"==p&&"1"==o[h+1]?o[h]="1":","!=m||p!=o[h+1]||"1"!=p&&"n"!=p||(o[h]=p),p=m}for(var g=0;g<i;++g){var v=o[g];if(","==v)o[g]="N";else if("%"==v){var y=void 0;for(y=g+1;y<i&&"%"==o[y];++y);for(var b=g&&"!"==o[g-1]||y<i&&"1"==o[y]?"1":"N",w=g;w<y;++w)o[w]=b;g=y-1}}for(var x=0,k=r;x<i;++x){var C=o[x];"L"==k&&"1"==C?o[x]="L":j.test(C)&&(k=C)}for(var T=0;T<i;++T)if(R.test(o[T])){var S=void 0;for(S=T+1;S<i&&R.test(o[S]);++S);for(var L="L"==(T?o[T-1]:r),M=L==("L"==(S<i?o[S]:r))?L?"L":"R":r,A=T;A<S;++A)o[A]=M;T=S-1}for(var O,N=[],_=0;_<i;)if(B.test(o[_])){var E=_;for(++_;_<i&&B.test(o[_]);++_);N.push(new U(0,E,_))}else{var D=_,F=N.length;for(++_;_<i&&"L"!=o[_];++_);for(var W=D;W<_;)if(q.test(o[W])){D<W&&N.splice(F,0,new U(1,D,W));var z=W;for(++W;W<_&&q.test(o[W]);++W);N.splice(F,0,new U(2,z,W)),D=W}else++W;D<_&&N.splice(F,0,new U(1,D,_))}return"ltr"==t&&(1==N[0].level&&(O=e.match(/^\s+/))&&(N[0].from=O[0].length,N.unshift(new U(0,0,O[0].length))),1==Y(N).level&&(O=e.match(/\s+$/))&&(Y(N).to-=O[0].length,N.push(new U(0,i-O[0].length,i)))),"rtl"==t?N.reverse():N}}();function Qe(e,t){var r=e.order;return null==r&&(r=e.order=Je(e.text,t)),r}var et=[],tt=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||et).concat(r)}};function rt(e,t){return e._handlers&&e._handlers[t]||et}function nt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=R(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var r=rt(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ot(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,r||t.type,e,t),dt(t)||t.codemirrorIgnore}function at(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==R(r,t[n])&&r.push(t[n])}function lt(e,t){return 0<rt(e,t).length}function st(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){ct(e),ut(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),w&&e.ctrlKey&&1==t&&(t=3),t}var mt,gt,vt=function(){if(x&&k<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==mt){var t=N("span","");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(mt=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&k<8))}var r=mt?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function bt(e){if(null!=gt)return gt;var t=A(e,document.createTextNode("AخA")),r=S(t,0,1).getBoundingClientRect(),n=S(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(gt=n.right-r.right<3)}var wt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},kt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ct="oncopy"in(wt=N("div"))||(wt.setAttribute("oncopy","return;"),"function"==typeof wt.oncopy),Tt=null;var St={},Lt={};function Mt(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function At(e,t){t=Mt(t);var r=St[t.name];if(!r)return At(e,"text/plain");var n=r(e,t);if(Ot.hasOwnProperty(t.name)){var i=Ot[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Ot={};function Nt(e,t){P(t,Ot.hasOwnProperty(e)?Ot[e]:Ot[e]={})}function _t(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Et(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Dt(e,t,r){return!e.startState||e.startState(t,r)}var Ft=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Wt=function(e,t){this.state=e,this.lookAhead=t},zt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Pt(t,r,n,e){var s=[t.state.modeGen],i={};Vt(t,r.text,t.doc.mode,n,function(e,t){return s.push(e,t)},i,e);for(var c=n.state,o=function(e){n.baseTokens=s;var o=t.state.overlays[e],a=1,l=0;n.state=!0,Vt(t,r.text,o.mode,n,function(e,t){for(var r=a;l<e;){var n=s[a];e<n&&s.splice(a,1,e,s[a+1],n),a+=2,l=Math.min(e,n)}if(t)if(o.opaque)s.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var i=s[r+1];s[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=c,n.baseTokens=null,n.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:s,classes:i.bgClass||i.textClass?i:null}}function Ht(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=It(e,fe(t)),i=t.text.length>e.options.maxHighlightLength&&_t(e.doc.mode,n.state),o=Pt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new zt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=se(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof Wt?c.lookAhead:0)<=o.modeFrontier))return l;var u=H(s.text,null,e.options.tabSize);(null==i||u<n)&&(i=l-1,n=u)}return i}(r,n,e),a=o>t.first&&se(t,o-1).stateAfter,l=a?zt.fromSaved(t,a,o):new zt(t,Dt(t.mode),o);return t.iter(o,n,function(e){Rt(r,e.text,l);var t=l.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?l.save():null,l.nextLine()}),e&&(t.modeFrontier=l.line),l}function Rt(e,t,r,n){var i=e.doc.mode,o=new Ft(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&jt(i,r.state);!o.eol();)Bt(i,o,r.state),o.start=o.pos}function jt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Et(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Bt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Et(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}zt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},zt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},zt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},zt.fromSaved=function(e,t,r){return t instanceof Wt?new zt(e,_t(e.mode,t.state),r,t.lookAhead):new zt(e,_t(e.mode,t),r)},zt.prototype.save=function(e){var t=!1!==e?_t(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new Wt(t,this.maxLookAhead):t};var qt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ut(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=se(a,(t=Ce(a,t)).line),c=It(e,t.line,r),u=new Ft(s.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Bt(l,u,c.state),n&&o.push(new qt(u,i,_t(a.mode,c.state)));return n?o:new qt(u,i,c.state)}function Kt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Vt(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ft(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Kt(jt(r,n.state),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&Rt(e,t,n,d.pos),d.pos=t.length,null):Kt(Bt(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var Gt=function(e,t,r){this.text=e,De(this,t),this.height=r?r(this):1};Gt.prototype.lineNo=function(){return fe(this)},st(Gt);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Yt:$t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=O("span",null,null,b?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=Qt,bt(e.display.measure)&&(a=Qe(o,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(o,n,Ht(e,o,t!=e.display.externalMeasured&&fe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Jt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,r,n,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){l=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var f=c.exec(t),h=f?f.index-d:t.length-d;if(h){var p=document.createTextNode(s.slice(d,d+h));x&&k<9?l.appendChild(N("span",[p])):l.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!f)break;d+=h+1;var m=void 0;if("\t"==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g;(m=l.appendChild(N("span",$(v),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=v}else"\r"==f[0]||"\n"==f[0]?(m=l.appendChild(N("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((m=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),x&&k<9?l.appendChild(N("span",[m])):l.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,l=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,l),x&&k<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==s.charCodeAt(t.length-1),r||n||i||u||o){var y=r||"";n&&(y+=n),i&&(y+=i);var b=N("span",[l],y,o);if(a)for(var w in a)a.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&b.setAttribute(w,a[w]);return e.content.appendChild(b)}e.content.appendChild(l)}}function er(d,f){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var l=e.pos,s=l+t.length;;){for(var c=void 0,u=0;u<f.length&&!((c=f[u]).to>l&&c.from<=l);u++);if(c.to>=s)return d(e,t,r,n,i,o,a);d(e,t.slice(0,c.to-l),r,n,null,o,a),n=null,t=t.slice(c.to-l),l=c.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=l="",d=f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;if("bookmark"==k.type&&x.from==p&&k.widgetNode)y.push(k);else if(x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C];k.collapsed&&(!d||ze(d.marker,k)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var T=0;T<b.length;T+=2)b[T+1]==v&&(c+=" "+b[T]);if(!d||d.from==p)for(var S=0;S<y.length;++S)tr(t,0,y[S]);if(d&&(d.from||0)==p){if(tr(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(h<=p)break;for(var L=Math.min(h,v);;){if(g){var M=p+g.length;if(!d){var A=L<M?g.slice(0,L-p):g;t.addToken(t,A,a?a+s:s,u,p+A.length==v?c:"",l,f)}if(L<=M){g=g.slice(L-p),p=L;break}p=M,u=""}g=i.slice(o,o=r[m++]),a=Xt(r[m++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,i.slice(o,o=r[O]),Xt(r[O+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Ie(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?fe(Y(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ke(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new nr(e.doc,se(e.doc,o),o);n=o+a.size,i.push(a)}return i}var or=null;var ar=null;function lr(e,t){var r=rt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(sr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function sr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?hr(e,t):"widget"==o&&mr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),x&&k<8&&(e.node.style.zIndex=2)),e.node}function dr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zt(e,t)}function fr(e,t){var r=t.text.className,n=dr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,hr(e,t)):r&&(t.text.className=r)}function hr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ur(t);t.background=n.insertBefore(N("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function pr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ur(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ur(t),l=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(N("div",me(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var c=e.options.gutters[s],u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function mr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);gr(e,t,r)}function gr(e,t,r){if(vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)vr(e,t.rest[n],t,r,!1)}function vr(e,t,r,n,i){if(t.widgets)for(var o=ur(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),yr(s,c,r,n),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),lr(s,"redraw")}}function yr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function br(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,N("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function wr(e,t){for(var r=ht(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function xr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,N("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Tr(e){return j-e.display.nativeBarWidth}function Sr(e){return e.display.scroller.clientWidth-Tr(e)-e.display.barWidth}function Lr(e){return e.display.scroller.clientHeight-Tr(e)-e.display.barHeight}function Mr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(fe(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ar(e,t,r,n){return _r(e,Nr(e,t),r,n)}function Or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ln(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Nr(e,t){var r=fe(t),n=Or(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,tn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=fe(t=Be(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Zt(e,n);return n.text=i.pre,A(e.display.lineMeasure,i.pre),n}(e,t));var i=Mr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _r(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&Sr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];2<Math.abs(s.bottom-c.bottom)&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Fr(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+s));)++s;if((i=x&&k<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Wr(S(a,l,s).getClientRects(),n)).left||i.right||0==l)break;s=l,l-=1,c="right"}x&&k<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Tt)return Tt;var t=A(e,N("span","x")),r=t.getBoundingClientRect(),n=S(t,0,1).getBoundingClientRect();return Tt=1<Math.abs(r.left-n.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;0<l&&(c=n="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(x&&k<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+en(e.display),top:f.top,bottom:f.bottom}:Dr}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(h+p)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};i.left||i.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p);return w}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Er,Dr={left:0,right:0,top:0,bottom:0};function Fr(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=(i=t-l)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,s<=t&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Wr(e,t){var r=Dr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function zr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Pr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)zr(e.display.view[t])}function Hr(e){Pr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ir(){return a&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Rr(){return a&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function jr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function Br(e,t,r,n,i){if(!i){var o=jr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=Ge(t);if("local"==n?a+=xr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:Rr());var s=l.left+("window"==n?0:Ir());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function qr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Ir(),i-=Rr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Ur(e,t,r,n,i){return n||(n=se(e.doc,t.line)),Br(e,n,Ar(e,n,t.ch,i),r)}function Kr(n,e,i,o,a,l){function s(e,t){var r=_r(n,a,e,t?"right":"left",l);return t?r.left=r.right:r.right=r.left,Br(n,o,r,i)}o=o||se(n.doc,e.line),a||(a=Nr(n,o));var c=Qe(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!c)return s("before"==r?t-1:t,"before"==r);function u(e,t,r){return s(r?e-1:e,1==c[t].level!=r)}var d=Ze(c,t,r),f=Xe,h=u(t,d,"before"==r);return null!=f&&(h.other=u(t,f,"before"!=r)),h}function Vr(e,t){var r=0;t=Ce(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=se(e.doc,t.line),i=Ge(n)+xr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Gr(e,t,r,n,i){var o=ge(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function $r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Gr(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(o<i)return Gr(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=se(n,i);;){var l=Jr(e,a,i,t,r),s=Re(a,l.ch+(0<l.xRel?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=se(n,i=c.line)}}function Yr(t,e,r,n){n-=jr(e);var i=e.text.length,o=ae(function(e){return _r(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=ae(function(e){return _r(t,r,e).top>n},o,i)}}function Xr(e,t,r,n){return r||(r=Nr(e,t)),Yr(e,t,r,Br(e,t,_r(e,r,n),"line").top)}function Zr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(r,e,t,n,i){i-=Ge(e);var o=Nr(r,e),a=jr(e),l=0,s=e.text.length,c=!0,u=Qe(e,r.doc.direction);if(u){var d=(r.options.lineWrapping?function(e,t,r,n,i,o,a){var l=Yr(e,t,n,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=s)){var p=1!=h.level,m=_r(e,n,p?Math.min(c,h.to)-1:Math.max(s,h.from)).right,g=m<o?o-m+1e9:m-o;(!u||g<d)&&(u=h,d=g)}}u||(u=i[i.length-1]);u.from<s&&(u={from:s,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(n,i,o,a,l,s,c){var e=ae(function(e){var t=l[e],r=1!=t.level;return Zr(Kr(n,ge(o,r?t.to:t.from,r?"before":"after"),"line",i,a),s,c,!0)},0,l.length-1),t=l[e];if(0<e){var r=1!=t.level,u=Kr(n,ge(o,r?t.from:t.to,r?"after":"before"),"line",i,a);Zr(u,s,c,!0)&&u.top>c&&(t=l[e-1])}return t})(r,e,t,o,u,n,i);l=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(e){var t=_r(r,o,e);return t.top+=a,t.bottom+=a,!!Zr(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,m=t),!0)},l,s),v=!1;if(m){var y=n-m.left<m.right-n,b=y==c;g=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||g!=s&&g!=l||g++,h=0==g?"after":g==e.text.length?"before":_r(r,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Kr(r,ge(t,g,h),"line",e,o);f=w.left,v=i<w.top||i>=w.bottom}return Gr(t,g=oe(e.text,g,1),h,v,n-f)}function Qr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Er){Er=N("pre");for(var t=0;t<49;++t)Er.appendChild(document.createTextNode("x")),Er.appendChild(N("br"));Er.appendChild(document.createTextNode("x"))}A(e.measure,Er);var r=Er.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function en(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t]);A(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function tn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nn(n){var i=Qr(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/en(n.display)-3);return function(e){if(Ke(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function on(e){var t=e.doc,r=nn(e);t.iter(function(e){var t=r(e);t!=e.height&&de(e,t)})}function an(e,t,r,n){var i=e.display;if(!r&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=$r(e,o,a);if(n&&1==c.xRel&&(s=se(e.doc,c.line).text).length==c.ch){var u=H(s,s.length,e.options.tabSize)-s.length;c=ge(c.line,Math.max(0,Math.round((o-Cr(e.display).left)/en(e.display))-u))}return c}function ln(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function cn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&un(e,l.head,i),s||fn(e,l,o)}}return n}function un(e,t,r){var n=Kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function dn(e,t){return e.top-t.top||e.left-t.left}function fn(a,e,t){var r=a.display,n=a.doc,i=document.createDocumentFragment(),o=Cr(a.display),L=o.left,M=Math.max(r.sizerWidth,Sr(a)-r.sizer.offsetLeft)-o.right,A="ltr"==n.direction;function O(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function l(r,y,b){var w,x,o=se(n,r),k=o.text.length;function C(e,t){return Ur(a,ge(r,e),"div",o,t)}function T(e,t,r){var n=Xr(a,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return C("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var S=Qe(o,n.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(S,y||0,null==b?k:b,function(e,t,r,n){var i="ltr"==r,o=C(e,i?"left":"right"),a=C(t-1,i?"right":"left"),l=null==y&&0==e,s=null==b&&t==k,c=0==n,u=!S||n==S.length-1;if(a.top-o.top<=3){var d=(A?s:l)&&u,f=(A?l:s)&&c?L:(i?o:a).left,h=d?M:(i?a:o).right;O(f,o.top,h-f,o.bottom)}else{var p,m,g,v;v=i?(p=A&&l&&c?L:o.left,m=A?M:T(e,r,"before"),g=A?L:T(t,r,"after"),A&&s&&u?M:a.right):(p=A?T(e,r,"before"):L,m=!A&&l&&c?M:o.right,g=!A&&s&&u?L:a.left,A?T(t,r,"after"):M),O(p,o.top,m-p,o.bottom),o.bottom<a.top&&O(L,o.bottom,null,a.top),O(g,a.top,v-g,a.bottom)}(!w||dn(o,w)<0)&&(w=o),dn(a,w)<0&&(w=a),(!x||dn(o,x)<0)&&(x=o),dn(a,x)<0&&(x=a)}),{start:w,end:x}}var s=e.from(),c=e.to();if(s.line==c.line)l(s.line,s.ch,c.ch);else{var u=se(n,s.line),d=se(n,c.line),f=Be(u)==Be(d),h=l(s.line,s.ch,f?u.text.length+1:null).end,p=l(c.line,f?0:null,c.ch).start;f&&(h.top<p.top-2?(O(h.right,h.top,null,h.bottom),O(L,p.top,p.left,p.bottom)):O(h.right,h.top,p.left-h.right,h.bottom)),h.bottom<p.top&&O(L,h.bottom,null,p.top)}t.appendChild(i)}function hn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function pn(e){e.state.focused||(e.display.input.focus(),gn(e))}function mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vn(e))},100)}function gn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function vn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,l=0;if(!i.hidden){if(x&&k<8){var s=i.node.offsetTop+i.node.offsetHeight;a=s-r,r=s}else{var c=i.node.getBoundingClientRect();a=c.bottom-c.top,!o&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var u=i.line.height-a;if(a<2&&(a=Qr(t)),(.005<u||u<-.005)&&(de(i.line,a),bn(i.line),i.rest))for(var d=0;d<i.rest.length;d++)bn(i.rest[d]);if(l>e.display.sizerWidth){var f=Math.ceil(l/en(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function bn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function wn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-xr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),a=he(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?a=he(t,Ge(se(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=he(t,Ge(se(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function xn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function kn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=me(e.options,t.first+t.size-1),n=e.display;if(r.length==n.lineNumChars)return!1;var i=n.measure.appendChild(N("div",[N("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",li(e),!0}function Cn(e,t){var r=e.display,n=Qr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Lr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+kr(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Sr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Tn(e,t){null!=t&&(Mn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Sn(e){Mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||Mn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Mn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,An(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function An(e,t,r,n){var i=Cn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,i.scrollLeft,i.scrollTop)}function On(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||ai(e,{top:t}),Nn(e,t,!0),m&&ai(e),ti(e,100))}function Nn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function _n(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,xn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function En(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Dn=function(e,t,r){this.cm=r;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),tt(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Dn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dn.prototype.zeroWidthHack=function(){var e=w&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},Dn.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},Dn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fn=function(){};function Wn(e,t){t||(t=En(e));var r=e.display.barWidth,n=e.display.barHeight;zn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&yn(e),zn(e,En(e)),r=e.display.barWidth,n=e.display.barHeight}function zn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Fn.prototype.update=function(){return{bottom:0,right:0}},Fn.prototype.setScrollLeft=function(){},Fn.prototype.setScrollTop=function(){},Fn.prototype.clear=function(){};var Pn={native:Dn,null:Fn};function Hn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&L(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new Pn[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),tt(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?_n(r,e):On(r,e)},r),r.display.scrollbars.addClass&&D(r.display.wrapper,r.display.scrollbars.addClass)}var In=0;function Rn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++In},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function jn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{or=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Bn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ii(i.cm,i.update);var i;for(var o=0;o<t.length;o++)qn(t[o]);for(var a=0;a<t.length;a++)Un(t[a]);for(var l=0;l<t.length;l++)Kn(t[l])}(e)})}function Bn(e){var t,r,n=e.cm,i=n.display;!(r=(t=n).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Tr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Tr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Ye(n),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ni(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qn(e){var t=e.cm,r=t.display;e.updatedDisplay&&yn(t),e.barMeasure=En(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Sr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Un(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_n(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wn(t,e.barMeasure),e.updatedDisplay&&si(t,e.barMeasure),e.selectionChanged&&hn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&pn(e.cm)}function Kn(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&oi(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Nn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&_n(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=N("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-xr(e.display))+"px;\n height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ge(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ge(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Kr(e,t),s=r&&r!=t?Kr(e,r):l,c=Cn(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(On(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(_n(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return i}(t,Ce(n,e.scrollToPos.from),Ce(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||it(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&it(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vn(e,t){if(e.curOp)return t();Rn(e);try{return t()}finally{jn(e)}}function Gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Rn(e);try{return t.apply(e,arguments)}finally{jn(e)}}}function $n(e){return function(){if(this.curOp)return e.apply(this,arguments);Rn(this);try{return e.apply(this,arguments)}finally{jn(this)}}}function Yn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Rn(e);try{return t.apply(this,arguments)}finally{jn(e)}}}function Xn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&qe(e.doc,t)<i.viewTo&&Jn(e);else if(r<=i.viewFrom)Le&&Ue(e.doc,r+n)>i.viewFrom?Jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Jn(e);else if(t<=i.viewFrom){var o=Qn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Jn(e)}else if(r>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jn(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(ir(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Jn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function Zn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[ln(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==R(a,r)&&a.push(r)}}}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,r,n){var i,o=ln(e,t),a=e.display.view;if(!Le||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<n){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;qe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function ei(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,z(ri,e))}function ri(s){var c=s.doc;if(!(c.highlightFrontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=It(s,c.highlightFrontier),f=[];c.iter(d.line,Math.min(c.first+c.size,s.display.viewTo+500),function(e){if(d.line>=s.display.viewFrom){var t=e.styles,r=e.text.length>s.options.maxHighlightLength?_t(c.mode,d.state):null,n=Pt(s,e,d,!0);r&&(d.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),l=0;!a&&l<t.length;++l)a=t[l]!=e.styles[l];a&&f.push(d.line),e.stateAfter=d.save(),d.nextLine()}else e.text.length<=s.options.maxHighlightLength&&Rt(s,e.text,d),e.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>u)return ti(s,s.options.workDelay),!0}),c.highlightFrontier=d.line,c.modeFrontier=Math.max(c.modeFrontier,d.line),f.length&&Vn(s,function(){for(var e=0;e<f.length;e++)Zn(s,f[e],"text")})}}var ni=function(e,t,r){var n=e.display;this.viewport=t,this.visible=wn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Sr(e),this.force=r,this.dims=tn(e),this.events=[]};function ii(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==ei(e))return!1;kn(e)&&(Jn(e),t.dims=tn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Le&&(o=qe(e.doc,o),a=Ue(e.doc,a));var l,s,c,u,d=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;s=o,c=a,0==(u=(l=e).display).view.length||s>=u.viewTo||c<=u.viewFrom?(u.view=ir(l,s,c),u.viewFrom=s):(u.viewFrom>s?u.view=ir(l,s,u.viewFrom).concat(u.view):u.viewFrom<s&&(u.view=u.view.slice(ln(l,s))),u.viewFrom=s,u.viewTo<c?u.view=u.view.concat(ir(l,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,ln(l,c)))),u.viewTo=c,r.viewOffset=Ge(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=ei(e);if(!d&&0==f&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=function(e){if(e.hasFocus())return null;var t=E();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<f&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(e){var t=e.nextSibling;return b&&w&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var s=n.view,c=n.viewFrom,u=0;u<s.length;u++){var d=s[u];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var f=i&&null!=e&&e<=c&&d.lineNumber;d.changes&&(-1<R(d.changes,"gutter")&&(f=!1),cr(r,d,c,t)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(me(r.options,c)))),a=d.node.nextSibling}else{var h=(g=c,v=t,void 0,y=dr(p=r,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),hr(p,m),pr(p,m,g,v),gr(p,m,v),m.node);o.insertBefore(h,a)}c+=d.size}var p,m,g,v,y;for(;a;)a=l(a)}(e,r.updateLineNumbers,t.dims),4<f&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=E()&&(e.activeElt.focus(),e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(h),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,d&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ti(e,400)),!(r.updateLineNumbers=null)}function oi(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Sr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Lr(e),r.top)}),t.visible=wn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ii(e,t);n=!1){yn(e);var i=En(e);sn(e),Wn(e,i),si(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ai(e,t){var r=new ni(e,t);if(ii(e,r)){yn(e),oi(e,r);var n=En(e);sn(e),Wn(e,n),si(e,n),r.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function si(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tr(e)+"px"}function ci(e){var t=e.display.gutters,r=e.options.gutters;M(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(N("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",li(e)}function ui(e){var t=R(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ni.prototype.signal=function(e,t){lt(e,t)&&this.events.push(arguments)},ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var di=0,fi=null;function hi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function pi(e){var t=hi(e);return t.x*=fi,t.y*=fi,t}function mi(e,t){var r=hi(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&w&&b)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!m&&!g&&null!=fi)return i&&s&&On(e,Math.max(0,a.scrollTop+i*fi)),_n(e,Math.max(0,a.scrollLeft+n*fi)),(!i||i&&s)&&ct(t),void(o.wheelStartX=null);if(i&&null!=fi){var f=i*fi,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):p=Math.min(e.doc.height,p+f+50),ai(e,{top:h,bottom:p})}di<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(fi=(fi*di+r)/(di+1),++di)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}x?fi=-.53:m?fi=15:a?fi=-.7:s&&(fi=-1/3);var gi=function(e,t){this.ranges=e,this.primIndex=t};gi.prototype.primary=function(){return this.ranges[this.primIndex]},gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ye(r.anchor,n.anchor)||!ye(r.head,n.head))return!1}return!0},gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vi(be(this.ranges[t].anchor),be(this.ranges[t].head));return new gi(e,this.primIndex)},gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},gi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ve(t,n.from())&&ve(e,n.to())<=0)return r}return-1};var vi=function(e,t){this.anchor=e,this.head=t};function yi(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ve(e.from(),t.from())}),r=R(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ve(l.to(),a.from());if(n&&!a.empty()?0<s:0<=s){var c=xe(l.from(),a.from()),u=we(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new vi(d?u:c,d?c:u))}}return new gi(t,r)}function bi(e,t){return new gi([new vi(e,t||e)],0)}function wi(e){return e.text?ge(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function xi(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return wi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=wi(t).ch-t.to.ch),ge(r,n)}function ki(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new vi(xi(i.anchor,t),xi(i.head,t)))}return yi(e.cm,r,e.sel.primIndex)}function Ci(e,t,r){return e.line==t.line?ge(r.line,e.ch-t.ch+r.ch):ge(r.line+(e.line-t.line),e.ch)}function Ti(e){e.doc.mode=At(e.options,e.doc.modeOption),Si(e)}function Si(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Xn(e)}function Li(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ee(e),De(e,r);var i=n?n(e):1;i!=e.height&&de(e,i)}(e,t,r,i),lr(e,"change",e,n)}function a(e,t){for(var r=[],n=e;n<t;++n)r.push(new Gt(c[n],o(n),i));return r}var l=n.from,s=n.to,c=n.text,u=se(e,l.line),d=se(e,s.line),f=Y(c),h=o(c.length-1),p=s.line-l.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Li(e,n)){var m=a(0,c.length-1);r(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)r(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var g=a(1,c.length-1);g.push(new Gt(f+u.text.slice(s.ch),h,i)),r(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,g)}else if(1==c.length)r(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{r(u,u.text.slice(0,l.ch)+c[0],o(0)),r(d,f+d.text.slice(s.ch),h);var v=a(1,c.length-1);1<p&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}lr(e,"change",e,n)}function Ai(e,l,s){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Oi(e,t){if(t.cm)throw new Error("This document is already in use.");on((e.doc=t).cm=e),Ti(e),Ni(e),e.options.lineWrapping||Ye(e),e.options.mode=t.modeOption,Xn(e)}function Ni(e){("rtl"==e.doc.direction?D:L)(e.display.lineDiv,"CodeMirror-rtl")}function _i(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ei(e,t){var r={from:be(t.from),to:wi(t),text:ce(e,t.from,t.to)};return Pi(e,r,t.from.line,t.to.line+1),Ai(e,function(e){return Pi(e,r,t.from.line,t.to.line+1)},!0),r}function Di(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function Fi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(l=i).lastOp==n?(Di(l.done),Y(l.done)):l.done.length&&!Y(l.done).ranges?Y(l.done):1<l.done.length&&!l.done[l.done.length-2].ranges?(l.done.pop(),Y(l.done)):void 0))a=Y(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,a.to)?a.to=wi(t):o.changes.push(Ei(e,t));else{var c=Y(i.done);for(c&&c.ranges||zi(e.sel,i.done),o={changes:[Ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||it(e,"historyAdded")}function Wi(e,t,r,n){var i,o,a,l,s,c=e.history,u=n&&n.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(i=e,o=u,a=Y(c.done),l=t,"*"==(s=o.charAt(0))||"+"==s&&a.ranges.length==l.ranges.length&&a.somethingSelected()==l.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:zi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,n&&!1!==n.clearRedo&&Di(c.undone)}function zi(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Pi(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Hi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Ii(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Hi(r[i]));return n}(e,t),n=Ne(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Ri(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?gi.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<R(t,Number(u[1]))&&(Y(l)[d]=c[d],delete c[d])}}}return n}function ji(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new vi(i,t)}return new vi(r||t,t)}function Bi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Gi(e,new gi([ji(e.sel.primary(),t,r,i)],0),n)}function qi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=ji(e.sel.ranges[o],t[o],null,i);Gi(e,yi(e.cm,n,e.sel.primIndex),r)}function Ui(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Gi(e,yi(e.cm,i,e.sel.primIndex),n)}function Ki(e,t,r,n){Gi(e,bi(t,r),n)}function Vi(e,t,r){var n=e.history.done,i=Y(n);i&&i.ranges?$i(e,n[n.length-1]=t,r):Gi(e,t,r)}function Gi(e,t,r){$i(e,t,r),Wi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $i(e,t,r){var n,i,o,a;(lt(e,"beforeSelectionChange")||e.cm&<(e.cm,"beforeSelectionChange"))&&(n=e,o=r,a={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new vi(Ce(n,e[t].anchor),Ce(n,e[t].head))},origin:o&&o.origin},it(n,"beforeSelectionChange",n,a),n.cm&&it(n.cm,"beforeSelectionChange",n.cm,a),t=a.ranges!=i.ranges?yi(n.cm,a.ranges,a.ranges.length-1):i),Yi(e,Zi(e,t,r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||Sn(e.cm)}function Yi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,at(e.cm)),lr(e,"cursorActivity",e))}function Xi(e){Yi(e,Zi(e,e.sel,null,!1))}function Zi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Qi(e,a.anchor,l&&l.anchor,r,n),c=Qi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new vi(s,c))}return i?yi(e.cm,i,t.primIndex):t}function Ji(e,t,r,n,i){var o=se(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(it(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=eo(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ve(c,r))&&(n<0?u<0:0<u))return Ji(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=eo(e,d,n,d.line==t.line?o:null)),d?Ji(e,d,t,n,i):null}}return t}function Qi(e,t,r,n,i){var o=n||1,a=Ji(e,t,r,o,i)||!i&&Ji(e,t,r,o,!0)||Ji(e,t,r,-o,i)||!i&&Ji(e,t,r,-o,!0);return a||(e.cantEdit=!0,ge(e.first,0))}function eo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Ce(e,ge(t.line-1)):null:0<r&&t.ch==(n||se(e,t.line)).text.length?t.line<e.first+e.size-1?ge(t.line+1,0):null:new ge(t.line,t.ch+r)}function to(e){e.setSelection(ge(e.firstLine(),0),ge(e.lastLine()),q)}function ro(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=Ce(i,e)),t&&(o.to=Ce(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),it(i,"beforeChange",i,o),i.cm&&it(i.cm,"beforeChange",i.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function no(e,t,r){if(e.cm){if(!e.cm.curOp)return Gn(e.cm,no)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(lt(e,"beforeChange")||e.cm&<(e.cm,"beforeChange"))||(t=ro(e,t,!0))){var n=Se&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=R(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ve(c.to,l.from)<0||0<ve(c.from,l.to))){var u=[s,1],d=ve(c.from,l.from),f=ve(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(0<f||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)io(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else io(e,t)}}function io(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ve(r.from,r.to)){var t=ki(e,r);Fi(e,r,t,e.cm?e.cm.curOp.id:NaN),lo(e,r,t,Ne(e,r));var n=[];Ai(e,function(e,t){t||-1!=R(n,e.history)||(fo(e.history,r),n.push(e.history)),lo(e,r,null,Ne(e,r))})}}function oo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,r=i.history,n=i.sel,l="undo"==o?r.done:r.undone,s="undo"==o?r.undone:r.done,c=0;c<l.length&&(a=l[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=l.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(a=l.pop()).ranges){if(t)return void l.push(a);break}if(zi(a,s),e&&!a.equals(i.sel))return void Gi(i,a,{clearRedo:!1});n=a}var u=[];zi(n,s),s.push({changes:u,generation:r.generation}),r.generation=a.generation||++r.maxGeneration;for(var d=lt(i,"beforeChange")||i.cm&<(i.cm,"beforeChange"),f=function(e){var r=a.changes[e];if(r.origin=o,d&&!ro(i,r,!1))return l.length=0,{};u.push(Ei(i,r));var t=e?ki(i,r):Y(l);lo(i,r,t,Ii(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:wi(r)});var n=[];Ai(i,function(e,t){t||-1!=R(n,e.history)||(fo(e.history,r),n.push(e.history)),lo(e,r,null,Ii(e,r))})},h=a.changes.length-1;0<=h;--h){var p=f(h);if(p)return p.v}}}}function ao(e,t){if(0!=t&&(e.first+=t,e.sel=new gi(X(e.sel.ranges,function(e){return new vi(ge(e.anchor.line+t,e.anchor.ch),ge(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Xn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Zn(e.cm,n,"gutter")}}function lo(e,t,r,n){if(e.cm&&!e.cm.curOp)return Gn(e.cm,lo)(e,t,r,n);if(t.to.line<e.first)ao(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ao(e,i),t={from:ge(e.first,0),to:ge(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ge(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),r||(r=ki(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=fe(Be(se(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0}));-1<n.sel.contains(t.from,t.to)&&at(e);Mi(n,t,r,nn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=$e(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;r<n;n--){var i=se(e,n).stateAfter;if(i&&(!(i instanceof Wt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ti(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Xn(e):o.line!=a.line||1!=t.text.length||Li(e.doc,t)?Xn(e,o.line,a.line+1,c):Zn(e,o.line,"text");var u=lt(e,"changes"),d=lt(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&lr(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Mi(e,t,n),$i(e,r,q)}}function so(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),no(e,{from:r,to:n,text:t,origin:i})}function co(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function uo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)co(o.ranges[l].anchor,t,r,n),co(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=ge(c.from.line+n,c.from.ch),c.to=ge(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function fo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;uo(e.done,r,n,i),uo(e.undone,r,n,i)}function ho(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=se(e,ke(e,t)):i=fe(t),null==i?null:(n(o,i)&&e.cm&&Zn(e.cm,i,r),o)}function po(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function mo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}vi.prototype.from=function(){return xe(this.anchor,this.head)},vi.prototype.to=function(){return we(this.anchor,this.head)},vi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,n=e,i=e+t;n<i;++n){var o=this.lines[n];this.height-=o.height,(r=o).parent=null,Ee(r),lr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof po))){var l=[];this.collapse(l),this.children=[new po(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new po(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++n,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=R(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new mo(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var go=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function vo(e,t,r){Ge(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Tn(e,r)}go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=fe(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=br(this);de(r,Math.max(0,r.height-o)),e&&(Vn(e,function(){vo(e,r,-o),Zn(e,n,"widget")}),lr(e,"lineWidgetCleared",e,this,n))}},go.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=br(this)-t;i&&(Ke(this.doc,n)||de(n,n.height+i),r&&Vn(r,function(){r.curOp.forceUpdate=!0,vo(r,n,i),lr(r,"lineWidgetChanged",r,e,fe(n))}))},st(go);var yo=0,bo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yo};function wo(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=P(i)).shared=!1;var a=[wo(e,r,n,i,o)],l=a[0],s=i.widgetNode;return Ai(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(wo(e,Ce(e,r),Ce(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=Y(a)}),new xo(a,l)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return Gn(t.cm,wo)(t,n,i,e,r);var o=new bo(t,r),a=ve(n,i);if(e&&P(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(je(t,n.line,n,i,o)||n.line!=i.line&&je(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Fi(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var l,s=n.line,c=t.cm;if(t.iter(s,i.line+1,function(e){var t,r;c&&o.collapsed&&!c.options.lineWrapping&&Be(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&de(e,0),t=e,r=new Me(o,s==n.line?n.ch:null,s==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++s}),o.collapsed&&t.iter(n.line,i.line+1,function(e){Ke(t,e)&&de(e,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Se=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++yo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Xn(c,n.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=n.line;u<=i.line;u++)Zn(c,u,"text");o.atomic&&Xi(c.doc),lr(c,"markerAdded",c,o)}return o}bo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Rn(t),lt(this,"clear")){var n=this.find();n&&lr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Ae(l.markedSpans,e);t&&!e.collapsed?Zn(t,fe(l),"text"):t&&(null!=s.to&&(o=fe(l)),null!=s.from&&(i=fe(l))),l.markedSpans=Oe(l.markedSpans,s),null==s.from&&e.collapsed&&!Ke(e.doc,l)&&t&&de(l,Qr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=Be(e.lines[c]),d=$e(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Xn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Xi(t.doc)),t&&lr(t,"markerCleared",t,this,i,o),r&&jn(t),this.parent&&this.parent.clear()}},bo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ae(o.markedSpans,this);if(null!=a.from&&(r=ge(t?o:fe(o),a.from),-1==e))return r;if(null!=a.to&&(n=ge(t?o:fe(o),a.to),1==e))return n}return r&&{from:r,to:n}},bo.prototype.changed=function(){var o=this,a=this.find(-1,!0),l=this,s=this.doc.cm;a&&s&&Vn(s,function(){var e=a.line,t=fe(a.line),r=Or(s,t);if(r&&(zr(r),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Ke(l.doc,e)&&null!=l.height){var n=l.height;l.height=null;var i=br(l)-n;i&&de(e,e.height+i)}lr(s,"markerChanged",s,o)})},bo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=R(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bo.prototype.detachLine=function(e){if(this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},st(bo);var xo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ko(e){return e.findMarks(ge(e.first,0),e.clipPos(ge(e.lastLine())),function(e){return e.parent})}function Co(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];Ai(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==R(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();lr(this,"clear")}},xo.prototype.find=function(e,t){return this.primary.find(e,t)},st(xo);var To=0,So=function(e,t,r,n,i){if(!(this instanceof So))return new So(e,t,r,n,i);null==r&&(r=0),mo.call(this,[new po([new Gt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ge(r,0);this.sel=bi(o),this.history=new _i(null),this.id=++To,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:o,to:o,text:e}),Gi(this,bi(o),q)};So.prototype=J(mo.prototype,{constructor:So,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ue(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Yn(function(e){var t=ge(this.first,0),r=this.first+this.size-1;no(this,{from:t,to:ge(r,se(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),Gi(this,bi(t),q)}),replaceRange:function(e,t,r,n){so(this,e,t=Ce(this,t),r=r?Ce(this,r):t,n)},getRange:function(e,t,r){var n=ce(this,Ce(this,e),Ce(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return se(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=se(this,e)),Be(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yn(function(e,t,r){Ki(this,Ce(this,"number"==typeof e?ge(e,t||0):e),null,r)}),setSelection:Yn(function(e,t,r){Ki(this,Ce(this,e),Ce(this,t||e),r)}),extendSelection:Yn(function(e,t,r){Bi(this,Ce(this,e),t&&Ce(this,t),r)}),extendSelections:Yn(function(e,t){qi(this,Te(this,e),t)}),extendSelectionsBy:Yn(function(e,t){qi(this,Te(this,X(this.sel.ranges,e)),t)}),setSelections:Yn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new vi(Ce(this,e[i].anchor),Ce(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Gi(this,yi(this.cm,n,t),r)}}),addSelection:Yn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new vi(Ce(this,e),Ce(this,t||e))),Gi(this,yi(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ce(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Yn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=ge(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ci(l.from,i,o),c=Ci(wi(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=ve(u.head,u.anchor)<0;n[a]=new vi(d?c:s,d?s:c)}else n[a]=new vi(s,s)}return new gi(n,e.sel.primIndex)}(this,n,t),s=n.length-1;0<=s;s--)no(this,n[s]);l?Vi(this,l):this.cm&&Sn(this.cm)}),undo:Yn(function(){oo(this,"undo")}),redo:Yn(function(){oo(this,"redo")}),undoSelection:Yn(function(){oo(this,"undo",!0)}),redoSelection:Yn(function(){oo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new _i(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ri(this.history.done),undone:Ri(this.history.undone)}},setHistory:function(e){var t=this.history=new _i(this.history.maxGeneration);t.done=Ri(e.done.slice(0),null,!0),t.undone=Ri(e.undone.slice(0),null,!0)},setGutterMarker:Yn(function(e,r,n){return ho(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),!0})}),clearGutter:Yn(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ho(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(!(e=se(this,t=e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Yn(function(e,r,n){return ho(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(T(n).test(e[t]))return!1;e[t]+=" "+n}else e[t]=n;return!0})}),removeLineClass:Yn(function(e,o,a){return ho(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(!r)return!1;if(null==a)e[t]=null;else{var n=r.match(T(a));if(!n)return!1;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return!0})}),addLineWidget:Yn(function(e,t,r){return i=e,o=new go(n=this,t,r),(a=n.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),ho(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ke(n,e)){var r=Ge(e)<n.scrollTop;de(e,e.height+br(o)),r&&Tn(a,o.height),a.curOp.forceUpdate=!0}return!0}),a&&lr(a,"lineWidgetAdded",a,o,"number"==typeof i?i:fe(i)),o;var n,i,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return wo(this,Ce(this,e),Ce(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return wo(this,e=Ce(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=se(this,(e=Ce(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,a){i=Ce(this,i),o=Ce(this,o);var l=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&s==i.line&&i.ch>=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||a&&!a(n.marker)||l.push(n.marker.parent||n.marker)}++s}),l},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),Ce(this,ge(i,n))},indexFromPos:function(e){var t=(e=Ce(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new So(ue(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new So(ue(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ve(o,a)){var l=wo(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,ko(this)),n},unlinkDoc:function(e){if(e instanceof ka&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Co(ko(this));break}}if(e.history==this.history){var r=[e.id];Ai(e,function(e){return r.push(e.id)},!0),e.history=new _i(null),e.history.done=Ri(this.history.done,r),e.history.undone=Ri(this.history.undone,r)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Yn(function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Vn(t=this.cm,function(){Ni(t),Xn(t)}))})}),So.prototype.eachLine=So.prototype.iter;var Lo=0;function Mo(e){var i=this;if(Ao(i),!ot(i,e)&&!wr(i.display,e)){ct(e),x&&(Lo=+new Date);var o=an(i,e,!0),t=e.dataTransfer.files;if(o&&!i.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var a=t.length,l=Array(a),s=0,r=function(e,r){if(!i.options.allowDropFileTypes||-1!=R(i.options.allowDropFileTypes,e.type)){var n=new FileReader;n.onload=Gn(i,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),l[r]=e,++s==a){var t={from:o=Ce(i.doc,o),to:o,text:i.doc.splitLines(l.join(i.doc.lineSeparator())),origin:"paste"};no(i.doc,t),Vi(i.doc,bi(o,wi(t)))}}),n.readAsText(e)}},n=0;n<a;++n)r(t[n],n);else{if(i.state.draggingText&&-1<i.doc.sel.contains(o))return i.state.draggingText(e),void setTimeout(function(){return i.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(i.state.draggingText&&!i.state.draggingText.copy&&(u=i.listSelections()),$i(i.doc,bi(o,o)),u)for(var d=0;d<u.length;++d)so(i.doc,"",u[d].anchor,u[d].head,"drag");i.replaceSelection(c,"around","paste"),i.display.input.focus()}}catch(e){}}}}function Ao(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oo(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var e=0;e<r.length;e++)t(r[e])})}}var No=!1;function _o(){var e;No||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Oo(Eo)},100))}),tt(window,"blur",function(){return Oo(vn)}),No=!0)}function Eo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Do={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fo=0;Fo<10;Fo++)Do[Fo+48]=Do[Fo+96]=String(Fo);for(var Wo=65;Wo<=90;Wo++)Do[Wo]=String.fromCharCode(Wo);for(var zo=1;zo<=12;zo++)Do[zo+111]=Do[zo+63235]="F"+zo;var Po={};function Ho(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Io(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=X(r.split(" "),Ho),o=0;o<i.length;o++){var a=void 0,l=void 0;a=o==i.length-1?(l=i.join(" "),n):(l=i.slice(0,o+1).join(" "),"...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Ro(e,t,r,n){var i=(t=Uo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ro(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Ro(e,t.fallthrough[o],r,n);if(a)return a}}}function jo(e){var t="string"==typeof e?e:Do[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Bo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function qo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var r=Do[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Bo(r,e,t))}function Uo(e){return"string"==typeof e?Po[e]:e}function Ko(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ve(o.from,Y(n).to)<=0;){var a=n.pop();if(ve(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Vn(t,function(){for(var e=n.length-1;0<=e;e--)so(t.doc,"",n[e].from,n[e].to,"+delete");Sn(t)})}function Vo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Go(e,t,r){var n=Vo(e,t.ch,r);return null==n?null:new ge(t.line,n,r<0?"after":"before")}function $o(e,t,r,n,i){if(e){var o=Qe(r,t.doc.direction);if(o){var a,l=i<0?Y(o):o[0],s=i<0==(1==l.level)?"after":"before";if(0<l.level||"rtl"==t.doc.direction){var c=Nr(t,r);a=i<0?r.text.length-1:0;var u=_r(t,c,a).top;a=ae(function(e){return _r(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Vo(r,a,1))}else a=i<0?l.to:l.from;return new ge(n,a,s)}}return new ge(n,i<0?r.text.length:0,i<0?"before":"after")}Po.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Po.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Po.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Po.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Po.default=w?Po.macDefault:Po.pcDefault;var Yo={selectAll:to,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(r){return Ko(r,function(e){if(e.empty()){var t=se(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:ge(e.head.line+1,0)}:{from:e.head,to:ge(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Ko(t,function(e){return{from:ge(e.from().line,0),to:Ce(t.doc,ge(e.to().line+1,0))}})},delLineLeft:function(e){return Ko(e,function(e){return{from:ge(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return Ko(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return Ko(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ge(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Xo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Zo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=se(e.doc,t),n=function(e){for(var t;t=Ie(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=fe(n));return $o(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},K)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},K)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?Zo(n,e.head):r},K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=H(e.getLine(o.line),o.ch,n);t.push($(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return Vn(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=se(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new ge(n.line,n.ch-1)),0<n.ch)n=new ge(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),ge(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=se(a.doc,n.line-1).text;o&&(n=new ge(n.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),ge(n.line-1,o.length-1),n,"+transpose"))}t.push(new vi(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){return Vn(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);Sn(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xo(e,t){var r=se(e.doc,t),n=Be(r);return n!=r&&(t=fe(n)),$o(!0,e,n,t,1)}function Zo(e,t){var r=Xo(e,t.line),n=se(e.doc,r.line),i=Qe(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ge(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Yo[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var Qo=new I;function ea(e,t,r,n){var i=e.state.keySeq;if(i){if(jo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Qo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ta(e,i+" "+t,r,n))return!0}return ta(e,t,r,n)}function ta(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Ro(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Ro(t,e.options.extraKeys,r,e)||Ro(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&lr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(ct(r),hn(e)),!!i}function ra(t,e){var r=qo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?ea(t,"Shift-"+r,e,function(e){return Jo(t,e,!0)})||ea(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Jo(t,e)}):ea(t,r,e,function(e){return Jo(t,e)}))}var na=null;function ia(e){if(this.curOp.focus=E(),!ot(this,e)){x&&k<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var r=ra(this,e);g&&(na=r?t:null,!r&&88==t&&!Ct&&(w?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}D(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r)}(this)}}function oa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function aa(e){if(!(wr(this.display,e)||ot(this,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var t=e.keyCode,r=e.charCode;if(g&&t==na)return na=null,void ct(e);if(!g||e.which&&!(e.which<10)||!ra(this,e)){var n,i=String.fromCharCode(null==r?t:r);if("\b"!=i)if(!ea(n=this,"'"+i+"'",e,function(e){return Jo(n,e,!0)}))this.display.input.onKeyPress(e)}}}var la,sa,ca=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ua(e){var t=this,r=t.display;if(!(ot(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,wr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ha(t,e)){var n,i,o,a=an(t,e),l=pt(e),s=a?(n=a,i=l,o=+new Date,sa&&sa.compare(o,n,i)?(la=sa=null,"triple"):la&&la.compare(o,n,i)?(sa=new ca(o,n,i),la=null,"double"):(la=new ca(o,n,i),sa=null,"single")):"single";window.focus(),1==l&&t.state.selectingText&&t.state.selectingText(e),a&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ea(r,Bo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=Yo[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=B}finally{r.state.suppressEdits=!1}return t})}(t,l,a,s,e)||(1==l?a?function(e,t,r,n){x?setTimeout(z(pn,e),0):e.curOp.focus=E();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=w?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&-1<(i=a.contains(t))&&(ve((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ve(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,a=!1,l=Gn(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,nt(o.wrapper.ownerDocument,"mouseup",l),nt(o.wrapper.ownerDocument,"mousemove",s),nt(o.scroller,"dragstart",c),nt(o.scroller,"drop",l),a||(ct(e),i.addNew||Bi(t.doc,n,null,null,i.extend),b||x&&9==k?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),s=function(e){a=a||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},c=function(){return a=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=l).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();tt(o.wrapper.ownerDocument,"mouseup",l),tt(o.wrapper.ownerDocument,"mousemove",s),tt(o.scroller,"dragstart",c),tt(o.scroller,"drop",l),mn(t),setTimeout(function(){return o.input.focus()},20)}(e,n,t,o):function(g,e,v,y){var a=g.display,b=g.doc;ct(e);var w,x,k=b.sel,t=k.ranges;y.addNew&&!y.extend?(x=b.sel.contains(v),w=-1<x?t[x]:new vi(v,v)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new vi(v,v)),v=an(g,e,!0,!0),x=-1;else{var r=da(g,v,y.unit);w=y.extend?ji(w,r.anchor,r.head,y.extend):r}y.addNew?-1==x?(x=t.length,Gi(b,yi(g,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(Gi(b,yi(g,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Ui(b,x,w,U):(Gi(b,new gi([w],x=0),U),k=b.sel);var C=v;function l(e){if(0!=ve(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],r=g.options.tabSize,n=H(se(b,v.line).text,v.ch,r),i=H(se(b,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),l=Math.min(v.line,e.line),s=Math.min(g.lastLine(),Math.max(v.line,e.line));l<=s;l++){var c=se(b,l).text,u=V(c,o,r);o==a?t.push(new vi(ge(l,u),ge(l,u))):c.length>u&&t.push(new vi(ge(l,u),ge(l,V(c,a,r))))}t.length||t.push(new vi(v,v)),Gi(b,yi(g,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var d,f=w,h=da(g,e,y.unit),p=f.anchor;p=0<ve(h.anchor,p)?(d=h.head,xe(f.from(),h.anchor)):(d=h.anchor,we(f.to(),h.head));var m=k.ranges.slice(0);m[x]=function(e,t){var r=t.anchor,n=t.head,i=se(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Qe(i);if(!o)return t;var a=Ze(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,c=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)s=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var u=Ze(o,n.ch,n.sticky),d=u-a||(n.ch-r.ch)*(1==l.level?-1:1);s=u==c-1||u==c?d<0:0<d}var f=o[c+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new vi(new ge(r.line,p,m),n)}(g,new vi(Ce(b,p),d)),Gi(b,yi(g,m,x),U)}}var s=a.wrapper.getBoundingClientRect(),c=0;function n(e){g.state.selectingText=!1,c=1/0,ct(e),a.input.focus(),nt(a.wrapper.ownerDocument,"mousemove",i),nt(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=Gn(g,function(e){0!==e.buttons&&pt(e)?function e(t){var r=++c;var n=an(g,t,!0,"rectangle"==y.unit);if(!n)return;if(0!=ve(n,C)){g.curOp.focus=E(),l(n);var i=wn(a,b);(n.line>=i.to||n.line<i.from)&&setTimeout(Gn(g,function(){c==r&&e(t)}),150)}else{var o=t.clientY<s.top?-20:t.clientY>s.bottom?20:0;o&&setTimeout(Gn(g,function(){c==r&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):n(e)}),o=Gn(g,n);g.state.selectingText=o,tt(a.wrapper.ownerDocument,"mousemove",i),tt(a.wrapper.ownerDocument,"mouseup",o)}(e,n,t,o)}(t,a,s,e):ht(e)==r.scroller&&ct(e):2==l?(a&&Bi(t.doc,a),setTimeout(function(){return r.input.focus()},20)):3==l&&(C?t.display.input.onContextMenu(e):mn(t)))}}function da(e,t,r){if("char"==r)return new vi(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new vi(ge(t.line,0),Ce(e.doc,ge(t.line+1,0)));var n=r(e,t);return new vi(n.from,n.to)}function fa(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ct(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!lt(e,r))return dt(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return it(e,r,e,he(e.doc,o),e.options.gutters[s],t),dt(t)}}function ha(e,t){return fa(e,t,"gutterClick",!0)}function pa(e,t){var r,n;wr(e.display,t)||(n=t,lt(r=e,"gutterContextMenu")&&fa(r,n,"gutterContextMenu",!1))||(ot(e,t,"contextmenu")||C||e.display.input.onContextMenu(t))}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hr(e)}ca.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var ga={toString:function(){return"CodeMirror.Init"}},va={},ya={};function ba(e){ci(e),Xn(e),xn(e)}function wa(e,t,r){if(!t!=!(r&&r!=ga)){var n=e.display.dragFunctions,i=t?tt:nt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function xa(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Ye(e)),on(e),Xn(e),Hr(e),setTimeout(function(){return Wn(e)},100)}function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?P(t):{},P(va,t,!1),ui(t);var n=t.value;"string"==typeof n?n=new So(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new ka.inputStyles[t.inputStyle](this),o=this.display=new le(e,n,i);for(var a in ci(o.wrapper.CodeMirror=this),ma(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&k<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;tt(o.scroller,"mousedown",Gn(i,ua)),tt(o.scroller,"dblclick",x&&k<11?Gn(i,function(e){if(!ot(i,e)){var t=an(i,e);if(t&&!ha(i,e)&&!wr(i.display,e)){ct(e);var r=i.findWordAt(t);Bi(i.doc,r.anchor,r.head)}}}):function(e){return ot(i,e)||ct(e)});tt(o.scroller,"contextmenu",function(e){return pa(i,e)});var r,n={end:0};function a(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function l(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}tt(o.scroller,"touchstart",function(e){if(!ot(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ha(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),tt(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),tt(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!wr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||l(t,t.prev)?new vi(n,n):!t.prev.prev||l(t,t.prev.prev)?i.findWordAt(n):new vi(ge(n.line,0),Ce(i.doc,ge(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),ct(e)}a()}),tt(o.scroller,"touchcancel",a),tt(o.scroller,"scroll",function(){o.scroller.clientHeight&&(On(i,o.scroller.scrollTop),_n(i,o.scroller.scrollLeft,!0),it(i,"scroll",i))}),tt(o.scroller,"mousewheel",function(e){return mi(i,e)}),tt(o.scroller,"DOMMouseScroll",function(e){return mi(i,e)}),tt(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){ot(i,e)||ft(e)},over:function(e){ot(i,e)||(!function(e,t){var r=an(e,t);if(r){var n=document.createDocumentFragment();un(e,r,n),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,n)}}(i,e),ft(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||+new Date-Lo<100))ft(t);else if(!ot(e,t)&&!wr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s)){var r=N("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}(i,e)},drop:Gn(i,Mo),leave:function(e){ot(i,e)||Ao(i)}};var e=o.input.getField();tt(e,"keyup",function(e){return oa.call(i,e)}),tt(e,"keydown",Gn(i,ia)),tt(e,"keypress",Gn(i,aa)),tt(e,"focus",function(e){return gn(i,e)}),tt(e,"blur",function(e){return vn(i,e)})}(this),_o(),Rn(this),this.curOp.forceUpdate=!0,Oi(this,n),t.autofocus&&!f||this.hasFocus()?setTimeout(z(gn,this),20):vn(this),ya)ya.hasOwnProperty(a)&&ya[a](r,t[a],ga);kn(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Ca.length;++l)Ca[l](r);jn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}ka.defaults=va,ka.optionHandlers=ya;var Ca=[];function Ta(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=It(e,t).state:r="prev");var a=e.options.tabSize,l=se(o,t),s=H(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==B||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?H(se(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=$(c-f)),d!=u)return so(o,d,ge(t,0),ge(t,u.length),"+input"),!(l.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=ge(t,u.length);Ui(o,p,new vi(g,g));break}}}ka.defineInitHook=function(e){return Ca.push(e)};var Sa=null;function La(e){Sa=e}function Ma(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a,l=e.state.pasteIncoming||"paste"==i,s=xt(t),c=null;if(l&&1<n.ranges.length)if(Sa&&Sa.text.join("\n")==t){if(n.ranges.length%Sa.text.length==0){c=[];for(var u=0;u<Sa.text.length;u++)c.push(o.splitLines(Sa.text[u]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,function(e){return[e]}));for(var d=n.ranges.length-1;0<=d;d--){var f=n.ranges[d],h=f.from(),p=f.to();f.empty()&&(r&&0<r?h=ge(h.line,h.ch-r):e.state.overwrite&&!l?p=ge(p.line,Math.min(se(o,p.line).text.length,p.ch+Y(s).length)):l&&Sa&&Sa.lineWise&&Sa.text.join("\n")==t&&(h=p=ge(h.line,0))),a=e.curOp.updateInput;var m={from:h,to:p,text:c?c[d%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};no(e.doc,m),lr(e,"inputRead",e,m)}t&&!l&&Oa(e,t),Sn(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Aa(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vn(t,function(){return Ma(t,r,0,null,"paste")}),!0}function Oa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(-1<t.indexOf(o.electricChars.charAt(l))){a=Ta(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ta(e,i.head.line,"smart"));a&&lr(e,"electricInput",e,i.head.line)}}}function Na(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:ge(i,0),head:ge(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function _a(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ea(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),u&&(e.style.border="1px solid black"),_a(e),t}function Da(n,i,o,e,a){var t=i,r=o,l=se(n,i.line);function s(e){var t,r;if(null==(t=a?function(t,r,l,e){var s=Qe(r,t.doc.direction);if(!s)return Go(r,l,e);l.ch>=r.text.length?(l.ch=r.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var n=Ze(s,l.ch,l.sticky),i=s[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>l.ch:i.from<l.ch))return Go(r,l,e);var o,c=function(e,t){return Vo(r,e instanceof ge?e.ch:e,t)},a=function(e){return t.options.lineWrapping?(o=o||Nr(t,r),Xr(t,r,o,e)):{begin:0,end:r.text.length}},u=a("before"==l.sticky?c(l,-1):l.ch);if("rtl"==t.doc.direction||1==i.level){var d=1==i.level==e<0,f=c(l,d?1:-1);if(null!=f&&(d?f<=i.to&&f<=u.end:f>=i.from&&f>=u.begin)){var h=d?"before":"after";return new ge(l.line,f,h)}}var p=function(e,t,r){for(var n=function(e,t){return t?new ge(l.line,c(e,1),"before"):new ge(l.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),a=o?r.begin:c(r.end,-1);if(i.from<=a&&a<i.to)return n(a,o);if(a=o?i.from:c(i.to,-1),r.begin<=a&&a<r.end)return n(a,o)}},m=p(n+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==r.text.length||!(m=p(0<e?0:s.length-1,e,a(g)))?null:m}(n.cm,l,i,o):Go(l,i,o))){if(e||(r=i.line+o)<n.first||r>=n.first+n.size||(i=new ge(r,i.ch,i.sticky),!(l=se(n,r))))return!1;i=$o(a,n.cm,l,i.line,o)}else i=t;return!0}if("char"==e)s();else if("column"==e)s(!0);else if("word"==e||"group"==e)for(var c=null,u="group"==e,d=n.cm&&n.cm.getHelper(i,"wordChars"),f=!0;!(o<0)||s(!f);f=!1){var h=l.text.charAt(i.ch)||"\n",p=te(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){o<0&&(o=1,s(),i.sticky="after");break}if(p&&(c=p),0<o&&!s(!f))break}var m=Qi(n,i,t,r,!0);return ye(t,m)&&(m.hitSide=!0),m}function Fa(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*Qr(e.display),3);i=(0<r?t.bottom:t.top)+r*c}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=$r(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Wa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function za(e,t){var r=Or(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Mr(r,n,t.line),o=Qe(n,e.doc.direction),a="left";o&&(a=Ze(o,t.ch)%2?"right":"left");var l=Fr(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Pa(e,t){return t&&(e.bad=!0),e}function Ha(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Pa(e.clipPos(ge(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Ia(o,t,r)}}function Ia(c,e,t){var r=c.text.firstChild,n=!1;if(!e||!_(r,e))return Pa(ge(fe(c.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=c.rest?Y(c.rest):c.line;return Pa(ge(fe(i),i.text.length),n)}var o=3==e.nodeType?e:null,a=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t&&(t=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=c.measure,d=u.maps;function l(e,t,r){for(var n=-1;n<(d?d.length:0);n++)for(var i=n<0?u.map:d[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=fe(n<0?c.line:c.rest[n]),s=i[o]+r;return(r<0||a!=e)&&(s=i[o+(r?1:0)]),ge(l,s)}}}var s=l(o,a,t);if(s)return Pa(s,n);for(var f=a.nextSibling,h=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(s=l(f,f.firstChild,0))return Pa(ge(s.line,s.ch-h),n);h+=f.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(s=l(p,p.firstChild,-1))return Pa(ge(s.line,s.ch+m),n);m+=p.textContent.length}}Wa.prototype.init=function(e){var t=this,a=this,l=a.cm,s=a.div=e.lineDiv;function r(e){if(!ot(l,e)){if(l.somethingSelected())La({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=Na(l);La({lineWise:!0,text:t.text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,q),l.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Sa.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Ea(),i=n.firstChild;l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),i.value=Sa.text.join("\n");var o=document.activeElement;W(i),setTimeout(function(){l.display.lineSpace.removeChild(n),o.focus(),o==s&&a.showPrimarySelection()},50)}}_a(s,l.options.spellcheck),tt(s,"paste",function(e){ot(l,e)||Aa(e,l)||k<=11&&setTimeout(Gn(l,function(){return t.updateFromDOM()}),20)}),tt(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(s,"touchstart",function(){return a.forceCompositionEnd()}),tt(s,"input",function(){t.composing||t.readFromDOMSoon()}),tt(s,"copy",r),tt(s,"cut",r)},Wa.prototype.prepareSelection=function(){var e=cn(this.cm,!1);return e.focus=this.cm.state.focused,e},Wa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Wa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Ha(t,e.anchorNode,e.anchorOffset),a=Ha(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ve(xe(o,a),n)||0!=ve(we(o,a),i)){var l=t.display.view,s=n.line>=t.display.viewFrom&&za(t,n)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&za(t,i);if(!c){var u=l[l.length-1].measure,d=u.maps?u.maps[u.maps.length-1]:u.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(s&&c){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=S(s.node,s.offset,c.offset,c.node)}catch(e){}f&&(!m&&t.state.focused?(e.collapse(s.node,s.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):m&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Wa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Wa.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Wa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Wa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},Wa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Wa.prototype.blur=function(){this.div.blur()},Wa.prototype.getField=function(){return this.div},Wa.prototype.supportsTouch=function(){return!0},Wa.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Vn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},Wa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Wa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(d&&a&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Ha(t,e.anchorNode,e.anchorOffset),n=Ha(t,e.focusNode,e.focusOffset);r&&n&&Vn(t,function(){Gi(t.doc,bi(r,n),q),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Wa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ge(a.line-1,se(n.doc,a.line-1).length)),l.ch==se(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=ge(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;r=a.line==i.viewFrom||0==(e=ln(n,a.line))?(t=fe(i.view[0].line),i.view[0].node):(t=fe(i.view[e].line),i.view[e-1].node.nextSibling);var s,c,u=ln(n,l.line);if(c=u==i.view.length-1?(s=i.viewTo-1,i.lineDiv.lastChild):(s=fe(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(function(s,e,t,c,u){var r="",d=!1,f=s.doc.lineSeparator(),h=!1;function p(){d&&(r+=f,h&&(r+=f),d=h=!1)}function m(e){e&&(p(),r+=e)}function g(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void m(t);var r,n=e.getAttribute("cm-marker");if(n){var i=s.findMarks(ge(c,0),ge(u+1,0),(l=+n,function(e){return e.id==l}));return void(i.length&&(r=i[0].find(0))&&m(ce(s.doc,r.from,r.to).join(f)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&p();for(var a=0;a<e.childNodes.length;a++)g(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(h=!0),o&&(d=!0)}else 3==e.nodeType&&m(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var l}for(;g(e),e!=t;)e=e.nextSibling,h=!1;return r}(n,r,c,t,s)),f=ce(n.doc,ge(t,0),ge(s,se(n.doc,s).text.length));1<d.length&&1<f.length;)if(Y(d)==Y(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=Y(d),b=Y(f),w=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var x=ge(t,h),k=ge(s,f.length?Y(f).length-p:0);return 1<d.length||d[0]||ve(x,k)?(so(n.doc,d,x,k,"+input"),!0):void 0},Wa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wa.prototype.reset=function(){this.forceCompositionEnd()},Wa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Wa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vn(this.cm,function(){return Xn(e.cm)})},Wa.prototype.setUneditable=function(e){e.contentEditable="false"},Wa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wa.prototype.onContextMenu=function(){},Wa.prototype.resetPosition=function(){},Wa.prototype.needsContentAttribute=!0;var Ra,ja,Ba,qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(t){var e=this,r=this,n=this.cm;this.createField(t);var i=this.textarea;function o(e){if(!ot(n,e)){if(n.somethingSelected())La({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Na(n);La({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,q):(r.prevInput="",i.value=t.text.join("\n"),W(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),u&&(i.style.width="0px"),tt(i,"input",function(){x&&9<=k&&e.hasSelection&&(e.hasSelection=null),r.poll()}),tt(i,"paste",function(e){ot(n,e)||Aa(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),tt(i,"cut",o),tt(i,"copy",o),tt(t.scroller,"paste",function(e){wr(t,e)||ot(n,e)||(n.state.pasteIncoming=!0,r.focus())}),tt(t.lineSpace,"selectstart",function(e){wr(t,e)||ct(e)}),tt(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},qa.prototype.createField=function(e){this.wrapper=Ea(),this.textarea=this.wrapper.firstChild},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=cn(e);if(e.options.moveInputWithCursor){var i=Kr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},qa.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&W(this.textarea),x&&9<=k&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",x&&9<=k&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qa.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},qa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||kt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(x&&9<=k&&this.hasSelection===i||w&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Vn(t,function(){Ma(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){x&&9<=k&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea,t=an(n,e),a=i.scroller.scrollTop;if(t&&!g){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&Gn(n,Gi)(n.doc,bi(t),q);var l=o.style.cssText,s=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var c,u=r.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(x?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(c=window.scrollY),i.input.focus(),b&&window.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=!0,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=k&&f(),C){ft(e);var d=function(){nt(window,"mouseup",d),setTimeout(h,20)};tt(window,"mouseup",d)}else setTimeout(h,50)}function f(){if(null!=o.selectionStart){var e=n.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function h(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=s,o.style.cssText=l,x&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),null!=o.selectionStart){(!x||x&&k<9)&&f();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?Gn(n,to)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(i){var o=i.optionHandlers;function e(e,t,n,r){i.defaults[e]=t,n&&(o[e]=r?function(e,t,r){r!=ga&&n(e,t,r)}:n)}i.defineOption=e,i.Init=ga,e("value","",function(e,t){return e.setValue(t)},!0),e("mode",null,function(e,t){e.doc.modeOption=t,Ti(e)},!0),e("indentUnit",2,Ti,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(e){Si(e),Hr(e),Xn(e)},!0),e("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(ge(o,r))}o++});for(var t=i.length-1;0<=t;t--)so(e.doc,n,i[t],ge(i[t].line,i[t].ch+n.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=ga&&e.refresh()}),e("specialCharPlaceholder",Jt,function(e){return e.refresh()},!0),e("electricChars",!0),e("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),e("rtlMoveVisually",!p),e("wholeLineUpdateBefore",!0),e("theme","default",function(e){ma(e),ba(e)},!0),e("keyMap","default",function(e,t,r){var n=Uo(t),i=r!=ga&&Uo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,xa,!0),e("gutters",[],function(e){ui(e.options),ba(e)},!0),e("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rn(e.display)+"px":"0",e.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(e){return Wn(e)},!0),e("scrollbarStyle","native",function(e){Hn(e),Wn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),e("lineNumbers",!1,function(e){ui(e.options),ba(e)},!0),e("firstLineNumber",1,ba,!0),e("lineNumberFormatter",function(e){return e},ba,!0),e("showCursorWhenSelecting",!1,sn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,function(e,t){"nocursor"==t&&(vn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),e("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),e("dragDrop",!0,wa),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,sn,!0),e("singleCursorHeightPerLine",!0,sn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Si,!0),e("addModeClass",!1,Si,!0),e("pollInterval",100),e("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),e("historyEventDelay",1250),e("viewportMargin",10,function(e){return e.refresh()},!0),e("maxHighlightLength",1e4,Si,!0),e("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),e("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),e("autofocus",null),e("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),e("phrases",null)}(ka),ja=(Ra=ka).optionHandlers,Ba=Ra.helpers={},Ra.prototype={constructor:Ra,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,ja.hasOwnProperty(e)&&Gn(this,ja[e])(this,t,n),it(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Uo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:$n(function(e,t){var r=e.token?e:Ra.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,Xn(this)}),removeOverlay:$n(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Xn(this)}}),indentLine:$n(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&Ta(this,e,t,r)}),indentSelection:$n(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Ta(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Sn(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<r;++s)Ta(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&0<c[n].from().ch&&Ui(this.doc,n,new vi(o,c[n].to()),q)}}}),getTokenAt:function(e,t){return Ut(this,e,t)},getLineTokens:function(e,t){return Ut(this,ge(e),t,!0)},getTokenTypeAt:function(e){e=Ce(this.doc,e);var t,r=Ht(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Ra.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ba.hasOwnProperty(t))return r;var n=Ba[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var l=0;l<n._global.length;l++){var s=n._global[l];s.pred(i,this)&&-1==R(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return It(this,(e=ke(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Kr(this,null==e?r.head:"object"==typeof e?Ce(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Ur(this,Ce(this.doc,e),t||"page")},coordsChar:function(e,t){return $r(this,(e=qr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=qr(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:o<e&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Br(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Ge(n):0)},defaultTextHeight:function(){return Qr(this.display)},defaultCharWidth:function(){return en(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,l,s=this.display,c=(e=Kr(this,Ce(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var d=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=Cn(o,a)).scrollTop&&On(o,l.scrollTop),null!=l.scrollLeft&&_n(o,l.scrollLeft))},triggerOnKeyDown:$n(ia),triggerOnKeyPress:$n(aa),triggerOnKeyUp:oa,triggerOnMouseDown:$n(ua),execCommand:function(e){if(Yo.hasOwnProperty(e))return Yo[e].call(null,this)},triggerElectric:$n(function(e){Oa(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=Ce(this.doc,e),a=0;a<t&&!(o=Da(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:$n(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Da(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},K)}),deleteH:$n(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):Ko(this,function(e){var t=Da(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=Ce(this.doc,e),l=0;l<t;++l){var s=Kr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Fa(this,s,i,r)).hitSide)break}return a},moveV:$n(function(n,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(s)return n<0?e.from():e.to();var t=Kr(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var r=Fa(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Tn(o,Ur(o,r,"div").top-t.top),r},K),l.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=l[e]}),findWordAt:function(e){var t=se(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new vi(ge(e.line,r),ge(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:$n(function(e,t){Ln(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tr(this)-this.display.barHeight,width:e.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:Lr(this),clientWidth:Sr(this)}},scrollIntoView:$n(function(e,t){var r,n;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ge(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(n=e,Mn(r=this),r.curOp.scrollToPos=n):An(this,e.from,e.to,e.margin)}),setSize:$n(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Pr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Zn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return Vn(this,e)},startOperation:function(){return Rn(this)},endOperation:function(){return jn(this)},refresh:$n(function(){var e=this.display.cachedTextHeight;Xn(this),this.curOp.forceUpdate=!0,Hr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),li(this),(null==e||.5<Math.abs(e-Qr(this.display)))&&on(this),it(this,"refresh",this)}),swapDoc:$n(function(e){var t=this.doc;return t.cm=null,Oi(this,e),Hr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},st(Ra),Ra.registerHelper=function(e,t,r){Ba.hasOwnProperty(e)||(Ba[e]=Ra[e]={_global:[]}),Ba[e][t]=r},Ra.registerGlobalHelper=function(e,t,r,n){Ra.registerHelper(e,t,n),Ba[e]._global.push({pred:r,val:n})};var Ua,Ka="iter insert remove copy getEditor constructor".split(" ");for(var Va in So.prototype)So.prototype.hasOwnProperty(Va)&&R(Ka,Va)<0&&(ka.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(So.prototype[Va]));return st(So),ka.inputStyles={textarea:qa,contenteditable:Wa},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){Lt[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){So.prototype[e]=t},ka.fromTextArea=function(t,e){if((e=e?P(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=E();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=l.getValue()}var i;if(t.form&&(tt(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(nt(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var l=ka(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return l},(Ua=ka).off=nt,Ua.on=tt,Ua.wheelEventPixels=pi,Ua.Doc=So,Ua.splitLines=xt,Ua.countColumn=H,Ua.findColumn=V,Ua.isWordChar=ee,Ua.Pass=B,Ua.signal=it,Ua.Line=Gt,Ua.changeEnd=wi,Ua.scrollbarModel=Pn,Ua.Pos=ge,Ua.cmpPos=ve,Ua.modes=St,Ua.mimeModes=Lt,Ua.resolveMode=Mt,Ua.getMode=At,Ua.modeExtensions=Ot,Ua.extendMode=Nt,Ua.copyState=_t,Ua.startState=Dt,Ua.innerMode=Et,Ua.commands=Yo,Ua.keyMap=Po,Ua.keyName=qo,Ua.isModifierKey=jo,Ua.lookupKey=Ro,Ua.normalizeKeyMap=Io,Ua.StringStream=Ft,Ua.SharedTextMarker=xo,Ua.TextMarker=bo,Ua.LineWidget=go,Ua.e_preventDefault=ct,Ua.e_stopPropagation=ut,Ua.e_stop=ft,Ua.addClass=D,Ua.contains=_,Ua.rmClass=L,Ua.keyNames=Do,ka.version="5.42.0",ka},"object"==typeof r&&void 0!==t?t.exports=i():"function"==typeof o&&o.amd?o(i):n.CodeMirror=i()},{}],18:[function(e,t,r){var n;n=function(N){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}N.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=N.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,l=t.documentTypes||{},s=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},d=t.propertyKeywords||{},f=t.nonStandardPropertyKeywords||{},h=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,y=t.lineComment,b=!0===t.supportsAtComponent;function w(e,t){return n=t,e}function x(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return(r==i||!n&&")"!=i)&&(t.tokenize=null),w("string","string")}}function k(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=x(")"),w(null,"(")}function C(e,t,r){this.type=e,this.indent=t,this.prev=r}function T(e,t,r,n){return e.context=new C(r,t.indentation()+(!1===n?0:o),e.context),r}function S(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,r){return O[r.context.type](e,t,r)}function M(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return L(e,t,r)}function A(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,r){if("{"==e)return T(r,t,"block");if("}"==e&&r.context.prev)return S(r);if(b&&/@component/i.test(e))return T(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return T(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(i="error","block");var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(i="property","maybeprop"):f.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?T(r,t,"prop"):L(e,t,r)},prop:function(e,t,r){if(";"==e)return S(r);if("{"==e&&v)return T(r,t,"propBlock");if("}"==e||"{"==e)return M(e,t,r);if("("==e)return T(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return T(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?S(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?M(e,t,r):")"==e?S(r):"("==e?T(r,t,"parens"):"interpolation"==e?T(r,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):L(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",r.context.type):O.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return T(r,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,r);if("{"==e)return S(r)&&T(r,t,v?"block":"top");if("interpolation"==e)return T(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":f.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?M(e,t,r):"{"==e?S(r)&&T(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?S(r):"{"==e||"}"==e?M(e,t,r,2):O.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?T(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,S(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?T(r,t,"top"):L(e,t,r)},at:function(e,t,r){return";"==e?S(r):"{"==e||"}"==e?M(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?S(r):"{"==e||";"==e?M(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=x(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=k,w("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=O[t.state](n,e,t)),i},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(n),o=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],a=e(o),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],s=e(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=e(c),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=e(d),h=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=e(m),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=e(v),b=t.concat(n).concat(o).concat(l).concat(c).concat(d).concat(m).concat(v);function w(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}N.registerHelper("hintWords","css",b),N.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),N.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),N.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),N.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],19:[function(e,t,r){var n;n=function(p){"use strict";var i={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function m(e,t){var r,n=e.match(o[r=t]||(o[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;0<=o;o--)n.unshift(i[o])}p.defineMode("htmlmixed",function(u,e){var d=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),f={},t=e&&e.tags,r=e&&e.scriptTypes;if(a(i,f),t&&a(t,f),r)for(var n=r.length-1;0<=n;n--)f.script.unshift(["type",r[n].matches,r[n].mode]);function h(e,t){var r,n=d.token(e,t.htmlState),i=/\btag\b/.test(n);if(i&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&i&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var a=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(m(t,n[0])))return n[2]}}(f[o[1]],o[2]),l=p.getMode(u,a),s=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(s,!1)?(t.token=h,t.localState=t.localMode=null,null):(r=e,n=c,i=t.localMode.token(e,t.localState),o=r.current(),-1<(a=o.search(n))?r.backUp(o.length-a):o.match(/<\/?$/)&&(r.backUp(o.length),r.match(n,!1)||r.match(o)),i);var r,n,i,o,a},t.localMode=l,t.localState=p.startState(l,d.indent(t.htmlState,""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:p.startState(d)}},copyState:function(e){var t;return e.localState&&(t=p.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:p.copyState(d,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t):e.localMode.indent?e.localMode.indent(e.localState,t,r):p.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||d}}}},"xml","javascript","css"),p.defineMIME("text/html","htmlmixed")},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof o&&o.amd?o(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],n):n(CodeMirror)},{"../../lib/codemirror":17,"../css/css":18,"../javascript/javascript":20,"../xml/xml":21}],20:[function(e,t,r){var n;n=function(Ge){"use strict";Ge.defineMode("javascript",function(e,d){var n,i,f=e.indentUnit,h=d.statementIndent,a=d.jsonld,l=d.json||a,c=d.typescript,u=d.wordCharacters||/[\w$\xa1-\uffff]/,s=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),p=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,i=r,t}function v(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(a&&"@"==e.peek()&&e.match(m))return t.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=v),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return g("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y)(e,t):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Ve(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return(t.tokenize=b)(e,t);if("#"==r)return e.skipToEnd(),g("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),g("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var n=e.current();if("."!=t.lastType){if(s.propertyIsEnumerable(n)){var o=s[n];return g(o.type,o.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var w="([{}])";function o(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;0<=a;--a){var l=e.string.charAt(a),s=w.indexOf(l);if(0<=s&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(u.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var x={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function C(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var T={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;0<=e;e--)T.cc.push(arguments[e])}function L(){return S.apply(null,arguments),!0}function M(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function r(e){var t=T.state;if(T.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new O(n,r.vars,!0):null}return M(t,r.vars)?r:new O(r.prev,new N(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!M(e,t.localVars))return void(t.localVars=new N(e,t.localVars));d.globalVars&&!M(e,t.globalVars)&&(t.globalVars=new N(e,t.globalVars))}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function O(e,t,r){this.prev=e,this.vars=t,this.block=r}function N(e,t){this.name=e,this.next=t}var t=new N("this",new N("arguments",null));function _(){T.state.context=new O(T.state.context,T.state.localVars,!1),T.state.localVars=t}function E(){T.state.context=new O(T.state.context,T.state.localVars,!0),T.state.localVars=null}function D(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function F(n,i){var e=function(){var e=T.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new k(t,T.stream.column(),n,null,e.lexical,i)};return e.lex=!0,e}function W(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function z(r){return function e(t){return t==r?L():";"==r||"}"==t||")"==t||"]"==t?S():L(e)}}function P(e,t){return"var"==e?L(F("vardef",t),ve,z(";"),W):"keyword a"==e?L(F("form"),j,P,W):"keyword b"==e?L(F("form"),P,W):"keyword d"==e?T.stream.match(/^\s*$/,!1)?L():L(F("stat"),q,z(";"),W):"debugger"==e?L(z(";")):"{"==e?L(F("}"),E,oe,W,D):";"==e?L():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==W&&T.state.cc.pop()(),L(F("form"),j,P,W,Ce)):"function"==e?L(Oe):"for"==e?L(F("form"),Te,P,W):"class"==e||c&&"interface"==t?(T.marked="keyword",L(F("form"),Ee,W)):"variable"==e?c&&"declare"==t?(T.marked="keyword",L(P)):c&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?L(Ue):"type"==t?L(ce,z("operator"),ce,z(";")):L(F("form"),ye,z("{"),F("}"),oe,W,W)):c&&"namespace"==t?(T.marked="keyword",L(F("form"),I,oe,W)):c&&"abstract"==t?(T.marked="keyword",L(P)):L(F("stat"),J):"switch"==e?L(F("form"),j,z("{"),F("}","switch"),E,oe,W,W,D):"case"==e?L(I,z(":")):"default"==e?L(z(":")):"catch"==e?L(F("form"),_,H,P,W,D):"export"==e?L(F("stat"),ze,W):"import"==e?L(F("stat"),He,W):"async"==e?L(P):"@"==t?L(I,P):S(F("stat"),I,z(";"),W)}function H(e){if("("==e)return L(Ne,z(")"))}function I(e,t){return B(e,t,!1)}function R(e,t){return B(e,t,!0)}function j(e){return"("!=e?S():L(F(")"),I,z(")"),W)}function B(e,t,r){if(T.state.fatArrowAt==T.stream.start){var n=r?Y:$;if("("==e)return L(_,F(")"),ne(Ne,")"),W,z("=>"),n,D);if("variable"==e)return S(_,ye,z("=>"),n,D)}var i,o=r?K:U;return x.hasOwnProperty(e)?L(o):"function"==e?L(Oe,o):"class"==e||c&&"interface"==t?(T.marked="keyword",L(F("form"),_e,W)):"keyword c"==e||"async"==e?L(r?R:I):"("==e?L(F(")"),q,z(")"),W,o):"operator"==e||"spread"==e?L(r?R:I):"["==e?L(F("]"),qe,W,o):"{"==e?ie(ee,"}",null,o):"quasi"==e?S(V,o):"new"==e?L((i=r,function(e){return"."==e?L(i?Z:X):"variable"==e&&c?L(pe,i?K:U):S(i?R:I)})):"import"==e?L(I):L()}function q(e){return e.match(/[;\}\)\],]/)?S():S(I)}function U(e,t){return","==e?L(I):K(e,t,!1)}function K(e,t,r){var n=0==r?U:K,i=0==r?I:R;return"=>"==e?L(_,r?Y:$,D):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?L(n):c&&"<"==t&&T.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?L(F(">"),ne(ce,">"),W,n):"?"==t?L(I,z(":"),i):L(i):"quasi"==e?S(V,n):";"!=e?"("==e?ie(R,")","call",n):"."==e?L(Q,n):"["==e?L(F("]"),q,z("]"),W,n):c&&"as"==t?(T.marked="keyword",L(ce,n)):"regexp"==e?(T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),L(i)):void 0:void 0}function V(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?L(V):L(I,G)}function G(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,L(V)}function $(e){return o(T.stream,T.state),S("{"==e?P:I)}function Y(e){return o(T.stream,T.state),S("{"==e?P:R)}function X(e,t){if("target"==t)return T.marked="keyword",L(U)}function Z(e,t){if("target"==t)return T.marked="keyword",L(K)}function J(e){return":"==e?L(W,P):S(U,z(";"),W)}function Q(e){if("variable"==e)return T.marked="property",L()}function ee(e,t){if("async"==e)return T.marked="property",L(ee);if("variable"==e||"keyword"==T.style){return T.marked="property","get"==t||"set"==t?L(te):(c&&T.state.fatArrowAt==T.stream.start&&(r=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+r[0].length),L(re));var r}else{if("number"==e||"string"==e)return T.marked=a?"property":T.style+" property",L(re);if("jsonld-keyword"==e)return L(re);if(c&&A(t))return T.marked="keyword",L(ee);if("["==e)return L(I,ae,z("]"),re);if("spread"==e)return L(R,re);if("*"==t)return T.marked="keyword",L(ee);if(":"==e)return S(re)}}function te(e){return"variable"!=e?S(re):(T.marked="property",L(Oe))}function re(e){return":"==e?L(R):"("==e?S(Oe):void 0}function ne(n,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var r=T.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),L(function(e,t){return e==i||t==i?S():S(n)},a)}return e==i||t==i?L():L(z(i))}return function(e,t){return e==i||t==i?L():S(n,a)}}function ie(e,t,r){for(var n=3;n<arguments.length;n++)T.cc.push(arguments[n]);return L(F(t,r),ne(e,t),W)}function oe(e){return"}"==e?L():S(P,oe)}function ae(e,t){if(c){if(":"==e)return L(ce);if("?"==t)return L(ae)}}function le(e){if(c&&":"==e)return T.stream.match(/^\s*\w+\s+is\b/,!1)?L(I,se,ce):L(ce)}function se(e,t){if("is"==t)return T.marked="keyword",L()}function ce(e,t){return"keyof"==t||"typeof"==t?(T.marked="keyword",L("keyof"==t?ce:R)):"variable"==e||"void"==t?(T.marked="type",L(he)):"string"==e||"number"==e||"atom"==e?L(he):"["==e?L(F("]"),ne(ce,"]",","),W,he):"{"==e?L(F("}"),ne(de,"}",",;"),W,he):"("==e?L(ne(fe,")"),ue):"<"==e?L(ne(ce,">"),ce):void 0}function ue(e){if("=>"==e)return L(ce)}function de(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",L(de)):"?"==t?L(de):":"==e?L(ce):"["==e?L(I,ae,z("]"),de):void 0}function fe(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?L(fe):":"==e?L(ce):S(ce)}function he(e,t){return"<"==t?L(F(">"),ne(ce,">"),W,he):"|"==t||"."==e||"&"==t?L(ce):"["==e?L(z("]"),he):"extends"==t||"implements"==t?(T.marked="keyword",L(ce)):void 0}function pe(e,t){if("<"==t)return L(F(">"),ne(ce,">"),W,he)}function me(){return S(ce,ge)}function ge(e,t){if("="==t)return L(ce)}function ve(e,t){return"enum"==t?(T.marked="keyword",L(Ue)):S(ye,ae,xe,ke)}function ye(e,t){return c&&A(t)?(T.marked="keyword",L(ye)):"variable"==e?(r(t),L()):"spread"==e?L(ye):"["==e?ie(we,"]"):"{"==e?ie(be,"}"):void 0}function be(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?L(ye):"}"==e?S():"["==e?L(I,z("]"),z(":"),be):L(z(":"),ye,xe)):(r(t),L(xe))}function we(){return S(ye,xe)}function xe(e,t){if("="==t)return L(R)}function ke(e){if(","==e)return L(ve)}function Ce(e,t){if("keyword b"==e&&"else"==t)return L(F("form","else"),P,W)}function Te(e,t){return"await"==t?L(Te):"("==e?L(F(")"),Se,z(")"),W):void 0}function Se(e){return"var"==e?L(ve,z(";"),Me):";"==e?L(Me):"variable"==e?L(Le):S(I,z(";"),Me)}function Le(e,t){return"in"==t||"of"==t?(T.marked="keyword",L(I)):L(U,Me)}function Me(e,t){return";"==e?L(Ae):"in"==t||"of"==t?(T.marked="keyword",L(I)):S(I,z(";"),Ae)}function Ae(e){")"!=e&&L(I)}function Oe(e,t){return"*"==t?(T.marked="keyword",L(Oe)):"variable"==e?(r(t),L(Oe)):"("==e?L(_,F(")"),ne(Ne,")"),W,le,P,D):c&&"<"==t?L(F(">"),ne(me,">"),W,Oe):void 0}function Ne(e,t){return"@"==t&&L(I,Ne),"spread"==e?L(Ne):c&&A(t)?(T.marked="keyword",L(Ne)):S(ye,ae,xe)}function _e(e,t){return"variable"==e?Ee(e,t):De(e,t)}function Ee(e,t){if("variable"==e)return r(t),L(De)}function De(e,t){return"<"==t?L(F(">"),ne(me,">"),W,De):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(T.marked="keyword"),L(c?ce:I,De)):"{"==e?L(F("}"),Fe,W):void 0}function Fe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&A(t))&&T.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",L(Fe)):"variable"==e||"keyword"==T.style?(T.marked="property",L(c?We:Oe,Fe)):"["==e?L(I,ae,z("]"),c?We:Oe,Fe):"*"==t?(T.marked="keyword",L(Fe)):";"==e?L(Fe):"}"==e?L():"@"==t?L(I,Fe):void 0}function We(e,t){return"?"==t?L(We):":"==e?L(ce,xe):"="==t?L(R):S(Oe)}function ze(e,t){return"*"==t?(T.marked="keyword",L(Be,z(";"))):"default"==t?(T.marked="keyword",L(I,z(";"))):"{"==e?L(ne(Pe,"}"),Be,z(";")):S(P)}function Pe(e,t){return"as"==t?(T.marked="keyword",L(z("variable"))):"variable"==e?S(R,Pe):void 0}function He(e){return"string"==e?L():"("==e?S(I):S(Ie,Re,Be)}function Ie(e,t){return"{"==e?ie(Ie,"}"):("variable"==e&&r(t),"*"==t&&(T.marked="keyword"),L(je))}function Re(e){if(","==e)return L(Ie,Re)}function je(e,t){if("as"==t)return T.marked="keyword",L(Ie)}function Be(e,t){if("from"==t)return T.marked="keyword",L(I)}function qe(e){return"]"==e?L():S(ne(R,"]"))}function Ue(){return S(F("form"),ye,z("{"),F("}"),ne(Ke,"}"),W,W)}function Ke(){return S(ye,xe)}function Ve(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return W.lex=D.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-f,0,"block",!1),localVars:d.localVars,context:d.localVars&&new O(null,null,!1),indented:e||0};return d.globalVars&&"object"==typeof d.globalVars&&(t.globalVars=d.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),o(e,t)),t.tokenize!=y&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?I:P)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==r&&C(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(e,t){if(e.tokenize==y)return Ge.Pass;if(e.tokenize!=v)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var a=e.cc[o];if(a==W)i=i.prev;else if(a!=Ce)break}for(;("stat"==i.type||"form"==i.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==U||r==K)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;h&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l,s,c=i.type,u=n==c;return"vardef"==c?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==c&&"{"==n?i.indented:"form"==c?i.indented+f:"stat"==c?i.indented+(s=t,"operator"==(l=e).lastType||","==l.lastType||p.test(s.charAt(0))||/[,.]/.test(s.charAt(0))?h||f:0):"switch"!=i.info||u||0==d.doubleIndentSwitch?i.align?i.column+(u?0:1):i.indented+(u?0:f):i.indented+(/^(?:case|default)\b/.test(t)?f:2*f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:Ve,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=I&&t!=R||e.cc.pop()}}}),Ge.registerHelper("wordChars","javascript",/[\w$]/),Ge.defineMIME("text/javascript","javascript"),Ge.defineMIME("text/ecmascript","javascript"),Ge.defineMIME("application/javascript","javascript"),Ge.defineMIME("application/x-javascript","javascript"),Ge.defineMIME("application/ecmascript","javascript"),Ge.defineMIME("application/json",{name:"javascript",json:!0}),Ge.defineMIME("application/x-json",{name:"javascript",json:!0}),Ge.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),Ge.defineMIME("text/typescript",{name:"javascript",typescript:!0}),Ge.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],21:[function(e,t,r){var n;n=function(C){"use strict";var T={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};C.defineMode("xml",function(e,t){var a,o,l=e.indentUnit,s={},r=t.htmlMode?T:S;for(var n in r)s[n]=r[n];for(var n in t)s[n]=t[n];function c(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",r.tokenize=u,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function u(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=c,a=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return a="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=c,t.state=p,t.tagName=t.tagStart=null;var n,i,o=t.tokenize(e,t);return o?o+" tag error":"tag error"}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=c;break}e.next()}return r}}function d(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(r)||!s.contextGrabbers[r].hasOwnProperty(t))return;f(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",b):s.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",m)}function g(e,t,r){if("word"!=e)return s.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,r)):(o="error",y);var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(r.context.tagName)&&f(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,r){return"endTag"!=e?(o="error",v):(f(r),p)}function y(e,t,r){return o="error",v(e,0,r)}function b(e,t,r){if("word"==e)return o="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(n)?h(r,n):(h(r,n),r.context=new d(r,n,i==r.indented)),p}function w(e,t,r){return"equals"==e?x:(s.allowMissing||(o="error"),b(e,0,r))}function x(e,t,r){return"string"==e?k:"word"==e&&s.allowUnquoted?(o="string",b):(o="error",b(e,0,r))}function k(e,t,r){return"string"==e?k:b(e,0,r)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!=r&&(o=null,t.state=t.state(a||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+l;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=u&&e.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!s.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=s.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+l:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof o&&o.amd?o(["../../lib/codemirror"],n):n(CodeMirror)},{"../../lib/codemirror":17}],22:[function(e,t,r){t.exports={prettyPrint:function(e,t){var r,n,i,o,a,c;for(n=(t=t||{}).indent_size||4,i=t.indent_char||" ",a=t.brace_style||"collapse",o=0==t.max_char?1/0:t.max_char||70,c=t.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],(r=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace))t.length&&(r=!0),this.line_char_count--;else{if(r){if(this.line_char_count>=this.max_char){t.push("\n");for(var n=0;n<this.indent_level;n++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;r=!1}t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,r="",n=[],i=!1;do{if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];r=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(r,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==r&&'"'!==r||n[1]&&"!"===n[1]||(r+=this.get_unformatted(r),i=!0),"="===r&&(i=!1),n.length&&"="!==n[n.length-1]&&">"!==r&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,n),this.line_char_count=0):(n.push(" "),this.line_char_count++),i=!1),"<"===r&&(e=this.pos-1),n.push(r))}while(">"!==r);var o,a=n.join("");o=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var l=a.substring(1,o).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(l,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===l)this.record_tag(l),this.tag_type="SCRIPT";else if("style"===l)this.record_tag(l),this.tag_type="STYLE";else if(this.Utils.in_array(l,c)){var s=this.get_unformatted("</"+l+">",a);n.push(s),0<e&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&n.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(t+1),this.Utils.whitespace)&&n.push(this.input.charAt(t+1)),this.tag_type="SINGLE"}else"!"===l.charAt(0)?-1!=l.indexOf("[if")?(-1!=a.indexOf("!IE")&&(s=this.get_unformatted("--\x3e",a),n.push(s)),this.tag_type="START"):-1!=l.indexOf("[endif")?(this.tag_type="END",this.unindent()):(s=-1!=l.indexOf("[cdata[")?this.get_unformatted("]]>",a):this.get_unformatted("--\x3e",a),n.push(s),this.tag_type="SINGLE"):("/"===l.charAt(0)?(this.retrieve_tag(l.substring(1)),this.tag_type="END"):(this.record_tag(l),this.tag_type="START"),this.Utils.in_array(l,this.Utils.extra_liners)&&this.print_newline(!0,this.output));return n.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var r="",n="",i=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,i=!0}while(-1==n.toLowerCase().indexOf(e));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"!==this.last_token&&"TK_TAG_STYLE"!==this.last_token)return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0;var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,r,n,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=r,this.brace_style=i,this.indent_level=0,this.max_char=n;for(var o=this.line_char_count=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,i,n,o,a);;){var l=r.get_token();if(r.token_text=l[0],r.token_type=l[1],"TK_EOF"===r.token_type)break;switch(r.token_type){case"TK_TAG_START":r.print_newline(!1,r.output),r.print_token(r.token_text),r.indent(),r.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":r.print_newline(!1,r.output),r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===r.last_token&&""===r.last_text){var s=r.token_text.match(/\w+/)[0],u=r.output[r.output.length-1].match(/<\s*(\w+)/);null!==u&&u[1]===s||r.print_newline(!0,r.output)}r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var d=r.token_text.match(/^\s*<([a-z]+)/i);d&&r.Utils.in_array(d[1],c)||r.print_newline(!1,r.output),r.print_token(r.token_text),r.current_mode="CONTENT";break;case"TK_CONTENT":""!==r.token_text&&r.print_token(r.token_text),r.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==r.token_text){r.output.push("\n");var f=r.token_text;if("TK_SCRIPT"==r.token_type)var h="function"==typeof js_beautify&&js_beautify;else"TK_STYLE"==r.token_type&&(h="function"==typeof css_beautify&&css_beautify);if("keep"==t.indent_scripts)var p=0;else p="separate"==t.indent_scripts?-r.indent_level:1;var m=r.get_full_indent(p);if(h)f=h(f.replace(/^\s*/,m),t);else{var g=f.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(r.indent_string).length-1,v=r.get_full_indent(p-g);f=f.replace(/^\s*/,m).replace(/\r\n|\r|\n/g,"\n"+v).replace(/\s*$/,"")}f&&(r.print_token(f),r.print_newline(!0,r.output))}r.current_mode="TAG"}r.last_token=r.token_type,r.last_text=r.token_text}return r.output.join("")}}},{}],23:[function(e,t,r){"use strict";t.exports=e("./stream/stream")},{"./stream/stream":24}],24:[function(e,r,t){!function(){"use strict";var t=0,i={};function a(){function e(){return 0<arguments.length&&arguments[0]!==i&&n(e,arguments[0]),e._state.value}var r;return(r=e).constructor=a,r._state={id:t++,value:void 0,state:0,derive:void 0,recover:void 0,deps:{},parents:[],endStream:void 0,unregister:void 0},r.map=r["fantasy-land/map"]=u,r["fantasy-land/ap"]=d,r["fantasy-land/of"]=a,r.valueOf=f,r.toJSON=h,r.toString=f,Object.defineProperties(r,{end:{get:function(){if(!r._state.endStream){var t=a();t.map(function(e){return!0===e&&(c(r),t._state.unregister=function(){c(t)}),e}),r._state.endStream=t}return r._state.endStream}}}),0<arguments.length&&arguments[0]!==i&&n(e,arguments[0]),e}function n(e,t){for(var r in o(e,t),e._state.deps)l(e._state.deps[r],!1);null!=e._state.unregister&&e._state.unregister(),function(e){for(var t in e._state.changed=!1,e._state.deps)e._state.deps[t]._state.changed=!1}(e)}function o(e,t){e._state.value=t,e._state.changed=!0,2!==e._state.state&&(e._state.state=1)}function l(e,t){var r=e._state.parents;if(0<r.length&&r.every(m)&&(t||r.some(g))){var n=e._state.derive();if(n===i)return!1;o(e,n)}}function s(e,t){if(!t.every(p))throw new Error("Ensure that each item passed to stream.combine/stream.merge is a stream");return r=a(),n=t,i=function(){return e.apply(this,t.concat([t.filter(g)]))},(o=r._state).derive=i,o.parents=n.filter(v),function e(t,r){for(var n=0;n<r.length;n++)r[n]._state.deps[t._state.id]=t,e(t,r[n]._state.parents)}(r,o.parents),l(r,!0),r;var r,n,i,o}function c(e){for(var t=0;t<e._state.parents.length;t++){delete e._state.parents[t]._state.deps[e._state.id]}for(var r in e._state.deps){var n=e._state.deps[r],i=n._state.parents.indexOf(e);-1<i&&n._state.parents.splice(i,1)}e._state.state=2,e._state.deps={}}function u(t){return s(function(e){return t(e())},[this])}function d(e){return s(function(e,t){return e()(t())},[e,this])}function f(){return this._state.value}function h(){return null!=this._state.value&&"function"==typeof this._state.value.toJSON?this._state.value.toJSON():this._state.value}function p(e){return e._state}function m(e){return 1===e._state.state}function g(e){return e._state.changed}function v(e){return 2!==e._state.state}(a["fantasy-land/of"]=a).merge=function(e){return s(function(){return e.map(function(e){return e()})},e)},a.combine=s,a.scan=function(t,r,e){var n=s(function(e){return r=t(r,e._state.value)},[e]);return 0===n._state.state&&n(r),n},a.scanMerge=function(n,i){var e=n.map(function(e){var t=e[0];return 0===t._state.state&&t(void 0),t});return s(function(){var r=arguments[arguments.length-1];return e.forEach(function(e,t){-1<r.indexOf(e)&&(i=n[t][1](i,e._state.value))}),i},e)},a.HALT=i,void 0!==r?r.exports=a:"function"!=typeof window.m||"stream"in window.m?window.m={stream:a}:window.m.stream=a}()},{}]},{},[11])}();
|
2 |
//# sourceMappingURL=forms-admin.min.js.map
|
assets/js/forms-admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["forms-admin.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","m","i18n","showType","config","fieldType","type","charAt","toUpperCase","slice","label","fieldLabel","value","onchange","withAttr","placeholder","title","isHidden","initialValue","style","optional","valueHelp","numberMinMax","min","max","isRequired","inputAtts","checked","required","desc","forceRequired","disabled","isFieldRequired","placeholderHelp","useParagraphs","wrap","wrapInParagraphTags","choiceType","options","selected","dropdown","radioButtons","acceptsMultipleValues","push","checkboxes","choices","html","map","choice","index","data-id","name","selectChoice","bind","preselect","remove","class","onclick","key","this","splice","linkToTerms","agreeToTermsLink","link","2","forms","rows","render","text","visibleRows","hidden","submit","number","./field-forms-rows.js","3","htmlutil","setAttributes","vnode","dom","setAttribute","generators","select","attributes","hasSelection","oncreate","unshift","href","target","checkbox","radio","field","htmlTemplate","vdom","document","createElement","showLabel","prettyPrint","innerHTML","4","tabs","editor","fields","events","fieldConfig","generate","overlay","setActiveField","get","join","redraw","createFieldHTMLAndAddToForm","insert","on","view","fieldCategories","getCategories","availableFields","getAll","fieldsChoice","chooseField","category","categoryFields","filter","className","inForm","inFormContent","form","help","trust","onkeydown","window","event","keyCode","addToForm","controller","./field-forms.js","./field-generator.js","./overlay.js","5","registeredFields","register","data","sticky","getFieldType","phone","birthday","registerMergeField","mergeField","listFields","field_type","tag","mailchimpType","streetAddress","city","state","zip","country","mc4wp_vars","countries","registerInterestCategory","interestCategory","interestCategories","id","interests","registerListFields","list","merge_fields","sort","b","public","forEach","interest_categories","registerCustomFields","lists","formFields","subscribe","submitButton","listChoice","listChoiceDescription","unsubscribe","formAction","formActionDescription","agreeToTerms","agreeToTermsShort","registerListsFields","deregister","6","prop","timeout","categories","Field","FieldChoice","getAllWhere","searchKey","searchValue","indexOf","existingField","shift","choiceLabel","Object","keys","clearTimeout","setTimeout","trigger","mithril/stream","7","CodeMirror","previewDom","FormEditor","_dom","domDirty","element","getElementById","previewFrame","templateRegex","setPreviewDom","frameContent","contentDocument","contentWindow","querySelector","updatePreview","markup","getValue","replace","dispatchEvent","Event","toLowerCase","addEventListener","signal","query","querySelectorAll","containsField","fieldName","elements","namedItem","replaceSelection","focus","callback","refresh","fromTextArea","selectionPointer","mode","htmlMode","autoCloseTags","autoRefresh","styleActiveLine","matchBrackets","matchTags","bothTags","bubbles","codemirror","codemirror/addon/edit/closetag.js","codemirror/addon/edit/matchbrackets.js","codemirror/addon/edit/matchtags.js","codemirror/addon/fold/xml-fold.js","codemirror/addon/selection/active-line.js","codemirror/mode/css/css","codemirror/mode/htmlmixed/htmlmixed","codemirror/mode/javascript/javascript","codemirror/mode/xml/xml","8","settings","helpers","requiredFieldsInput","updateFields","requiredFields","requiredFieldElements","originalRequiredValue","nameGroup","Array","prototype","el","pos","substr","debounce","9","notices","show","hide","container","heading","parentNode","insertBefore","nextSibling","init","groupingsNotice","requiredFieldsNotice","missingFields","10","_element","_onCloseCallback","close","removeEventListener","onKeyDown","position","preventDefault","windowWidth","innerWidth","documentElement","clientWidth","body","windowHeight","innerHeight","clientHeight","marginLeft","marginTop","left","top","storeElementReference","content","onCloseCallback","onremove","11","mc4wp_forms_i18n","mc4wp","deps","mithril","FormWatcher","FieldHelper","FieldsFactory","formEditor","fieldHelper","mount","fieldsFactory","getSelectedLists","mailchimp","./admin/field-helper.js","./admin/fields-factory.js","./admin/fields.js","./admin/form-editor.js","./admin/form-watcher.js","./admin/notices","12","mod","defineOption","cm","val","old","Init","removeKeyMap","whenClosing","getOption","Pass","autoCloseCurrent","whenOpening","ranges","listSelections","replacements","opt","empty","head","tok","getTokenAt","inner","innerMode","getMode","tagName","configuration","dontCloseTags","htmlDontClose","indentTags","htmlIndent","end","ch","lowerTagName","test","string","closingTagExists","indent","newPos","Pos","line","dontIndentOnAutoClose","info","replaceRange","anchor","sel","setSelections","indentLine","autoCloseGT","addKeyMap","typingSlash","dontIndentOnSlash","replacement","start","context","getLine","replaceSelections","collection","elt","newTag","scanForClosingTag","Math","lastLine","nextClose","cx","onCx","prev","to","next","commands","closeTag","amd","../../lib/codemirror","../fold/xml-fold","13","ie_lt8","navigator","userAgent","documentMode","matching","(",")","[","]","{","}","findMatchingBracket","where","getLineHandle","afterCursor","getWrapperElement","match","dir","strict","getTokenTypeAt","found","scanForBracket","from","forward","maxScanLen","maxScanLineLength","maxScanLines","stack","re","bracketRegex","lineEnd","firstLine","lineNo","pop","autoclear","maxHighlightLen","maxHighlightLineLength","marks","markText","focused","clear","operation","doMatchBrackets","currentlyHighlighted","off","defineExtension","oldConfig","14","tagHit","tagOther","doMatchTags","failedTagMatch","somethingSelected","cur","getCursor","range","getViewport","findMatchingTag","matchBothTags","hit","at","open","other","maybeUpdateMatch","toMatchingTag","extendSelection","15","cmp","nameStartChar","xmlTagStart","RegExp","Iter","tagAt","iter","nextLine","prevLine","toTagEnd","gt","lastSlash","lastIndexOf","selfClose","toTagStart","lt","lastIndex","exec","toNextTag","toPrevTag","findMatchingClose","startLine","startCh","findMatchingOpen","endLine","endCh","registerHelper","openTag","startPos","endPos","here","findEnclosingTag","16","WRAP_CLASS","BACK_CLASS","GUTT_CLASS","clearActiveLines","activeLines","removeLineClass","updateActiveLines","active","option","nonEmpty","getLineHandleVisualStart","sameArray","addLineClass","selectionChange","17","global","factory","platform","gecko","ie_upto10","ie_11up","edge","ie","ie_version","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","Number","flipCtrlCmd","captureRightClick","classTest","cls","rmClass","node","current","after","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","cssText","createTextNode","eltP","contains","child","nodeType","host","activeElt","activeElement","shadowRoot","addClass","joinClasses","as","split","createRange","endNode","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","args","arguments","apply","copyObj","obj","overwrite","hasOwnProperty","countColumn","tabSize","startIndex","startValue","search","nextTab","selectionStart","selectionEnd","_e","Delayed","array","set","ms","scrollerGap","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","col","skipped","spaceStrs","spaceStr","lst","arr","out","nothing","createObj","base","props","inst","create","nonASCIISingleCaseWordChar","isWordCharBasic","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","findFirst","pred","midF","mid","ceil","floor","Display","place","doc","input","d","scrollbarFiller","gutterFiller","lineDiv","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","lines","mover","sizer","sizerWidth","heightForcer","gutters","lineGutter","scroller","wrapper","zIndex","paddingRight","draggable","viewFrom","viewTo","first","reportedViewFrom","reportedViewTo","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","selForContextMenu","activeTouch","size","chunk","children","sz","chunkSize","getBetween","getLines","updateLineHeight","height","diff","no","lineAtHeight","h","outer","i$1","lh","isLine","l","lineNumberFor","String","lineNumberFormatter","firstLineNumber","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","clipPos","linelen","last","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","stretchSpansOverChange","change","full","oldFirst","markedSpans","oldLast","isInsert","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansBefore","startsBefore","markedSpansAfter","sameLine","offset","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","detachMarkedSpans","detachLine","attachMarkedSpans","attachLine","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","find","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","lineNo$$1","visualLine","merged","visualLineNo","lineN","vis","visualLineEndNo","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","found$1","findMaxLine","display","bidiOther","getBidiPartAt","order","bidiOrdering","lowTypes","arabicTypes","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","level","direction","outerType","types","type$1","prev$1","type$2","i$4","type$3","j","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","i$7","j$2","nstart","reverse","getOrder","noHandlers","emitter","attachEvent","map$$1","_handlers","concat","getHandlers","detachEvent","handlers","signalDOMEvent","override","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","right","splitLinesAuto","result","nl","rt","getSelection","te","range$$1","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","modes","mimeModes","resolveMode","spec","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","nstate","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","hideFirstChars","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","loop","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","save","styleClasses","highlightFrontier","modeFrontier","precise","minindent","minline","lim","indented","findStartLine","saved","fromSaved","processLine","startAt","stream","callBlankLine","readToken","blankLine","token","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","Line","estimateHeight","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","rest","addToken","buildToken","buildTokenBadBidi","insertLineContent","maps","caches","lastChild","defaultSpecialCharPlaceholder","startStyle","endStyle","css","displayText","trailingBefore","spaceBefore","special","specialChars","mustWrap","createDocumentFragment","txt$1","tabWidth","specialCharPlaceholder","fullStyle","part","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","visualLineContinued","buildViewArray","nextPos","operationGroup","orphanDelayedCallbacks","signalLater","delayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","getLineContent","ext","built","background","updateLineBackground","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","markers","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterWidth","alignable","insertLineWidgets","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","widgetHeight","parentStyle","eventInWidget","getAttribute","paddingTop","offsetTop","paddingVert","paddingH","getComputedStyle","currentStyle","parseInt","isNaN","scrollGap","displayWidth","displayHeight","mapFromLineView","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","updateExternalMeasurement","rect","hasHeights","prepared","varHeight","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","abs","bottom","ensureLineHeights","nodeAndOffsetInLineMap","coverStart","coverEnd","getUsefulRect","screen","logicalXDPI","deviceXDPI","normal","fromRange","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","maybeUpdateRectForZooming","rSpan","charWidth","nullRect","rtop","rbot","bot","bogus","singleCursorHeightPerLine","rbottom","measureCharInner","measureText","mStart","mEnd","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","pageScrollX","pageXOffset","scrollLeft","pageScrollY","pageYOffset","scrollTop","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","partPos","invert","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","widgetHeight$$1","ltr","_lineNo","ref","closestDist","endX","dist","baseX","chAround","boxAround","atLeft","atStart","textHeight","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","estHeight","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","primIndex","showCursorWhenSelecting","drawSelectionCursor","drawSelectionRange","cursor","cursorHeight","otherCursor","cmpCoords","fragment","padding","leftSide","rightSide","docLTR","add","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","iterateBidiSections","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","ensureFocus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","readOnly","reset","receivedFocus","updateHeightsInViewport","prevBottom","updateWidgetHeight","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","updateGutterSpace","calculateScrollPos","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","scrollToPos","margin","cursorScrollMargin","scrollToCoords","scrollToCoordsRange","sPos","updateScrollTop","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","setScrollLeft","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","tabIndex","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","pointerEvents","bar","delay","maybeDisable","elementFromPoint","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","borderBottom","coverGutterNextToScrollbar","scrollbarModel","native","null","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","op","viewChanged","updateInput","typing","changeObjs","cursorActivityCalled","selectionChanged","updateMaxLine","ops","ownsGroup","endOperation","endCb","group","callbacks","fireCallbacksForOps","finishOperation","endOperation_R1","updatedDisplay","mustUpdate","updateDisplayIfNeeded","endOperation_R2","endOperation_W2","endOperation_finish","endOperations","marginBottom","borderRightWidth","DisplayUpdate","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","doScroll","scrollNode","scrollIntoView","maybeScrollWindow","limit","changed","endCoords","scrollPos","startTop","startLeft","scrollPosIntoView","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","methodOp","docMethodOp","regChange","lendiff","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","viewportMargin","different","toUpdate","selSnapshot","hasFocus","anchorNode","extend","anchorOffset","focusNode","focusOffset","selectionSnapshot","updateNumbersFrom","rm","currentWheelTarget","updateNumber","patchDisplay","snapshot","removeAllRanges","addRange","restoreSelection","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","movedX","movedY","sample","Selection","equals","there","deepCopy","Range","normalizeSelection","mayTouch","selectionsMayTouch","prim","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","estimateHeight$$1","spansFor","updateLine","linesFor","lastText","lastSpans","nlines","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","addChangeToHistory","selAfter","opId","hist","history","historyEventDelay","pushSelectionToHistory","addSelectionToHistory","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","mergeOldSpans","getOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","newChanges","extendRange","posBefore","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","mark","parts","mk","newParts","dfrom","dto","removeReadOnlyRanges","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","returned","v","shiftDoc","distance","removed","recomputeMaxLength","checkWidthStart","retreatFrontier","changesHandler","changeHandler","makeChangeSingleDocInEditor","assign","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","oldHeight","remaining","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","adjustScrollWhenAboveVisible","this$1","oldH","nextMarkerId","TextMarker","cloneNode","isParent","SharedTextMarker","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","withOp","visual","dHeight","findSharedMarkers","findMarks","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","lineSeparator","setValue","getRange","getLineNumber","lineCount","setCursor","extendSelectionsBy","addSelection","getSelections","dup","newSel","hint","oldPrev","newPrev","computeReplacedSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineWidget","insertAt","aboveVisible","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","mFrom","mTo","subMark","copySharedMarkers","unlinkDoc","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","file","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","globalsRegistered","ensureGlobalHandlers","resizeTimer","onResize","setSize","keyNames","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","145","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","fromCharCode","keyMap","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","visualLineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","keyMaps","extraKeys","lookupKeyForEditor","handleKeyBinding","motion","lastStoppedKey","handled","up","showCrossHair","onKeyUp","onKeyPress","charCode","lastClick","lastDoubleClick","PastClick","onMouseDown","supportsTouch","clickInGutter","now","repeat","compare","selectingText","handleMappedButton","contained","behavior","unit","addNew","moveOnDrag","configureMouse","dragDrop","moved","dragEnd","mouseMove","dragStart","e2","leftButtonStartDrag","ourRange","ourIndex","startSel","rangeForUnit","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","anchorLine","boundary","headIndex","usePart","bidiSimplify","editorSize","counter","move","buttons","curCount","leftButtonSelect","leftButtonDown","onContextMenu","findWordAt","gutterEvent","prevent","mX","mY","touches","lineBox","g","themeChanged","theme","defaults","optionHandlers","guttersChanged","dragDropChanged","funcs","dragFunctions","toggle","enter","over","leave","drop","wrappingChanged","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","word","touchFinished","prevTouch","finishTouch","farAway","touch","radiusX","radiusY","isMouseLikeTouchEvent","pageX","pageY","frag","onDragOver","setData","effectAllowed","setDragImage","img","src","_top","onDragStart","inp","getField","registerEventHandlers","finishInit","initHooks","textRendering","how","aggressive","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","spellcheck","hiddenTextarea","border","findPosH","origDir","moveOnce","boundToLine","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","res","nextCh","moveVisually","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","badPos","bad","domToPos","lineNode","locateNodeInLineView","textNode","topNode","nodeValue","curNode","textContent","previousSibling","dist$1","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","updateFromDOM","readFromDOMSoon","forceCompositionEnd","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","pollSelection","pollInterval","poll","scan","isInGutter","triggerOnKeyDown","pollContent","fromIndex","fromNode","toNode","toIndex","newText","closing","extraLinebreak","addText","walk","cmText","markerID","isBlock","nodeName","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","createField","textarea","prepareCopyCut","fastPoll","_display","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldCSS","oldWrapperCSS","oldScrollY","wrapperBox","scrollY","scrollTo","detectingSelectAll","prepareSelectAllHack","mouseup","rehide","extval","deflt","notOnInit","newBreaks","getInputField","detach","attach","integer","defineOptions","setOption","getDoc","addOverlay","score","priority","insertSorted","modeSpec","removeOverlay","newRanges","getLineTokens","getHelpers","_global","getStateAfter","defaultTextHeight","defaultCharWidth","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","amount","rtlMoveVisually","goalColumn","goals","startChar","check","getScrollInfo","interpret","swapDoc","phrase","phraseText","phrases","getScrollerElement","getGutterElement","registerGlobalHelper","predicate","dontDelegate","method","contenteditable","defineMode","dependencies","defineMIME","mime","func","defineDocExtension","tabindex","realSubmit","leaveSubmitMethodAlone","wrappedSubmit","getTextArea","toTextArea","cmpPos","version","keySet","parserConfig","inline","propertyKeywords","tokenHooks","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","colorKeywords","valueKeywords","allowNested","lineComment","supportsAtComponent","ret","tp","tokenString","quote","escaped","tokenize","tokenParenthesized","pushContext","popContext","pass","states","popAndPass","wordAsValue","stateArg","block","maybeprop","propBlock","_stream","parens","pseudo","atBlock","atComponentBlock","atBlock_parens","restricted_atBlock_before","restricted_atBlock","keyframes","interpolation","textAfter","blockCommentStart","blockCommentEnd","blockCommentContinue","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","colorKeywords_","valueKeywords_","allWords","tokenCComment","maybeEnd","/",":","$","#","@","&","defaultTags","script","attrRegexpCache","getAttrValue","attr","getTagRegexp","anchored","addTags","multilineTagIndentFactor","multilineTagIndentPastTag","tags","configTags","configScript","scriptTypes","matches","htmlState","inTag","tagInfo","tagText","findMatchingMode","endTagA","endTag","localState","localMode","pat","local","../css/css","../javascript/javascript","../xml/xml","statementIndent","jsonldMode","jsonld","jsonMode","json","isTS","typescript","wordRE","wordCharacters","keywords","kw","A","B","C","D","operator","atom","if","while","with","else","do","try","finally","return","break","continue","new","delete","void","throw","debugger","var","const","let","function","catch","for","switch","case","default","in","typeof","instanceof","true","false","super","yield","export","import","extends","await","isOperatorChar","isJsonldKeyword","cont","tokenBase","tokenComment","expressionAllowed","inSet","readRegexp","tokenQuasi","lexical","lastType","propertyIsEnumerable","brackets","findFatArrow","fatArrowAt","arrow","depth","sawSomething","bracket","atomicTypes","variable","regexp","jsonld-keyword","JSLexical","inScope","varname","localVars","vars","marked","cc","inList","newContext","registerVarScoped","Var","globalVars","isModifier","defaultVars","pushcontext","pushblockcontext","popcontext","pushlex","lex","poplex","expect","wanted","exp","statement","vardef","parenExpr","maybeexpression","maybeelse","functiondef","forspec","enumdef","typeexpr","expression","maybelabel","maybeCatchBinding","afterExport","afterImport","funarg","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","classExpression","arrayLiteral","contCommasep","objprop","quasi","targetNoComma","maybeTypeArgs","expr","property","continueQuasi","_","getterSetter","afterprop","maybetype","what","sep","proceed","mayberettype","isKW","afterType","typeprop","typearg","maybeReturnType","typeparam","maybeTypeDefault","maybeAssign","vardefCont","eltpattern","proppattern","_type","forspec1","forspec2","formaybeinof","forspec3","classNameAfter","classBody","classfield","maybeFrom","exportField","importSpec","maybeMoreImports","maybeAs","enummember","basecolumn","parseJS","firstChar","doubleIndentSwitch","closeBrackets","skipExpression","21","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","menu","nav","ol","section","table","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","allowMissingTagName","editorConf","config_","setStyle","inText","chain","parser","inBlock","doctype","closure","isInAttribute","stringStartCol","baseState","tagStart","terminator","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","closeState","closeStateErr","matchClosing","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","skipAttribute","22","html_source","multi_parser","indent_size","indent_character","max_char","brace_style","unformatted","indent_char","current_mode","parentcount","parent1","tag_type","token_text","last_token","last_text","token_type","Utils","whitespace","single_token","extra_liners","in_array","get_content","input_char","line_char_count","indent_level","indent_string","get_contents_to","reg_match","reg_array","end_script","substring","record_tag","retrieve_tag","temp_parent","get_tag","tag_start","tag_end","get_unformatted","print_newline","tag_index","tag_complete","tag_check","comment","unindent","delimiter","orig_tag","get_token","get_full_indent","printer","js_source","ignore","print_token","tag_name","tag_extracted_from_last_output","_beautifier","js_beautify","css_beautify","indent_scripts","script_indent_level","_level","reindent","23","./stream/stream","24","guid","HALT","createStream","updateStream","_state","derive","recover","parents","endStream","unregister","ap","valueOf","toJSON","defineProperties","unregisterStream","updateState","updateDependency","finalize","mustSync","every","some","combine","fn","streams","valid","dep","notEnded","registerDependency","dependent","s1","s2","merge","s","reducer","seed","newStream","scanMerge","tuples","tuple","idx"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,I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