Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | MailChimp for WordPress |
Version | 4.7.6 |
Comparing to | |
See all releases |
Code changes from version 4.7.5 to 4.7.6
- CHANGELOG.md +8 -1
- assets/js/admin.js +45 -39
- assets/js/admin.min.js +1 -1
- assets/js/admin.min.js.map +1 -1
- assets/js/forms-admin.js +176 -237
- assets/js/forms-admin.min.js +1 -1
CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
Changelog
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
#### 4.7.5 - Feb 10, 2020
|
5 |
|
6 |
-
- Add AMP compatibility to sign-up forms.
|
7 |
- Add settings key to WPML config so settings can easily by copied over to translated versions of a form.
|
8 |
- Optimize size & performance of JavaScript code, resulting in a file that is 40% smaller.
|
9 |
- Update CodeMirror to its latest version.
|
1 |
Changelog
|
2 |
=========
|
3 |
|
4 |
+
#### 4.7.6 - Apr 9, 2020
|
5 |
+
|
6 |
+
- Update JS dependencies to their latest versions.
|
7 |
+
- Check if className is of type string, fixes a console warning when clicking inside a SVG element.
|
8 |
+
- Minor improvements to the AMP implementation to address harmless validation warnings.
|
9 |
+
|
10 |
+
|
11 |
#### 4.7.5 - Feb 10, 2020
|
12 |
|
13 |
+
- Add AMP compatibility to sign-up forms, thanks to Claudiu Lodromanean. This uses the [official AMP plugin for WordPress](https://amp-wp.org).
|
14 |
- Add settings key to WPML config so settings can easily by copied over to translated versions of a form.
|
15 |
- Optimize size & performance of JavaScript code, resulting in a file that is 40% smaller.
|
16 |
- Update CodeMirror to its latest version.
|
assets/js/admin.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
(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 |
-
|
3 |
|
4 |
var _tlite = _interopRequireDefault(require("tlite"));
|
5 |
|
6 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7 |
|
|
|
8 |
var tabs = require('./admin/tabs.js');
|
9 |
|
10 |
var settings = require('./admin/settings.js');
|
@@ -30,7 +31,7 @@ window.mc4wp.settings = settings;
|
|
30 |
window.mc4wp.tabs = tabs;
|
31 |
|
32 |
},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/list-overview.js":5,"./admin/settings.js":6,"./admin/show-if.js":7,"./admin/tabs.js":8,"tlite":35}],2:[function(require,module,exports){
|
33 |
-
|
34 |
|
35 |
function validate(evt) {
|
36 |
var node = document.createElement('p');
|
@@ -53,11 +54,9 @@ if (field) {
|
|
53 |
}
|
54 |
|
55 |
},{}],3:[function(require,module,exports){
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
helpers.debounce = function (func, wait, immediate) {
|
61 |
var timeout;
|
62 |
return function () {
|
63 |
var context = this;
|
@@ -70,12 +69,14 @@ helpers.debounce = function (func, wait, immediate) {
|
|
70 |
}, wait);
|
71 |
if (callNow) func.apply(context, args);
|
72 |
};
|
73 |
-
}
|
74 |
|
75 |
-
module.exports =
|
|
|
|
|
76 |
|
77 |
},{}],4:[function(require,module,exports){
|
78 |
-
|
79 |
|
80 |
var config = window.mc4wp_vars;
|
81 |
var i18n = window.mc4wp_vars.i18n;
|
@@ -141,7 +142,7 @@ if (mount) {
|
|
141 |
}
|
142 |
|
143 |
},{"mithril":13}],5:[function(require,module,exports){
|
144 |
-
|
145 |
|
146 |
var ajaxurl = window.mc4wp_vars.ajaxurl;
|
147 |
|
@@ -202,7 +203,7 @@ if (table) {
|
|
202 |
}
|
203 |
|
204 |
},{"mithril":13}],6:[function(require,module,exports){
|
205 |
-
|
206 |
|
207 |
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
208 |
|
@@ -270,7 +271,7 @@ module.exports = {
|
|
270 |
};
|
271 |
|
272 |
},{}],7:[function(require,module,exports){
|
273 |
-
|
274 |
|
275 |
var showIfElements = document.querySelectorAll('[data-showif]');
|
276 |
[].forEach.call(showIfElements, function (element) {
|
@@ -309,7 +310,7 @@ var showIfElements = document.querySelectorAll('[data-showif]');
|
|
309 |
});
|
310 |
|
311 |
},{}],8:[function(require,module,exports){
|
312 |
-
|
313 |
|
314 |
var URL = require('./url.js');
|
315 |
|
@@ -492,40 +493,45 @@ module.exports = {
|
|
492 |
};
|
493 |
|
494 |
},{"./url.js":9}],9:[function(require,module,exports){
|
495 |
-
|
496 |
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
var a = url.split('&');
|
501 |
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
}
|
506 |
-
|
507 |
-
var b = a[i].split('=');
|
508 |
-
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
509 |
}
|
510 |
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
var ret = [];
|
515 |
|
516 |
-
|
517 |
-
|
518 |
-
|
|
|
|
|
519 |
|
520 |
-
|
521 |
-
|
522 |
-
setParameter: function setParameter(url, key, value) {
|
523 |
-
var data = URL.parse(url);
|
524 |
-
data[key] = value;
|
525 |
-
return URL.build(data);
|
526 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
};
|
528 |
-
module.exports = URL;
|
529 |
|
530 |
},{}],10:[function(require,module,exports){
|
531 |
"use strict"
|
1 |
(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 |
var _tlite = _interopRequireDefault(require("tlite"));
|
5 |
|
6 |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7 |
|
8 |
+
// dependencies
|
9 |
var tabs = require('./admin/tabs.js');
|
10 |
|
11 |
var settings = require('./admin/settings.js');
|
31 |
window.mc4wp.tabs = tabs;
|
32 |
|
33 |
},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/list-overview.js":5,"./admin/settings.js":6,"./admin/show-if.js":7,"./admin/tabs.js":8,"tlite":35}],2:[function(require,module,exports){
|
34 |
+
"use strict";
|
35 |
|
36 |
function validate(evt) {
|
37 |
var node = document.createElement('p');
|
54 |
}
|
55 |
|
56 |
},{}],3:[function(require,module,exports){
|
57 |
+
"use strict";
|
58 |
|
59 |
+
function debounce(func, wait, immediate) {
|
|
|
|
|
60 |
var timeout;
|
61 |
return function () {
|
62 |
var context = this;
|
69 |
}, wait);
|
70 |
if (callNow) func.apply(context, args);
|
71 |
};
|
72 |
+
}
|
73 |
|
74 |
+
module.exports = {
|
75 |
+
debounce: debounce
|
76 |
+
};
|
77 |
|
78 |
},{}],4:[function(require,module,exports){
|
79 |
+
"use strict";
|
80 |
|
81 |
var config = window.mc4wp_vars;
|
82 |
var i18n = window.mc4wp_vars.i18n;
|
142 |
}
|
143 |
|
144 |
},{"mithril":13}],5:[function(require,module,exports){
|
145 |
+
"use strict";
|
146 |
|
147 |
var ajaxurl = window.mc4wp_vars.ajaxurl;
|
148 |
|
203 |
}
|
204 |
|
205 |
},{"mithril":13}],6:[function(require,module,exports){
|
206 |
+
"use strict";
|
207 |
|
208 |
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
209 |
|
271 |
};
|
272 |
|
273 |
},{}],7:[function(require,module,exports){
|
274 |
+
"use strict";
|
275 |
|
276 |
var showIfElements = document.querySelectorAll('[data-showif]');
|
277 |
[].forEach.call(showIfElements, function (element) {
|
310 |
});
|
311 |
|
312 |
},{}],8:[function(require,module,exports){
|
313 |
+
"use strict";
|
314 |
|
315 |
var URL = require('./url.js');
|
316 |
|
493 |
};
|
494 |
|
495 |
},{"./url.js":9}],9:[function(require,module,exports){
|
496 |
+
"use strict";
|
497 |
|
498 |
+
function parse(url) {
|
499 |
+
var query = {};
|
500 |
+
var a = url.split('&');
|
|
|
501 |
|
502 |
+
for (var i in a) {
|
503 |
+
if (!a.hasOwnProperty(i)) {
|
504 |
+
continue;
|
|
|
|
|
|
|
|
|
505 |
}
|
506 |
|
507 |
+
var b = a[i].split('=');
|
508 |
+
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);
|
509 |
+
}
|
|
|
510 |
|
511 |
+
return query;
|
512 |
+
}
|
513 |
+
|
514 |
+
function build(data) {
|
515 |
+
var ret = [];
|
516 |
|
517 |
+
for (var d in data) {
|
518 |
+
ret.push(d + '=' + encodeURIComponent(data[d]));
|
|
|
|
|
|
|
|
|
519 |
}
|
520 |
+
|
521 |
+
return ret.join('&');
|
522 |
+
}
|
523 |
+
|
524 |
+
function setParameter(url, key, value) {
|
525 |
+
var data = parse(url);
|
526 |
+
data[key] = value;
|
527 |
+
return build(data);
|
528 |
+
}
|
529 |
+
|
530 |
+
module.exports = {
|
531 |
+
parse: parse,
|
532 |
+
build: build,
|
533 |
+
setParameter: setParameter
|
534 |
};
|
|
|
535 |
|
536 |
},{}],10:[function(require,module,exports){
|
537 |
"use strict"
|
assets/js/admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function i(l,a,s){function u(t,e){if(!a[t]){if(!l[t]){var n="function"==typeof require&&require;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 o=a[t]={exports:{}};l[t][0].call(o.exports,function(e){return u(l[t][1][e]||e)},o,o.exports,i,l,a,s)}return a[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";var r,o=(r=e("tlite"))&&r.__esModule?r:{default:r};var i=e("./admin/tabs.js"),l=e("./admin/settings.js"),a=e("./admin/helpers.js");(0,o.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")}),e("./admin/list-fetcher.js"),e("./admin/fields/mailchimp-api-key.js"),e("./admin/list-overview.js"),e("./admin/show-if.js"),window.mc4wp=window.mc4wp||{},window.mc4wp.helpers=a,window.mc4wp.settings=l,window.mc4wp.tabs=i},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/list-overview.js":5,"./admin/settings.js":6,"./admin/show-if.js":7,"./admin/tabs.js":8,tlite:35}],2:[function(e,t,n){"use strict";var r=document.getElementById("mailchimp_api_key");r&&r.addEventListener("change",function(e){var t=document.createElement("p");t.className="help red",t.innerText=window.mc4wp_vars.i18n.invalid_api_key,r.nextElementSibling.innerText===t.innerText&&r.nextElementSibling.parentElement.removeChild(r.nextElementSibling),r.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)||r.parentElement.insertBefore(t,r.nextElementSibling)})},{}],3:[function(e,t,n){"use strict";var r={debounce:function(r,o,i){var l;return function(){var e=this,t=arguments,n=i&&!l;clearTimeout(l),l=setTimeout(function(){l=null,i||r.apply(e,t)},o),n&&r.apply(e,t)}}};t.exports=r},{}],4:[function(e,t,n){"use strict";var r=window.mc4wp_vars,o=window.mc4wp_vars.i18n,i=window.mc4wp_vars.ajaxurl,l=e("mithril"),a={working:!1,done:!1,success:!1};function s(e){e&&e.preventDefault(),a.working=!0,a.done=!1,l.request({method:"POST",url:i+"?action=mc4wp_renew_mailchimp_lists",timeout:6e5}).then(function(e){a.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}).catch(function(e){a.success=!1}).finally(function(e){a.working=!1,a.done=!0,l.redraw()})}var u=document.getElementById("mc4wp-list-fetcher");u&&(r.mailchimp.api_connected&&0===r.mailchimp.lists.length&&s(),l.mount(u,{view:function(){return l("form",{method:"POST",onsubmit:s.bind(this)},[l("p",[l("input",{type:"submit",value:a.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!a.working}),l.trust(" "),a.working?[l("span.mc4wp-loader","Loading..."),l.trust(" ")]:"",a.done?[a.success?l("em.help.green",o.fetching_mailchimp_lists_done):l("em.help.red",o.fetching_mailchimp_lists_error)]:""])])}}))},{mithril:13}],5:[function(e,t,n){"use strict";var i=window.mc4wp_vars.ajaxurl,l=e("mithril");function r(e){e.preventDefault();var t=e.target,n=t.parentElement.parentElement.nextElementSibling,r=t.getAttribute("data-list-id"),o=n.querySelector("div");"none"===n.style.display?(l.request({method:"GET",url:i+"?action=mc4wp_get_list_details&ids="+r}).then(function(e){l.render(o,function(e){return[l("h3","Merge fields"),l("table.widefat.striped",[l("thead",[l("tr",[l("th","Name"),l("th","Tag"),l("th","Type")])]),l("tbody",e.merge_fields.map(function(e){return l("tr",[l("td",[e.name,e.required&&l("span.red","*")]),l("td",[l("code",e.tag)]),l("td",[e.type," ",e.options&&e.options.date_format?"("+e.options.date_format+")":"",e.options&&e.options.choices?"("+e.options.choices.join(", ")+")":""])])}))]),0<e.interest_categories.length&&[l("h3","Interest Categories"),l("table.striped.widefat",[l("thead",[l("tr",[l("th","Name"),l("th","Type"),l("th","Interests")])]),l("tbody",e.interest_categories.map(function(t){return l("tr",[l("td",[l("strong",t.title),l("br"),l("br"),"ID: ",l("code",t.id)]),l("td",t.type),l("td",[l("div.row",{style:"margin-bottom: 4px;"},[l("div.col.col-3",[l("strong",{style:"display: block; border-bottom: 1px solid #eee;"},"Name")]),l("div.col.col-3",[l("strong",{style:"display: block; border-bottom: 1px solid #eee;"},"ID")])]),Object.keys(t.interests).map(function(e){return l("div.row.tiny-margin",[l("div.col.col-3",t.interests[e]),l("div.col.col-3",[l("code",{title:"Interest ID"},e)]),l("br.clearfix.clear.cf")])})])])}))])]]}(e.shift()))}),n.style.display=""):n.style.display="none"}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var o=document.getElementById("mc4wp-mailchimp-lists-overview");o&&o.addEventListener("click",function(e){e.target.matches(".mc4wp-mailchimp-list")&&r(e)})},{mithril:13}],6:[function(e,t,n){"use strict";function r(e){return(r="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)}var o=document.getElementById("mc4wp-admin").querySelectorAll(".mc4wp-list-input"),i=window.mc4wp_vars.mailchimp.lists,l=[],a={};function s(){return l=[],[].forEach.call(o,function(e){"boolean"==typeof e.checked&&!e.checked||"object"!==r(i[e.value])||l.push(i[e.value])}),function(){var e=document.querySelectorAll(".lists--only-selected > *");[].forEach.call(e,function(e){var t=0<function(t,n){return l.filter(function(e){return e[t]===n})}("id",e.getAttribute("data-list-id")).length;e.style.display=t?"":"none"})}(),function(e,t){a[e]=a[e]||[],a[e].forEach(function(e){return e.apply(null,t)})}("selectedLists.change",[l]),l}[].forEach.call(o,function(e){e.addEventListener("change",s)}),s(),t.exports={getSelectedLists:function(){return l},on:function(e,t){a[e]=a[e]||[],a[e].push(t)}}},{}],7:[function(e,t,n){"use strict";var r=document.querySelectorAll("[data-showif]");[].forEach.call(r,function(n){var r=JSON.parse(n.getAttribute("data-showif")),e=document.querySelectorAll('[name="'+r.element+'"]'),o=n.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===r.hide||r.hide;function t(){if("radio"!==this.type||this.checked){var e="checkbox"===this.type?this.checked:this.value,t=String(e)===String(r.value);i?(n.style.display=t?"":"none",n.style.visibility=t?"":"hidden"):n.style.opacity=t?"":"0.4",[].forEach.call(o,function(e){e.readOnly=!t})}}[].forEach.call(e,function(e){e.addEventListener("change",t),t.call(e)})})},{}],8:[function(e,t,n){"use strict";var i=e("./url.js"),o=document.getElementById("mc4wp-admin"),r=o.querySelectorAll(".tab"),l=o.querySelectorAll(".nav-tab"),a=o.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];return null}function c(e,t){if("string"==typeof e&&(e=u(e)),!e)return!1;void 0===t&&(t=!0),[].forEach.call(r,function(e){e.className=e.className.replace("tab-active",""),e.style.display=" none"}),[].forEach.call(l,function(e){e.className=e.className.replace("nav-tab-active","")}),[].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=i.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),a.value=n,"function"==typeof window.tb_remove&&window.tb_remove(),window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&window.mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function d(e){var t=e.target,n=t.getAttribute("data-tab");if(!n){var r=t.className.match(/nav-tab-(\w+)?/);r&&(n=r[1])}if(!n){var o=i.parse(t.href);if(!o.tab)return;n=o.tab}return!c(n)||(e.preventDefault(),e.returnValue=!1)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),[].forEach.call(r,function(e,t){var n=e.id.substring(4),r=e.querySelector("h2:first-of-type").textContent;s.push({id:n,title:r,element:e,nav:o.querySelectorAll(".nav-tab-"+n),open:function(){return c(n)}})}),[].forEach.call(l,function(e){return e.addEventListener("click",d)}),document.body.addEventListener("click",function(e){e.target.matches(".tab-link")&&d(e)}),function(){var e=s.filter(function(e){return null!==e.element.offsetParent}).shift();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)}),t.exports={open:c,get:u}},{"./url.js":9}],9:[function(e,t,n){"use strict";var o={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[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=o.parse(e);return r[t]=n,o.build(r)}};t.exports=o},{}],10:[function(e,t,n){"use strict";var s=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function l(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],s(o[e+1]),a)}catch(e){t.error(e)}n=!1}function a(){i||(i=!0,e(function(){i=!1,l()}))}return a.sync=l,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],a)),null!=t&&(o.push(e,t),r(e,s(t),a))},redraw:a}}},{"../render/vnode":29}],11:[function(e,t,n){(function(E){"use strict";var k=e("../render/vnode"),l=e("../render/hyperscript"),S=e("../promise/promise"),i=e("../pathname/build"),T=e("../pathname/parse"),_=e("../pathname/compileTemplate"),j=e("../pathname/assign"),A={};t.exports=function(d,p){var s;function m(e,t,n){if(e=i(e,t),null!=s){s();var r=n?n.state:null,o=n?n.title:null;n&&n.replace?d.history.replaceState(r,o,x.prefix+e):d.history.pushState(r,o,x.prefix+e)}else d.location.href=x.prefix+e}var h,v,y,g,w=A,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,u=0,c=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:_(e)}}),o="function"==typeof E?E:setTimeout,f=S.resolve(),i=!1;if((s=null)!=t){var l=T(t);if(!c.some(function(e){return e.check(l)}))throw new ReferenceError("Default route doesn't match any known routes")}function a(){i=!1;var e=d.location.hash;"#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e));var l=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length),a=T(l);function s(){if(l===t)throw new Error("Could not resolve default route "+t);m(t,null,{replace:!0})}j(a.params,d.history.state),function t(n){for(;n<c.length;n++)if(c[n].check(a)){var r=c[n].component,e=c[n].route,o=r,i=g=function(e){if(i===g){if(e===b)return t(n+1);h=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=a.params,y=l,g=null,w=r.render?r:null,2===u?p.redraw():(u=2,p.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(a.params,l,e)}).then(i,s):i("div"))}s()}(0)}return s=function(){i||(i=!0,o(a))},"function"==typeof d.history.pushState?(r=function(){d.removeEventListener("popstate",s,!1)},d.addEventListener("popstate",s,!1)):"#"===x.prefix[0]&&(s=null,r=function(){d.removeEventListener("hashchange",a,!1)},d.addEventListener("hashchange",a,!1)),p.mount(e,{onbeforeupdate:function(){return!(!(u=u?2:1)||A===w)},oncreate:a,onremove:r,view:function(){if(u&&A!==w){var e=[k(h,v.key,v)];return w&&(e=w.render(e[0])),e}}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,m(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={};j(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null;var i=l(e.attrs.selector||"a",t,e.children);return(i.attrs.disabled=Boolean(i.attrs.disabled))?(i.attrs.href=null,i.attrs["aria-disabled"]="true",i.attrs.onclick=null):(n=i.attrs.onclick,r=i.attrs.href,i.attrs.href=x.prefix+r,i.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null==n||"object"!=typeof n||"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),i}},x.param=function(e){return v&&null!=e?v[e]:v},x}}).call(this,e("timers").setImmediate)},{"../pathname/assign":15,"../pathname/build":16,"../pathname/compileTemplate":17,"../pathname/parse":18,"../promise/promise":20,"../render/hyperscript":25,"../render/vnode":29,timers:34}],12:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":24,"./render/hyperscript":25,"./render/trust":28}],13:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),l=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=l.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=l.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":12,"./mount-redraw":14,"./pathname/build":16,"./pathname/parse":18,"./promise/polyfill":19,"./querystring/build":21,"./querystring/parse":22,"./render":23,"./render/vnode":29,"./request":30,"./route":32}],14:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":10,"./render":23}],15:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],16:[function(e,t,n){"use strict";var h=e("../querystring/build"),v=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=t<0?o:t,l=e.slice(0,i),a={};v(a,r);var s=l.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete a[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))}),u=s.indexOf("?"),c=s.indexOf("#"),f=c<0?s.length:c,d=u<0?f:u,p=s.slice(0,d);0<=t&&(p+=e.slice(t,o)),0<=u&&(p+=(t<0?"?":"&")+s.slice(u,f));var m=h(a);return m&&(p+=(t<0&&u<0?"?":"&")+m),0<=n&&(p+=e.slice(n)),0<=c&&(p+=(n<0?"":"&")+s.slice(c)),p}},{"../querystring/build":21,"./assign":15}],17:[function(e,t,n){"use strict";var a=e("./parse");t.exports=function(e){var r=a(e),o=Object.keys(r.params),i=[],l=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return l.test(e.path);var n=l.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":18}],18:[function(e,t,n){"use strict";var l=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),r=n<0?e.length:n,o=t<0?r:t,i=e.slice(0,o).replace(/\/{2,}/g,"/");return i?("/"!==i[0]&&(i="/"+i),1<i.length&&"/"===i[i.length-1]&&(i=i.slice(0,-1))):i="/",{path:i,params:t<0?{}:l(e.slice(t+1,r))}}},{"../querystring/parse":22}],19:[function(e,t,n){(function(n){"use strict";var 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 i=this,l=[],a=[],o=t(l,!0),s=t(a,!1),u=i._instance={resolvers:l,rejectors:a},c="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,u.state=o,u.retry=function(){t(n)}});else{if(n===i)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(o),r)}catch(e){r(e)}}f(e)};d.prototype.then=function(e,t){var o,i,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new d(function(e,t){o=e,i=t});return n(e,l.resolvers,o,!0),n(t,l.rejectors,i,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.prototype.finally=function(t){return this.then(function(e){return d.resolve(t()).then(function(){return e})},function(e){return d.resolve(t()).then(function(){return d.reject(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(a){return new d(function(n,r){var o=a.length,i=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){i++,l[t]=e,i===o&&n(l)}null==a[t]||"object"!=typeof a[t]&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[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)})},t.exports=d}).call(this,e("timers").setImmediate)},{timers:34}],20:[function(n,r,e){(function(e){"use strict";var t=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=t:window.Promise.prototype.finally||(window.Promise.prototype.finally=t.prototype.finally),r.exports=window.Promise):void 0!==e?(void 0===e.Promise?e.Promise=t:e.Promise.prototype.finally||(e.Promise.prototype.finally=t.prototype.finally),r.exports=e.Promise):r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":19}],21:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)o(t,e[t]);return r.join("&");function o(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)o(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)o(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}}},{}],22:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),l=decodeURIComponent(i[0]),a=2===i.length?decodeURIComponent(i[1]):"";"true"===a?a=!0:"false"===a&&(a=!1);var s=l.split(/\]\[?|\[/),u=r;-1<l.indexOf("[")&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],p=""==d||!isNaN(parseInt(d,10));if(""===f)null==n[l=s.slice(0,c).join()]&&(n[l]=Array.isArray(u)?u.length:0),f=n[l]++;else if("__proto__"===f)break;if(c===s.length-1)u[f]=a;else{var m=Object.getOwnPropertyDescriptor(u,f);null!=m&&(m=m.value),null==m&&(u[f]=m=p?[]:{}),u=m}}}return r}},{}],23:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":27}],24:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":29,"./hyperscriptVnode":26}],25:[function(e,t,n){"use strict";var s=e("../render/vnode"),r=e("./hyperscriptVnode"),u=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,c={},f={}.hasOwnProperty;function d(e){for(var t in e)if(f.call(e,t))return!1;return!0}t.exports=function(e){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.");var t=r.apply(1,arguments);return"string"==typeof e&&(t.children=s.normalizeChildren(t.children),"["!==e)?function(e,t){var n=t.attrs,r=s.normalizeChildren(t.children),o=f.call(n,"class"),i=o?n.class:n.className;if(t.tag=e.tag,t.attrs=null,t.children=void 0,!d(e.attrs)&&!d(n)){var l={};for(var a in n)f.call(n,a)&&(l[a]=n[a]);n=l}for(var a in e.attrs)f.call(e.attrs,a)&&"className"!==a&&!f.call(n,a)&&(n[a]=e.attrs[a]);for(var a in null==i&&null==e.attrs.className||(n.className=null!=i?null!=e.attrs.className?String(e.attrs.className)+" "+String(i):i:null!=e.attrs.className?e.attrs.className:null),o&&(n.class=null),n)if(f.call(n,a)&&"key"!==a){t.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?t.text=r[0].children:t.children=r,t}(c[e]||function(e){for(var t,n="div",r=[],o={};t=u.exec(e);){var i=t[1],l=t[2];if(""===i&&""!==l)n=l;else if("#"===i)o.id=l;else if("."===i)r.push(l);else if("["===t[3][0]){var a=t[6];a=a&&a.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(a):o[t[4]]=""===a?a:a||!0}}return 0<r.length&&(o.className=r.join(" ")),c[e]={tag:n,attrs:o}}(e),t):(t.tag=e,t)}},{"../render/vnode":29,"./hyperscriptVnode":26}],26:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":29}],27:[function(e,t,n){"use strict";var $=e("../render/vnode");t.exports=function(e){var s,c=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function f(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function u(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function d(e){var t=e.state;try{return this.apply(t,arguments)}finally{u(e,t)}}function p(){try{return c.activeElement}catch(e){return null}}function A(e,t,n,r,o,i,l){for(var a=n;a<r;a++){var s=t[a];null!=s&&C(e,s,o,l,i)}}function C(e,t,n,r,o){var i=t.tag;if("string"==typeof i)switch(t.state={},null!=t.attrs&&_(t.attrs,t,n),i){case"#":!function(e,t,n){t.dom=c.createTextNode(t.children),v(e,t.dom,n)}(e,t,o);break;case"<":a(e,t,r,o);break;case"[":!function(e,t,n,r,o){var i=c.createDocumentFragment();if(null!=t.children){var l=t.children;A(i,l,0,l.length,n,null,r)}t.dom=i.firstChild,t.domSize=i.childNodes.length,v(e,i,o)}(e,t,n,r,o);break;default:!function(e,t,n,r,o){var i=t.tag,l=t.attrs,a=l&&l.is,s=(r=f(t)||r)?a?c.createElementNS(r,i,{is:a}):c.createElementNS(r,i):a?c.createElement(i,{is:a}):c.createElement(i);t.dom=s,null!=l&&function(e,t,n){for(var r in t)x(e,r,null,t[r],n)}(t,l,r);if(v(e,s,o),!y(t)&&(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children)){var u=t.children;A(s,u,0,u.length,n,null,r),"select"===t.tag&&null!=l&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&x(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,l)}}(e,t,n,r,o)}else!function(e,t,n,r,o){(function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}_(e.state,e,t),null!=e.attrs&&_(e.attrs,e,t);if(e.instance=$.normalize(d.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(t,n),null!=t.instance?(C(e,t.instance,n,r,o),t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0):t.domSize=0}(e,t,n,r,o)}var m={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function a(e,t,n,r){var o=t.children.match(/^\s*?<(\w+)/im)||[],i=c.createElement(m[o[1]]||"div");"http://www.w3.org/2000/svg"===n?(i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length,t.instance=[];for(var l,a=c.createDocumentFragment();l=i.firstChild;)t.instance.push(l),a.appendChild(l);v(e,a,r)}function h(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)A(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)z(e,t,0,t.length);else{var l=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,s=0,u=0;if(!l)for(;u<t.length&&null==t[u];)u++;if(!a)for(;s<n.length&&null==n[s];)s++;if(null===a&&null==l)return;if(l!=a)z(e,t,u,t.length),A(e,n,s,n.length,r,o,i);else if(a){for(var c,f,d,p,m,h=t.length-1,v=n.length-1;u<=h&&s<=v&&(d=t[h],p=n[v],d.key===p.key);)d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),h--,v--;for(;u<=h&&s<=v&&(c=t[u],f=n[s],c.key===f.key);)u++,s++,c!==f&&N(e,c,f,r,L(t,u,o),i);for(;u<=h&&s<=v&&s!==v&&c.key===p.key&&d.key===f.key;)q(e,d,m=L(t,u,o)),d!==f&&N(e,d,f,r,m,i),++s<=--v&&q(e,c,o),c!==p&&N(e,c,p,r,o,i),null!=p.dom&&(o=p.dom),u++,d=t[--h],p=n[v],c=t[u],f=n[s];for(;u<=h&&s<=v&&d.key===p.key;)d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),v--,d=t[--h],p=n[v];if(v<s)z(e,t,u,h+1);else if(h<u)A(e,n,s,v+1,r,o,i);else{var y,g,w=o,b=v-s+1,x=new Array(b),E=0,k=0,S=2147483647,T=0;for(k=0;k<b;k++)x[k]=-1;for(k=v;s<=k;k--){null==y&&(y=I(t,u,h+1));var _=y[(p=n[k]).key];null!=_&&(S=_<S?_:-1,d=t[x[k-s]=_],t[_]=null,d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),T++)}if(o=w,T!==h-u+1&&z(e,t,u,h+1),0===T)A(e,n,s,v+1,r,o,i);else if(-1===S)for(E=(g=function(e){var t=[0],n=0,r=0,o=0,i=O.length=e.length;for(o=0;o<i;o++)O[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var l=t[t.length-1];if(e[l]<e[o])O[o]=l,t.push(o);else{for(n=0,r=t.length-1;n<r;){var a=(n>>>1)+(r>>>1)+(n&r&1);e[t[a]]<e[o]?n=1+a:r=a}e[o]<e[t[n]]&&(0<n&&(O[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=O[r];return O.length=0,t}(x)).length-1,k=v;s<=k;k--)f=n[k],-1===x[k-s]?C(e,f,r,i,o):g[E]===k-s?E--:q(e,f,o),null!=f.dom&&(o=n[k].dom);else for(k=v;s<=k;k--)f=n[k],-1===x[k-s]&&C(e,f,r,i,o),null!=f.dom&&(o=n[k].dom)}}else{var j=t.length<n.length?t.length:n.length;for(s=s<u?s:u;s<j;s++)(c=t[s])===(f=n[s])||null==c&&null==f||(null==c?C(e,f,r,i,L(t,s+1,o)):null==f?P(e,c):N(e,c,f,r,L(t,s+1,o),i));t.length>j&&z(e,t,s,t.length),n.length>j&&A(e,n,s,n.length,r,o,i)}}}function N(e,t,n,r,o,i){var l=t.tag;if(l===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=d.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=d.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof l)switch(null!=n.attrs&&j(n.attrs,n,r),l){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":!function(e,t,n,r,o){t.children!==n.children?(g(e,t),a(e,n,r,o)):(n.dom=t.dom,n.domSize=t.domSize,n.instance=t.instance)}(e,t,n,i,o);break;case"[":!function(e,t,n,r,o,i){h(e,t.children,n.children,r,o,i);var l=0,a=n.children;if((n.dom=null)!=a){for(var s=0;s<a.length;s++){var u=a[s];null!=u&&null!=u.dom&&(null==n.dom&&(n.dom=u.dom),l+=u.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,r,o,i);break;default:!function(e,t,n,r){var o=t.dom=e.dom;r=f(t)||r,"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 o in n)x(e,o,t&&t[o],n[o],r);var i;if(null!=t)for(var o in t)null==(i=t[o])||null!=n&&null!=n[o]||E(e,o,i,r)})(t,e.attrs,t.attrs,r),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=[$("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),h(o,e.children,t.children,n,null,r)))}(t,n,r,i)}else!function(e,t,n,r,o,i){if(n.instance=$.normalize(d.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");j(n.state,n,r),null!=n.attrs&&j(n.attrs,n,r);null!=n.instance?(null==t.instance?C(e,n.instance,r,i,o):N(e,t.instance,n.instance,r,o,i),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(P(e,t.instance),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,o,i)}else P(e,t),C(e,n,r,i,o)}function I(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];if(null!=o){var i=o.key;null!=i&&(r[i]=t)}}return r}var O=[];function L(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function q(e,t,n){var r=c.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(var o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),v(e,r,n)}function v(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function y(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;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");return!0}function z(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&P(e,i)}}function P(e,t){var n,r,o,i=0,l=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=d.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(i=1,n=o);t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=d.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(i|=2,r=o);if(u(t,l),i){if(null!=n){var a=function(){1&i&&((i&=2)||s())};n.then(a,a)}if(null!=r){a=function(){2&i&&((i&=1)||s())};r.then(a,a)}}else b(t),w(e,t);function s(){u(t,l),b(t),w(e,t)}}function g(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function w(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)g(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&w(e,r)}}break}}function b(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&d.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&d.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&b(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&b(r)}}}function x(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!i(t)&&(n!==r||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===p()||"option"===e.tag&&e.dom.parentNode===c.activeElement}(e,t)||"object"==typeof r)){if("o"===t[0]&&"n"===t[1])return T(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)S(e.dom,n,r);else if(l(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===p())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function E(e,t,n,r){if("key"!==t&&"is"!==t&&null!=n&&!i(t))if("o"!==t[0]||"n"!==t[1]||i(t))if("style"===t)S(e.dom,n,null);else if(!l(e,t,r)||"className"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===p())||"input"===e.tag&&"type"===t){var o=t.indexOf(":");-1!==o&&(t=t.slice(o+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null;else T(e,t,void 0)}function i(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function l(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function k(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function S(e,t,n){if(t===n);else if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(o=n[r])&&e.style.setProperty(k(r),String(o))}else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(k(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(k(r))}}function o(){this._=s}function T(e,t,n){if(null!=e.events){if(e.events[t]===n)return;null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}else null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function _(e,t,n){"function"==typeof e.oninit&&d.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(d.bind(e.oncreate,t))}function j(e,t,n){"function"==typeof e.onupdate&&n.push(d.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=p(),i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),t=$.normalizeChildren(Array.isArray(t)?t:[t]);var l=s;try{s="function"==typeof n?n:void 0,h(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{s=l}e.vnodes=t,null!=o&&p()!==o&&"function"==typeof o.focus&&o.focus();for(var a=0;a<r.length;a++)r[a]()}}},{"../render/vnode":29}],28:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return null==e&&(e=""),r("<",void 0,void 0,e,void 0,void 0)}},{"../render/vnode":29}],29:[function(e,t,n){"use strict";function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],30:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":14,"./promise/promise":20,"./request/request":31}],31:[function(e,t,n){"use strict";var u=e("../pathname/build");t.exports=function(m,n,a){var l=0;function s(e){return new n(e)}function e(l){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){l(u(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof a&&a()}return function t(n){var r=n.then;n.constructor=s;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function h(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return!0;return!1}return s.prototype=n.prototype,s.__proto__=n,{request:e(function(i,l,a,s){var e,t=null!=l.method?l.method.toUpperCase():"GET",n=l.body,r=!(null!=l.serialize&&l.serialize!==JSON.serialize||n instanceof m.FormData),u=l.responseType||("function"==typeof l.extract?"":"json"),o=new m.XMLHttpRequest,c=!1,f=o,d=o.abort;for(var p in o.abort=function(){c=!0,d.call(this)},o.open(t,i,!1!==l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),r&&null!=n&&!h(l,/^content-type$/i)&&o.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof l.deserialize||h(l,/^accept$/i)||o.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(o.withCredentials=l.withCredentials),l.timeout&&(o.timeout=l.timeout),o.responseType=u,l.headers)!{}.hasOwnProperty.call(l.headers,p)||o.setRequestHeader(p,l.headers[p]);o.onreadystatechange=function(e){if(!c&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===u?e.target.responseType||"function"==typeof l.extract||(r=JSON.parse(e.target.responseText)):u&&"text"!==u||null==r&&(r=e.target.responseText),"function"==typeof l.extract?(r=l.extract(e.target,l),n=!0):"function"==typeof l.deserialize&&(r=l.deserialize(r)),n)a(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,s(o)}}catch(e){s(e)}},"function"==typeof l.config&&(o=l.config(o,l,i)||o)!==f&&(e=o.abort,o.abort=function(){c=!0,e.call(this)}),null==n?o.send():"function"==typeof l.serialize?o.send(l.serialize(n)):n instanceof m.FormData?o.send(n):o.send(JSON.stringify(n))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+l++,i=m.document.createElement("script");m[o]=function(e){delete m[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete m[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),m.document.documentElement.appendChild(i)})}}},{"../pathname/build":16}],32:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":11,"./mount-redraw":14}],33:[function(e,t,n){var r,o,i=t.exports={};function l(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===l||!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:l}catch(e){r=l}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var u,c=[],f=!1,d=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&m())}function m(){if(!f){var e=s(p);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(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}i.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 h(e,t)),1!==c.length||f||s(m)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],34:[function(s,e,u){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;function a(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},a.prototype.unref=a.prototype.ref=function(){},a.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=l++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof t?t:function(e){delete i[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":33,timers:34}],35:[function(e,t,n){function f(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);(n=n||(t=t.parentElement)&&r(t))&&f.show(t,n,!0)})}f.show=function(e,t,n){var r,o,i,l,a,s="data-tlite";function u(){f.hide(r,!0)}function c(){i=i||function(a,e,t){var s=document.createElement("span"),n=t.grav||a.getAttribute("data-tlite")||"n";s.innerHTML=e,a.appendChild(s);var u=n[0]||"",c=n[1]||"";function r(){s.className="tlite tlite-"+u+c;var e=a.offsetTop,t=a.offsetLeft;s.offsetParent===a&&(e=t=0);var n=a.offsetWidth,r=a.offsetHeight,o=s.offsetHeight,i=s.offsetWidth,l=t+n/2;s.style.top=("s"===u?e-o-10:"n"===u?e+r+10:e+r/2-o/2)+"px",s.style.left=("w"===c?t:"e"===c?t+n-i:"w"===u?t+n+10:"e"===u?t-i-10:l-i/2)+"px"}r();var o=s.getBoundingClientRect();"s"===u&&o.top<0?(u="n",r()):"n"===u&&o.bottom>window.innerHeight?(u="s",r()):"e"===u&&o.left<0?(u="w",r()):"w"===u&&o.right>window.innerWidth&&(u="e",r());return s.className+=" tlite-visible",s}(r,a,o)}t=t||{},(e.tooltip||(o=t,(r=e).addEventListener("mousedown",u),r.addEventListener("mouseleave",u),r.tooltip={show:function(){a=r.title||r.getAttribute(s)||a,r.title="",r.setAttribute(s,""),a&&!l&&(l=setTimeout(c,n?150:1))},hide:function(e){if(n===e){l=clearTimeout(l);var t=i&&i.parentNode;t&&t.removeChild(i),i=void 0}}})).show()},f.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=f)},{}]},{},[1]);
|
2 |
//# sourceMappingURL=admin.min.js.map
|
1 |
+
!function i(l,a,s){function c(t,e){if(!a[t]){if(!l[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=a[t]={exports:{}};l[t][0].call(o.exports,function(e){return c(l[t][1][e]||e)},o,o.exports,i,l,a,s)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){"use strict";var r,o=(r=e("tlite"))&&r.__esModule?r:{default:r};var i=e("./admin/tabs.js"),l=e("./admin/settings.js"),a=e("./admin/helpers.js");(0,o.default)(function(e){return-1<e.className.indexOf("mc4wp-tooltip")}),e("./admin/list-fetcher.js"),e("./admin/fields/mailchimp-api-key.js"),e("./admin/list-overview.js"),e("./admin/show-if.js"),window.mc4wp=window.mc4wp||{},window.mc4wp.helpers=a,window.mc4wp.settings=l,window.mc4wp.tabs=i},{"./admin/fields/mailchimp-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/list-overview.js":5,"./admin/settings.js":6,"./admin/show-if.js":7,"./admin/tabs.js":8,tlite:35}],2:[function(e,t,n){"use strict";var r=document.getElementById("mailchimp_api_key");r&&r.addEventListener("change",function(e){var t=document.createElement("p");t.className="help red",t.innerText=window.mc4wp_vars.i18n.invalid_api_key,r.nextElementSibling.innerText===t.innerText&&r.nextElementSibling.parentElement.removeChild(r.nextElementSibling),r.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)||r.parentElement.insertBefore(t,r.nextElementSibling)})},{}],3:[function(e,t,n){"use strict";t.exports={debounce:function(r,o,i){var l;return function(){var e=this,t=arguments,n=i&&!l;clearTimeout(l),l=setTimeout(function(){l=null,i||r.apply(e,t)},o),n&&r.apply(e,t)}}}},{}],4:[function(e,t,n){"use strict";var r=window.mc4wp_vars,o=window.mc4wp_vars.i18n,i=window.mc4wp_vars.ajaxurl,l=e("mithril"),a={working:!1,done:!1,success:!1};function s(e){e&&e.preventDefault(),a.working=!0,a.done=!1,l.request({method:"POST",url:i+"?action=mc4wp_renew_mailchimp_lists",timeout:6e5}).then(function(e){a.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}).catch(function(e){a.success=!1}).finally(function(e){a.working=!1,a.done=!0,l.redraw()})}var c=document.getElementById("mc4wp-list-fetcher");c&&(r.mailchimp.api_connected&&0===r.mailchimp.lists.length&&s(),l.mount(c,{view:function(){return l("form",{method:"POST",onsubmit:s.bind(this)},[l("p",[l("input",{type:"submit",value:a.working?o.fetching_mailchimp_lists:o.renew_mailchimp_lists,className:"button",disabled:!!a.working}),l.trust(" "),a.working?[l("span.mc4wp-loader","Loading..."),l.trust(" ")]:"",a.done?[a.success?l("em.help.green",o.fetching_mailchimp_lists_done):l("em.help.red",o.fetching_mailchimp_lists_error)]:""])])}}))},{mithril:13}],5:[function(e,t,n){"use strict";var i=window.mc4wp_vars.ajaxurl,l=e("mithril");function r(e){e.preventDefault();var t=e.target,n=t.parentElement.parentElement.nextElementSibling,r=t.getAttribute("data-list-id"),o=n.querySelector("div");"none"===n.style.display?(l.request({method:"GET",url:i+"?action=mc4wp_get_list_details&ids="+r}).then(function(e){l.render(o,function(e){return[l("h3","Merge fields"),l("table.widefat.striped",[l("thead",[l("tr",[l("th","Name"),l("th","Tag"),l("th","Type")])]),l("tbody",e.merge_fields.map(function(e){return l("tr",[l("td",[e.name,e.required&&l("span.red","*")]),l("td",[l("code",e.tag)]),l("td",[e.type," ",e.options&&e.options.date_format?"("+e.options.date_format+")":"",e.options&&e.options.choices?"("+e.options.choices.join(", ")+")":""])])}))]),0<e.interest_categories.length&&[l("h3","Interest Categories"),l("table.striped.widefat",[l("thead",[l("tr",[l("th","Name"),l("th","Type"),l("th","Interests")])]),l("tbody",e.interest_categories.map(function(t){return l("tr",[l("td",[l("strong",t.title),l("br"),l("br"),"ID: ",l("code",t.id)]),l("td",t.type),l("td",[l("div.row",{style:"margin-bottom: 4px;"},[l("div.col.col-3",[l("strong",{style:"display: block; border-bottom: 1px solid #eee;"},"Name")]),l("div.col.col-3",[l("strong",{style:"display: block; border-bottom: 1px solid #eee;"},"ID")])]),Object.keys(t.interests).map(function(e){return l("div.row.tiny-margin",[l("div.col.col-3",t.interests[e]),l("div.col.col-3",[l("code",{title:"Interest ID"},e)]),l("br.clearfix.clear.cf")])})])])}))])]]}(e.shift()))}),n.style.display=""):n.style.display="none"}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var o=document.getElementById("mc4wp-mailchimp-lists-overview");o&&o.addEventListener("click",function(e){e.target.matches(".mc4wp-mailchimp-list")&&r(e)})},{mithril:13}],6:[function(e,t,n){"use strict";function r(e){return(r="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)}var o=document.getElementById("mc4wp-admin").querySelectorAll(".mc4wp-list-input"),i=window.mc4wp_vars.mailchimp.lists,l=[],a={};function s(){return l=[],[].forEach.call(o,function(e){"boolean"==typeof e.checked&&!e.checked||"object"!==r(i[e.value])||l.push(i[e.value])}),function(){var e=document.querySelectorAll(".lists--only-selected > *");[].forEach.call(e,function(e){var t=0<function(t,n){return l.filter(function(e){return e[t]===n})}("id",e.getAttribute("data-list-id")).length;e.style.display=t?"":"none"})}(),function(e,t){a[e]=a[e]||[],a[e].forEach(function(e){return e.apply(null,t)})}("selectedLists.change",[l]),l}[].forEach.call(o,function(e){e.addEventListener("change",s)}),s(),t.exports={getSelectedLists:function(){return l},on:function(e,t){a[e]=a[e]||[],a[e].push(t)}}},{}],7:[function(e,t,n){"use strict";var r=document.querySelectorAll("[data-showif]");[].forEach.call(r,function(n){var r=JSON.parse(n.getAttribute("data-showif")),e=document.querySelectorAll('[name="'+r.element+'"]'),o=n.querySelectorAll("input,select,textarea:not([readonly])"),i=void 0===r.hide||r.hide;function t(){if("radio"!==this.type||this.checked){var e="checkbox"===this.type?this.checked:this.value,t=String(e)===String(r.value);i?(n.style.display=t?"":"none",n.style.visibility=t?"":"hidden"):n.style.opacity=t?"":"0.4",[].forEach.call(o,function(e){e.readOnly=!t})}}[].forEach.call(e,function(e){e.addEventListener("change",t),t.call(e)})})},{}],8:[function(e,t,n){"use strict";var i=e("./url.js"),o=document.getElementById("mc4wp-admin"),r=o.querySelectorAll(".tab"),l=o.querySelectorAll(".nav-tab"),a=o.querySelector('input[name="_wp_http_referer"]'),s=[];function c(e){for(var t=0;t<s.length;t++)if(s[t].id===e)return s[t];return null}function u(e,t){if("string"==typeof e&&(e=c(e)),!e)return!1;void 0===t&&(t=!0),[].forEach.call(r,function(e){e.className=e.className.replace("tab-active",""),e.style.display=" none"}),[].forEach.call(l,function(e){e.className=e.className.replace("nav-tab-active","")}),[].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=i.setParameter(window.location.href,"tab",e.id);return history.pushState&&t&&history.pushState(e.id,"",n),f(e),a.value=n,"function"==typeof window.tb_remove&&window.tb_remove(),window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&window.mc4wp.forms.editor.refresh(),!0}function f(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function d(e){var t=e.target,n=t.getAttribute("data-tab");if(!n){var r=t.className.match(/nav-tab-(\w+)?/);r&&(n=r[1])}if(!n){var o=i.parse(t.href);if(!o.tab)return;n=o.tab}return!u(n)||(e.preventDefault(),e.returnValue=!1)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),[].forEach.call(r,function(e,t){var n=e.id.substring(4),r=e.querySelector("h2:first-of-type").textContent;s.push({id:n,title:r,element:e,nav:o.querySelectorAll(".nav-tab-"+n),open:function(){return u(n)}})}),[].forEach.call(l,function(e){return e.addEventListener("click",d)}),document.body.addEventListener("click",function(e){e.target.matches(".tab-link")&&d(e)}),function(){var e=s.filter(function(e){return null!==e.element.offsetParent}).shift();if(e){var t=c(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||u(e.state,!1)}),t.exports={open:u,get:c}},{"./url.js":9}],9:[function(e,t,n){"use strict";function o(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}function i(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")}t.exports={parse:o,build:i,setParameter:function(e,t,n){var r=o(e);return r[t]=n,i(r)}}},{}],10:[function(e,t,n){"use strict";var s=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function l(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],s(o[e+1]),a)}catch(e){t.error(e)}n=!1}function a(){i||(i=!0,e(function(){i=!1,l()}))}return a.sync=l,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],a)),null!=t&&(o.push(e,t),r(e,s(t),a))},redraw:a}}},{"../render/vnode":29}],11:[function(e,t,n){(function(E){"use strict";var k=e("../render/vnode"),l=e("../render/hyperscript"),S=e("../promise/promise"),i=e("../pathname/build"),T=e("../pathname/parse"),_=e("../pathname/compileTemplate"),j=e("../pathname/assign"),A={};t.exports=function(d,p){var s;function m(e,t,n){if(e=i(e,t),null!=s){s();var r=n?n.state:null,o=n?n.title:null;n&&n.replace?d.history.replaceState(r,o,x.prefix+e):d.history.pushState(r,o,x.prefix+e)}else d.location.href=x.prefix+e}var h,v,y,g,w=A,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,c=0,u=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:_(e)}}),o="function"==typeof E?E:setTimeout,f=S.resolve(),i=!1;if((s=null)!=t){var l=T(t);if(!u.some(function(e){return e.check(l)}))throw new ReferenceError("Default route doesn't match any known routes")}function a(){i=!1;var e=d.location.hash;"#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e));var l=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length),a=T(l);function s(){if(l===t)throw new Error("Could not resolve default route "+t);m(t,null,{replace:!0})}j(a.params,d.history.state),function t(n){for(;n<u.length;n++)if(u[n].check(a)){var r=u[n].component,e=u[n].route,o=r,i=g=function(e){if(i===g){if(e===b)return t(n+1);h=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=a.params,y=l,g=null,w=r.render?r:null,2===c?p.redraw():(c=2,p.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(a.params,l,e)}).then(i,s):i("div"))}s()}(0)}return s=function(){i||(i=!0,o(a))},"function"==typeof d.history.pushState?(r=function(){d.removeEventListener("popstate",s,!1)},d.addEventListener("popstate",s,!1)):"#"===x.prefix[0]&&(s=null,r=function(){d.removeEventListener("hashchange",a,!1)},d.addEventListener("hashchange",a,!1)),p.mount(e,{onbeforeupdate:function(){return!(!(c=c?2:1)||A===w)},oncreate:a,onremove:r,view:function(){if(c&&A!==w){var e=[k(h,v.key,v)];return w&&(e=w.render(e[0])),e}}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,m(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={};j(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null;var i=l(e.attrs.selector||"a",t,e.children);return(i.attrs.disabled=Boolean(i.attrs.disabled))?(i.attrs.href=null,i.attrs["aria-disabled"]="true",i.attrs.onclick=null):(n=i.attrs.onclick,r=i.attrs.href,i.attrs.href=x.prefix+r,i.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null==n||"object"!=typeof n||"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),i}},x.param=function(e){return v&&null!=e?v[e]:v},x}}).call(this,e("timers").setImmediate)},{"../pathname/assign":15,"../pathname/build":16,"../pathname/compileTemplate":17,"../pathname/parse":18,"../promise/promise":20,"../render/hyperscript":25,"../render/vnode":29,timers:34}],12:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":24,"./render/hyperscript":25,"./render/trust":28}],13:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),l=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=l.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=l.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":12,"./mount-redraw":14,"./pathname/build":16,"./pathname/parse":18,"./promise/polyfill":19,"./querystring/build":21,"./querystring/parse":22,"./render":23,"./render/vnode":29,"./request":30,"./route":32}],14:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":10,"./render":23}],15:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],16:[function(e,t,n){"use strict";var h=e("../querystring/build"),v=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=t<0?o:t,l=e.slice(0,i),a={};v(a,r);var s=l.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete a[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))}),c=s.indexOf("?"),u=s.indexOf("#"),f=u<0?s.length:u,d=c<0?f:c,p=s.slice(0,d);0<=t&&(p+=e.slice(t,o)),0<=c&&(p+=(t<0?"?":"&")+s.slice(c,f));var m=h(a);return m&&(p+=(t<0&&c<0?"?":"&")+m),0<=n&&(p+=e.slice(n)),0<=u&&(p+=(n<0?"":"&")+s.slice(u)),p}},{"../querystring/build":21,"./assign":15}],17:[function(e,t,n){"use strict";var a=e("./parse");t.exports=function(e){var r=a(e),o=Object.keys(r.params),i=[],l=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return l.test(e.path);var n=l.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":18}],18:[function(e,t,n){"use strict";var l=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),r=n<0?e.length:n,o=t<0?r:t,i=e.slice(0,o).replace(/\/{2,}/g,"/");return i?("/"!==i[0]&&(i="/"+i),1<i.length&&"/"===i[i.length-1]&&(i=i.slice(0,-1))):i="/",{path:i,params:t<0?{}:l(e.slice(t+1,r))}}},{"../querystring/parse":22}],19:[function(e,t,n){(function(n){"use strict";var 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 i=this,l=[],a=[],o=t(l,!0),s=t(a,!1),c=i._instance={resolvers:l,rejectors:a},u="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))u(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,c.state=o,c.retry=function(){t(n)}});else{if(n===i)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(o),r)}catch(e){r(e)}}f(e)};d.prototype.then=function(e,t){var o,i,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new d(function(e,t){o=e,i=t});return n(e,l.resolvers,o,!0),n(t,l.rejectors,i,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.prototype.finally=function(t){return this.then(function(e){return d.resolve(t()).then(function(){return e})},function(e){return d.resolve(t()).then(function(){return d.reject(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(a){return new d(function(n,r){var o=a.length,i=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){i++,l[t]=e,i===o&&n(l)}null==a[t]||"object"!=typeof a[t]&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[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)})},t.exports=d}).call(this,e("timers").setImmediate)},{timers:34}],20:[function(n,r,e){(function(e){"use strict";var t=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=t:window.Promise.prototype.finally||(window.Promise.prototype.finally=t.prototype.finally),r.exports=window.Promise):void 0!==e?(void 0===e.Promise?e.Promise=t:e.Promise.prototype.finally||(e.Promise.prototype.finally=t.prototype.finally),r.exports=e.Promise):r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":19}],21:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var r=[];for(var t in e)o(t,e[t]);return r.join("&");function o(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)o(e+"["+n+"]",t[n]);else if("[object Object]"===Object.prototype.toString.call(t))for(var n in t)o(e+"["+n+"]",t[n]);else r.push(encodeURIComponent(e)+(null!=t&&""!==t?"="+encodeURIComponent(t):""))}}},{}],22:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),l=decodeURIComponent(i[0]),a=2===i.length?decodeURIComponent(i[1]):"";"true"===a?a=!0:"false"===a&&(a=!1);var s=l.split(/\]\[?|\[/),c=r;-1<l.indexOf("[")&&s.pop();for(var u=0;u<s.length;u++){var f=s[u],d=s[u+1],p=""==d||!isNaN(parseInt(d,10));if(""===f)null==n[l=s.slice(0,u).join()]&&(n[l]=Array.isArray(c)?c.length:0),f=n[l]++;else if("__proto__"===f)break;if(u===s.length-1)c[f]=a;else{var m=Object.getOwnPropertyDescriptor(c,f);null!=m&&(m=m.value),null==m&&(c[f]=m=p?[]:{}),c=m}}}return r}},{}],23:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":27}],24:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":29,"./hyperscriptVnode":26}],25:[function(e,t,n){"use strict";var s=e("../render/vnode"),r=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},f={}.hasOwnProperty;function d(e){for(var t in e)if(f.call(e,t))return!1;return!0}t.exports=function(e){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.");var t=r.apply(1,arguments);return"string"==typeof e&&(t.children=s.normalizeChildren(t.children),"["!==e)?function(e,t){var n=t.attrs,r=s.normalizeChildren(t.children),o=f.call(n,"class"),i=o?n.class:n.className;if(t.tag=e.tag,t.attrs=null,t.children=void 0,!d(e.attrs)&&!d(n)){var l={};for(var a in n)f.call(n,a)&&(l[a]=n[a]);n=l}for(var a in e.attrs)f.call(e.attrs,a)&&"className"!==a&&!f.call(n,a)&&(n[a]=e.attrs[a]);for(var a in null==i&&null==e.attrs.className||(n.className=null!=i?null!=e.attrs.className?String(e.attrs.className)+" "+String(i):i:null!=e.attrs.className?e.attrs.className:null),o&&(n.class=null),n)if(f.call(n,a)&&"key"!==a){t.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?t.text=r[0].children:t.children=r,t}(u[e]||function(e){for(var t,n="div",r=[],o={};t=c.exec(e);){var i=t[1],l=t[2];if(""===i&&""!==l)n=l;else if("#"===i)o.id=l;else if("."===i)r.push(l);else if("["===t[3][0]){var a=t[6];a=a&&a.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(a):o[t[4]]=""===a?a:a||!0}}return 0<r.length&&(o.className=r.join(" ")),u[e]={tag:n,attrs:o}}(e),t):(t.tag=e,t)}},{"../render/vnode":29,"./hyperscriptVnode":26}],26:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":29}],27:[function(e,t,n){"use strict";var $=e("../render/vnode");t.exports=function(e){var s,u=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function f(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function c(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function d(e){var t=e.state;try{return this.apply(t,arguments)}finally{c(e,t)}}function p(){try{return u.activeElement}catch(e){return null}}function A(e,t,n,r,o,i,l){for(var a=n;a<r;a++){var s=t[a];null!=s&&C(e,s,o,l,i)}}function C(e,t,n,r,o){var i=t.tag;if("string"==typeof i)switch(t.state={},null!=t.attrs&&_(t.attrs,t,n),i){case"#":!function(e,t,n){t.dom=u.createTextNode(t.children),v(e,t.dom,n)}(e,t,o);break;case"<":a(e,t,r,o);break;case"[":!function(e,t,n,r,o){var i=u.createDocumentFragment();if(null!=t.children){var l=t.children;A(i,l,0,l.length,n,null,r)}t.dom=i.firstChild,t.domSize=i.childNodes.length,v(e,i,o)}(e,t,n,r,o);break;default:!function(e,t,n,r,o){var i=t.tag,l=t.attrs,a=l&&l.is,s=(r=f(t)||r)?a?u.createElementNS(r,i,{is:a}):u.createElementNS(r,i):a?u.createElement(i,{is:a}):u.createElement(i);t.dom=s,null!=l&&function(e,t,n){for(var r in t)x(e,r,null,t[r],n)}(t,l,r);if(v(e,s,o),!y(t)&&(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children)){var c=t.children;A(s,c,0,c.length,n,null,r),"select"===t.tag&&null!=l&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&x(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,l)}}(e,t,n,r,o)}else!function(e,t,n,r,o){(function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}_(e.state,e,t),null!=e.attrs&&_(e.attrs,e,t);if(e.instance=$.normalize(d.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(t,n),null!=t.instance?(C(e,t.instance,n,r,o),t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0):t.domSize=0}(e,t,n,r,o)}var m={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function a(e,t,n,r){var o=t.children.match(/^\s*?<(\w+)/im)||[],i=u.createElement(m[o[1]]||"div");"http://www.w3.org/2000/svg"===n?(i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length,t.instance=[];for(var l,a=u.createDocumentFragment();l=i.firstChild;)t.instance.push(l),a.appendChild(l);v(e,a,r)}function h(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)A(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)z(e,t,0,t.length);else{var l=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,s=0,c=0;if(!l)for(;c<t.length&&null==t[c];)c++;if(!a)for(;s<n.length&&null==n[s];)s++;if(null===a&&null==l)return;if(l!=a)z(e,t,c,t.length),A(e,n,s,n.length,r,o,i);else if(a){for(var u,f,d,p,m,h=t.length-1,v=n.length-1;c<=h&&s<=v&&(d=t[h],p=n[v],d.key===p.key);)d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),h--,v--;for(;c<=h&&s<=v&&(u=t[c],f=n[s],u.key===f.key);)c++,s++,u!==f&&N(e,u,f,r,L(t,c,o),i);for(;c<=h&&s<=v&&s!==v&&u.key===p.key&&d.key===f.key;)q(e,d,m=L(t,c,o)),d!==f&&N(e,d,f,r,m,i),++s<=--v&&q(e,u,o),u!==p&&N(e,u,p,r,o,i),null!=p.dom&&(o=p.dom),c++,d=t[--h],p=n[v],u=t[c],f=n[s];for(;c<=h&&s<=v&&d.key===p.key;)d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),v--,d=t[--h],p=n[v];if(v<s)z(e,t,c,h+1);else if(h<c)A(e,n,s,v+1,r,o,i);else{var y,g,w=o,b=v-s+1,x=new Array(b),E=0,k=0,S=2147483647,T=0;for(k=0;k<b;k++)x[k]=-1;for(k=v;s<=k;k--){null==y&&(y=I(t,c,h+1));var _=y[(p=n[k]).key];null!=_&&(S=_<S?_:-1,d=t[x[k-s]=_],t[_]=null,d!==p&&N(e,d,p,r,o,i),null!=p.dom&&(o=p.dom),T++)}if(o=w,T!==h-c+1&&z(e,t,c,h+1),0===T)A(e,n,s,v+1,r,o,i);else if(-1===S)for(E=(g=function(e){var t=[0],n=0,r=0,o=0,i=O.length=e.length;for(o=0;o<i;o++)O[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var l=t[t.length-1];if(e[l]<e[o])O[o]=l,t.push(o);else{for(n=0,r=t.length-1;n<r;){var a=(n>>>1)+(r>>>1)+(n&r&1);e[t[a]]<e[o]?n=1+a:r=a}e[o]<e[t[n]]&&(0<n&&(O[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=O[r];return O.length=0,t}(x)).length-1,k=v;s<=k;k--)f=n[k],-1===x[k-s]?C(e,f,r,i,o):g[E]===k-s?E--:q(e,f,o),null!=f.dom&&(o=n[k].dom);else for(k=v;s<=k;k--)f=n[k],-1===x[k-s]&&C(e,f,r,i,o),null!=f.dom&&(o=n[k].dom)}}else{var j=t.length<n.length?t.length:n.length;for(s=s<c?s:c;s<j;s++)(u=t[s])===(f=n[s])||null==u&&null==f||(null==u?C(e,f,r,i,L(t,s+1,o)):null==f?P(e,u):N(e,u,f,r,L(t,s+1,o),i));t.length>j&&z(e,t,s,t.length),n.length>j&&A(e,n,s,n.length,r,o,i)}}}function N(e,t,n,r,o,i){var l=t.tag;if(l===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=d.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=d.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof l)switch(null!=n.attrs&&j(n.attrs,n,r),l){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":!function(e,t,n,r,o){t.children!==n.children?(g(e,t),a(e,n,r,o)):(n.dom=t.dom,n.domSize=t.domSize,n.instance=t.instance)}(e,t,n,i,o);break;case"[":!function(e,t,n,r,o,i){h(e,t.children,n.children,r,o,i);var l=0,a=n.children;if((n.dom=null)!=a){for(var s=0;s<a.length;s++){var c=a[s];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,r,o,i);break;default:!function(e,t,n,r){var o=t.dom=e.dom;r=f(t)||r,"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 o in n)x(e,o,t&&t[o],n[o],r);var i;if(null!=t)for(var o in t)null==(i=t[o])||null!=n&&null!=n[o]||E(e,o,i,r)})(t,e.attrs,t.attrs,r),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=[$("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),h(o,e.children,t.children,n,null,r)))}(t,n,r,i)}else!function(e,t,n,r,o,i){if(n.instance=$.normalize(d.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");j(n.state,n,r),null!=n.attrs&&j(n.attrs,n,r);null!=n.instance?(null==t.instance?C(e,n.instance,r,i,o):N(e,t.instance,n.instance,r,o,i),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(P(e,t.instance),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,o,i)}else P(e,t),C(e,n,r,i,o)}function I(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];if(null!=o){var i=o.key;null!=i&&(r[i]=t)}}return r}var O=[];function L(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function q(e,t,n){var r=u.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(var o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),v(e,r,n)}function v(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function y(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;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");return!0}function z(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&P(e,i)}}function P(e,t){var n,r,o,i=0,l=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=d.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(i=1,n=o);t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=d.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(i|=2,r=o);if(c(t,l),i){if(null!=n){var a=function(){1&i&&((i&=2)||s())};n.then(a,a)}if(null!=r){a=function(){2&i&&((i&=1)||s())};r.then(a,a)}}else b(t),w(e,t);function s(){c(t,l),b(t),w(e,t)}}function g(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function w(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)g(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&w(e,r)}}break}}function b(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&d.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&d.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&b(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&b(r)}}}function x(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!i(t)&&(n!==r||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===p()||"option"===e.tag&&e.dom.parentNode===u.activeElement}(e,t)||"object"==typeof r)){if("o"===t[0]&&"n"===t[1])return T(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)S(e.dom,n,r);else if(l(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===p())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function E(e,t,n,r){if("key"!==t&&"is"!==t&&null!=n&&!i(t))if("o"!==t[0]||"n"!==t[1]||i(t))if("style"===t)S(e.dom,n,null);else if(!l(e,t,r)||"className"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===p())||"input"===e.tag&&"type"===t){var o=t.indexOf(":");-1!==o&&(t=t.slice(o+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null;else T(e,t,void 0)}function i(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function l(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function k(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function S(e,t,n){if(t===n);else if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(o=n[r])&&e.style.setProperty(k(r),String(o))}else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(k(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(k(r))}}function o(){this._=s}function T(e,t,n){if(null!=e.events){if(e.events[t]===n)return;null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}else null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function _(e,t,n){"function"==typeof e.oninit&&d.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(d.bind(e.oncreate,t))}function j(e,t,n){"function"==typeof e.onupdate&&n.push(d.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=p(),i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),t=$.normalizeChildren(Array.isArray(t)?t:[t]);var l=s;try{s="function"==typeof n?n:void 0,h(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{s=l}e.vnodes=t,null!=o&&p()!==o&&"function"==typeof o.focus&&o.focus();for(var a=0;a<r.length;a++)r[a]()}}},{"../render/vnode":29}],28:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return null==e&&(e=""),r("<",void 0,void 0,e,void 0,void 0)}},{"../render/vnode":29}],29:[function(e,t,n){"use strict";function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],30:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":14,"./promise/promise":20,"./request/request":31}],31:[function(e,t,n){"use strict";var c=e("../pathname/build");t.exports=function(m,n,a){var l=0;function s(e){return new n(e)}function e(l){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){l(c(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof a&&a()}return function t(n){var r=n.then;n.constructor=s;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function h(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return!0;return!1}return s.prototype=n.prototype,s.__proto__=n,{request:e(function(i,l,a,s){var e,t=null!=l.method?l.method.toUpperCase():"GET",n=l.body,r=!(null!=l.serialize&&l.serialize!==JSON.serialize||n instanceof m.FormData),c=l.responseType||("function"==typeof l.extract?"":"json"),o=new m.XMLHttpRequest,u=!1,f=o,d=o.abort;for(var p in o.abort=function(){u=!0,d.call(this)},o.open(t,i,!1!==l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),r&&null!=n&&!h(l,/^content-type$/i)&&o.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof l.deserialize||h(l,/^accept$/i)||o.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(o.withCredentials=l.withCredentials),l.timeout&&(o.timeout=l.timeout),o.responseType=c,l.headers)!{}.hasOwnProperty.call(l.headers,p)||o.setRequestHeader(p,l.headers[p]);o.onreadystatechange=function(e){if(!u&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===c?e.target.responseType||"function"==typeof l.extract||(r=JSON.parse(e.target.responseText)):c&&"text"!==c||null==r&&(r=e.target.responseText),"function"==typeof l.extract?(r=l.extract(e.target,l),n=!0):"function"==typeof l.deserialize&&(r=l.deserialize(r)),n)a(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,s(o)}}catch(e){s(e)}},"function"==typeof l.config&&(o=l.config(o,l,i)||o)!==f&&(e=o.abort,o.abort=function(){u=!0,e.call(this)}),null==n?o.send():"function"==typeof l.serialize?o.send(l.serialize(n)):n instanceof m.FormData?o.send(n):o.send(JSON.stringify(n))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+l++,i=m.document.createElement("script");m[o]=function(e){delete m[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete m[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),m.document.documentElement.appendChild(i)})}}},{"../pathname/build":16}],32:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":11,"./mount-redraw":14}],33:[function(e,t,n){var r,o,i=t.exports={};function l(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===l||!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:l}catch(e){r=l}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&m())}function m(){if(!f){var e=s(p);f=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}i.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];u.push(new h(e,t)),1!==u.length||f||s(m)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],34:[function(s,e,c){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;function a(e,t){this._id=e,this._clearFn=t}c.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(e){e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},c.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},c._unrefActive=c.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},c.setImmediate="function"==typeof e?e:function(e){var t=l++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),c.clearImmediate(t))}),t},c.clearImmediate="function"==typeof t?t:function(e){delete i[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":33,timers:34}],35:[function(e,t,n){function f(r){document.addEventListener("mouseover",function(e){var t=e.target,n=r(t);(n=n||(t=t.parentElement)&&r(t))&&f.show(t,n,!0)})}f.show=function(e,t,n){var r,o,i,l,a,s="data-tlite";function c(){f.hide(r,!0)}function u(){i=i||function(a,e,t){var s=document.createElement("span"),n=t.grav||a.getAttribute("data-tlite")||"n";s.innerHTML=e,a.appendChild(s);var c=n[0]||"",u=n[1]||"";function r(){s.className="tlite tlite-"+c+u;var e=a.offsetTop,t=a.offsetLeft;s.offsetParent===a&&(e=t=0);var n=a.offsetWidth,r=a.offsetHeight,o=s.offsetHeight,i=s.offsetWidth,l=t+n/2;s.style.top=("s"===c?e-o-10:"n"===c?e+r+10:e+r/2-o/2)+"px",s.style.left=("w"===u?t:"e"===u?t+n-i:"w"===c?t+n+10:"e"===c?t-i-10:l-i/2)+"px"}r();var o=s.getBoundingClientRect();"s"===c&&o.top<0?(c="n",r()):"n"===c&&o.bottom>window.innerHeight?(c="s",r()):"e"===c&&o.left<0?(c="w",r()):"w"===c&&o.right>window.innerWidth&&(c="e",r());return s.className+=" tlite-visible",s}(r,a,o)}t=t||{},(e.tooltip||(o=t,(r=e).addEventListener("mousedown",c),r.addEventListener("mouseleave",c),r.tooltip={show:function(){a=r.title||r.getAttribute(s)||a,r.title="",r.setAttribute(s,""),a&&!l&&(l=setTimeout(u,n?150:1))},hide:function(e){if(n===e){l=clearTimeout(l);var t=i&&i.parentNode;t&&t.removeChild(i),i=void 0}}})).show()},f.hide=function(e,t){e.tooltip&&e.tooltip.hide(t)},void 0!==t&&t.exports&&(t.exports=f)},{}]},{},[1]);
|
2 |
//# sourceMappingURL=admin.min.js.map
|
assets/js/admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["admin.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","obj","_tlite","__esModule","default","tabs","settings","helpers","el","className","indexOf","window","mc4wp","./admin/fields/mailchimp-api-key.js","./admin/helpers.js","./admin/list-fetcher.js","./admin/list-overview.js","./admin/settings.js","./admin/show-if.js","./admin/tabs.js","tlite","2","field","document","getElementById","addEventListener","evt","node","createElement","innerText","mc4wp_vars","i18n","invalid_api_key","nextElementSibling","parentElement","removeChild","value","match","insertBefore","3","debounce","func","wait","immediate","timeout","context","this","args","arguments","callNow","clearTimeout","setTimeout","apply","4","config","ajaxurl","m","state","working","done","success","fetch","preventDefault","request","method","url","then","data","location","reload","redraw","mount","mailchimp","api_connected","lists","view","onsubmit","bind","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","mithril","5","showDetails","link","target","next","listID","getAttribute","querySelector","style","display","details","render","merge_fields","map","name","required","tag","options","date_format","choices","join","interest_categories","title","id","Object","keys","interests","shift","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","table","6","_typeof","Symbol","iterator","constructor","listInputs","querySelectorAll","selectedLists","listeners","updateSelectedLists","forEach","input","checked","push","rows","isSelected","searchKey","searchValue","filter","getSelectedListsWhere","toggleVisibleLists","event","emit","getSelectedLists","on","7","showIfElements","element","JSON","parse","parentElements","inputs","hide","undefined","toggleElement","conditionMet","String","visibility","opacity","inputElement","readOnly","8","URL","tabElements","tabNavElements","refererField","get","_open","tab","updateState","replace","nav","blur","setParameter","href","history","pushState","tb_remove","forms","editor","refresh","split","switchTab","tabId","urlParams","returnValue","substring","textContent","open","body","activeTab","offsetParent","replaceState","init","./url.js","9","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","key","10","Vnode","schedule","console","subscriptions","rendering","pending","sync","error","root","component","TypeError","index","splice","../render/vnode","11","setImmediate","Promise","buildPathname","parsePathname","compileTemplate","assign","sentinel","$window","mountRedraw","fireAsync","setPath","path","route","prefix","attrs","currentPath","lastUpdate","currentResolver","SKIP","defaultRoute","routes","onremove","compiled","SyntaxError","test","check","callAsync","resolve","scheduled","defaultData","some","ReferenceError","resolveRoute","hash","search","pathname","concat","slice","fail","params","loop","payload","matchedRoute","localComp","update","comp","onmatch","removeEventListener","onbeforeupdate","oncreate","vnode","set","Link","onclick","selector","oninit","onupdate","onbeforeremove","child","children","Boolean","result","currentTarget","handleEvent","defaultPrevented","button","which","ctrlKey","metaKey","shiftKey","altKey","param","../pathname/assign","../pathname/build","../pathname/compileTemplate","../pathname/parse","../promise/promise","../render/hyperscript","timers","12","hyperscript","fragment","./render/fragment","./render/hyperscript","./render/trust","13","jsonp","parseQueryString","buildQueryString","PromisePolyfill","./hyperscript","./mount-redraw","./pathname/build","./pathname/parse","./promise/polyfill","./querystring/build","./querystring/parse","./render","./render/vnode","./request","./route","14","requestAnimationFrame","./api/mount-redraw","15","source","16","template","queryIndex","hashIndex","queryEnd","pathEnd","resolved","variadic","newQueryIndex","newHashIndex","newQueryEnd","newPathEnd","querystring","../querystring/build","./assign","17","templateData","templateKeys","regexp","RegExp","extra","k","values","exec","./parse","18","../querystring/parse","19","executor","self","resolvers","rejectors","resolveCurrent","handler","rejectCurrent","instance","_instance","list","shouldAbsorb","execute","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","promise","reject","catch","finally","reason","all","total","count","consume","race","20","global","./polyfill","21","object","toString","destructure","Array","isArray","22","string","charAt","entries","counters","entry","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","desc","getOwnPropertyDescriptor","23","./render/render","24","hyperscriptVnode","normalizeChildren","./hyperscriptVnode","25","selectorParser","selectorCache","hasOwn","isEmpty","hasClass","class","newAttrs","text","execSelector","classes","attrValue","compileSelector","26","start","27","currentRedraw","$doc","nameSpace","svg","math","getNameSpace","xmlns","checkState","original","callHook","activeElement","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initLifecycle","dom","createTextNode","insertNode","createText","createHTML","createDocumentFragment","firstChild","domSize","childNodes","createFragment","is","createElementNS","setAttr","setAttrs","maybeSetContentEditable","selectedIndex","normalized","setLateSelectAttrs","create","$$reentrantLock$$","normalize","initComponent","createComponent","possibleParents","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","appendChild","updateNodes","old","removeNodes","isOldKeyed","isKeyed","oldStart","v","oe","ve","topSibling","oldEnd","updateNode","getNextSibling","moveNodes","lisIndices","originalNextSibling","vnodesLength","oldIndices","li","pos","matched","getKeyMap","oldIndex","il","lisTemp","makeLisIndices","commonLength","removeNode","oldTag","events","force","shouldNotUpdate","updateLifecycle","nodeValue","updateText","removeHTML","updateHTML","updateFragment","val","removeAttr","updateAttrs","updateElement","updateComponent","frag","moveChildToFrag","parentNode","contenteditable","contentEditable","content","stateResult","attrsResult","mask","reallyRemove","isLifecycleMethod","attr","isFormAttribute","updateEvent","setAttributeNS","updateStyle","hasPropertyKey","setAttribute","removeAttribute","nsLastIndex","uppercaseRegex","toLowerCase","capital","normalizeKey","cssText","setProperty","removeProperty","EventDict","_","ev","stopPropagation","active","namespace","namespaceURI","prevRedraw","focus","28","html","29","30","./promise/promise","./request/request","31","oncompletion","callbackCount","PromiseProxy","makeRequest","factory","background","complete","wrap","hasHeader","headers","__proto__","replacedAbort","toUpperCase","assumeJSON","serialize","FormData","responseType","extract","xhr","XMLHttpRequest","aborted","abort","async","user","password","setRequestHeader","deserialize","withCredentials","onreadystatechange","readyState","message","status","response","responseText","send","stringify","callbackName","Math","round","random","script","src","callbackKey","documentElement","32","./api/router","33","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","version","versions","addListener","once","off","removeListener","removeAllListeners","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","34","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","35","getTooltipOpts","opts","show","isAuto","tooltipEl","showTimer","fallbackAttrib","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","tooltip","isAutoHiding"],"mappings":"CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,mBAAmBC,SAASA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAI,IAAIK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,KAAK,MAAMK,EAAE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B,EAAc,CAC3B3B,EAAYloB,aAAakoB,GACzB,IAAInP,EAASkP,GAAaA,EAAUzJ,WACpCzF,GAAUA,EAAO9Z,YAAYgpB,GAC7BA,OAAY1hB,OA1BgBwhB,QA6GpC7pB,EAAMoI,KAAO,SAAUhJ,EAAI0qB,GACzB1qB,EAAGssB,SAAWtsB,EAAGssB,QAAQtjB,KAAK0hB,SAGV,IAAXlrB,GAA0BA,EAAOJ,UAC1CI,EAAOJ,QAAUwB,IAGjB,KAAK,GAAG,CAAC","file":"admin.min.js","sourcesContent":["(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 tabs = require('./admin/tabs.js');\n\nvar settings = require('./admin/settings.js');\n\nvar helpers = require('./admin/helpers.js');\n\n(0, _tlite[\"default\"])(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n});\n\nrequire('./admin/list-fetcher.js');\n\nrequire('./admin/fields/mailchimp-api-key.js');\n\nrequire('./admin/list-overview.js');\n\nrequire('./admin/show-if.js'); // expose some things\n\n\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/fields/mailchimp-api-key.js\":2,\"./admin/helpers.js\":3,\"./admin/list-fetcher.js\":4,\"./admin/list-overview.js\":5,\"./admin/settings.js\":6,\"./admin/show-if.js\":7,\"./admin/tabs.js\":8,\"tlite\":35}],2:[function(require,module,exports){\n'use strict';\n\nfunction validate(evt) {\n var node = document.createElement('p');\n node.className = 'help red';\n node.innerText = window.mc4wp_vars.i18n.invalid_api_key;\n\n if (field.nextElementSibling.innerText === node.innerText) {\n field.nextElementSibling.parentElement.removeChild(field.nextElementSibling);\n }\n\n if (!field.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)) {\n field.parentElement.insertBefore(node, field.nextElementSibling);\n }\n}\n\nvar field = document.getElementById('mailchimp_api_key');\n\nif (field) {\n field.addEventListener('change', validate);\n}\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar helpers = {}; // polling\n\nhelpers.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (callNow) func.apply(context, args);\n };\n};\n\nmodule.exports = helpers;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar config = window.mc4wp_vars;\nvar i18n = window.mc4wp_vars.i18n;\nvar ajaxurl = window.mc4wp_vars.ajaxurl;\n\nvar m = require('mithril');\n\nvar state = {\n working: false,\n done: false,\n success: false\n};\n\nfunction fetch(evt) {\n evt && evt.preventDefault();\n state.working = true;\n state.done = false;\n m.request({\n method: 'POST',\n url: ajaxurl + '?action=mc4wp_renew_mailchimp_lists',\n timeout: 600000 // 10 minutes, matching max_execution_time\n\n }).then(function (data) {\n state.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n })[\"catch\"](function (data) {\n state.success = false;\n })[\"finally\"](function (data) {\n state.working = false;\n state.done = true;\n m.redraw();\n });\n}\n\nfunction view() {\n return m('form', {\n method: 'POST',\n onsubmit: fetch.bind(this)\n }, [m('p', [m('input', {\n type: 'submit',\n value: state.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: 'button',\n disabled: !!state.working\n }), m.trust(' '), state.working ? [m('span.mc4wp-loader', 'Loading...'), m.trust(' ')] : '', state.done ? [state.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n}\n\nvar mount = document.getElementById('mc4wp-list-fetcher');\n\nif (mount) {\n // start fetching right away when no lists but api key given\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n fetch();\n }\n\n m.mount(mount, {\n view: view\n });\n}\n\n},{\"mithril\":13}],5:[function(require,module,exports){\n'use strict';\n\nvar ajaxurl = window.mc4wp_vars.ajaxurl;\n\nvar m = require('mithril');\n\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\nfunction showDetails(evt) {\n evt.preventDefault();\n var link = evt.target;\n var next = link.parentElement.parentElement.nextElementSibling;\n var listID = link.getAttribute('data-list-id');\n var mount = next.querySelector('div');\n\n if (next.style.display === 'none') {\n m.request({\n method: 'GET',\n url: ajaxurl + '?action=mc4wp_get_list_details&ids=' + listID\n }).then(function (details) {\n m.render(mount, view(details.shift()));\n });\n next.style.display = '';\n } else {\n next.style.display = 'none';\n }\n}\n\nfunction view(data) {\n return [m('h3', 'Merge fields'), m('table.widefat.striped', [m('thead', [m('tr', [m('th', 'Name'), m('th', 'Tag'), m('th', 'Type')])]), m('tbody', data.merge_fields.map(function (f) {\n return m('tr', [m('td', [f.name, f.required && m('span.red', '*')]), m('td', [m('code', f.tag)]), m('td', [f.type, ' ', f.options && f.options.date_format ? '(' + f.options.date_format + ')' : '', f.options && f.options.choices ? '(' + f.options.choices.join(', ') + ')' : ''])]);\n }))]), data.interest_categories.length > 0 && [m('h3', 'Interest Categories'), m('table.striped.widefat', [m('thead', [m('tr', [m('th', 'Name'), m('th', 'Type'), m('th', 'Interests')])]), m('tbody', data.interest_categories.map(function (f) {\n return m('tr', [m('td', [m('strong', f.title), m('br'), m('br'), 'ID: ', m('code', f.id)]), m('td', f.type), m('td', [m('div.row', {\n style: 'margin-bottom: 4px;'\n }, [m('div.col.col-3', [m('strong', {\n style: 'display: block; border-bottom: 1px solid #eee;'\n }, 'Name')]), m('div.col.col-3', [m('strong', {\n style: 'display: block; border-bottom: 1px solid #eee;'\n }, 'ID')])]), Object.keys(f.interests).map(function (id) {\n return m('div.row.tiny-margin', [m('div.col.col-3', f.interests[id]), m('div.col.col-3', [m('code', {\n title: 'Interest ID'\n }, id)]), m('br.clearfix.clear.cf')]);\n })])]);\n }))])]];\n}\n\nvar table = document.getElementById('mc4wp-mailchimp-lists-overview');\n\nif (table) {\n table.addEventListener('click', function (evt) {\n if (!evt.target.matches('.mc4wp-mailchimp-list')) {\n return;\n }\n\n showDetails(evt);\n });\n}\n\n},{\"mithril\":13}],6:[function(require,module,exports){\n'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; 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 context = document.getElementById('mc4wp-admin');\nvar listInputs = context.querySelectorAll('.mc4wp-list-input');\nvar lists = window.mc4wp_vars.mailchimp.lists;\nvar selectedLists = [];\nvar listeners = {}; // functions\n\nfunction getSelectedListsWhere(searchKey, searchValue) {\n return selectedLists.filter(function (el) {\n return el[searchKey] === searchValue;\n });\n}\n\nfunction getSelectedLists() {\n return selectedLists;\n}\n\nfunction updateSelectedLists() {\n selectedLists = [];\n [].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 toggleVisibleLists();\n emit('selectedLists.change', [selectedLists]);\n return selectedLists;\n}\n\nfunction toggleVisibleLists() {\n var rows = document.querySelectorAll('.lists--only-selected > *');\n [].forEach.call(rows, function (el) {\n var listId = el.getAttribute('data-list-id');\n var isSelected = getSelectedListsWhere('id', listId).length > 0;\n el.style.display = isSelected ? '' : 'none';\n });\n}\n\nfunction emit(event, args) {\n listeners[event] = listeners[event] || [];\n listeners[event].forEach(function (f) {\n return f.apply(null, args);\n });\n}\n\nfunction on(event, func) {\n listeners[event] = listeners[event] || [];\n listeners[event].push(func);\n}\n\n[].forEach.call(listInputs, function (el) {\n el.addEventListener('change', updateSelectedLists);\n});\nupdateSelectedLists();\nmodule.exports = {\n getSelectedLists: getSelectedLists,\n on: on\n};\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nvar showIfElements = document.querySelectorAll('[data-showif]');\n[].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.type === 'radio' && !this.checked) {\n return;\n }\n\n var value = this.type === 'checkbox' ? this.checked : this.value;\n var conditionMet = String(value) === String(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 [].forEach.call(inputs, function (inputElement) {\n inputElement.readOnly = !conditionMet;\n });\n } // find checked element and call toggleElement function\n\n\n [].forEach.call(parentElements, function (el) {\n el.addEventListener('change', toggleElement);\n toggleElement.call(el);\n });\n});\n\n},{}],8:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js');\n\nvar context = document.getElementById('mc4wp-admin');\nvar tabElements = context.querySelectorAll('.tab');\nvar tabNavElements = context.querySelectorAll('.nav-tab');\nvar refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\nvar tabs = [];\n\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n[].forEach.call(tabElements, function (t, i) {\n var id = t.id.substring(4);\n var title = t.querySelector('h2:first-of-type').textContent;\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\nfunction 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 null;\n}\n\nfunction _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 [].forEach.call(tabElements, function (t) {\n t.className = t.className.replace('tab-active', '');\n t.style.display = ' none';\n });\n [].forEach.call(tabNavElements, function (t) {\n t.className = t.className.replace('nav-tab-active', '');\n }); // add `nav-tab-active` to this tab\n\n [].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 window.tb_remove === 'function') {\n window.tb_remove();\n } // refresh editor if open\n\n\n if (window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n window.mc4wp.forms.editor.refresh();\n }\n\n return true;\n}\n\nfunction title(tab) {\n var title = document.title.split('-');\n document.title = document.title.replace(title[0], tab.title + ' ');\n}\n\nfunction switchTab(evt) {\n var link = evt.target; // get from data attribute\n\n var tabId = link.getAttribute('data-tab'); // get from classname\n\n if (!tabId) {\n var match = link.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(link.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 evt.preventDefault();\n evt.returnValue = false;\n return false;\n }\n\n return true;\n}\n\nfunction init() {\n var activeTab = tabs.filter(function (t) {\n return t.element.offsetParent !== null;\n }).shift();\n\n if (!activeTab) {\n return;\n }\n\n var tab = get(activeTab.id.substring(4));\n\n if (!tab) {\n return;\n } // check if tab is in html5 history\n\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[].forEach.call(tabNavElements, function (el) {\n return el.addEventListener('click', switchTab);\n});\ndocument.body.addEventListener('click', function (evt) {\n if (!evt.target.matches('.tab-link')) {\n return;\n }\n\n switchTab(evt);\n});\ninit();\n\nif (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\nmodule.exports = {\n open: _open,\n get: get\n};\n\n},{\"./url.js\":9}],9:[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},{}],10:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(render, schedule, console) {\n\tvar subscriptions = []\n\tvar rendering = false\n\tvar pending = false\n\n\tfunction sync() {\n\t\tif (rendering) throw new Error(\"Nested m.redraw.sync() call\")\n\t\trendering = true\n\t\tfor (var i = 0; i < subscriptions.length; i += 2) {\n\t\t\ttry { render(subscriptions[i], Vnode(subscriptions[i + 1]), redraw) }\n\t\t\tcatch (e) { console.error(e) }\n\t\t}\n\t\trendering = false\n\t}\n\n\tfunction redraw() {\n\t\tif (!pending) {\n\t\t\tpending = true\n\t\t\tschedule(function() {\n\t\t\t\tpending = false\n\t\t\t\tsync()\n\t\t\t})\n\t\t}\n\t}\n\n\tredraw.sync = sync\n\n\tfunction mount(root, component) {\n\t\tif (component != null && component.view == null && typeof component !== \"function\") {\n\t\t\tthrow new TypeError(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t}\n\n\t\tvar index = subscriptions.indexOf(root)\n\t\tif (index >= 0) {\n\t\t\tsubscriptions.splice(index, 2)\n\t\t\trender(root, [], redraw)\n\t\t}\n\n\t\tif (component != null) {\n\t\t\tsubscriptions.push(root, component)\n\t\t\trender(root, Vnode(component), redraw)\n\t\t}\n\t}\n\n\treturn {mount: mount, redraw: redraw}\n}\n\n},{\"../render/vnode\":29}],11:[function(require,module,exports){\n(function (setImmediate){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar m = require(\"../render/hyperscript\")\nvar Promise = require(\"../promise/promise\")\n\nvar buildPathname = require(\"../pathname/build\")\nvar parsePathname = require(\"../pathname/parse\")\nvar compileTemplate = require(\"../pathname/compileTemplate\")\nvar assign = require(\"../pathname/assign\")\n\nvar sentinel = {}\n\nmodule.exports = function($window, mountRedraw) {\n\tvar fireAsync\n\n\tfunction setPath(path, data, options) {\n\t\tpath = buildPathname(path, data)\n\t\tif (fireAsync != null) {\n\t\t\tfireAsync()\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, route.prefix + path)\n\t\t\telse $window.history.pushState(state, title, route.prefix + path)\n\t\t}\n\t\telse {\n\t\t\t$window.location.href = route.prefix + path\n\t\t}\n\t}\n\n\tvar currentResolver = sentinel, component, attrs, currentPath, lastUpdate\n\n\tvar SKIP = route.SKIP = {}\n\n\tfunction route(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\t// 0 = start\n\t\t// 1 = init\n\t\t// 2 = ready\n\t\tvar state = 0\n\n\t\tvar compiled = Object.keys(routes).map(function(route) {\n\t\t\tif (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a `/`\")\n\t\t\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(route)) {\n\t\t\t\tthrow new SyntaxError(\"Route parameter names must be separated with either `/`, `.`, or `-`\")\n\t\t\t}\n\t\t\treturn {\n\t\t\t\troute: route,\n\t\t\t\tcomponent: routes[route],\n\t\t\t\tcheck: compileTemplate(route),\n\t\t\t}\n\t\t})\n\t\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\t\tvar p = Promise.resolve()\n\t\tvar scheduled = false\n\t\tvar onremove\n\n\t\tfireAsync = null\n\n\t\tif (defaultRoute != null) {\n\t\t\tvar defaultData = parsePathname(defaultRoute)\n\n\t\t\tif (!compiled.some(function (i) { return i.check(defaultData) })) {\n\t\t\t\tthrow new ReferenceError(\"Default route doesn't match any known routes\")\n\t\t\t}\n\t\t}\n\n\t\tfunction resolveRoute() {\n\t\t\tscheduled = false\n\t\t\t// Consider the pathname holistically. The prefix might even be invalid,\n\t\t\t// but that's not our problem.\n\t\t\tvar prefix = $window.location.hash\n\t\t\tif (route.prefix[0] !== \"#\") {\n\t\t\t\tprefix = $window.location.search + prefix\n\t\t\t\tif (route.prefix[0] !== \"?\") {\n\t\t\t\t\tprefix = $window.location.pathname + prefix\n\t\t\t\t\tif (prefix[0] !== \"/\") prefix = \"/\" + prefix\n\t\t\t\t}\n\t\t\t}\n\t\t\t// This seemingly useless `.concat()` speeds up the tests quite a bit,\n\t\t\t// since the representation is consistently a relatively poorly\n\t\t\t// optimized cons string.\n\t\t\tvar path = prefix.concat()\n\t\t\t\t.replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\t\t\t.slice(route.prefix.length)\n\t\t\tvar data = parsePathname(path)\n\n\t\t\tassign(data.params, $window.history.state)\n\n\t\t\tfunction fail() {\n\t\t\t\tif (path === defaultRoute) throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t\t\tsetPath(defaultRoute, null, {replace: true})\n\t\t\t}\n\n\t\t\tloop(0)\n\t\t\tfunction loop(i) {\n\t\t\t\t// 0 = init\n\t\t\t\t// 1 = scheduled\n\t\t\t\t// 2 = done\n\t\t\t\tfor (; i < compiled.length; i++) {\n\t\t\t\t\tif (compiled[i].check(data)) {\n\t\t\t\t\t\tvar payload = compiled[i].component\n\t\t\t\t\t\tvar matchedRoute = compiled[i].route\n\t\t\t\t\t\tvar localComp = payload\n\t\t\t\t\t\tvar update = lastUpdate = function(comp) {\n\t\t\t\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\t\t\t\tif (comp === SKIP) return loop(i + 1)\n\t\t\t\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\t\t\t\tattrs = data.params, currentPath = path, lastUpdate = null\n\t\t\t\t\t\t\tcurrentResolver = payload.render ? payload : null\n\t\t\t\t\t\t\tif (state === 2) mountRedraw.redraw()\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tstate = 2\n\t\t\t\t\t\t\t\tmountRedraw.redraw.sync()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// There's no understating how much I *wish* I could\n\t\t\t\t\t\t// use `async`/`await` here...\n\t\t\t\t\t\tif (payload.view || typeof payload === \"function\") {\n\t\t\t\t\t\t\tpayload = {}\n\t\t\t\t\t\t\tupdate(localComp)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (payload.onmatch) {\n\t\t\t\t\t\t\tp.then(function () {\n\t\t\t\t\t\t\t\treturn payload.onmatch(data.params, path, matchedRoute)\n\t\t\t\t\t\t\t}).then(update, fail)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse update(\"div\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfail()\n\t\t\t}\n\t\t}\n\n\t\t// Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n\t\t// even if neither `pushState` nor `hashchange` are supported. It's\n\t\t// cleared if `hashchange` is used, since that makes it automatically\n\t\t// async.\n\t\tfireAsync = function() {\n\t\t\tif (!scheduled) {\n\t\t\t\tscheduled = true\n\t\t\t\tcallAsync(resolveRoute)\n\t\t\t}\n\t\t}\n\n\t\tif (typeof $window.history.pushState === \"function\") {\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"popstate\", fireAsync, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"popstate\", fireAsync, false)\n\t\t} else if (route.prefix[0] === \"#\") {\n\t\t\tfireAsync = null\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"hashchange\", resolveRoute, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"hashchange\", resolveRoute, false)\n\t\t}\n\n\t\treturn mountRedraw.mount(root, {\n\t\t\tonbeforeupdate: function() {\n\t\t\t\tstate = state ? 2 : 1\n\t\t\t\treturn !(!state || sentinel === currentResolver)\n\t\t\t},\n\t\t\toncreate: resolveRoute,\n\t\t\tonremove: onremove,\n\t\t\tview: function() {\n\t\t\t\tif (!state || sentinel === currentResolver) return\n\t\t\t\t// Wrap in a fragment to preserve existing key semantics\n\t\t\t\tvar vnode = [Vnode(component, attrs.key, attrs)]\n\t\t\t\tif (currentResolver) vnode = currentResolver.render(vnode[0])\n\t\t\t\treturn vnode\n\t\t\t},\n\t\t})\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\tsetPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = \"#!\"\n\troute.Link = {\n\t\tview: function(vnode) {\n\t\t\tvar options = vnode.attrs.options\n\t\t\t// Remove these so they don't get overwritten\n\t\t\tvar attrs = {}, onclick, href\n\t\t\tassign(attrs, vnode.attrs)\n\t\t\t// The first two are internal, but the rest are magic attributes\n\t\t\t// that need censored to not screw up rendering.\n\t\t\tattrs.selector = attrs.options = attrs.key = attrs.oninit =\n\t\t\tattrs.oncreate = attrs.onbeforeupdate = attrs.onupdate =\n\t\t\tattrs.onbeforeremove = attrs.onremove = null\n\n\t\t\t// Do this now so we can get the most current `href` and `disabled`.\n\t\t\t// Those attributes may also be specified in the selector, and we\n\t\t\t// should honor that.\n\t\t\tvar child = m(vnode.attrs.selector || \"a\", attrs, vnode.children)\n\n\t\t\t// Let's provide a *right* way to disable a route link, rather than\n\t\t\t// letting people screw up accessibility on accident.\n\t\t\t//\n\t\t\t// The attribute is coerced so users don't get surprised over\n\t\t\t// `disabled: 0` resulting in a button that's somehow routable\n\t\t\t// despite being visibly disabled.\n\t\t\tif (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n\t\t\t\tchild.attrs.href = null\n\t\t\t\tchild.attrs[\"aria-disabled\"] = \"true\"\n\t\t\t\t// If you *really* do want to do this on a disabled link, use\n\t\t\t\t// an `oncreate` hook to add it.\n\t\t\t\tchild.attrs.onclick = null\n\t\t\t} else {\n\t\t\t\tonclick = child.attrs.onclick\n\t\t\t\thref = child.attrs.href\n\t\t\t\tchild.attrs.href = route.prefix + href\n\t\t\t\tchild.attrs.onclick = function(e) {\n\t\t\t\t\tvar result\n\t\t\t\t\tif (typeof onclick === \"function\") {\n\t\t\t\t\t\tresult = onclick.call(e.currentTarget, e)\n\t\t\t\t\t} else if (onclick == null || typeof onclick !== \"object\") {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t} else if (typeof onclick.handleEvent === \"function\") {\n\t\t\t\t\t\tonclick.handleEvent(e)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Adapted from React Router's implementation:\n\t\t\t\t\t// https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n\t\t\t\t\t//\n\t\t\t\t\t// Try to be flexible and intuitive in how we handle links.\n\t\t\t\t\t// Fun fact: links aren't as obvious to get right as you\n\t\t\t\t\t// would expect. There's a lot more valid ways to click a\n\t\t\t\t\t// link than this, and one might want to not simply click a\n\t\t\t\t\t// link, but right click or command-click it to copy the\n\t\t\t\t\t// link target, etc. Nope, this isn't just for blind people.\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip if `onclick` prevented default\n\t\t\t\t\t\tresult !== false && !e.defaultPrevented &&\n\t\t\t\t\t\t// Ignore everything but left clicks\n\t\t\t\t\t\t(e.button === 0 || e.which === 0 || e.which === 1) &&\n\t\t\t\t\t\t// Let the browser handle `target=_blank`, etc.\n\t\t\t\t\t\t(!e.currentTarget.target || e.currentTarget.target === \"_self\") &&\n\t\t\t\t\t\t// No modifier keys\n\t\t\t\t\t\t!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey\n\t\t\t\t\t) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\te.redraw = false\n\t\t\t\t\t\troute.set(href, null, options)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child\n\t\t},\n\t}\n\troute.param = function(key) {\n\t\treturn attrs && key != null ? attrs[key] : attrs\n\t}\n\n\treturn route\n}\n\n}).call(this,require(\"timers\").setImmediate)\n},{\"../pathname/assign\":15,\"../pathname/build\":16,\"../pathname/compileTemplate\":17,\"../pathname/parse\":18,\"../promise/promise\":20,\"../render/hyperscript\":25,\"../render/vnode\":29,\"timers\":34}],12:[function(require,module,exports){\n\"use strict\"\n\nvar hyperscript = require(\"./render/hyperscript\")\n\nhyperscript.trust = require(\"./render/trust\")\nhyperscript.fragment = require(\"./render/fragment\")\n\nmodule.exports = hyperscript\n\n},{\"./render/fragment\":24,\"./render/hyperscript\":25,\"./render/trust\":28}],13:[function(require,module,exports){\n\"use strict\"\n\nvar hyperscript = require(\"./hyperscript\")\nvar request = require(\"./request\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nvar m = function m() { return hyperscript.apply(this, arguments) }\nm.m = hyperscript\nm.trust = hyperscript.trust\nm.fragment = hyperscript.fragment\nm.mount = mountRedraw.mount\nm.route = require(\"./route\")\nm.render = require(\"./render\")\nm.redraw = mountRedraw.redraw\nm.request = request.request\nm.jsonp = request.jsonp\nm.parseQueryString = require(\"./querystring/parse\")\nm.buildQueryString = require(\"./querystring/build\")\nm.parsePathname = require(\"./pathname/parse\")\nm.buildPathname = require(\"./pathname/build\")\nm.vnode = require(\"./render/vnode\")\nm.PromisePolyfill = require(\"./promise/polyfill\")\n\nmodule.exports = m\n\n},{\"./hyperscript\":12,\"./mount-redraw\":14,\"./pathname/build\":16,\"./pathname/parse\":18,\"./promise/polyfill\":19,\"./querystring/build\":21,\"./querystring/parse\":22,\"./render\":23,\"./render/vnode\":29,\"./request\":30,\"./route\":32}],14:[function(require,module,exports){\n\"use strict\"\n\nvar render = require(\"./render\")\n\nmodule.exports = require(\"./api/mount-redraw\")(render, requestAnimationFrame, console)\n\n},{\"./api/mount-redraw\":10,\"./render\":23}],15:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = Object.assign || function(target, source) {\n\tif(source) Object.keys(source).forEach(function(key) { target[key] = source[key] })\n}\n\n},{}],16:[function(require,module,exports){\n\"use strict\"\n\nvar buildQueryString = require(\"../querystring/build\")\nvar assign = require(\"./assign\")\n\n// Returns `path` from `template` + `params`\nmodule.exports = function(template, params) {\n\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(template)) {\n\t\tthrow new SyntaxError(\"Template parameter names *must* be separated\")\n\t}\n\tif (params == null) return template\n\tvar queryIndex = template.indexOf(\"?\")\n\tvar hashIndex = template.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? template.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = template.slice(0, pathEnd)\n\tvar query = {}\n\n\tassign(query, params)\n\n\tvar resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function(m, key, variadic) {\n\t\tdelete query[key]\n\t\t// If no such parameter exists, don't interpolate it.\n\t\tif (params[key] == null) return m\n\t\t// Escape normal parameters, but not variadic ones.\n\t\treturn variadic ? params[key] : encodeURIComponent(String(params[key]))\n\t})\n\n\t// In case the template substitution adds new query/hash parameters.\n\tvar newQueryIndex = resolved.indexOf(\"?\")\n\tvar newHashIndex = resolved.indexOf(\"#\")\n\tvar newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex\n\tvar newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex\n\tvar result = resolved.slice(0, newPathEnd)\n\n\tif (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)\n\tif (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd)\n\tvar querystring = buildQueryString(query)\n\tif (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring\n\tif (hashIndex >= 0) result += template.slice(hashIndex)\n\tif (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex)\n\treturn result\n}\n\n},{\"../querystring/build\":21,\"./assign\":15}],17:[function(require,module,exports){\n\"use strict\"\n\nvar parsePathname = require(\"./parse\")\n\n// Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\nmodule.exports = function(template) {\n\tvar templateData = parsePathname(template)\n\tvar templateKeys = Object.keys(templateData.params)\n\tvar keys = []\n\tvar regexp = new RegExp(\"^\" + templateData.path.replace(\n\t\t// I escape literal text so people can use things like `:file.:ext` or\n\t\t// `:lang-:locale` in routes. This is all merged into one pass so I\n\t\t// don't also accidentally escape `-` and make it harder to detect it to\n\t\t// ban it from template parameters.\n\t\t/:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g,\n\t\tfunction(m, key, extra) {\n\t\t\tif (key == null) return \"\\\\\" + m\n\t\t\tkeys.push({k: key, r: extra === \"...\"})\n\t\t\tif (extra === \"...\") return \"(.*)\"\n\t\t\tif (extra === \".\") return \"([^/]+)\\\\.\"\n\t\t\treturn \"([^/]+)\" + (extra || \"\")\n\t\t}\n\t) + \"$\")\n\treturn function(data) {\n\t\t// First, check the params. Usually, there isn't any, and it's just\n\t\t// checking a static set.\n\t\tfor (var i = 0; i < templateKeys.length; i++) {\n\t\t\tif (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false\n\t\t}\n\t\t// If no interpolations exist, let's skip all the ceremony\n\t\tif (!keys.length) return regexp.test(data.path)\n\t\tvar values = regexp.exec(data.path)\n\t\tif (values == null) return false\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tdata.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])\n\t\t}\n\t\treturn true\n\t}\n}\n\n},{\"./parse\":18}],18:[function(require,module,exports){\n\"use strict\"\n\nvar parseQueryString = require(\"../querystring/parse\")\n\n// Returns `{path, params}` from `url`\nmodule.exports = function(url) {\n\tvar queryIndex = url.indexOf(\"?\")\n\tvar hashIndex = url.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? url.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\")\n\n\tif (!path) path = \"/\"\n\telse {\n\t\tif (path[0] !== \"/\") path = \"/\" + path\n\t\tif (path.length > 1 && path[path.length - 1] === \"/\") path = path.slice(0, -1)\n\t}\n\treturn {\n\t\tpath: path,\n\t\tparams: queryIndex < 0\n\t\t\t? {}\n\t\t\t: parseQueryString(url.slice(queryIndex + 1, queryEnd)),\n\t}\n}\n\n},{\"../querystring/parse\":22}],19:[function(require,module,exports){\n(function (setImmediate){\n\"use strict\"\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\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\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.prototype.finally = function(callback) {\n\treturn this.then(\n\t\tfunction(value) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn value\n\t\t\t})\n\t\t},\n\t\tfunction(reason) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn PromisePolyfill.reject(reason);\n\t\t\t})\n\t\t}\n\t)\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}\n\nmodule.exports = PromisePolyfill\n\n}).call(this,require(\"timers\").setImmediate)\n},{\"timers\":34}],20:[function(require,module,exports){\n(function (global){\n\"use strict\"\n\nvar PromisePolyfill = require(\"./polyfill\")\n\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") {\n\t\twindow.Promise = PromisePolyfill\n\t} else if (!window.Promise.prototype.finally) {\n\t\twindow.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") {\n\t\tglobal.Promise = PromisePolyfill\n\t} else if (!global.Promise.prototype.finally) {\n\t\tglobal.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = global.Promise\n} else {\n\tmodule.exports = PromisePolyfill\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./polyfill\":19}],21:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\n\tvar args = []\n\tfor (var key in object) {\n\t\tdestructure(key, object[key])\n\t}\n\n\treturn args.join(\"&\")\n\n\tfunction destructure(key, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key + \"[\" + 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(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\n\n},{}],22:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\n\tvar entries = string.split(\"&\"), counters = {}, data = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\n\t\tvar levels = key.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data\n\t\tif (key.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\tif (level === \"\") {\n\t\t\t\tvar key = levels.slice(0, j).join()\n\t\t\t\tif (counters[key] == null) {\n\t\t\t\t\tcounters[key] = Array.isArray(cursor) ? cursor.length : 0\n\t\t\t\t}\n\t\t\t\tlevel = counters[key]++\n\t\t\t}\n\t\t\t// Disallow direct prototype pollution\n\t\t\telse if (level === \"__proto__\") break\n\t\t\tif (j === levels.length - 1) cursor[level] = value\n\t\t\telse {\n\t\t\t\t// Read own properties exclusively to disallow indirect\n\t\t\t\t// prototype pollution\n\t\t\t\tvar desc = Object.getOwnPropertyDescriptor(cursor, level)\n\t\t\t\tif (desc != null) desc = desc.value\n\t\t\t\tif (desc == null) cursor[level] = desc = isNumber ? [] : {}\n\t\t\t\tcursor = desc\n\t\t\t}\n\t\t}\n\t}\n\treturn data\n}\n\n},{}],23:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = require(\"./render/render\")(window)\n\n},{\"./render/render\":27}],24:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nmodule.exports = function() {\n\tvar vnode = hyperscriptVnode.apply(0, arguments)\n\n\tvnode.tag = \"[\"\n\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\treturn vnode\n}\n\n},{\"../render/vnode\":29,\"./hyperscriptVnode\":26}],25:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\n\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\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}\n\nfunction execSelector(state, vnode) {\n\tvar attrs = vnode.attrs\n\tvar children = Vnode.normalizeChildren(vnode.children)\n\tvar hasClass = hasOwn.call(attrs, \"class\")\n\tvar className = hasClass ? attrs.class : attrs.className\n\n\tvnode.tag = state.tag\n\tvnode.attrs = null\n\tvnode.children = undefined\n\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]\n\t\t}\n\n\t\tattrs = newAttrs\n\t}\n\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)){\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className != null || state.attrs.className != null) attrs.className =\n\t\tclassName != null\n\t\t\t? state.attrs.className != null\n\t\t\t\t? String(state.attrs.className) + \" \" + String(className)\n\t\t\t\t: className\n\t\t\t: state.attrs.className != null\n\t\t\t\t? state.attrs.className\n\t\t\t\t: null\n\n\tif (hasClass) attrs.class = null\n\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\tvnode.attrs = attrs\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\tvnode.text = children[0].children\n\t} else {\n\t\tvnode.children = children\n\t}\n\n\treturn vnode\n}\n\nfunction hyperscript(selector) {\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\n\tvar vnode = hyperscriptVnode.apply(1, arguments)\n\n\tif (typeof selector === \"string\") {\n\t\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\t\tif (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)\n\t}\n\n\tvnode.tag = selector\n\treturn vnode\n}\n\nmodule.exports = hyperscript\n\n},{\"../render/vnode\":29,\"./hyperscriptVnode\":26}],26:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\n// Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n// another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n// than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n// if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n// if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n// } else {\n// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n// attrs = undefined\n// }\n//\n// if (attrs == null) attrs = {}\n// return Vnode(\"\", attrs.key, attrs, children)\n// }\nmodule.exports = function() {\n\tvar attrs = arguments[this], start = this + 1, children\n\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 = this\n\t}\n\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\n\treturn Vnode(\"\", attrs.key, attrs, children)\n}\n\n},{\"../render/vnode\":29}],27:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function($window) {\n\tvar $doc = $window && $window.document\n\tvar currentRedraw\n\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\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\n\t//sanity check to discourage people from doing `vnode.state = ...`\n\tfunction checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}\n\n\t//Note: the hook is passed as the `this` argument to allow proxying the\n\t//arguments without requiring a full array allocation to do so. It also\n\t//takes advantage of the fact the current `vnode` is the first argument in\n\t//all lifecycle methods.\n\tfunction callHook(vnode) {\n\t\tvar original = vnode.state\n\t\ttry {\n\t\t\treturn this.apply(original, arguments)\n\t\t} finally {\n\t\t\tcheckState(vnode, original)\n\t\t}\n\t}\n\n\t// IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n\t// inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\tfunction activeElement() {\n\t\ttry {\n\t\t\treturn $doc.activeElement\n\t\t} catch (e) {\n\t\t\treturn null\n\t\t}\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 \"#\": createText(parent, vnode, nextSibling); break\n\t\t\t\tcase \"<\": createHTML(parent, vnode, ns, nextSibling); break\n\t\t\t\tcase \"[\": createFragment(parent, vnode, hooks, ns, nextSibling); break\n\t\t\t\tdefault: createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse 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}\n\tvar possibleParents = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}\n\tfunction createHTML(parent, vnode, ns, nextSibling) {\n\t\tvar match = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\t// not using the proper parent makes the child element(s) vanish.\n\t\t// var div = document.createElement(\"div\")\n\t\t// div.innerHTML = \"<td>i</td><td>j</td>\"\n\t\t// console.log(div.innerHTML)\n\t\t// --> \"ij\", no <td> in sight.\n\t\tvar temp = $doc.createElement(possibleParents[match[1]] || \"div\")\n\t\tif (ns === \"http://www.w3.org/2000/svg\") {\n\t\t\ttemp.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\">\" + vnode.children + \"</svg>\"\n\t\t\ttemp = temp.firstChild\n\t\t} else {\n\t\t\ttemp.innerHTML = vnode.children\n\t\t}\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\t// Capture nodes to remove, so we don't confuse them.\n\t\tvnode.instance = []\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tvnode.instance.push(child)\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\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}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs = vnode.attrs\n\t\tvar is = attrs && attrs.is\n\n\t\tns = getNameSpace(vnode) || ns\n\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\n\t\tif (attrs != null) {\n\t\t\tsetAttrs(vnode, attrs, ns)\n\t\t}\n\n\t\tinsertNode(parent, element, nextSibling)\n\n\t\tif (!maybeSetContentEditable(vnode)) {\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\tif (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs)\n\t\t\t}\n\t\t}\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\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\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\tinitLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, 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\tcreateNode(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}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t}\n\t}\n\n\t//update\n\t/**\n\t * @param {Element|Fragment} parent - the parent element\n\t * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n\t * this part of the tree\n\t * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n\t * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n\t * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n\t * fragment that is not the last item in its\n\t * parent\n\t * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n\t * @returns void\n\t */\n\t// This function diffs and patches lists of vnodes, both keyed and unkeyed.\n\t//\n\t// We will:\n\t//\n\t// 1. describe its general structure\n\t// 2. focus on the diff algorithm optimizations\n\t// 3. discuss DOM node operations.\n\n\t// ## Overview:\n\t//\n\t// The updateNodes() function:\n\t// - deals with trivial cases\n\t// - determines whether the lists are keyed or unkeyed based on the first non-null node\n\t// of each list.\n\t// - diffs them and patches the DOM if needed (that's the brunt of the code)\n\t// - manages the leftovers: after diffing, are there:\n\t// - old nodes left to remove?\n\t// \t - new nodes to insert?\n\t// \t deal with them!\n\t//\n\t// The lists are only iterated over once, with an exception for the nodes in `old` that\n\t// are visited in the fourth part of the diff and in the `removeNodes` loop.\n\n\t// ## Diffing\n\t//\n\t// Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n\t// may be good for context on longest increasing subsequence-based logic for moving nodes.\n\t//\n\t// In order to diff keyed lists, one has to\n\t//\n\t// 1) match nodes in both lists, per key, and update them accordingly\n\t// 2) create the nodes present in the new list, but absent in the old one\n\t// 3) remove the nodes present in the old list, but absent in the new one\n\t// 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n\t//\n\t// To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n\t// over the new list and for each new vnode, find the corresponding vnode in the old list using\n\t// the map.\n\t// 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n\t// and must be created.\n\t// For the removals, we actually remove the nodes that have been updated from the old list.\n\t// The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n\t// The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n\t// algorithm.\n\t//\n\t// the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n\t// from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n\t// corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n\t// match the above lists, for example).\n\t//\n\t// In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n\t// can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n\t//\n\t// @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n\t// the longest increasing subsequence *of old nodes still present in the new list*).\n\t//\n\t// It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n\t// and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n\t// the `LIS` and a temporary one to create the LIS).\n\t//\n\t// So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n\t// the LIS and can be updated without moving them.\n\t//\n\t// If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n\t// the exception of the last node if the list is fully reversed).\n\t//\n\t// ## Finding the next sibling.\n\t//\n\t// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n\t// When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n\t// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n\t// list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n\t//\n\t// In the other scenarios (swaps, upwards traversal, map-based diff),\n\t// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n\t// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node\n\t// as the next sibling (cached in the `nextSibling` variable).\n\n\n\t// ## DOM node moves\n\t//\n\t// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n\t// this is not the case if the node moved (second and fourth part of the diff algo). We move\n\t// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n\t// variable rather than fetching it using `getNextSibling()`.\n\t//\n\t// The fourth part of the diff currently inserts nodes unconditionally, leading to issues\n\t// like #1791 and #1999. We need to be smarter about those situations where adjascent old\n\t// nodes remain together in the new list in a way that isn't covered by parts one and\n\t// three of the diff algo.\n\n\tfunction updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)\n\t\telse {\n\t\t\tvar isOldKeyed = old[0] != null && old[0].key != null\n\t\t\tvar isKeyed = vnodes[0] != null && vnodes[0].key != null\n\t\t\tvar start = 0, oldStart = 0\n\t\t\tif (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) oldStart++\n\t\t\tif (!isKeyed) while (start < vnodes.length && vnodes[start] == null) start++\n\t\t\tif (isKeyed === null && isOldKeyed == null) return // both lists are full of nulls\n\t\t\tif (isOldKeyed !== isKeyed) {\n\t\t\t\tremoveNodes(parent, old, oldStart, old.length)\n\t\t\t\tcreateNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else if (!isKeyed) {\n\t\t\t\t// Don't index past the end of either list (causes deopts).\n\t\t\t\tvar commonLength = old.length < vnodes.length ? old.length : vnodes.length\n\t\t\t\t// Rewind if necessary to the first non-null index on either side.\n\t\t\t\t// We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n\t\t\t\t// but that would be optimizing for sparse lists which are more rare than dense ones.\n\t\t\t\tstart = start < oldStart ? start : oldStart\n\t\t\t\tfor (; start < commonLength; start++) {\n\t\t\t\t\to = old[start]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o === v || o == null && v == null) continue\n\t\t\t\t\telse if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))\n\t\t\t\t\telse if (v == null) removeNode(parent, o)\n\t\t\t\t\telse updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\tif (old.length > commonLength) removeNodes(parent, old, start, old.length)\n\t\t\t\tif (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else {\n\t\t\t\t// keyed diff\n\t\t\t\tvar oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling\n\n\t\t\t\t// bottom-up\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\t// top-down\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o.key !== v.key) break\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tif (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\t// swaps and list reversals\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (start === end) break\n\t\t\t\t\tif (o.key !== ve.key || oe.key !== v.key) break\n\t\t\t\t\ttopSibling = getNextSibling(old, oldStart, nextSibling)\n\t\t\t\t\tmoveNodes(parent, oe, topSibling)\n\t\t\t\t\tif (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)\n\t\t\t\t\tif (++start <= --end) moveNodes(parent, o, nextSibling)\n\t\t\t\t\tif (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldStart++; oldEnd--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t}\n\t\t\t\t// bottom up once again\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t}\n\t\t\t\tif (start > end) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\telse if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\telse {\n\t\t\t\t\t// inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n\t\t\t\t\tvar originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li=0, i=0, pos = 2147483647, matched = 0, map, lisIndices\n\t\t\t\t\tfor (i = 0; i < vnodesLength; i++) oldIndices[i] = -1\n\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\tif (map == null) map = getKeyMap(old, oldStart, oldEnd + 1)\n\t\t\t\t\t\tve = vnodes[i]\n\t\t\t\t\t\tvar oldIndex = map[ve.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tpos = (oldIndex < pos) ? oldIndex : -1 // becomes -1 if nodes were re-ordered\n\t\t\t\t\t\t\toldIndices[i-start] = oldIndex\n\t\t\t\t\t\t\toe = old[oldIndex]\n\t\t\t\t\t\t\told[oldIndex] = null\n\t\t\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\t\t\tmatched++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnextSibling = originalNextSibling\n\t\t\t\t\tif (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\t\tif (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (pos === -1) {\n\t\t\t\t\t\t\t// the indices of the indices of the items that are part of the\n\t\t\t\t\t\t\t// longest increasing subsequence in the oldIndices list\n\t\t\t\t\t\t\tlisIndices = makeLisIndices(oldIndices)\n\t\t\t\t\t\t\tli = lisIndices.length - 1\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (lisIndices[li] === i - start) li--\n\t\t\t\t\t\t\t\t\telse moveNodes(parent, v, nextSibling)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, 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.events = old.events\n\t\t\tif (shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tupdateLifecycle(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, ns, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(parent, old)\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, ns, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\tremoveHTML(parent, old)\n\t\t\tcreateHTML(parent, vnode, ns, nextSibling)\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t}\n\t}\n\tfunction updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, 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, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\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 handle 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 (!maybeSetContentEditable(vnode)) {\n\t\t\tif (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t\tupdateNodes(element, old.children, vnode.children, hooks, null, ns)\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tupdateLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\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, 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(parent, old.instance)\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 getKeyMap(vnodes, start, end) {\n\t\tvar map = Object.create(null)\n\t\tfor (; start < end; start++) {\n\t\t\tvar vnode = vnodes[start]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key = vnode.key\n\t\t\t\tif (key != null) map[key] = start\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\t// Lifted from ivi https://github.com/ivijs/ivi/\n\t// takes a list of unique numbers (-1 is special and can\n\t// occur multiple times) and returns an array with the indices\n\t// of the items that are part of the longest increasing\n\t// subsequece\n\tvar lisTemp = []\n\tfunction makeLisIndices(a) {\n\t\tvar result = [0]\n\t\tvar u = 0, v = 0, i = 0\n\t\tvar il = lisTemp.length = a.length\n\t\tfor (var i = 0; i < il; i++) lisTemp[i] = a[i]\n\t\tfor (var i = 0; i < il; ++i) {\n\t\t\tif (a[i] === -1) continue\n\t\t\tvar j = result[result.length - 1]\n\t\t\tif (a[j] < a[i]) {\n\t\t\t\tlisTemp[i] = j\n\t\t\t\tresult.push(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu = 0\n\t\t\tv = result.length - 1\n\t\t\twhile (u < v) {\n\t\t\t\t// Fast integer average without overflow.\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tvar c = (u >>> 1) + (v >>> 1) + (u & v & 1)\n\t\t\t\tif (a[result[c]] < a[i]) {\n\t\t\t\t\tu = c + 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tv = c\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a[i] < a[result[u]]) {\n\t\t\t\tif (u > 0) lisTemp[i] = result[u - 1]\n\t\t\t\tresult[u] = i\n\t\t\t}\n\t\t}\n\t\tu = result.length\n\t\tv = result[u - 1]\n\t\twhile (u-- > 0) {\n\t\t\tresult[u] = v\n\t\t\tv = lisTemp[v]\n\t\t}\n\t\tlisTemp.length = 0\n\t\treturn result\n\t}\n\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\n\t// This covers a really specific edge case:\n\t// - Parent node is keyed and contains child\n\t// - Child is removed, returns unresolved promise in `onbeforeremove`\n\t// - Parent node is moved in keyed diff\n\t// - Remaining children still need moved appropriately\n\t//\n\t// Ideally, I'd track removed nodes as well, but that introduces a lot more\n\t// complexity and I'm not exactly interested in doing that.\n\tfunction moveNodes(parent, vnode, nextSibling) {\n\t\tvar frag = $doc.createDocumentFragment()\n\t\tmoveChildToFrag(parent, frag, vnode)\n\t\tinsertNode(parent, frag, nextSibling)\n\t}\n\tfunction moveChildToFrag(parent, frag, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\t\t\tfrag.appendChild(vnode.instance[i])\n\t\t\t\t}\n\t\t\t} else if (vnode.tag !== \"[\") {\n\t\t\t\t// Don't recurse for text nodes *or* elements, just fragments\n\t\t\t\tfrag.appendChild(vnode.dom)\n\t\t\t} else if (vnode.children.length === 1) {\n\t\t\t\tvnode = vnode.children[0]\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\tif (child != null) moveChildToFrag(parent, frag, child)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling != null) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\n\tfunction maybeSetContentEditable(vnode) {\n\t\tif (vnode.attrs == null || (\n\t\t\tvnode.attrs.contenteditable == null && // attribute\n\t\t\tvnode.attrs.contentEditable == null // property\n\t\t)) return false\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\treturn true\n\t}\n\n\t//remove\n\tfunction removeNodes(parent, vnodes, start, end) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) removeNode(parent, vnode)\n\t\t}\n\t}\n\tfunction removeNode(parent, vnode) {\n\t\tvar mask = 0\n\t\tvar original = vnode.state\n\t\tvar stateResult, attrsResult\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.state.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\tmask = 1\n\t\t\t\tstateResult = result\n\t\t\t}\n\t\t}\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.attrs.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tmask |= 2\n\t\t\t\tattrsResult = result\n\t\t\t}\n\t\t}\n\t\tcheckState(vnode, original)\n\n\t\t// If we can, try to fast-path it and avoid all the overhead of awaiting\n\t\tif (!mask) {\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t} else {\n\t\t\tif (stateResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 1) { mask &= 2; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tstateResult.then(next, next)\n\t\t\t}\n\t\t\tif (attrsResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 2) { mask &= 1; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tattrsResult.then(next, next)\n\t\t\t}\n\t\t}\n\n\t\tfunction reallyRemove() {\n\t\t\tcheckState(vnode, original)\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t}\n\t}\n\tfunction removeHTML(parent, vnode) {\n\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\tparent.removeChild(vnode.instance[i])\n\t\t}\n\t}\n\tfunction removeChild(parent, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tremoveHTML(parent, vnode)\n\t\t\t} else {\n\t\t\t\tif (vnode.tag !== \"[\") {\n\t\t\t\t\tparent.removeChild(vnode.dom)\n\t\t\t\t\tif (!Array.isArray(vnode.children)) break\n\t\t\t\t}\n\t\t\t\tif (vnode.children.length === 1) {\n\t\t\t\t\tvnode = vnode.children[0]\n\t\t\t\t\tif (vnode != null) continue\n\t\t\t\t} else {\n\t\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\t\tif (child != null) removeChild(parent, child)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tfunction onremove(vnode) {\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode)\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\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\n\t//attrs\n\tfunction setAttrs(vnode, attrs, ns) {\n\t\tfor (var key in attrs) {\n\t\t\tsetAttr(vnode, key, null, attrs[key], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key, old, value, ns) {\n\t\tif (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || (old === value && !isFormAttribute(vnode, key)) && typeof value !== \"object\") return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value)\n\t\tif (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, value)\n\t\telse if (hasPropertyKey(vnode, key, ns)) {\n\t\t\tif (key === \"value\") {\n\t\t\t\t// Only do the coercion if we're actually going to check the value.\n\t\t\t\t/* eslint-disable 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 === \"\" + value && vnode.dom === 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\" && old !== null && vnode.dom.value === \"\" + value) return\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 === \"\" + value) return\n\t\t\t\t/* eslint-enable no-implicit-coercion */\n\t\t\t}\n\t\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t\tif (vnode.tag === \"input\" && key === \"type\") vnode.dom.setAttribute(key, value)\n\t\t\telse vnode.dom[key] = value\n\t\t} else {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) vnode.dom.setAttribute(key, \"\")\n\t\t\t\telse vnode.dom.removeAttribute(key)\n\t\t\t}\n\t\t\telse vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value)\n\t\t}\n\t}\n\tfunction removeAttr(vnode, key, old, ns) {\n\t\tif (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return\n\t\tif (key[0] === \"o\" && key[1] === \"n\" && !isLifecycleMethod(key)) updateEvent(vnode, key, undefined)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, null)\n\t\telse if (\n\t\t\thasPropertyKey(vnode, key, ns)\n\t\t\t&& key !== \"className\"\n\t\t\t&& !(key === \"value\" && (\n\t\t\t\tvnode.tag === \"option\"\n\t\t\t\t|| vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement()\n\t\t\t))\n\t\t\t&& !(vnode.tag === \"input\" && key === \"type\")\n\t\t) {\n\t\t\tvnode.dom[key] = null\n\t\t} else {\n\t\t\tvar nsLastIndex = key.indexOf(\":\")\n\t\t\tif (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1)\n\t\t\tif (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key)\n\t\t}\n\t}\n\tfunction setLateSelectAttrs(vnode, attrs) {\n\t\tif (\"value\" in attrs) {\n\t\t\tif(attrs.value === null) {\n\t\t\t\tif (vnode.dom.selectedIndex !== -1) vnode.dom.value = null\n\t\t\t} else {\n\t\t\t\tvar normalized = \"\" + attrs.value // eslint-disable-line no-implicit-coercion\n\t\t\t\tif (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n\t\t\t\t\tvnode.dom.value = normalized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined)\n\t}\n\tfunction updateAttrs(vnode, old, attrs, ns) {\n\t\tif (attrs != null) {\n\t\t\tfor (var key in attrs) {\n\t\t\t\tsetAttr(vnode, key, old && old[key], attrs[key], ns)\n\t\t\t}\n\t\t}\n\t\tvar val\n\t\tif (old != null) {\n\t\t\tfor (var key in old) {\n\t\t\t\tif (((val = old[key]) != null) && (attrs == null || attrs[key] == null)) {\n\t\t\t\t\tremoveAttr(vnode, key, val, ns)\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 === activeElement() || vnode.tag === \"option\" && vnode.dom.parentNode === $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 hasPropertyKey(vnode, key, ns) {\n\t\t// Filter out namespaced keys\n\t\treturn ns === undefined && (\n\t\t\t// If it's a custom element, just keep it.\n\t\t\tvnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is ||\n\t\t\t// If it's a normal element, let's try to avoid a few browser bugs.\n\t\t\tkey !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\"// && key !== \"type\"\n\t\t\t// Defer the property check until *after* we check everything.\n\t\t) && key in vnode.dom\n\t}\n\n\t//style\n\tvar uppercaseRegex = /[A-Z]/g\n\tfunction toLowerCase(capital) { return \"-\" + capital.toLowerCase() }\n\tfunction normalizeKey(key) {\n\t\treturn key[0] === \"-\" && key[1] === \"-\" ? key :\n\t\t\tkey === \"cssFloat\" ? \"float\" :\n\t\t\t\tkey.replace(uppercaseRegex, toLowerCase)\n\t}\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) {\n\t\t\t// Styles are equivalent, do nothing.\n\t\t} else if (style == null) {\n\t\t\t// New style is missing, just clear it.\n\t\t\telement.style.cssText = \"\"\n\t\t} else if (typeof style !== \"object\") {\n\t\t\t// New style is a string, let engine deal with patching.\n\t\t\telement.style.cssText = style\n\t\t} else if (old == null || typeof old !== \"object\") {\n\t\t\t// `old` is missing or a string, `style` is an object.\n\t\t\telement.style.cssText = \"\"\n\t\t\t// Add new style properties\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null) element.style.setProperty(normalizeKey(key), String(value))\n\t\t\t}\n\t\t} else {\n\t\t\t// Both old & new are (different) objects.\n\t\t\t// Update style properties that have changed\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null && (value = String(value)) !== String(old[key])) {\n\t\t\t\t\telement.style.setProperty(normalizeKey(key), value)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove style properties that no longer exist\n\t\t\tfor (var key in old) {\n\t\t\t\tif (old[key] != null && style[key] == null) {\n\t\t\t\t\telement.style.removeProperty(normalizeKey(key))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Here's an explanation of how this works:\n\t// 1. The event names are always (by design) prefixed by `on`.\n\t// 2. The EventListener interface accepts either a function or an object\n\t// with a `handleEvent` method.\n\t// 3. The object does not inherit from `Object.prototype`, to avoid\n\t// any potential interference with that (e.g. setters).\n\t// 4. The event name is remapped to the handler before calling it.\n\t// 5. In function-based event handlers, `ev.target === this`. We replicate\n\t// that below.\n\t// 6. In function-based event handlers, `return false` prevents the default\n\t// action and stops event propagation. We replicate that below.\n\tfunction EventDict() {\n\t\t// Save this, so the current redraw is correctly tracked.\n\t\tthis._ = currentRedraw\n\t}\n\tEventDict.prototype = Object.create(null)\n\tEventDict.prototype.handleEvent = function (ev) {\n\t\tvar handler = this[\"on\" + ev.type]\n\t\tvar result\n\t\tif (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev)\n\t\telse if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev)\n\t\tif (this._ && ev.redraw !== false) (0, this._)()\n\t\tif (result === false) {\n\t\t\tev.preventDefault()\n\t\t\tev.stopPropagation()\n\t\t}\n\t}\n\n\t//event\n\tfunction updateEvent(vnode, key, value) {\n\t\tif (vnode.events != null) {\n\t\t\tif (vnode.events[key] === value) return\n\t\t\tif (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\t\tif (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = value\n\t\t\t} else {\n\t\t\t\tif (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = undefined\n\t\t\t}\n\t\t} else if (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\tvnode.events = new EventDict()\n\t\t\tvnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\tvnode.events[key] = value\n\t\t}\n\t}\n\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tdo {\n\t\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.state.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\treturn false\n\t\t} while (false); // eslint-disable-line no-constant-condition\n\t\tvnode.dom = old.dom\n\t\tvnode.domSize = old.domSize\n\t\tvnode.instance = old.instance\n\t\t// One would think having the actual latest attributes would be ideal,\n\t\t// but it doesn't let us properly diff based on our current internal\n\t\t// representation. We have to save not only the old DOM info, but also\n\t\t// the attributes used to create it, as we diff *that*, not against the\n\t\t// DOM directly (with a few exceptions in `setAttr`). And, of course, we\n\t\t// need to save the children and text as they are conceptually not\n\t\t// unlike special \"attributes\" internally.\n\t\tvnode.attrs = old.attrs\n\t\tvnode.children = old.children\n\t\tvnode.text = old.text\n\t\treturn true\n\t}\n\n\treturn function(dom, vnodes, redraw) {\n\t\tif (!dom) throw new TypeError(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = activeElement()\n\t\tvar namespace = dom.namespaceURI\n\n\t\t// First time rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\n\t\tvnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes])\n\t\tvar prevRedraw = currentRedraw\n\t\ttry {\n\t\t\tcurrentRedraw = typeof redraw === \"function\" ? redraw : undefined\n\t\t\tupdateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\t} finally {\n\t\t\tcurrentRedraw = prevRedraw\n\t\t}\n\t\tdom.vnodes = vnodes\n\t\t// `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\t\tif (active != null && activeElement() !== active && typeof active.focus === \"function\") active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n}\n\n},{\"../render/vnode\":29}],28:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\n\n},{\"../render/vnode\":29}],29:[function(require,module,exports){\n\"use strict\"\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}\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 === \"boolean\") return null\n\tif (typeof node === \"object\") return node\n\treturn Vnode(\"#\", undefined, undefined, String(node), undefined, undefined)\n}\nVnode.normalizeChildren = function(input) {\n\tvar children = []\n\tif (input.length) {\n\t\tvar isKeyed = input[0] != null && input[0].key != null\n\t\t// Note: this is a *very* perf-sensitive check.\n\t\t// Fun fact: merging the loop like this is somehow faster than splitting\n\t\t// it, noticeably so.\n\t\tfor (var i = 1; i < input.length; i++) {\n\t\t\tif ((input[i] != null && input[i].key != null) !== isKeyed) {\n\t\t\t\tthrow new TypeError(\"Vnodes must either always have keys or never have keys!\")\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\tchildren[i] = Vnode.normalize(input[i])\n\t\t}\n\t}\n\treturn children\n}\n\nmodule.exports = Vnode\n\n},{}],30:[function(require,module,exports){\n\"use strict\"\n\nvar PromisePolyfill = require(\"./promise/promise\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./request/request\")(window, PromisePolyfill, mountRedraw.redraw)\n\n},{\"./mount-redraw\":14,\"./promise/promise\":20,\"./request/request\":31}],31:[function(require,module,exports){\n\"use strict\"\n\nvar buildPathname = require(\"../pathname/build\")\n\nmodule.exports = function($window, Promise, oncompletion) {\n\tvar callbackCount = 0\n\n\tfunction PromiseProxy(executor) {\n\t\treturn new Promise(executor)\n\t}\n\n\t// In case the global Promise is some userland library's where they rely on\n\t// `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n\t// similar. Let's *not* break them.\n\tPromiseProxy.prototype = Promise.prototype\n\tPromiseProxy.__proto__ = Promise // eslint-disable-line no-proto\n\n\tfunction makeRequest(factory) {\n\t\treturn function(url, args) {\n\t\t\tif (typeof url !== \"string\") { args = url; url = url.url }\n\t\t\telse if (args == null) args = {}\n\t\t\tvar promise = new Promise(function(resolve, reject) {\n\t\t\t\tfactory(buildPathname(url, args.params), args, function (data) {\n\t\t\t\t\tif (typeof args.type === \"function\") {\n\t\t\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tdata[i] = new args.type(data[i])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse data = new args.type(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(data)\n\t\t\t\t}, reject)\n\t\t\t})\n\t\t\tif (args.background === true) return promise\n\t\t\tvar count = 0\n\t\t\tfunction complete() {\n\t\t\t\tif (--count === 0 && typeof oncompletion === \"function\") oncompletion()\n\t\t\t}\n\n\t\t\treturn wrap(promise)\n\n\t\t\tfunction wrap(promise) {\n\t\t\t\tvar then = promise.then\n\t\t\t\t// Set the constructor, so engines know to not await or resolve\n\t\t\t\t// this as a native promise. At the time of writing, this is\n\t\t\t\t// only necessary for V8, but their behavior is the correct\n\t\t\t\t// behavior per spec. See this spec issue for more details:\n\t\t\t\t// https://github.com/tc39/ecma262/issues/1577. Also, see the\n\t\t\t\t// corresponding comment in `request/tests/test-request.js` for\n\t\t\t\t// a bit more background on the issue at hand.\n\t\t\t\tpromise.constructor = PromiseProxy\n\t\t\t\tpromise.then = function() {\n\t\t\t\t\tcount++\n\t\t\t\t\tvar next = then.apply(promise, arguments)\n\t\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\t\tcomplete()\n\t\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t\t})\n\t\t\t\t\treturn wrap(next)\n\t\t\t\t}\n\t\t\t\treturn promise\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasHeader(args, name) {\n\t\tfor (var key in args.headers) {\n\t\t\tif ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true\n\t\t}\n\t\treturn false\n\t}\n\n\treturn {\n\t\trequest: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar method = args.method != null ? args.method.toUpperCase() : \"GET\"\n\t\t\tvar body = args.body\n\t\t\tvar assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData)\n\t\t\tvar responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\")\n\n\t\t\tvar xhr = new $window.XMLHttpRequest(), aborted = false\n\t\t\tvar original = xhr, replacedAbort\n\t\t\tvar abort = xhr.abort\n\n\t\t\txhr.abort = function() {\n\t\t\t\taborted = true\n\t\t\t\tabort.call(this)\n\t\t\t}\n\n\t\t\txhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\n\t\t\tif (assumeJSON && body != null && !hasHeader(args, /^content-type$/i)) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (typeof args.deserialize !== \"function\" && !hasHeader(args, /^accept$/i)) {\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\tif (args.timeout) xhr.timeout = args.timeout\n\t\t\txhr.responseType = responseType\n\n\t\t\tfor (var key in args.headers) {\n\t\t\t\tif ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.onreadystatechange = function(ev) {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif (aborted) return\n\n\t\t\t\tif (ev.target.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar success = (ev.target.status >= 200 && ev.target.status < 300) || ev.target.status === 304 || (/^file:\\/\\//i).test(url)\n\t\t\t\t\t\t// When the response type isn't \"\" or \"text\",\n\t\t\t\t\t\t// `xhr.responseText` is the wrong thing to use.\n\t\t\t\t\t\t// Browsers do the right thing and throw here, and we\n\t\t\t\t\t\t// should honor that and do the right thing by\n\t\t\t\t\t\t// preferring `xhr.response` where possible/practical.\n\t\t\t\t\t\tvar response = ev.target.response, message\n\n\t\t\t\t\t\tif (responseType === \"json\") {\n\t\t\t\t\t\t\t// For IE and Edge, which don't implement\n\t\t\t\t\t\t\t// `responseType: \"json\"`.\n\t\t\t\t\t\t\tif (!ev.target.responseType && typeof args.extract !== \"function\") response = JSON.parse(ev.target.responseText)\n\t\t\t\t\t\t} else if (!responseType || responseType === \"text\") {\n\t\t\t\t\t\t\t// Only use this default if it's text. If a parsed\n\t\t\t\t\t\t\t// document is needed on old IE and friends (all\n\t\t\t\t\t\t\t// unsupported), the user should use a custom\n\t\t\t\t\t\t\t// `config` instead. They're already using this at\n\t\t\t\t\t\t\t// their own risk.\n\t\t\t\t\t\t\tif (response == null) response = ev.target.responseText\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof args.extract === \"function\") {\n\t\t\t\t\t\t\tresponse = args.extract(ev.target, args)\n\t\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\t} else if (typeof args.deserialize === \"function\") {\n\t\t\t\t\t\t\tresponse = args.deserialize(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (success) resolve(response)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttry { message = ev.target.responseText }\n\t\t\t\t\t\t\tcatch (e) { message = response }\n\t\t\t\t\t\t\tvar error = new Error(message)\n\t\t\t\t\t\t\terror.code = ev.target.status\n\t\t\t\t\t\t\terror.response = response\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\n\t\t\tif (typeof args.config === \"function\") {\n\t\t\t\txhr = args.config(xhr, args, url) || xhr\n\n\t\t\t\t// Propagate the `abort` to any replacement XHR as well.\n\t\t\t\tif (xhr !== original) {\n\t\t\t\t\treplacedAbort = xhr.abort\n\t\t\t\t\txhr.abort = function() {\n\t\t\t\t\t\taborted = true\n\t\t\t\t\t\treplacedAbort.call(this)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body == null) xhr.send()\n\t\t\telse if (typeof args.serialize === \"function\") xhr.send(args.serialize(body))\n\t\t\telse if (body instanceof $window.FormData) xhr.send(body)\n\t\t\telse xhr.send(JSON.stringify(body))\n\t\t}),\n\t\tjsonp: makeRequest(function(url, args, 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\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(data)\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t}\n\t\t\tscript.src = url + (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") +\n\t\t\t\tencodeURIComponent(args.callbackKey || \"callback\") + \"=\" +\n\t\t\t\tencodeURIComponent(callbackName)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t}),\n\t}\n}\n\n},{\"../pathname/build\":16}],32:[function(require,module,exports){\n\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./api/router\")(window, mountRedraw)\n\n},{\"./api/router\":11,\"./mount-redraw\":14}],33:[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},{}],34:[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\":33,\"timers\":34}],35:[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},{}]},{},[1]);\n"]}
|
1 |
+
{"version":3,"sources":["admin.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","obj","_tlite","__esModule","default","tabs","settings","helpers","el","className","indexOf","window","mc4wp","./admin/fields/mailchimp-api-key.js","./admin/helpers.js","./admin/list-fetcher.js","./admin/list-overview.js","./admin/settings.js","./admin/show-if.js","./admin/tabs.js","tlite","2","field","document","getElementById","addEventListener","evt","node","createElement","innerText","mc4wp_vars","i18n","invalid_api_key","nextElementSibling","parentElement","removeChild","value","match","insertBefore","3","debounce","func","wait","immediate","timeout","context","this","args","arguments","callNow","clearTimeout","setTimeout","apply","4","config","ajaxurl","m","state","working","done","success","fetch","preventDefault","request","method","url","then","data","location","reload","redraw","mount","mailchimp","api_connected","lists","view","onsubmit","bind","type","fetching_mailchimp_lists","renew_mailchimp_lists","disabled","trust","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","mithril","5","showDetails","link","target","next","listID","getAttribute","querySelector","style","display","details","render","merge_fields","map","name","required","tag","options","date_format","choices","join","interest_categories","title","id","Object","keys","interests","shift","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","table","6","_typeof","Symbol","iterator","constructor","listInputs","querySelectorAll","selectedLists","listeners","updateSelectedLists","forEach","input","checked","push","rows","isSelected","searchKey","searchValue","filter","getSelectedListsWhere","toggleVisibleLists","event","emit","getSelectedLists","on","7","showIfElements","element","JSON","parse","parentElements","inputs","hide","undefined","toggleElement","conditionMet","String","visibility","opacity","inputElement","readOnly","8","URL","tabElements","tabNavElements","refererField","get","_open","tab","updateState","replace","nav","blur","setParameter","href","history","pushState","tb_remove","forms","editor","refresh","split","switchTab","tabId","urlParams","returnValue","substring","textContent","open","body","activeTab","offsetParent","replaceState","init","./url.js","9","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","key","10","Vnode","schedule","console","subscriptions","rendering","pending","sync","error","root","component","TypeError","index","splice","../render/vnode","11","setImmediate","Promise","buildPathname","parsePathname","compileTemplate","assign","sentinel","$window","mountRedraw","fireAsync","setPath","path","route","prefix","attrs","currentPath","lastUpdate","currentResolver","SKIP","defaultRoute","routes","onremove","compiled","SyntaxError","test","check","callAsync","resolve","scheduled","defaultData","some","ReferenceError","resolveRoute","hash","search","pathname","concat","slice","fail","params","loop","payload","matchedRoute","localComp","update","comp","onmatch","removeEventListener","onbeforeupdate","oncreate","vnode","set","Link","onclick","selector","oninit","onupdate","onbeforeremove","child","children","Boolean","result","currentTarget","handleEvent","defaultPrevented","button","which","ctrlKey","metaKey","shiftKey","altKey","param","../pathname/assign","../pathname/build","../pathname/compileTemplate","../pathname/parse","../promise/promise","../render/hyperscript","timers","12","hyperscript","fragment","./render/fragment","./render/hyperscript","./render/trust","13","jsonp","parseQueryString","buildQueryString","PromisePolyfill","./hyperscript","./mount-redraw","./pathname/build","./pathname/parse","./promise/polyfill","./querystring/build","./querystring/parse","./render","./render/vnode","./request","./route","14","requestAnimationFrame","./api/mount-redraw","15","source","16","template","queryIndex","hashIndex","queryEnd","pathEnd","resolved","variadic","newQueryIndex","newHashIndex","newQueryEnd","newPathEnd","querystring","../querystring/build","./assign","17","templateData","templateKeys","regexp","RegExp","extra","k","values","exec","./parse","18","../querystring/parse","19","executor","self","resolvers","rejectors","resolveCurrent","handler","rejectCurrent","instance","_instance","list","shouldAbsorb","execute","retry","executeOnce","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","promise","reject","catch","finally","reason","all","total","count","consume","race","20","global","./polyfill","21","object","toString","destructure","Array","isArray","22","string","charAt","entries","counters","entry","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","desc","getOwnPropertyDescriptor","23","./render/render","24","hyperscriptVnode","normalizeChildren","./hyperscriptVnode","25","selectorParser","selectorCache","hasOwn","isEmpty","hasClass","class","newAttrs","text","execSelector","classes","attrValue","compileSelector","26","start","27","currentRedraw","$doc","nameSpace","svg","math","getNameSpace","xmlns","checkState","original","callHook","activeElement","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initLifecycle","dom","createTextNode","insertNode","createText","createHTML","createDocumentFragment","firstChild","domSize","childNodes","createFragment","is","createElementNS","setAttr","setAttrs","maybeSetContentEditable","selectedIndex","normalized","setLateSelectAttrs","create","$$reentrantLock$$","normalize","initComponent","createComponent","possibleParents","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","appendChild","updateNodes","old","removeNodes","isOldKeyed","isKeyed","oldStart","v","oe","ve","topSibling","oldEnd","updateNode","getNextSibling","moveNodes","lisIndices","originalNextSibling","vnodesLength","oldIndices","li","pos","matched","getKeyMap","oldIndex","il","lisTemp","makeLisIndices","commonLength","removeNode","oldTag","events","force","shouldNotUpdate","updateLifecycle","nodeValue","updateText","removeHTML","updateHTML","updateFragment","val","removeAttr","updateAttrs","updateElement","updateComponent","frag","moveChildToFrag","parentNode","contenteditable","contentEditable","content","stateResult","attrsResult","mask","reallyRemove","isLifecycleMethod","attr","isFormAttribute","updateEvent","setAttributeNS","updateStyle","hasPropertyKey","setAttribute","removeAttribute","nsLastIndex","uppercaseRegex","toLowerCase","capital","normalizeKey","cssText","setProperty","removeProperty","EventDict","_","ev","stopPropagation","active","namespace","namespaceURI","prevRedraw","focus","28","html","29","30","./promise/promise","./request/request","31","oncompletion","callbackCount","PromiseProxy","makeRequest","factory","background","complete","wrap","hasHeader","headers","__proto__","replacedAbort","toUpperCase","assumeJSON","serialize","FormData","responseType","extract","xhr","XMLHttpRequest","aborted","abort","async","user","password","setRequestHeader","deserialize","withCredentials","onreadystatechange","readyState","message","status","response","responseText","send","stringify","callbackName","Math","round","random","script","src","callbackKey","documentElement","32","./api/router","33","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","version","versions","addListener","once","off","removeListener","removeAllListeners","prependListener","prependOnceListener","binding","cwd","chdir","dir","umask","34","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js","35","getTooltipOpts","opts","show","isAuto","tooltipEl","showTimer","fallbackAttrib","autoHide","fadeIn","grav","vertGrav","horzGrav","positionTooltip","top","offsetTop","left","offsetLeft","width","offsetWidth","height","offsetHeight","tooltipHeight","tooltipWidth","centerEl","rect","getBoundingClientRect","bottom","innerHeight","right","innerWidth","createTooltip","tooltip","isAutoHiding"],"mappings":"CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,mBAAmBC,SAASA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAI,IAAIK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,KAAK,MAAMK,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEX,EAAEG,GAAG,CAACS,QAAQ,IAAIb,EAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGS,QAAQ,IAAI,IAAIL,EAAE,mBAAmBD,SAASA,QAAQH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACa,EAAE,CAAC,SAAST,EAAQU,EAAOJ,GACxe,aAEA,IAEgCK,EAF5BC,GAE4BD,EAFIX,EAAQ,WAESW,EAAIE,WAAaF,EAAM,CAAEG,QAAWH,GAGzF,IAAII,EAAOf,EAAQ,mBAEfgB,EAAWhB,EAAQ,uBAEnBiB,EAAUjB,EAAQ,uBAEtB,EAAIY,EAAgB,SAAG,SAAUM,GAC/B,OAAgD,EAAzCA,EAAGC,UAAUC,QAAQ,mBAG9BpB,EAAQ,2BAERA,E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ACjDnB,EAAW,IACXE,KAKF,OAFAR,EAAU1qB,WAAa,iBAEhB0qB,EAzES0B,CAAcrsB,EAAIqa,EAAMmQ,GAlC1CA,EAAOA,GAAQ,IAEdxqB,EAAGssB,UAEiB9B,EAFMA,GAEVxqB,EAFMA,GAOlBiB,iBAAiB,YAAa6pB,GACjC9qB,EAAGiB,iBAAiB,aAAc6pB,GA4B3B9qB,EAAGssB,QAAU,CAClB7B,KA3BF,WACEpQ,EAAOra,EAAGoG,OAASpG,EAAGoF,aAAaylB,IAAmBxQ,EACtDra,EAAGoG,MAAQ,GACXpG,EAAGiiB,aAAa4I,EAAgB,IAChCxQ,IAASuQ,IAAcA,EAAYjoB,WAAWooB,EAAQL,EAAS,IAAM,KAwBrE1hB,KAjBF,SAAcujB,GACZ,GAAI7B,IAAW6B,EAAc,CAC3B3B,EAAYloB,aAAakoB,GACzB,IAAInP,EAASkP,GAAaA,EAAUzJ,WACpCzF,GAAUA,EAAO9Z,YAAYgpB,GAC7BA,OAAY1hB,OA1BgBwhB,QA6GpC7pB,EAAMoI,KAAO,SAAUhJ,EAAI0qB,GACzB1qB,EAAGssB,SAAWtsB,EAAGssB,QAAQtjB,KAAK0hB,SAGV,IAAXlrB,GAA0BA,EAAOJ,UAC1CI,EAAOJ,QAAUwB,IAGjB,KAAK,GAAG,CAAC","file":"admin.min.js","sourcesContent":["(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\nvar _tlite = _interopRequireDefault(require(\"tlite\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// dependencies\nvar tabs = require('./admin/tabs.js');\n\nvar settings = require('./admin/settings.js');\n\nvar helpers = require('./admin/helpers.js');\n\n(0, _tlite[\"default\"])(function (el) {\n return el.className.indexOf('mc4wp-tooltip') > -1;\n});\n\nrequire('./admin/list-fetcher.js');\n\nrequire('./admin/fields/mailchimp-api-key.js');\n\nrequire('./admin/list-overview.js');\n\nrequire('./admin/show-if.js'); // expose some things\n\n\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/fields/mailchimp-api-key.js\":2,\"./admin/helpers.js\":3,\"./admin/list-fetcher.js\":4,\"./admin/list-overview.js\":5,\"./admin/settings.js\":6,\"./admin/show-if.js\":7,\"./admin/tabs.js\":8,\"tlite\":35}],2:[function(require,module,exports){\n\"use strict\";\n\nfunction validate(evt) {\n var node = document.createElement('p');\n node.className = 'help red';\n node.innerText = window.mc4wp_vars.i18n.invalid_api_key;\n\n if (field.nextElementSibling.innerText === node.innerText) {\n field.nextElementSibling.parentElement.removeChild(field.nextElementSibling);\n }\n\n if (!field.value.match(/^[0-9a-zA-Z*]{32}-[a-z]{2}[0-9]{1,2}$/)) {\n field.parentElement.insertBefore(node, field.nextElementSibling);\n }\n}\n\nvar field = document.getElementById('mailchimp_api_key');\n\nif (field) {\n field.addEventListener('change', validate);\n}\n\n},{}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (callNow) func.apply(context, args);\n };\n}\n\nmodule.exports = {\n debounce: debounce\n};\n\n},{}],4:[function(require,module,exports){\n\"use strict\";\n\nvar config = window.mc4wp_vars;\nvar i18n = window.mc4wp_vars.i18n;\nvar ajaxurl = window.mc4wp_vars.ajaxurl;\n\nvar m = require('mithril');\n\nvar state = {\n working: false,\n done: false,\n success: false\n};\n\nfunction fetch(evt) {\n evt && evt.preventDefault();\n state.working = true;\n state.done = false;\n m.request({\n method: 'POST',\n url: ajaxurl + '?action=mc4wp_renew_mailchimp_lists',\n timeout: 600000 // 10 minutes, matching max_execution_time\n\n }).then(function (data) {\n state.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n })[\"catch\"](function (data) {\n state.success = false;\n })[\"finally\"](function (data) {\n state.working = false;\n state.done = true;\n m.redraw();\n });\n}\n\nfunction view() {\n return m('form', {\n method: 'POST',\n onsubmit: fetch.bind(this)\n }, [m('p', [m('input', {\n type: 'submit',\n value: state.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: 'button',\n disabled: !!state.working\n }), m.trust(' '), state.working ? [m('span.mc4wp-loader', 'Loading...'), m.trust(' ')] : '', state.done ? [state.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n}\n\nvar mount = document.getElementById('mc4wp-list-fetcher');\n\nif (mount) {\n // start fetching right away when no lists but api key given\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n fetch();\n }\n\n m.mount(mount, {\n view: view\n });\n}\n\n},{\"mithril\":13}],5:[function(require,module,exports){\n\"use strict\";\n\nvar ajaxurl = window.mc4wp_vars.ajaxurl;\n\nvar m = require('mithril');\n\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\nfunction showDetails(evt) {\n evt.preventDefault();\n var link = evt.target;\n var next = link.parentElement.parentElement.nextElementSibling;\n var listID = link.getAttribute('data-list-id');\n var mount = next.querySelector('div');\n\n if (next.style.display === 'none') {\n m.request({\n method: 'GET',\n url: ajaxurl + '?action=mc4wp_get_list_details&ids=' + listID\n }).then(function (details) {\n m.render(mount, view(details.shift()));\n });\n next.style.display = '';\n } else {\n next.style.display = 'none';\n }\n}\n\nfunction view(data) {\n return [m('h3', 'Merge fields'), m('table.widefat.striped', [m('thead', [m('tr', [m('th', 'Name'), m('th', 'Tag'), m('th', 'Type')])]), m('tbody', data.merge_fields.map(function (f) {\n return m('tr', [m('td', [f.name, f.required && m('span.red', '*')]), m('td', [m('code', f.tag)]), m('td', [f.type, ' ', f.options && f.options.date_format ? '(' + f.options.date_format + ')' : '', f.options && f.options.choices ? '(' + f.options.choices.join(', ') + ')' : ''])]);\n }))]), data.interest_categories.length > 0 && [m('h3', 'Interest Categories'), m('table.striped.widefat', [m('thead', [m('tr', [m('th', 'Name'), m('th', 'Type'), m('th', 'Interests')])]), m('tbody', data.interest_categories.map(function (f) {\n return m('tr', [m('td', [m('strong', f.title), m('br'), m('br'), 'ID: ', m('code', f.id)]), m('td', f.type), m('td', [m('div.row', {\n style: 'margin-bottom: 4px;'\n }, [m('div.col.col-3', [m('strong', {\n style: 'display: block; border-bottom: 1px solid #eee;'\n }, 'Name')]), m('div.col.col-3', [m('strong', {\n style: 'display: block; border-bottom: 1px solid #eee;'\n }, 'ID')])]), Object.keys(f.interests).map(function (id) {\n return m('div.row.tiny-margin', [m('div.col.col-3', f.interests[id]), m('div.col.col-3', [m('code', {\n title: 'Interest ID'\n }, id)]), m('br.clearfix.clear.cf')]);\n })])]);\n }))])]];\n}\n\nvar table = document.getElementById('mc4wp-mailchimp-lists-overview');\n\nif (table) {\n table.addEventListener('click', function (evt) {\n if (!evt.target.matches('.mc4wp-mailchimp-list')) {\n return;\n }\n\n showDetails(evt);\n });\n}\n\n},{\"mithril\":13}],6:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; 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 context = document.getElementById('mc4wp-admin');\nvar listInputs = context.querySelectorAll('.mc4wp-list-input');\nvar lists = window.mc4wp_vars.mailchimp.lists;\nvar selectedLists = [];\nvar listeners = {}; // functions\n\nfunction getSelectedListsWhere(searchKey, searchValue) {\n return selectedLists.filter(function (el) {\n return el[searchKey] === searchValue;\n });\n}\n\nfunction getSelectedLists() {\n return selectedLists;\n}\n\nfunction updateSelectedLists() {\n selectedLists = [];\n [].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 toggleVisibleLists();\n emit('selectedLists.change', [selectedLists]);\n return selectedLists;\n}\n\nfunction toggleVisibleLists() {\n var rows = document.querySelectorAll('.lists--only-selected > *');\n [].forEach.call(rows, function (el) {\n var listId = el.getAttribute('data-list-id');\n var isSelected = getSelectedListsWhere('id', listId).length > 0;\n el.style.display = isSelected ? '' : 'none';\n });\n}\n\nfunction emit(event, args) {\n listeners[event] = listeners[event] || [];\n listeners[event].forEach(function (f) {\n return f.apply(null, args);\n });\n}\n\nfunction on(event, func) {\n listeners[event] = listeners[event] || [];\n listeners[event].push(func);\n}\n\n[].forEach.call(listInputs, function (el) {\n el.addEventListener('change', updateSelectedLists);\n});\nupdateSelectedLists();\nmodule.exports = {\n getSelectedLists: getSelectedLists,\n on: on\n};\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\n\nvar showIfElements = document.querySelectorAll('[data-showif]');\n[].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.type === 'radio' && !this.checked) {\n return;\n }\n\n var value = this.type === 'checkbox' ? this.checked : this.value;\n var conditionMet = String(value) === String(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 [].forEach.call(inputs, function (inputElement) {\n inputElement.readOnly = !conditionMet;\n });\n } // find checked element and call toggleElement function\n\n\n [].forEach.call(parentElements, function (el) {\n el.addEventListener('change', toggleElement);\n toggleElement.call(el);\n });\n});\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\nvar URL = require('./url.js');\n\nvar context = document.getElementById('mc4wp-admin');\nvar tabElements = context.querySelectorAll('.tab');\nvar tabNavElements = context.querySelectorAll('.nav-tab');\nvar refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\nvar tabs = [];\n\nif (!Element.prototype.matches) {\n Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\n[].forEach.call(tabElements, function (t, i) {\n var id = t.id.substring(4);\n var title = t.querySelector('h2:first-of-type').textContent;\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\nfunction 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 null;\n}\n\nfunction _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 [].forEach.call(tabElements, function (t) {\n t.className = t.className.replace('tab-active', '');\n t.style.display = ' none';\n });\n [].forEach.call(tabNavElements, function (t) {\n t.className = t.className.replace('nav-tab-active', '');\n }); // add `nav-tab-active` to this tab\n\n [].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 window.tb_remove === 'function') {\n window.tb_remove();\n } // refresh editor if open\n\n\n if (window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n window.mc4wp.forms.editor.refresh();\n }\n\n return true;\n}\n\nfunction title(tab) {\n var title = document.title.split('-');\n document.title = document.title.replace(title[0], tab.title + ' ');\n}\n\nfunction switchTab(evt) {\n var link = evt.target; // get from data attribute\n\n var tabId = link.getAttribute('data-tab'); // get from classname\n\n if (!tabId) {\n var match = link.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(link.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 evt.preventDefault();\n evt.returnValue = false;\n return false;\n }\n\n return true;\n}\n\nfunction init() {\n var activeTab = tabs.filter(function (t) {\n return t.element.offsetParent !== null;\n }).shift();\n\n if (!activeTab) {\n return;\n }\n\n var tab = get(activeTab.id.substring(4));\n\n if (!tab) {\n return;\n } // check if tab is in html5 history\n\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[].forEach.call(tabNavElements, function (el) {\n return el.addEventListener('click', switchTab);\n});\ndocument.body.addEventListener('click', function (evt) {\n if (!evt.target.matches('.tab-link')) {\n return;\n }\n\n switchTab(evt);\n});\ninit();\n\nif (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\nmodule.exports = {\n open: _open,\n get: get\n};\n\n},{\"./url.js\":9}],9:[function(require,module,exports){\n\"use strict\";\n\nfunction 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\nfunction 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\nfunction setParameter(url, key, value) {\n var data = parse(url);\n data[key] = value;\n return build(data);\n}\n\nmodule.exports = {\n parse: parse,\n build: build,\n setParameter: setParameter\n};\n\n},{}],10:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(render, schedule, console) {\n\tvar subscriptions = []\n\tvar rendering = false\n\tvar pending = false\n\n\tfunction sync() {\n\t\tif (rendering) throw new Error(\"Nested m.redraw.sync() call\")\n\t\trendering = true\n\t\tfor (var i = 0; i < subscriptions.length; i += 2) {\n\t\t\ttry { render(subscriptions[i], Vnode(subscriptions[i + 1]), redraw) }\n\t\t\tcatch (e) { console.error(e) }\n\t\t}\n\t\trendering = false\n\t}\n\n\tfunction redraw() {\n\t\tif (!pending) {\n\t\t\tpending = true\n\t\t\tschedule(function() {\n\t\t\t\tpending = false\n\t\t\t\tsync()\n\t\t\t})\n\t\t}\n\t}\n\n\tredraw.sync = sync\n\n\tfunction mount(root, component) {\n\t\tif (component != null && component.view == null && typeof component !== \"function\") {\n\t\t\tthrow new TypeError(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t}\n\n\t\tvar index = subscriptions.indexOf(root)\n\t\tif (index >= 0) {\n\t\t\tsubscriptions.splice(index, 2)\n\t\t\trender(root, [], redraw)\n\t\t}\n\n\t\tif (component != null) {\n\t\t\tsubscriptions.push(root, component)\n\t\t\trender(root, Vnode(component), redraw)\n\t\t}\n\t}\n\n\treturn {mount: mount, redraw: redraw}\n}\n\n},{\"../render/vnode\":29}],11:[function(require,module,exports){\n(function (setImmediate){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar m = require(\"../render/hyperscript\")\nvar Promise = require(\"../promise/promise\")\n\nvar buildPathname = require(\"../pathname/build\")\nvar parsePathname = require(\"../pathname/parse\")\nvar compileTemplate = require(\"../pathname/compileTemplate\")\nvar assign = require(\"../pathname/assign\")\n\nvar sentinel = {}\n\nmodule.exports = function($window, mountRedraw) {\n\tvar fireAsync\n\n\tfunction setPath(path, data, options) {\n\t\tpath = buildPathname(path, data)\n\t\tif (fireAsync != null) {\n\t\t\tfireAsync()\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, route.prefix + path)\n\t\t\telse $window.history.pushState(state, title, route.prefix + path)\n\t\t}\n\t\telse {\n\t\t\t$window.location.href = route.prefix + path\n\t\t}\n\t}\n\n\tvar currentResolver = sentinel, component, attrs, currentPath, lastUpdate\n\n\tvar SKIP = route.SKIP = {}\n\n\tfunction route(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\t// 0 = start\n\t\t// 1 = init\n\t\t// 2 = ready\n\t\tvar state = 0\n\n\t\tvar compiled = Object.keys(routes).map(function(route) {\n\t\t\tif (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a `/`\")\n\t\t\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(route)) {\n\t\t\t\tthrow new SyntaxError(\"Route parameter names must be separated with either `/`, `.`, or `-`\")\n\t\t\t}\n\t\t\treturn {\n\t\t\t\troute: route,\n\t\t\t\tcomponent: routes[route],\n\t\t\t\tcheck: compileTemplate(route),\n\t\t\t}\n\t\t})\n\t\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\t\tvar p = Promise.resolve()\n\t\tvar scheduled = false\n\t\tvar onremove\n\n\t\tfireAsync = null\n\n\t\tif (defaultRoute != null) {\n\t\t\tvar defaultData = parsePathname(defaultRoute)\n\n\t\t\tif (!compiled.some(function (i) { return i.check(defaultData) })) {\n\t\t\t\tthrow new ReferenceError(\"Default route doesn't match any known routes\")\n\t\t\t}\n\t\t}\n\n\t\tfunction resolveRoute() {\n\t\t\tscheduled = false\n\t\t\t// Consider the pathname holistically. The prefix might even be invalid,\n\t\t\t// but that's not our problem.\n\t\t\tvar prefix = $window.location.hash\n\t\t\tif (route.prefix[0] !== \"#\") {\n\t\t\t\tprefix = $window.location.search + prefix\n\t\t\t\tif (route.prefix[0] !== \"?\") {\n\t\t\t\t\tprefix = $window.location.pathname + prefix\n\t\t\t\t\tif (prefix[0] !== \"/\") prefix = \"/\" + prefix\n\t\t\t\t}\n\t\t\t}\n\t\t\t// This seemingly useless `.concat()` speeds up the tests quite a bit,\n\t\t\t// since the representation is consistently a relatively poorly\n\t\t\t// optimized cons string.\n\t\t\tvar path = prefix.concat()\n\t\t\t\t.replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\t\t\t.slice(route.prefix.length)\n\t\t\tvar data = parsePathname(path)\n\n\t\t\tassign(data.params, $window.history.state)\n\n\t\t\tfunction fail() {\n\t\t\t\tif (path === defaultRoute) throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t\t\tsetPath(defaultRoute, null, {replace: true})\n\t\t\t}\n\n\t\t\tloop(0)\n\t\t\tfunction loop(i) {\n\t\t\t\t// 0 = init\n\t\t\t\t// 1 = scheduled\n\t\t\t\t// 2 = done\n\t\t\t\tfor (; i < compiled.length; i++) {\n\t\t\t\t\tif (compiled[i].check(data)) {\n\t\t\t\t\t\tvar payload = compiled[i].component\n\t\t\t\t\t\tvar matchedRoute = compiled[i].route\n\t\t\t\t\t\tvar localComp = payload\n\t\t\t\t\t\tvar update = lastUpdate = function(comp) {\n\t\t\t\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\t\t\t\tif (comp === SKIP) return loop(i + 1)\n\t\t\t\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\t\t\t\tattrs = data.params, currentPath = path, lastUpdate = null\n\t\t\t\t\t\t\tcurrentResolver = payload.render ? payload : null\n\t\t\t\t\t\t\tif (state === 2) mountRedraw.redraw()\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tstate = 2\n\t\t\t\t\t\t\t\tmountRedraw.redraw.sync()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// There's no understating how much I *wish* I could\n\t\t\t\t\t\t// use `async`/`await` here...\n\t\t\t\t\t\tif (payload.view || typeof payload === \"function\") {\n\t\t\t\t\t\t\tpayload = {}\n\t\t\t\t\t\t\tupdate(localComp)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (payload.onmatch) {\n\t\t\t\t\t\t\tp.then(function () {\n\t\t\t\t\t\t\t\treturn payload.onmatch(data.params, path, matchedRoute)\n\t\t\t\t\t\t\t}).then(update, fail)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse update(\"div\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfail()\n\t\t\t}\n\t\t}\n\n\t\t// Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n\t\t// even if neither `pushState` nor `hashchange` are supported. It's\n\t\t// cleared if `hashchange` is used, since that makes it automatically\n\t\t// async.\n\t\tfireAsync = function() {\n\t\t\tif (!scheduled) {\n\t\t\t\tscheduled = true\n\t\t\t\tcallAsync(resolveRoute)\n\t\t\t}\n\t\t}\n\n\t\tif (typeof $window.history.pushState === \"function\") {\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"popstate\", fireAsync, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"popstate\", fireAsync, false)\n\t\t} else if (route.prefix[0] === \"#\") {\n\t\t\tfireAsync = null\n\t\t\tonremove = function() {\n\t\t\t\t$window.removeEventListener(\"hashchange\", resolveRoute, false)\n\t\t\t}\n\t\t\t$window.addEventListener(\"hashchange\", resolveRoute, false)\n\t\t}\n\n\t\treturn mountRedraw.mount(root, {\n\t\t\tonbeforeupdate: function() {\n\t\t\t\tstate = state ? 2 : 1\n\t\t\t\treturn !(!state || sentinel === currentResolver)\n\t\t\t},\n\t\t\toncreate: resolveRoute,\n\t\t\tonremove: onremove,\n\t\t\tview: function() {\n\t\t\t\tif (!state || sentinel === currentResolver) return\n\t\t\t\t// Wrap in a fragment to preserve existing key semantics\n\t\t\t\tvar vnode = [Vnode(component, attrs.key, attrs)]\n\t\t\t\tif (currentResolver) vnode = currentResolver.render(vnode[0])\n\t\t\t\treturn vnode\n\t\t\t},\n\t\t})\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\tsetPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = \"#!\"\n\troute.Link = {\n\t\tview: function(vnode) {\n\t\t\tvar options = vnode.attrs.options\n\t\t\t// Remove these so they don't get overwritten\n\t\t\tvar attrs = {}, onclick, href\n\t\t\tassign(attrs, vnode.attrs)\n\t\t\t// The first two are internal, but the rest are magic attributes\n\t\t\t// that need censored to not screw up rendering.\n\t\t\tattrs.selector = attrs.options = attrs.key = attrs.oninit =\n\t\t\tattrs.oncreate = attrs.onbeforeupdate = attrs.onupdate =\n\t\t\tattrs.onbeforeremove = attrs.onremove = null\n\n\t\t\t// Do this now so we can get the most current `href` and `disabled`.\n\t\t\t// Those attributes may also be specified in the selector, and we\n\t\t\t// should honor that.\n\t\t\tvar child = m(vnode.attrs.selector || \"a\", attrs, vnode.children)\n\n\t\t\t// Let's provide a *right* way to disable a route link, rather than\n\t\t\t// letting people screw up accessibility on accident.\n\t\t\t//\n\t\t\t// The attribute is coerced so users don't get surprised over\n\t\t\t// `disabled: 0` resulting in a button that's somehow routable\n\t\t\t// despite being visibly disabled.\n\t\t\tif (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n\t\t\t\tchild.attrs.href = null\n\t\t\t\tchild.attrs[\"aria-disabled\"] = \"true\"\n\t\t\t\t// If you *really* do want to do this on a disabled link, use\n\t\t\t\t// an `oncreate` hook to add it.\n\t\t\t\tchild.attrs.onclick = null\n\t\t\t} else {\n\t\t\t\tonclick = child.attrs.onclick\n\t\t\t\thref = child.attrs.href\n\t\t\t\tchild.attrs.href = route.prefix + href\n\t\t\t\tchild.attrs.onclick = function(e) {\n\t\t\t\t\tvar result\n\t\t\t\t\tif (typeof onclick === \"function\") {\n\t\t\t\t\t\tresult = onclick.call(e.currentTarget, e)\n\t\t\t\t\t} else if (onclick == null || typeof onclick !== \"object\") {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t} else if (typeof onclick.handleEvent === \"function\") {\n\t\t\t\t\t\tonclick.handleEvent(e)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Adapted from React Router's implementation:\n\t\t\t\t\t// https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n\t\t\t\t\t//\n\t\t\t\t\t// Try to be flexible and intuitive in how we handle links.\n\t\t\t\t\t// Fun fact: links aren't as obvious to get right as you\n\t\t\t\t\t// would expect. There's a lot more valid ways to click a\n\t\t\t\t\t// link than this, and one might want to not simply click a\n\t\t\t\t\t// link, but right click or command-click it to copy the\n\t\t\t\t\t// link target, etc. Nope, this isn't just for blind people.\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip if `onclick` prevented default\n\t\t\t\t\t\tresult !== false && !e.defaultPrevented &&\n\t\t\t\t\t\t// Ignore everything but left clicks\n\t\t\t\t\t\t(e.button === 0 || e.which === 0 || e.which === 1) &&\n\t\t\t\t\t\t// Let the browser handle `target=_blank`, etc.\n\t\t\t\t\t\t(!e.currentTarget.target || e.currentTarget.target === \"_self\") &&\n\t\t\t\t\t\t// No modifier keys\n\t\t\t\t\t\t!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey\n\t\t\t\t\t) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\te.redraw = false\n\t\t\t\t\t\troute.set(href, null, options)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child\n\t\t},\n\t}\n\troute.param = function(key) {\n\t\treturn attrs && key != null ? attrs[key] : attrs\n\t}\n\n\treturn route\n}\n\n}).call(this,require(\"timers\").setImmediate)\n},{\"../pathname/assign\":15,\"../pathname/build\":16,\"../pathname/compileTemplate\":17,\"../pathname/parse\":18,\"../promise/promise\":20,\"../render/hyperscript\":25,\"../render/vnode\":29,\"timers\":34}],12:[function(require,module,exports){\n\"use strict\"\n\nvar hyperscript = require(\"./render/hyperscript\")\n\nhyperscript.trust = require(\"./render/trust\")\nhyperscript.fragment = require(\"./render/fragment\")\n\nmodule.exports = hyperscript\n\n},{\"./render/fragment\":24,\"./render/hyperscript\":25,\"./render/trust\":28}],13:[function(require,module,exports){\n\"use strict\"\n\nvar hyperscript = require(\"./hyperscript\")\nvar request = require(\"./request\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nvar m = function m() { return hyperscript.apply(this, arguments) }\nm.m = hyperscript\nm.trust = hyperscript.trust\nm.fragment = hyperscript.fragment\nm.mount = mountRedraw.mount\nm.route = require(\"./route\")\nm.render = require(\"./render\")\nm.redraw = mountRedraw.redraw\nm.request = request.request\nm.jsonp = request.jsonp\nm.parseQueryString = require(\"./querystring/parse\")\nm.buildQueryString = require(\"./querystring/build\")\nm.parsePathname = require(\"./pathname/parse\")\nm.buildPathname = require(\"./pathname/build\")\nm.vnode = require(\"./render/vnode\")\nm.PromisePolyfill = require(\"./promise/polyfill\")\n\nmodule.exports = m\n\n},{\"./hyperscript\":12,\"./mount-redraw\":14,\"./pathname/build\":16,\"./pathname/parse\":18,\"./promise/polyfill\":19,\"./querystring/build\":21,\"./querystring/parse\":22,\"./render\":23,\"./render/vnode\":29,\"./request\":30,\"./route\":32}],14:[function(require,module,exports){\n\"use strict\"\n\nvar render = require(\"./render\")\n\nmodule.exports = require(\"./api/mount-redraw\")(render, requestAnimationFrame, console)\n\n},{\"./api/mount-redraw\":10,\"./render\":23}],15:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = Object.assign || function(target, source) {\n\tif(source) Object.keys(source).forEach(function(key) { target[key] = source[key] })\n}\n\n},{}],16:[function(require,module,exports){\n\"use strict\"\n\nvar buildQueryString = require(\"../querystring/build\")\nvar assign = require(\"./assign\")\n\n// Returns `path` from `template` + `params`\nmodule.exports = function(template, params) {\n\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(template)) {\n\t\tthrow new SyntaxError(\"Template parameter names *must* be separated\")\n\t}\n\tif (params == null) return template\n\tvar queryIndex = template.indexOf(\"?\")\n\tvar hashIndex = template.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? template.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = template.slice(0, pathEnd)\n\tvar query = {}\n\n\tassign(query, params)\n\n\tvar resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function(m, key, variadic) {\n\t\tdelete query[key]\n\t\t// If no such parameter exists, don't interpolate it.\n\t\tif (params[key] == null) return m\n\t\t// Escape normal parameters, but not variadic ones.\n\t\treturn variadic ? params[key] : encodeURIComponent(String(params[key]))\n\t})\n\n\t// In case the template substitution adds new query/hash parameters.\n\tvar newQueryIndex = resolved.indexOf(\"?\")\n\tvar newHashIndex = resolved.indexOf(\"#\")\n\tvar newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex\n\tvar newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex\n\tvar result = resolved.slice(0, newPathEnd)\n\n\tif (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)\n\tif (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd)\n\tvar querystring = buildQueryString(query)\n\tif (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring\n\tif (hashIndex >= 0) result += template.slice(hashIndex)\n\tif (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex)\n\treturn result\n}\n\n},{\"../querystring/build\":21,\"./assign\":15}],17:[function(require,module,exports){\n\"use strict\"\n\nvar parsePathname = require(\"./parse\")\n\n// Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\nmodule.exports = function(template) {\n\tvar templateData = parsePathname(template)\n\tvar templateKeys = Object.keys(templateData.params)\n\tvar keys = []\n\tvar regexp = new RegExp(\"^\" + templateData.path.replace(\n\t\t// I escape literal text so people can use things like `:file.:ext` or\n\t\t// `:lang-:locale` in routes. This is all merged into one pass so I\n\t\t// don't also accidentally escape `-` and make it harder to detect it to\n\t\t// ban it from template parameters.\n\t\t/:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g,\n\t\tfunction(m, key, extra) {\n\t\t\tif (key == null) return \"\\\\\" + m\n\t\t\tkeys.push({k: key, r: extra === \"...\"})\n\t\t\tif (extra === \"...\") return \"(.*)\"\n\t\t\tif (extra === \".\") return \"([^/]+)\\\\.\"\n\t\t\treturn \"([^/]+)\" + (extra || \"\")\n\t\t}\n\t) + \"$\")\n\treturn function(data) {\n\t\t// First, check the params. Usually, there isn't any, and it's just\n\t\t// checking a static set.\n\t\tfor (var i = 0; i < templateKeys.length; i++) {\n\t\t\tif (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false\n\t\t}\n\t\t// If no interpolations exist, let's skip all the ceremony\n\t\tif (!keys.length) return regexp.test(data.path)\n\t\tvar values = regexp.exec(data.path)\n\t\tif (values == null) return false\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tdata.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])\n\t\t}\n\t\treturn true\n\t}\n}\n\n},{\"./parse\":18}],18:[function(require,module,exports){\n\"use strict\"\n\nvar parseQueryString = require(\"../querystring/parse\")\n\n// Returns `{path, params}` from `url`\nmodule.exports = function(url) {\n\tvar queryIndex = url.indexOf(\"?\")\n\tvar hashIndex = url.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? url.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\")\n\n\tif (!path) path = \"/\"\n\telse {\n\t\tif (path[0] !== \"/\") path = \"/\" + path\n\t\tif (path.length > 1 && path[path.length - 1] === \"/\") path = path.slice(0, -1)\n\t}\n\treturn {\n\t\tpath: path,\n\t\tparams: queryIndex < 0\n\t\t\t? {}\n\t\t\t: parseQueryString(url.slice(queryIndex + 1, queryEnd)),\n\t}\n}\n\n},{\"../querystring/parse\":22}],19:[function(require,module,exports){\n(function (setImmediate){\n\"use strict\"\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\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\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.prototype.finally = function(callback) {\n\treturn this.then(\n\t\tfunction(value) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn value\n\t\t\t})\n\t\t},\n\t\tfunction(reason) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn PromisePolyfill.reject(reason);\n\t\t\t})\n\t\t}\n\t)\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}\n\nmodule.exports = PromisePolyfill\n\n}).call(this,require(\"timers\").setImmediate)\n},{\"timers\":34}],20:[function(require,module,exports){\n(function (global){\n\"use strict\"\n\nvar PromisePolyfill = require(\"./polyfill\")\n\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") {\n\t\twindow.Promise = PromisePolyfill\n\t} else if (!window.Promise.prototype.finally) {\n\t\twindow.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") {\n\t\tglobal.Promise = PromisePolyfill\n\t} else if (!global.Promise.prototype.finally) {\n\t\tglobal.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = global.Promise\n} else {\n\tmodule.exports = PromisePolyfill\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./polyfill\":19}],21:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\n\tvar args = []\n\tfor (var key in object) {\n\t\tdestructure(key, object[key])\n\t}\n\n\treturn args.join(\"&\")\n\n\tfunction destructure(key, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key + \"[\" + 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(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\n\n},{}],22:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\n\tvar entries = string.split(\"&\"), counters = {}, data = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\n\t\tvar levels = key.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data\n\t\tif (key.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\tif (level === \"\") {\n\t\t\t\tvar key = levels.slice(0, j).join()\n\t\t\t\tif (counters[key] == null) {\n\t\t\t\t\tcounters[key] = Array.isArray(cursor) ? cursor.length : 0\n\t\t\t\t}\n\t\t\t\tlevel = counters[key]++\n\t\t\t}\n\t\t\t// Disallow direct prototype pollution\n\t\t\telse if (level === \"__proto__\") break\n\t\t\tif (j === levels.length - 1) cursor[level] = value\n\t\t\telse {\n\t\t\t\t// Read own properties exclusively to disallow indirect\n\t\t\t\t// prototype pollution\n\t\t\t\tvar desc = Object.getOwnPropertyDescriptor(cursor, level)\n\t\t\t\tif (desc != null) desc = desc.value\n\t\t\t\tif (desc == null) cursor[level] = desc = isNumber ? [] : {}\n\t\t\t\tcursor = desc\n\t\t\t}\n\t\t}\n\t}\n\treturn data\n}\n\n},{}],23:[function(require,module,exports){\n\"use strict\"\n\nmodule.exports = require(\"./render/render\")(window)\n\n},{\"./render/render\":27}],24:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nmodule.exports = function() {\n\tvar vnode = hyperscriptVnode.apply(0, arguments)\n\n\tvnode.tag = \"[\"\n\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\treturn vnode\n}\n\n},{\"../render/vnode\":29,\"./hyperscriptVnode\":26}],25:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\n\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\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}\n\nfunction execSelector(state, vnode) {\n\tvar attrs = vnode.attrs\n\tvar children = Vnode.normalizeChildren(vnode.children)\n\tvar hasClass = hasOwn.call(attrs, \"class\")\n\tvar className = hasClass ? attrs.class : attrs.className\n\n\tvnode.tag = state.tag\n\tvnode.attrs = null\n\tvnode.children = undefined\n\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]\n\t\t}\n\n\t\tattrs = newAttrs\n\t}\n\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)){\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className != null || state.attrs.className != null) attrs.className =\n\t\tclassName != null\n\t\t\t? state.attrs.className != null\n\t\t\t\t? String(state.attrs.className) + \" \" + String(className)\n\t\t\t\t: className\n\t\t\t: state.attrs.className != null\n\t\t\t\t? state.attrs.className\n\t\t\t\t: null\n\n\tif (hasClass) attrs.class = null\n\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\tvnode.attrs = attrs\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\tvnode.text = children[0].children\n\t} else {\n\t\tvnode.children = children\n\t}\n\n\treturn vnode\n}\n\nfunction hyperscript(selector) {\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\n\tvar vnode = hyperscriptVnode.apply(1, arguments)\n\n\tif (typeof selector === \"string\") {\n\t\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\t\tif (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)\n\t}\n\n\tvnode.tag = selector\n\treturn vnode\n}\n\nmodule.exports = hyperscript\n\n},{\"../render/vnode\":29,\"./hyperscriptVnode\":26}],26:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\n// Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n// another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n// than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n// if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n// if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n// } else {\n// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n// attrs = undefined\n// }\n//\n// if (attrs == null) attrs = {}\n// return Vnode(\"\", attrs.key, attrs, children)\n// }\nmodule.exports = function() {\n\tvar attrs = arguments[this], start = this + 1, children\n\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 = this\n\t}\n\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\n\treturn Vnode(\"\", attrs.key, attrs, children)\n}\n\n},{\"../render/vnode\":29}],27:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function($window) {\n\tvar $doc = $window && $window.document\n\tvar currentRedraw\n\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\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\n\t//sanity check to discourage people from doing `vnode.state = ...`\n\tfunction checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}\n\n\t//Note: the hook is passed as the `this` argument to allow proxying the\n\t//arguments without requiring a full array allocation to do so. It also\n\t//takes advantage of the fact the current `vnode` is the first argument in\n\t//all lifecycle methods.\n\tfunction callHook(vnode) {\n\t\tvar original = vnode.state\n\t\ttry {\n\t\t\treturn this.apply(original, arguments)\n\t\t} finally {\n\t\t\tcheckState(vnode, original)\n\t\t}\n\t}\n\n\t// IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n\t// inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\tfunction activeElement() {\n\t\ttry {\n\t\t\treturn $doc.activeElement\n\t\t} catch (e) {\n\t\t\treturn null\n\t\t}\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 \"#\": createText(parent, vnode, nextSibling); break\n\t\t\t\tcase \"<\": createHTML(parent, vnode, ns, nextSibling); break\n\t\t\t\tcase \"[\": createFragment(parent, vnode, hooks, ns, nextSibling); break\n\t\t\t\tdefault: createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse 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}\n\tvar possibleParents = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}\n\tfunction createHTML(parent, vnode, ns, nextSibling) {\n\t\tvar match = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\t// not using the proper parent makes the child element(s) vanish.\n\t\t// var div = document.createElement(\"div\")\n\t\t// div.innerHTML = \"<td>i</td><td>j</td>\"\n\t\t// console.log(div.innerHTML)\n\t\t// --> \"ij\", no <td> in sight.\n\t\tvar temp = $doc.createElement(possibleParents[match[1]] || \"div\")\n\t\tif (ns === \"http://www.w3.org/2000/svg\") {\n\t\t\ttemp.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\">\" + vnode.children + \"</svg>\"\n\t\t\ttemp = temp.firstChild\n\t\t} else {\n\t\t\ttemp.innerHTML = vnode.children\n\t\t}\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\t// Capture nodes to remove, so we don't confuse them.\n\t\tvnode.instance = []\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tvnode.instance.push(child)\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\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}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs = vnode.attrs\n\t\tvar is = attrs && attrs.is\n\n\t\tns = getNameSpace(vnode) || ns\n\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\n\t\tif (attrs != null) {\n\t\t\tsetAttrs(vnode, attrs, ns)\n\t\t}\n\n\t\tinsertNode(parent, element, nextSibling)\n\n\t\tif (!maybeSetContentEditable(vnode)) {\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\tif (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs)\n\t\t\t}\n\t\t}\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\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\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\tinitLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, 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\tcreateNode(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}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t}\n\t}\n\n\t//update\n\t/**\n\t * @param {Element|Fragment} parent - the parent element\n\t * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n\t * this part of the tree\n\t * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n\t * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n\t * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n\t * fragment that is not the last item in its\n\t * parent\n\t * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n\t * @returns void\n\t */\n\t// This function diffs and patches lists of vnodes, both keyed and unkeyed.\n\t//\n\t// We will:\n\t//\n\t// 1. describe its general structure\n\t// 2. focus on the diff algorithm optimizations\n\t// 3. discuss DOM node operations.\n\n\t// ## Overview:\n\t//\n\t// The updateNodes() function:\n\t// - deals with trivial cases\n\t// - determines whether the lists are keyed or unkeyed based on the first non-null node\n\t// of each list.\n\t// - diffs them and patches the DOM if needed (that's the brunt of the code)\n\t// - manages the leftovers: after diffing, are there:\n\t// - old nodes left to remove?\n\t// \t - new nodes to insert?\n\t// \t deal with them!\n\t//\n\t// The lists are only iterated over once, with an exception for the nodes in `old` that\n\t// are visited in the fourth part of the diff and in the `removeNodes` loop.\n\n\t// ## Diffing\n\t//\n\t// Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n\t// may be good for context on longest increasing subsequence-based logic for moving nodes.\n\t//\n\t// In order to diff keyed lists, one has to\n\t//\n\t// 1) match nodes in both lists, per key, and update them accordingly\n\t// 2) create the nodes present in the new list, but absent in the old one\n\t// 3) remove the nodes present in the old list, but absent in the new one\n\t// 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n\t//\n\t// To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n\t// over the new list and for each new vnode, find the corresponding vnode in the old list using\n\t// the map.\n\t// 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n\t// and must be created.\n\t// For the removals, we actually remove the nodes that have been updated from the old list.\n\t// The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n\t// The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n\t// algorithm.\n\t//\n\t// the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n\t// from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n\t// corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n\t// match the above lists, for example).\n\t//\n\t// In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n\t// can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n\t//\n\t// @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n\t// the longest increasing subsequence *of old nodes still present in the new list*).\n\t//\n\t// It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n\t// and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n\t// the `LIS` and a temporary one to create the LIS).\n\t//\n\t// So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n\t// the LIS and can be updated without moving them.\n\t//\n\t// If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n\t// the exception of the last node if the list is fully reversed).\n\t//\n\t// ## Finding the next sibling.\n\t//\n\t// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n\t// When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n\t// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n\t// list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n\t//\n\t// In the other scenarios (swaps, upwards traversal, map-based diff),\n\t// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n\t// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node\n\t// as the next sibling (cached in the `nextSibling` variable).\n\n\n\t// ## DOM node moves\n\t//\n\t// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n\t// this is not the case if the node moved (second and fourth part of the diff algo). We move\n\t// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n\t// variable rather than fetching it using `getNextSibling()`.\n\t//\n\t// The fourth part of the diff currently inserts nodes unconditionally, leading to issues\n\t// like #1791 and #1999. We need to be smarter about those situations where adjascent old\n\t// nodes remain together in the new list in a way that isn't covered by parts one and\n\t// three of the diff algo.\n\n\tfunction updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)\n\t\telse {\n\t\t\tvar isOldKeyed = old[0] != null && old[0].key != null\n\t\t\tvar isKeyed = vnodes[0] != null && vnodes[0].key != null\n\t\t\tvar start = 0, oldStart = 0\n\t\t\tif (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) oldStart++\n\t\t\tif (!isKeyed) while (start < vnodes.length && vnodes[start] == null) start++\n\t\t\tif (isKeyed === null && isOldKeyed == null) return // both lists are full of nulls\n\t\t\tif (isOldKeyed !== isKeyed) {\n\t\t\t\tremoveNodes(parent, old, oldStart, old.length)\n\t\t\t\tcreateNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else if (!isKeyed) {\n\t\t\t\t// Don't index past the end of either list (causes deopts).\n\t\t\t\tvar commonLength = old.length < vnodes.length ? old.length : vnodes.length\n\t\t\t\t// Rewind if necessary to the first non-null index on either side.\n\t\t\t\t// We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n\t\t\t\t// but that would be optimizing for sparse lists which are more rare than dense ones.\n\t\t\t\tstart = start < oldStart ? start : oldStart\n\t\t\t\tfor (; start < commonLength; start++) {\n\t\t\t\t\to = old[start]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o === v || o == null && v == null) continue\n\t\t\t\t\telse if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))\n\t\t\t\t\telse if (v == null) removeNode(parent, o)\n\t\t\t\t\telse updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\tif (old.length > commonLength) removeNodes(parent, old, start, old.length)\n\t\t\t\tif (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else {\n\t\t\t\t// keyed diff\n\t\t\t\tvar oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling\n\n\t\t\t\t// bottom-up\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\t// top-down\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o.key !== v.key) break\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tif (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\t// swaps and list reversals\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (start === end) break\n\t\t\t\t\tif (o.key !== ve.key || oe.key !== v.key) break\n\t\t\t\t\ttopSibling = getNextSibling(old, oldStart, nextSibling)\n\t\t\t\t\tmoveNodes(parent, oe, topSibling)\n\t\t\t\t\tif (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)\n\t\t\t\t\tif (++start <= --end) moveNodes(parent, o, nextSibling)\n\t\t\t\t\tif (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldStart++; oldEnd--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t}\n\t\t\t\t// bottom up once again\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t}\n\t\t\t\tif (start > end) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\telse if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\telse {\n\t\t\t\t\t// inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n\t\t\t\t\tvar originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li=0, i=0, pos = 2147483647, matched = 0, map, lisIndices\n\t\t\t\t\tfor (i = 0; i < vnodesLength; i++) oldIndices[i] = -1\n\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\tif (map == null) map = getKeyMap(old, oldStart, oldEnd + 1)\n\t\t\t\t\t\tve = vnodes[i]\n\t\t\t\t\t\tvar oldIndex = map[ve.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tpos = (oldIndex < pos) ? oldIndex : -1 // becomes -1 if nodes were re-ordered\n\t\t\t\t\t\t\toldIndices[i-start] = oldIndex\n\t\t\t\t\t\t\toe = old[oldIndex]\n\t\t\t\t\t\t\told[oldIndex] = null\n\t\t\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\t\t\tmatched++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnextSibling = originalNextSibling\n\t\t\t\t\tif (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\t\tif (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (pos === -1) {\n\t\t\t\t\t\t\t// the indices of the indices of the items that are part of the\n\t\t\t\t\t\t\t// longest increasing subsequence in the oldIndices list\n\t\t\t\t\t\t\tlisIndices = makeLisIndices(oldIndices)\n\t\t\t\t\t\t\tli = lisIndices.length - 1\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (lisIndices[li] === i - start) li--\n\t\t\t\t\t\t\t\t\telse moveNodes(parent, v, nextSibling)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, 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.events = old.events\n\t\t\tif (shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tupdateLifecycle(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, ns, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(parent, old)\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, ns, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\tremoveHTML(parent, old)\n\t\t\tcreateHTML(parent, vnode, ns, nextSibling)\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t}\n\t}\n\tfunction updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, 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, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\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 handle 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 (!maybeSetContentEditable(vnode)) {\n\t\t\tif (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t\tupdateNodes(element, old.children, vnode.children, hooks, null, ns)\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tupdateLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\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, 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(parent, old.instance)\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 getKeyMap(vnodes, start, end) {\n\t\tvar map = Object.create(null)\n\t\tfor (; start < end; start++) {\n\t\t\tvar vnode = vnodes[start]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key = vnode.key\n\t\t\t\tif (key != null) map[key] = start\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\t// Lifted from ivi https://github.com/ivijs/ivi/\n\t// takes a list of unique numbers (-1 is special and can\n\t// occur multiple times) and returns an array with the indices\n\t// of the items that are part of the longest increasing\n\t// subsequece\n\tvar lisTemp = []\n\tfunction makeLisIndices(a) {\n\t\tvar result = [0]\n\t\tvar u = 0, v = 0, i = 0\n\t\tvar il = lisTemp.length = a.length\n\t\tfor (var i = 0; i < il; i++) lisTemp[i] = a[i]\n\t\tfor (var i = 0; i < il; ++i) {\n\t\t\tif (a[i] === -1) continue\n\t\t\tvar j = result[result.length - 1]\n\t\t\tif (a[j] < a[i]) {\n\t\t\t\tlisTemp[i] = j\n\t\t\t\tresult.push(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu = 0\n\t\t\tv = result.length - 1\n\t\t\twhile (u < v) {\n\t\t\t\t// Fast integer average without overflow.\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tvar c = (u >>> 1) + (v >>> 1) + (u & v & 1)\n\t\t\t\tif (a[result[c]] < a[i]) {\n\t\t\t\t\tu = c + 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tv = c\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a[i] < a[result[u]]) {\n\t\t\t\tif (u > 0) lisTemp[i] = result[u - 1]\n\t\t\t\tresult[u] = i\n\t\t\t}\n\t\t}\n\t\tu = result.length\n\t\tv = result[u - 1]\n\t\twhile (u-- > 0) {\n\t\t\tresult[u] = v\n\t\t\tv = lisTemp[v]\n\t\t}\n\t\tlisTemp.length = 0\n\t\treturn result\n\t}\n\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\n\t// This covers a really specific edge case:\n\t// - Parent node is keyed and contains child\n\t// - Child is removed, returns unresolved promise in `onbeforeremove`\n\t// - Parent node is moved in keyed diff\n\t// - Remaining children still need moved appropriately\n\t//\n\t// Ideally, I'd track removed nodes as well, but that introduces a lot more\n\t// complexity and I'm not exactly interested in doing that.\n\tfunction moveNodes(parent, vnode, nextSibling) {\n\t\tvar frag = $doc.createDocumentFragment()\n\t\tmoveChildToFrag(parent, frag, vnode)\n\t\tinsertNode(parent, frag, nextSibling)\n\t}\n\tfunction moveChildToFrag(parent, frag, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\t\t\tfrag.appendChild(vnode.instance[i])\n\t\t\t\t}\n\t\t\t} else if (vnode.tag !== \"[\") {\n\t\t\t\t// Don't recurse for text nodes *or* elements, just fragments\n\t\t\t\tfrag.appendChild(vnode.dom)\n\t\t\t} else if (vnode.children.length === 1) {\n\t\t\t\tvnode = vnode.children[0]\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\tif (child != null) moveChildToFrag(parent, frag, child)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling != null) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\n\tfunction maybeSetContentEditable(vnode) {\n\t\tif (vnode.attrs == null || (\n\t\t\tvnode.attrs.contenteditable == null && // attribute\n\t\t\tvnode.attrs.contentEditable == null // property\n\t\t)) return false\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\treturn true\n\t}\n\n\t//remove\n\tfunction removeNodes(parent, vnodes, start, end) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) removeNode(parent, vnode)\n\t\t}\n\t}\n\tfunction removeNode(parent, vnode) {\n\t\tvar mask = 0\n\t\tvar original = vnode.state\n\t\tvar stateResult, attrsResult\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.state.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\tmask = 1\n\t\t\t\tstateResult = result\n\t\t\t}\n\t\t}\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.attrs.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tmask |= 2\n\t\t\t\tattrsResult = result\n\t\t\t}\n\t\t}\n\t\tcheckState(vnode, original)\n\n\t\t// If we can, try to fast-path it and avoid all the overhead of awaiting\n\t\tif (!mask) {\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t} else {\n\t\t\tif (stateResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 1) { mask &= 2; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tstateResult.then(next, next)\n\t\t\t}\n\t\t\tif (attrsResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 2) { mask &= 1; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tattrsResult.then(next, next)\n\t\t\t}\n\t\t}\n\n\t\tfunction reallyRemove() {\n\t\t\tcheckState(vnode, original)\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t}\n\t}\n\tfunction removeHTML(parent, vnode) {\n\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\tparent.removeChild(vnode.instance[i])\n\t\t}\n\t}\n\tfunction removeChild(parent, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tremoveHTML(parent, vnode)\n\t\t\t} else {\n\t\t\t\tif (vnode.tag !== \"[\") {\n\t\t\t\t\tparent.removeChild(vnode.dom)\n\t\t\t\t\tif (!Array.isArray(vnode.children)) break\n\t\t\t\t}\n\t\t\t\tif (vnode.children.length === 1) {\n\t\t\t\t\tvnode = vnode.children[0]\n\t\t\t\t\tif (vnode != null) continue\n\t\t\t\t} else {\n\t\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\t\tif (child != null) removeChild(parent, child)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tfunction onremove(vnode) {\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode)\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\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\n\t//attrs\n\tfunction setAttrs(vnode, attrs, ns) {\n\t\tfor (var key in attrs) {\n\t\t\tsetAttr(vnode, key, null, attrs[key], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key, old, value, ns) {\n\t\tif (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || (old === value && !isFormAttribute(vnode, key)) && typeof value !== \"object\") return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value)\n\t\tif (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, value)\n\t\telse if (hasPropertyKey(vnode, key, ns)) {\n\t\t\tif (key === \"value\") {\n\t\t\t\t// Only do the coercion if we're actually going to check the value.\n\t\t\t\t/* eslint-disable 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 === \"\" + value && vnode.dom === 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\" && old !== null && vnode.dom.value === \"\" + value) return\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 === \"\" + value) return\n\t\t\t\t/* eslint-enable no-implicit-coercion */\n\t\t\t}\n\t\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t\tif (vnode.tag === \"input\" && key === \"type\") vnode.dom.setAttribute(key, value)\n\t\t\telse vnode.dom[key] = value\n\t\t} else {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) vnode.dom.setAttribute(key, \"\")\n\t\t\t\telse vnode.dom.removeAttribute(key)\n\t\t\t}\n\t\t\telse vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value)\n\t\t}\n\t}\n\tfunction removeAttr(vnode, key, old, ns) {\n\t\tif (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return\n\t\tif (key[0] === \"o\" && key[1] === \"n\" && !isLifecycleMethod(key)) updateEvent(vnode, key, undefined)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, null)\n\t\telse if (\n\t\t\thasPropertyKey(vnode, key, ns)\n\t\t\t&& key !== \"className\"\n\t\t\t&& !(key === \"value\" && (\n\t\t\t\tvnode.tag === \"option\"\n\t\t\t\t|| vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement()\n\t\t\t))\n\t\t\t&& !(vnode.tag === \"input\" && key === \"type\")\n\t\t) {\n\t\t\tvnode.dom[key] = null\n\t\t} else {\n\t\t\tvar nsLastIndex = key.indexOf(\":\")\n\t\t\tif (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1)\n\t\t\tif (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key)\n\t\t}\n\t}\n\tfunction setLateSelectAttrs(vnode, attrs) {\n\t\tif (\"value\" in attrs) {\n\t\t\tif(attrs.value === null) {\n\t\t\t\tif (vnode.dom.selectedIndex !== -1) vnode.dom.value = null\n\t\t\t} else {\n\t\t\t\tvar normalized = \"\" + attrs.value // eslint-disable-line no-implicit-coercion\n\t\t\t\tif (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n\t\t\t\t\tvnode.dom.value = normalized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined)\n\t}\n\tfunction updateAttrs(vnode, old, attrs, ns) {\n\t\tif (attrs != null) {\n\t\t\tfor (var key in attrs) {\n\t\t\t\tsetAttr(vnode, key, old && old[key], attrs[key], ns)\n\t\t\t}\n\t\t}\n\t\tvar val\n\t\tif (old != null) {\n\t\t\tfor (var key in old) {\n\t\t\t\tif (((val = old[key]) != null) && (attrs == null || attrs[key] == null)) {\n\t\t\t\t\tremoveAttr(vnode, key, val, ns)\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 === activeElement() || vnode.tag === \"option\" && vnode.dom.parentNode === $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 hasPropertyKey(vnode, key, ns) {\n\t\t// Filter out namespaced keys\n\t\treturn ns === undefined && (\n\t\t\t// If it's a custom element, just keep it.\n\t\t\tvnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is ||\n\t\t\t// If it's a normal element, let's try to avoid a few browser bugs.\n\t\t\tkey !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\"// && key !== \"type\"\n\t\t\t// Defer the property check until *after* we check everything.\n\t\t) && key in vnode.dom\n\t}\n\n\t//style\n\tvar uppercaseRegex = /[A-Z]/g\n\tfunction toLowerCase(capital) { return \"-\" + capital.toLowerCase() }\n\tfunction normalizeKey(key) {\n\t\treturn key[0] === \"-\" && key[1] === \"-\" ? key :\n\t\t\tkey === \"cssFloat\" ? \"float\" :\n\t\t\t\tkey.replace(uppercaseRegex, toLowerCase)\n\t}\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) {\n\t\t\t// Styles are equivalent, do nothing.\n\t\t} else if (style == null) {\n\t\t\t// New style is missing, just clear it.\n\t\t\telement.style.cssText = \"\"\n\t\t} else if (typeof style !== \"object\") {\n\t\t\t// New style is a string, let engine deal with patching.\n\t\t\telement.style.cssText = style\n\t\t} else if (old == null || typeof old !== \"object\") {\n\t\t\t// `old` is missing or a string, `style` is an object.\n\t\t\telement.style.cssText = \"\"\n\t\t\t// Add new style properties\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null) element.style.setProperty(normalizeKey(key), String(value))\n\t\t\t}\n\t\t} else {\n\t\t\t// Both old & new are (different) objects.\n\t\t\t// Update style properties that have changed\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null && (value = String(value)) !== String(old[key])) {\n\t\t\t\t\telement.style.setProperty(normalizeKey(key), value)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove style properties that no longer exist\n\t\t\tfor (var key in old) {\n\t\t\t\tif (old[key] != null && style[key] == null) {\n\t\t\t\t\telement.style.removeProperty(normalizeKey(key))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Here's an explanation of how this works:\n\t// 1. The event names are always (by design) prefixed by `on`.\n\t// 2. The EventListener interface accepts either a function or an object\n\t// with a `handleEvent` method.\n\t// 3. The object does not inherit from `Object.prototype`, to avoid\n\t// any potential interference with that (e.g. setters).\n\t// 4. The event name is remapped to the handler before calling it.\n\t// 5. In function-based event handlers, `ev.target === this`. We replicate\n\t// that below.\n\t// 6. In function-based event handlers, `return false` prevents the default\n\t// action and stops event propagation. We replicate that below.\n\tfunction EventDict() {\n\t\t// Save this, so the current redraw is correctly tracked.\n\t\tthis._ = currentRedraw\n\t}\n\tEventDict.prototype = Object.create(null)\n\tEventDict.prototype.handleEvent = function (ev) {\n\t\tvar handler = this[\"on\" + ev.type]\n\t\tvar result\n\t\tif (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev)\n\t\telse if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev)\n\t\tif (this._ && ev.redraw !== false) (0, this._)()\n\t\tif (result === false) {\n\t\t\tev.preventDefault()\n\t\t\tev.stopPropagation()\n\t\t}\n\t}\n\n\t//event\n\tfunction updateEvent(vnode, key, value) {\n\t\tif (vnode.events != null) {\n\t\t\tif (vnode.events[key] === value) return\n\t\t\tif (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\t\tif (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = value\n\t\t\t} else {\n\t\t\t\tif (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = undefined\n\t\t\t}\n\t\t} else if (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\tvnode.events = new EventDict()\n\t\t\tvnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\tvnode.events[key] = value\n\t\t}\n\t}\n\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tdo {\n\t\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.state.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\treturn false\n\t\t} while (false); // eslint-disable-line no-constant-condition\n\t\tvnode.dom = old.dom\n\t\tvnode.domSize = old.domSize\n\t\tvnode.instance = old.instance\n\t\t// One would think having the actual latest attributes would be ideal,\n\t\t// but it doesn't let us properly diff based on our current internal\n\t\t// representation. We have to save not only the old DOM info, but also\n\t\t// the attributes used to create it, as we diff *that*, not against the\n\t\t// DOM directly (with a few exceptions in `setAttr`). And, of course, we\n\t\t// need to save the children and text as they are conceptually not\n\t\t// unlike special \"attributes\" internally.\n\t\tvnode.attrs = old.attrs\n\t\tvnode.children = old.children\n\t\tvnode.text = old.text\n\t\treturn true\n\t}\n\n\treturn function(dom, vnodes, redraw) {\n\t\tif (!dom) throw new TypeError(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = activeElement()\n\t\tvar namespace = dom.namespaceURI\n\n\t\t// First time rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\n\t\tvnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes])\n\t\tvar prevRedraw = currentRedraw\n\t\ttry {\n\t\t\tcurrentRedraw = typeof redraw === \"function\" ? redraw : undefined\n\t\t\tupdateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\t} finally {\n\t\t\tcurrentRedraw = prevRedraw\n\t\t}\n\t\tdom.vnodes = vnodes\n\t\t// `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\t\tif (active != null && activeElement() !== active && typeof active.focus === \"function\") active.focus()\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t}\n}\n\n},{\"../render/vnode\":29}],28:[function(require,module,exports){\n\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\n\n},{\"../render/vnode\":29}],29:[function(require,module,exports){\n\"use strict\"\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}\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 === \"boolean\") return null\n\tif (typeof node === \"object\") return node\n\treturn Vnode(\"#\", undefined, undefined, String(node), undefined, undefined)\n}\nVnode.normalizeChildren = function(input) {\n\tvar children = []\n\tif (input.length) {\n\t\tvar isKeyed = input[0] != null && input[0].key != null\n\t\t// Note: this is a *very* perf-sensitive check.\n\t\t// Fun fact: merging the loop like this is somehow faster than splitting\n\t\t// it, noticeably so.\n\t\tfor (var i = 1; i < input.length; i++) {\n\t\t\tif ((input[i] != null && input[i].key != null) !== isKeyed) {\n\t\t\t\tthrow new TypeError(\"Vnodes must either always have keys or never have keys!\")\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\tchildren[i] = Vnode.normalize(input[i])\n\t\t}\n\t}\n\treturn children\n}\n\nmodule.exports = Vnode\n\n},{}],30:[function(require,module,exports){\n\"use strict\"\n\nvar PromisePolyfill = require(\"./promise/promise\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./request/request\")(window, PromisePolyfill, mountRedraw.redraw)\n\n},{\"./mount-redraw\":14,\"./promise/promise\":20,\"./request/request\":31}],31:[function(require,module,exports){\n\"use strict\"\n\nvar buildPathname = require(\"../pathname/build\")\n\nmodule.exports = function($window, Promise, oncompletion) {\n\tvar callbackCount = 0\n\n\tfunction PromiseProxy(executor) {\n\t\treturn new Promise(executor)\n\t}\n\n\t// In case the global Promise is some userland library's where they rely on\n\t// `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n\t// similar. Let's *not* break them.\n\tPromiseProxy.prototype = Promise.prototype\n\tPromiseProxy.__proto__ = Promise // eslint-disable-line no-proto\n\n\tfunction makeRequest(factory) {\n\t\treturn function(url, args) {\n\t\t\tif (typeof url !== \"string\") { args = url; url = url.url }\n\t\t\telse if (args == null) args = {}\n\t\t\tvar promise = new Promise(function(resolve, reject) {\n\t\t\t\tfactory(buildPathname(url, args.params), args, function (data) {\n\t\t\t\t\tif (typeof args.type === \"function\") {\n\t\t\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tdata[i] = new args.type(data[i])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse data = new args.type(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(data)\n\t\t\t\t}, reject)\n\t\t\t})\n\t\t\tif (args.background === true) return promise\n\t\t\tvar count = 0\n\t\t\tfunction complete() {\n\t\t\t\tif (--count === 0 && typeof oncompletion === \"function\") oncompletion()\n\t\t\t}\n\n\t\t\treturn wrap(promise)\n\n\t\t\tfunction wrap(promise) {\n\t\t\t\tvar then = promise.then\n\t\t\t\t// Set the constructor, so engines know to not await or resolve\n\t\t\t\t// this as a native promise. At the time of writing, this is\n\t\t\t\t// only necessary for V8, but their behavior is the correct\n\t\t\t\t// behavior per spec. See this spec issue for more details:\n\t\t\t\t// https://github.com/tc39/ecma262/issues/1577. Also, see the\n\t\t\t\t// corresponding comment in `request/tests/test-request.js` for\n\t\t\t\t// a bit more background on the issue at hand.\n\t\t\t\tpromise.constructor = PromiseProxy\n\t\t\t\tpromise.then = function() {\n\t\t\t\t\tcount++\n\t\t\t\t\tvar next = then.apply(promise, arguments)\n\t\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\t\tcomplete()\n\t\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t\t})\n\t\t\t\t\treturn wrap(next)\n\t\t\t\t}\n\t\t\t\treturn promise\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasHeader(args, name) {\n\t\tfor (var key in args.headers) {\n\t\t\tif ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true\n\t\t}\n\t\treturn false\n\t}\n\n\treturn {\n\t\trequest: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar method = args.method != null ? args.method.toUpperCase() : \"GET\"\n\t\t\tvar body = args.body\n\t\t\tvar assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData)\n\t\t\tvar responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\")\n\n\t\t\tvar xhr = new $window.XMLHttpRequest(), aborted = false\n\t\t\tvar original = xhr, replacedAbort\n\t\t\tvar abort = xhr.abort\n\n\t\t\txhr.abort = function() {\n\t\t\t\taborted = true\n\t\t\t\tabort.call(this)\n\t\t\t}\n\n\t\t\txhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\n\t\t\tif (assumeJSON && body != null && !hasHeader(args, /^content-type$/i)) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (typeof args.deserialize !== \"function\" && !hasHeader(args, /^accept$/i)) {\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\tif (args.timeout) xhr.timeout = args.timeout\n\t\t\txhr.responseType = responseType\n\n\t\t\tfor (var key in args.headers) {\n\t\t\t\tif ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.onreadystatechange = function(ev) {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif (aborted) return\n\n\t\t\t\tif (ev.target.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar success = (ev.target.status >= 200 && ev.target.status < 300) || ev.target.status === 304 || (/^file:\\/\\//i).test(url)\n\t\t\t\t\t\t// When the response type isn't \"\" or \"text\",\n\t\t\t\t\t\t// `xhr.responseText` is the wrong thing to use.\n\t\t\t\t\t\t// Browsers do the right thing and throw here, and we\n\t\t\t\t\t\t// should honor that and do the right thing by\n\t\t\t\t\t\t// preferring `xhr.response` where possible/practical.\n\t\t\t\t\t\tvar response = ev.target.response, message\n\n\t\t\t\t\t\tif (responseType === \"json\") {\n\t\t\t\t\t\t\t// For IE and Edge, which don't implement\n\t\t\t\t\t\t\t// `responseType: \"json\"`.\n\t\t\t\t\t\t\tif (!ev.target.responseType && typeof args.extract !== \"function\") response = JSON.parse(ev.target.responseText)\n\t\t\t\t\t\t} else if (!responseType || responseType === \"text\") {\n\t\t\t\t\t\t\t// Only use this default if it's text. If a parsed\n\t\t\t\t\t\t\t// document is needed on old IE and friends (all\n\t\t\t\t\t\t\t// unsupported), the user should use a custom\n\t\t\t\t\t\t\t// `config` instead. They're already using this at\n\t\t\t\t\t\t\t// their own risk.\n\t\t\t\t\t\t\tif (response == null) response = ev.target.responseText\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof args.extract === \"function\") {\n\t\t\t\t\t\t\tresponse = args.extract(ev.target, args)\n\t\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\t} else if (typeof args.deserialize === \"function\") {\n\t\t\t\t\t\t\tresponse = args.deserialize(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (success) resolve(response)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttry { message = ev.target.responseText }\n\t\t\t\t\t\t\tcatch (e) { message = response }\n\t\t\t\t\t\t\tvar error = new Error(message)\n\t\t\t\t\t\t\terror.code = ev.target.status\n\t\t\t\t\t\t\terror.response = response\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\n\t\t\tif (typeof args.config === \"function\") {\n\t\t\t\txhr = args.config(xhr, args, url) || xhr\n\n\t\t\t\t// Propagate the `abort` to any replacement XHR as well.\n\t\t\t\tif (xhr !== original) {\n\t\t\t\t\treplacedAbort = xhr.abort\n\t\t\t\t\txhr.abort = function() {\n\t\t\t\t\t\taborted = true\n\t\t\t\t\t\treplacedAbort.call(this)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body == null) xhr.send()\n\t\t\telse if (typeof args.serialize === \"function\") xhr.send(args.serialize(body))\n\t\t\telse if (body instanceof $window.FormData) xhr.send(body)\n\t\t\telse xhr.send(JSON.stringify(body))\n\t\t}),\n\t\tjsonp: makeRequest(function(url, args, 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\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(data)\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t}\n\t\t\tscript.src = url + (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") +\n\t\t\t\tencodeURIComponent(args.callbackKey || \"callback\") + \"=\" +\n\t\t\t\tencodeURIComponent(callbackName)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t}),\n\t}\n}\n\n},{\"../pathname/build\":16}],32:[function(require,module,exports){\n\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./api/router\")(window, mountRedraw)\n\n},{\"./api/router\":11,\"./mount-redraw\":14}],33:[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},{}],34:[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\":33,\"timers\":34}],35:[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},{}]},{},[1]);\n"]}
|
assets/js/forms-admin.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
(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 |
-
|
3 |
|
4 |
var i18n = window.mc4wp_forms_i18n;
|
5 |
|
@@ -8,7 +8,6 @@ var m = require('mithril');
|
|
8 |
var r = {};
|
9 |
|
10 |
r.showType = function (config) {
|
11 |
-
// ucfirst
|
12 |
var fieldType = config.type;
|
13 |
fieldType = fieldType.charAt(0).toUpperCase() + fieldType.slice(1);
|
14 |
return m('div', [m('label', i18n.fieldType), m('span', fieldType)]);
|
@@ -155,7 +154,7 @@ r.choices = function (config) {
|
|
155 |
title: i18n.remove,
|
156 |
"class": 'dashicons dashicons-no-alt hover-activated',
|
157 |
onclick: function (key) {
|
158 |
-
this.choices
|
159 |
}.bind(config, index)
|
160 |
}, ''))]);
|
161 |
})) // end of table
|
@@ -179,7 +178,7 @@ r.linkToTerms = function (config) {
|
|
179 |
module.exports = r;
|
180 |
|
181 |
},{"mithril":28}],2:[function(require,module,exports){
|
182 |
-
|
183 |
|
184 |
var forms = {};
|
185 |
|
@@ -193,11 +192,8 @@ forms.render = function (config) {
|
|
193 |
return forms[type](config);
|
194 |
}
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
case 'radio':
|
199 |
-
case 'checkbox':
|
200 |
-
return forms.choice(config);
|
201 |
} // fallback to good old text field
|
202 |
|
203 |
|
@@ -248,7 +244,7 @@ forms.number = function (config) {
|
|
248 |
module.exports = forms;
|
249 |
|
250 |
},{"./field-forms-rows.js":1}],3:[function(require,module,exports){
|
251 |
-
|
252 |
|
253 |
var htmlutil = require('html');
|
254 |
|
@@ -411,7 +407,7 @@ function generate(config) {
|
|
411 |
module.exports = generate;
|
412 |
|
413 |
},{"html":24,"mithril":28}],4:[function(require,module,exports){
|
414 |
-
|
415 |
|
416 |
var m = require('mithril');
|
417 |
|
@@ -431,13 +427,10 @@ var fieldConfig;
|
|
431 |
editor.on('blur', m.redraw);
|
432 |
/**
|
433 |
* Choose a field to open the helper form for
|
434 |
-
|
435 |
-
* @param index
|
436 |
-
* @returns {*}
|
437 |
-
*/
|
438 |
|
439 |
-
function setActiveField(
|
440 |
-
fieldConfig = fields.get(
|
441 |
|
442 |
if (fieldConfig && fieldConfig.type === 'hidden' && fieldConfig.choices.length > 0) {
|
443 |
fieldConfig.value = fieldConfig.choices.map(function (c) {
|
@@ -458,9 +451,7 @@ function createFieldHTMLAndAddToForm() {
|
|
458 |
|
459 |
editor.insert(html); // reset field form
|
460 |
|
461 |
-
setActiveField(
|
462 |
-
|
463 |
-
m.redraw();
|
464 |
}
|
465 |
/**
|
466 |
* View
|
@@ -470,9 +461,8 @@ function createFieldHTMLAndAddToForm() {
|
|
470 |
|
471 |
function view() {
|
472 |
// build DOM for fields choice
|
473 |
-
var fieldCategories = fields.getCategories();
|
474 |
var availableFields = fields.getAll();
|
475 |
-
var fieldsChoice = m('div.available-fields.small-margin', [m('h4', i18n.chooseField),
|
476 |
var categoryFields = availableFields.filter(function (f) {
|
477 |
return f.category === category;
|
478 |
});
|
@@ -501,7 +491,7 @@ function view() {
|
|
501 |
onclick: function onclick(evt) {
|
502 |
return setActiveField(evt.target.value);
|
503 |
},
|
504 |
-
value: field.
|
505 |
}, field.title);
|
506 |
})]);
|
507 |
})]); // build DOM for overlay
|
@@ -510,7 +500,9 @@ function view() {
|
|
510 |
|
511 |
if (fieldConfig) {
|
512 |
form = m(Overlay, {
|
513 |
-
onClose:
|
|
|
|
|
514 |
}, // field wizard
|
515 |
m('div.field-wizard', [// heading
|
516 |
m('h3', [fieldConfig.title, fieldConfig.forceRequired ? m('span.red', '*') : '', fieldConfig.name.length ? m('code', fieldConfig.name) : '']), // help text
|
@@ -540,7 +532,7 @@ if (fieldHelperRootElement) {
|
|
540 |
}
|
541 |
|
542 |
},{"../overlay.js":11,"./field-forms.js":2,"./field-generator.js":3,"./fields.js":6,"./form-editor.js":7,"mithril":28}],5:[function(require,module,exports){
|
543 |
-
|
544 |
|
545 |
var m = require('mithril');
|
546 |
|
@@ -551,12 +543,6 @@ var ajaxurl = window.mc4wp_vars.ajaxurl;
|
|
551 |
var i18n = window.mc4wp_forms_i18n;
|
552 |
var mailchimp = window.mc4wp_vars.mailchimp;
|
553 |
var countries = window.mc4wp_vars.countries;
|
554 |
-
/**
|
555 |
-
* Array of registered fields
|
556 |
-
*
|
557 |
-
* @type {Array}
|
558 |
-
*/
|
559 |
-
|
560 |
var registeredFields = [];
|
561 |
/**
|
562 |
* Reset all previously registered fields
|
@@ -565,6 +551,7 @@ var registeredFields = [];
|
|
565 |
function reset() {
|
566 |
// clear all of our fields
|
567 |
registeredFields.forEach(fields.deregister);
|
|
|
568 |
}
|
569 |
/**
|
570 |
* Helper function to quickly register a field and store it in local scope
|
@@ -668,7 +655,6 @@ function registerMergeField(mergeField) {
|
|
668 |
|
669 |
|
670 |
function registerInterestCategory(interestCategory) {
|
671 |
-
var category = i18n.interestCategories;
|
672 |
var fieldType = getFieldType(interestCategory.type);
|
673 |
var data = {
|
674 |
title: interestCategory.title,
|
@@ -677,7 +663,7 @@ function registerInterestCategory(interestCategory) {
|
|
677 |
choices: interestCategory.interests,
|
678 |
acceptsMultipleValues: fieldType === 'checkbox'
|
679 |
};
|
680 |
-
register(
|
681 |
}
|
682 |
/**
|
683 |
* Register all fields belonging to a list
|
@@ -703,6 +689,7 @@ function registerListFields(list) {
|
|
703 |
list.merge_fields.forEach(registerMergeField); // loop through groupings
|
704 |
|
705 |
list.interest_categories.forEach(registerInterestCategory);
|
|
|
706 |
}
|
707 |
/**
|
708 |
* Register all lists fields
|
@@ -726,7 +713,6 @@ function registerListsFields(lists) {
|
|
726 |
|
727 |
function registerCustomFields(lists) {
|
728 |
var choices;
|
729 |
-
var category = i18n.formFields;
|
730 |
register(i18n.listFields, {
|
731 |
name: 'EMAIL',
|
732 |
title: i18n.emailAddress,
|
@@ -735,7 +721,7 @@ function registerCustomFields(lists) {
|
|
735 |
type: 'email'
|
736 |
}, true); // register submit button
|
737 |
|
738 |
-
register(
|
739 |
name: '',
|
740 |
value: i18n.subscribe,
|
741 |
type: 'submit',
|
@@ -748,7 +734,7 @@ function registerCustomFields(lists) {
|
|
748 |
choices[lists[key].id] = lists[key].name;
|
749 |
}
|
750 |
|
751 |
-
register(
|
752 |
name: '_mc4wp_lists',
|
753 |
type: 'checkbox',
|
754 |
title: i18n.listChoice,
|
@@ -760,7 +746,7 @@ function registerCustomFields(lists) {
|
|
760 |
subscribe: 'Subscribe',
|
761 |
unsubscribe: 'Unsubscribe'
|
762 |
};
|
763 |
-
register(
|
764 |
name: '_mc4wp_action',
|
765 |
type: 'radio',
|
766 |
title: i18n.formAction,
|
@@ -768,7 +754,7 @@ function registerCustomFields(lists) {
|
|
768 |
value: 'subscribe',
|
769 |
help: i18n.formActionDescription
|
770 |
}, true);
|
771 |
-
register(
|
772 |
name: 'AGREE_TO_TERMS',
|
773 |
value: 1,
|
774 |
type: 'terms-checkbox',
|
@@ -788,16 +774,12 @@ registerListsFields(settings.getSelectedLists());
|
|
788 |
registerCustomFields(mailchimp.lists);
|
789 |
|
790 |
},{"./fields.js":6,"mithril":28}],6:[function(require,module,exports){
|
791 |
-
|
792 |
-
|
793 |
-
var m = require('mithril');
|
794 |
|
795 |
-
var
|
796 |
-
var fields = [];
|
797 |
-
var categories = [];
|
798 |
var listeners = {};
|
799 |
|
800 |
-
|
801 |
return {
|
802 |
name: data.name,
|
803 |
title: data.title || data.name,
|
@@ -818,33 +800,19 @@ var Field = function Field(data) {
|
|
818 |
acceptsMultipleValues: data.acceptsMultipleValues,
|
819 |
link: data.link || ''
|
820 |
};
|
821 |
-
}
|
822 |
-
/**
|
823 |
-
* @internal
|
824 |
-
*
|
825 |
-
* @param data
|
826 |
-
* @constructor
|
827 |
-
*/
|
828 |
-
|
829 |
|
830 |
-
|
831 |
return {
|
832 |
title: data.title || data.label,
|
833 |
selected: data.selected || false,
|
834 |
value: data.value || data.label,
|
835 |
label: data.label
|
836 |
};
|
837 |
-
}
|
838 |
-
/**
|
839 |
-
* Creates FieldChoice objects from an (associative) array of data objects
|
840 |
-
*
|
841 |
-
* @param data
|
842 |
-
* @returns {Array}
|
843 |
-
*/
|
844 |
-
|
845 |
|
846 |
function createChoices(data) {
|
847 |
-
var choices
|
848 |
|
849 |
if (typeof data.map === 'function') {
|
850 |
choices = data.map(function (choiceLabel) {
|
@@ -864,24 +832,18 @@ function createChoices(data) {
|
|
864 |
|
865 |
return choices;
|
866 |
}
|
867 |
-
/**
|
868 |
-
* Factory method
|
869 |
-
*
|
870 |
-
* @returns {Field}
|
871 |
-
*/
|
872 |
-
|
873 |
|
874 |
function register(category, data) {
|
875 |
-
|
|
|
|
|
876 |
|
877 |
if (existingField) {
|
878 |
-
// update "required" status
|
879 |
if (!existingField.forceRequired && data.forceRequired) {
|
880 |
existingField.forceRequired = true;
|
881 |
-
}
|
882 |
-
|
883 |
|
884 |
-
return
|
885 |
} // array of choices given? convert to FieldChoice objects
|
886 |
|
887 |
|
@@ -897,21 +859,13 @@ function register(category, data) {
|
|
897 |
return choice;
|
898 |
});
|
899 |
}
|
900 |
-
} // register category
|
901 |
-
|
902 |
-
|
903 |
-
if (categories.indexOf(category) < 0) {
|
904 |
-
categories.push(category);
|
905 |
} // create Field object
|
906 |
|
907 |
|
908 |
var field = new Field(data);
|
909 |
field.category = category; // add to array
|
910 |
|
911 |
-
fields.
|
912 |
-
|
913 |
-
timeout && window.clearTimeout(timeout);
|
914 |
-
timeout = window.setTimeout(m.redraw, 600); // trigger event
|
915 |
|
916 |
emit('change');
|
917 |
return field;
|
@@ -928,85 +882,38 @@ function on(event, func) {
|
|
928 |
listeners[event] = listeners[event] || [];
|
929 |
listeners[event].push(func);
|
930 |
}
|
931 |
-
/**
|
932 |
-
* @api
|
933 |
-
*
|
934 |
-
* @param field
|
935 |
-
*/
|
936 |
-
|
937 |
|
938 |
function deregister(field) {
|
939 |
-
|
940 |
-
|
941 |
-
if (index > -1) {
|
942 |
-
delete fields[index];
|
943 |
-
m.redraw();
|
944 |
-
}
|
945 |
}
|
946 |
-
/**
|
947 |
-
* Get a field config object
|
948 |
-
*
|
949 |
-
* @param name
|
950 |
-
* @returns {*}
|
951 |
-
*/
|
952 |
-
|
953 |
|
954 |
function get(name) {
|
955 |
return fields[name];
|
956 |
}
|
957 |
-
/**
|
958 |
-
* Get all field config objects
|
959 |
-
*
|
960 |
-
* @returns {Array|*}
|
961 |
-
*/
|
962 |
-
|
963 |
|
964 |
function getAll() {
|
965 |
-
|
966 |
-
fields = fields.map(function (f, i) {
|
967 |
-
f.index = i;
|
968 |
-
return f;
|
969 |
-
});
|
970 |
-
return fields;
|
971 |
}
|
972 |
|
973 |
-
function getCategories() {
|
974 |
-
return categories.sort(function (a, b) {
|
975 |
-
return a !== 'Form fields' ? -1 : 1;
|
976 |
-
});
|
977 |
-
}
|
978 |
-
/**
|
979 |
-
* Get all fields where a property matches the given value
|
980 |
-
*
|
981 |
-
* @param searchKey
|
982 |
-
* @param searchValue
|
983 |
-
* @returns {Array|*}
|
984 |
-
*/
|
985 |
-
|
986 |
-
|
987 |
function getAllWhere(searchKey, searchValue) {
|
988 |
-
return
|
989 |
return field[searchKey] === searchValue;
|
990 |
});
|
991 |
}
|
992 |
-
/**
|
993 |
-
* Exposed methods
|
994 |
-
*/
|
995 |
-
|
996 |
|
997 |
module.exports = {
|
998 |
get: get,
|
999 |
getAll: getAll,
|
1000 |
-
|
1001 |
deregister: deregister,
|
1002 |
register: register,
|
1003 |
-
getAllWhere: getAllWhere,
|
1004 |
on: on
|
1005 |
};
|
1006 |
|
1007 |
-
},{
|
1008 |
-
|
1009 |
|
|
|
1010 |
var CodeMirror = require('codemirror');
|
1011 |
|
1012 |
require('codemirror/mode/xml/xml');
|
@@ -1150,7 +1057,7 @@ if (previewFrame) {
|
|
1150 |
module.exports = FormEditor;
|
1151 |
|
1152 |
},{"codemirror":19,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchbrackets.js":15,"codemirror/addon/edit/matchtags.js":16,"codemirror/addon/fold/xml-fold.js":17,"codemirror/addon/selection/active-line.js":18,"codemirror/mode/css/css":20,"codemirror/mode/htmlmixed/htmlmixed":21,"codemirror/mode/javascript/javascript":22,"codemirror/mode/xml/xml":23}],8:[function(require,module,exports){
|
1153 |
-
|
1154 |
|
1155 |
var m = require('mithril');
|
1156 |
|
@@ -1231,11 +1138,9 @@ editor.on('change', helpers.debounce(updateFields, 600));
|
|
1231 |
fields.on('change', helpers.debounce(updateFields, 600));
|
1232 |
|
1233 |
},{"../helpers.js":9,"./fields.js":6,"./form-editor.js":7,"mithril":28}],9:[function(require,module,exports){
|
1234 |
-
|
1235 |
-
|
1236 |
-
var helpers = {}; // polling
|
1237 |
|
1238 |
-
|
1239 |
var timeout;
|
1240 |
return function () {
|
1241 |
var context = this;
|
@@ -1248,12 +1153,14 @@ helpers.debounce = function (func, wait, immediate) {
|
|
1248 |
}, wait);
|
1249 |
if (callNow) func.apply(context, args);
|
1250 |
};
|
1251 |
-
}
|
1252 |
|
1253 |
-
module.exports =
|
|
|
|
|
1254 |
|
1255 |
},{}],10:[function(require,module,exports){
|
1256 |
-
|
1257 |
|
1258 |
var editor = require('./form-editor/form-editor.js');
|
1259 |
|
@@ -1331,7 +1238,7 @@ editor.on('focus', requiredFieldsNotice);
|
|
1331 |
document.body.addEventListener('change', mailchimpListsNotice);
|
1332 |
|
1333 |
},{"./form-editor/fields.js":6,"./form-editor/form-editor.js":7,"./settings":12}],11:[function(require,module,exports){
|
1334 |
-
|
1335 |
|
1336 |
var m = require('mithril');
|
1337 |
|
@@ -1404,7 +1311,7 @@ function Overlay(vnode) {
|
|
1404 |
module.exports = Overlay;
|
1405 |
|
1406 |
},{"mithril":28}],12:[function(require,module,exports){
|
1407 |
-
|
1408 |
|
1409 |
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
1410 |
|
@@ -1472,7 +1379,7 @@ module.exports = {
|
|
1472 |
};
|
1473 |
|
1474 |
},{}],13:[function(require,module,exports){
|
1475 |
-
|
1476 |
|
1477 |
var editor = require('./admin/form-editor/form-editor.js');
|
1478 |
|
@@ -2642,14 +2549,15 @@ window.mc4wp.forms.editor = editor;
|
|
2642 |
for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
|
2643 |
order.push(new BidiSpan(0, start, i$7));
|
2644 |
} else {
|
2645 |
-
var pos = i$7, at = order.length;
|
2646 |
for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
|
2647 |
for (var j$2 = pos; j$2 < i$7;) {
|
2648 |
if (countsAsNum.test(types[j$2])) {
|
2649 |
-
if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }
|
2650 |
var nstart = j$2;
|
2651 |
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
|
2652 |
order.splice(at, 0, new BidiSpan(2, nstart, j$2));
|
|
|
2653 |
pos = j$2;
|
2654 |
} else { ++j$2; }
|
2655 |
}
|
@@ -5707,7 +5615,7 @@ window.mc4wp.forms.editor = editor;
|
|
5707 |
}
|
5708 |
|
5709 |
function setScrollTop(cm, val, forceScroll) {
|
5710 |
-
val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);
|
5711 |
if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
|
5712 |
cm.doc.scrollTop = val;
|
5713 |
cm.display.scrollbars.setScrollTop(val);
|
@@ -5717,7 +5625,7 @@ window.mc4wp.forms.editor = editor;
|
|
5717 |
// Sync scroller and scrollbar, ensure the gutter elements are
|
5718 |
// aligned.
|
5719 |
function setScrollLeft(cm, val, isScroller, forceScroll) {
|
5720 |
-
val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
|
5721 |
if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
|
5722 |
cm.doc.scrollLeft = val;
|
5723 |
alignHorizontally(cm);
|
@@ -6304,6 +6212,8 @@ window.mc4wp.forms.editor = editor;
|
|
6304 |
update.visible = visibleLines(cm.display, cm.doc, viewport);
|
6305 |
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
|
6306 |
{ break }
|
|
|
|
|
6307 |
}
|
6308 |
if (!updateDisplayIfNeeded(cm, update)) { break }
|
6309 |
updateHeightsInViewport(cm);
|
@@ -8653,7 +8563,7 @@ window.mc4wp.forms.editor = editor;
|
|
8653 |
text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),
|
8654 |
origin: "paste"};
|
8655 |
makeChange(cm.doc, change);
|
8656 |
-
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
|
8657 |
})();
|
8658 |
}
|
8659 |
};
|
@@ -8986,7 +8896,7 @@ window.mc4wp.forms.editor = editor;
|
|
8986 |
|
8987 |
function endOfLine(visually, cm, lineObj, lineNo, dir) {
|
8988 |
if (visually) {
|
8989 |
-
if (cm.
|
8990 |
var order = getOrder(lineObj, cm.doc.direction);
|
8991 |
if (order) {
|
8992 |
var part = dir < 0 ? lst(order) : order[0];
|
@@ -9241,7 +9151,7 @@ window.mc4wp.forms.editor = editor;
|
|
9241 |
var line = getLine(cm.doc, start.line);
|
9242 |
var order = getOrder(line, cm.doc.direction);
|
9243 |
if (!order || order[0].level == 0) {
|
9244 |
-
var firstNonWS = Math.max(
|
9245 |
var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
|
9246 |
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
|
9247 |
}
|
@@ -10797,7 +10707,7 @@ window.mc4wp.forms.editor = editor;
|
|
10797 |
var oldPos = pos;
|
10798 |
var origDir = dir;
|
10799 |
var lineObj = getLine(doc, pos.line);
|
10800 |
-
var lineDir = visually && doc.
|
10801 |
function findNextLine() {
|
10802 |
var l = pos.line + lineDir;
|
10803 |
if (l < doc.first || l >= doc.first + doc.size) { return false }
|
@@ -10962,7 +10872,7 @@ window.mc4wp.forms.editor = editor;
|
|
10962 |
|
10963 |
ContentEditableInput.prototype.prepareSelection = function () {
|
10964 |
var result = prepareSelection(this.cm, false);
|
10965 |
-
result.focus = this.
|
10966 |
return result
|
10967 |
};
|
10968 |
|
@@ -11058,7 +10968,7 @@ window.mc4wp.forms.editor = editor;
|
|
11058 |
|
11059 |
ContentEditableInput.prototype.focus = function () {
|
11060 |
if (this.cm.options.readOnly != "nocursor") {
|
11061 |
-
if (!this.selectionInEditor())
|
11062 |
{ this.showSelection(this.prepareSelection(), true); }
|
11063 |
this.div.focus();
|
11064 |
}
|
@@ -11890,7 +11800,7 @@ window.mc4wp.forms.editor = editor;
|
|
11890 |
|
11891 |
addLegacyProps(CodeMirror);
|
11892 |
|
11893 |
-
CodeMirror.version = "5.
|
11894 |
|
11895 |
return CodeMirror;
|
11896 |
|
@@ -12354,81 +12264,98 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
12354 |
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
12355 |
"animation-direction", "animation-duration", "animation-fill-mode",
|
12356 |
"animation-iteration-count", "animation-name", "animation-play-state",
|
12357 |
-
"animation-timing-function", "appearance", "azimuth", "
|
12358 |
-
"
|
12359 |
-
"background-
|
12360 |
-
"background-
|
12361 |
-
"
|
12362 |
-
"
|
12363 |
-
"
|
12364 |
-
"border-bottom
|
12365 |
-
"border-
|
|
|
12366 |
"border-image-repeat", "border-image-slice", "border-image-source",
|
12367 |
-
"border-image-width", "border-left", "border-left-color",
|
12368 |
-
"border-left-
|
12369 |
-
"border-right-
|
12370 |
-
"border-
|
12371 |
-
"border-top-
|
12372 |
-
"border-
|
12373 |
-
"
|
12374 |
-
"
|
12375 |
-
"column-
|
12376 |
-
"column-rule-
|
12377 |
-
"
|
12378 |
-
"cue-
|
12379 |
-
"
|
12380 |
-
"drop-initial-
|
12381 |
-
"drop-initial-
|
12382 |
-
"
|
12383 |
-
"flex-
|
12384 |
-
"
|
12385 |
-
"font-
|
12386 |
-
"font-
|
12387 |
-
"font-variant
|
12388 |
-
"font-variant-
|
12389 |
-
"font-
|
12390 |
-
"grid-
|
12391 |
-
"grid-column
|
12392 |
-
"grid-row
|
12393 |
-
"grid-template
|
12394 |
-
"
|
12395 |
-
"
|
12396 |
-
"
|
|
|
|
|
|
|
12397 |
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
12398 |
"list-style-image", "list-style-position", "list-style-type", "margin",
|
12399 |
-
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
12400 |
-
"
|
12401 |
-
"marquee-
|
12402 |
-
"max-width", "min-
|
12403 |
-
"
|
12404 |
-
"
|
12405 |
-
"
|
12406 |
-
"
|
12407 |
-
"
|
12408 |
-
"
|
12409 |
-
"
|
12410 |
-
"
|
12411 |
-
"
|
12412 |
-
"
|
12413 |
-
"
|
12414 |
-
"
|
12415 |
-
"
|
12416 |
-
"
|
12417 |
-
"
|
12418 |
-
"
|
12419 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12420 |
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
12421 |
-
"text-decoration-
|
12422 |
-
"text-emphasis-
|
12423 |
-
"text-
|
12424 |
-
"text-
|
12425 |
-
"text-
|
12426 |
-
"
|
12427 |
-
"
|
12428 |
-
"
|
12429 |
-
"
|
12430 |
-
"voice-
|
12431 |
-
"
|
|
|
12432 |
// SVG-specific
|
12433 |
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
|
12434 |
"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
|
@@ -12442,16 +12369,28 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
12442 |
], propertyKeywords = keySet(propertyKeywords_);
|
12443 |
|
12444 |
var nonStandardPropertyKeywords_ = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12445 |
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
|
12446 |
"scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
|
12447 |
-
"scrollbar-
|
12448 |
-
"searchfield-
|
12449 |
-
"searchfield-results-decoration", "zoom"
|
12450 |
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
|
12451 |
|
12452 |
var fontProperties_ = [
|
12453 |
-
"font-family", "src", "unicode-range", "font-variant",
|
12454 |
-
|
12455 |
], fontProperties = keySet(fontProperties_);
|
12456 |
|
12457 |
var counterDescriptors_ = [
|
@@ -13303,7 +13242,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
13303 |
}
|
13304 |
function parenExpr(type) {
|
13305 |
if (type != "(") return pass()
|
13306 |
-
return cont(pushlex(")"),
|
13307 |
}
|
13308 |
function expressionInner(type, value, noComma) {
|
13309 |
if (cx.state.fatArrowAt == cx.stream.start) {
|
@@ -13332,7 +13271,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
13332 |
}
|
13333 |
|
13334 |
function maybeoperatorComma(type, value) {
|
13335 |
-
if (type == ",") return cont(
|
13336 |
return maybeoperatorNoComma(type, value, false);
|
13337 |
}
|
13338 |
function maybeoperatorNoComma(type, value, noComma) {
|
1 |
(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 |
var i18n = window.mc4wp_forms_i18n;
|
5 |
|
8 |
var r = {};
|
9 |
|
10 |
r.showType = function (config) {
|
|
|
11 |
var fieldType = config.type;
|
12 |
fieldType = fieldType.charAt(0).toUpperCase() + fieldType.slice(1);
|
13 |
return m('div', [m('label', i18n.fieldType), m('span', fieldType)]);
|
154 |
title: i18n.remove,
|
155 |
"class": 'dashicons dashicons-no-alt hover-activated',
|
156 |
onclick: function (key) {
|
157 |
+
this.choices.splice(key, 1);
|
158 |
}.bind(config, index)
|
159 |
}, ''))]);
|
160 |
})) // end of table
|
178 |
module.exports = r;
|
179 |
|
180 |
},{"mithril":28}],2:[function(require,module,exports){
|
181 |
+
"use strict";
|
182 |
|
183 |
var forms = {};
|
184 |
|
192 |
return forms[type](config);
|
193 |
}
|
194 |
|
195 |
+
if (['select', 'radio', 'checkbox'].indexOf(type) > -1) {
|
196 |
+
return forms.choice(config);
|
|
|
|
|
|
|
197 |
} // fallback to good old text field
|
198 |
|
199 |
|
244 |
module.exports = forms;
|
245 |
|
246 |
},{"./field-forms-rows.js":1}],3:[function(require,module,exports){
|
247 |
+
"use strict";
|
248 |
|
249 |
var htmlutil = require('html');
|
250 |
|
407 |
module.exports = generate;
|
408 |
|
409 |
},{"html":24,"mithril":28}],4:[function(require,module,exports){
|
410 |
+
"use strict";
|
411 |
|
412 |
var m = require('mithril');
|
413 |
|
427 |
editor.on('blur', m.redraw);
|
428 |
/**
|
429 |
* Choose a field to open the helper form for
|
430 |
+
*/
|
|
|
|
|
|
|
431 |
|
432 |
+
function setActiveField(name) {
|
433 |
+
fieldConfig = name !== null ? fields.get(name) : null; // if this hidden field has choices (hidden groups), glue them together by their label.
|
434 |
|
435 |
if (fieldConfig && fieldConfig.type === 'hidden' && fieldConfig.choices.length > 0) {
|
436 |
fieldConfig.value = fieldConfig.choices.map(function (c) {
|
451 |
|
452 |
editor.insert(html); // reset field form
|
453 |
|
454 |
+
setActiveField(null);
|
|
|
|
|
455 |
}
|
456 |
/**
|
457 |
* View
|
461 |
|
462 |
function view() {
|
463 |
// build DOM for fields choice
|
|
|
464 |
var availableFields = fields.getAll();
|
465 |
+
var fieldsChoice = m('div.available-fields.small-margin', [m('h4', i18n.chooseField), [i18n.listFields, i18n.interestCategories, i18n.formFields].map(function (category) {
|
466 |
var categoryFields = availableFields.filter(function (f) {
|
467 |
return f.category === category;
|
468 |
});
|
491 |
onclick: function onclick(evt) {
|
492 |
return setActiveField(evt.target.value);
|
493 |
},
|
494 |
+
value: field.name
|
495 |
}, field.title);
|
496 |
})]);
|
497 |
})]); // build DOM for overlay
|
500 |
|
501 |
if (fieldConfig) {
|
502 |
form = m(Overlay, {
|
503 |
+
onClose: function onClose() {
|
504 |
+
return setActiveField(null);
|
505 |
+
}
|
506 |
}, // field wizard
|
507 |
m('div.field-wizard', [// heading
|
508 |
m('h3', [fieldConfig.title, fieldConfig.forceRequired ? m('span.red', '*') : '', fieldConfig.name.length ? m('code', fieldConfig.name) : '']), // help text
|
532 |
}
|
533 |
|
534 |
},{"../overlay.js":11,"./field-forms.js":2,"./field-generator.js":3,"./fields.js":6,"./form-editor.js":7,"mithril":28}],5:[function(require,module,exports){
|
535 |
+
"use strict";
|
536 |
|
537 |
var m = require('mithril');
|
538 |
|
543 |
var i18n = window.mc4wp_forms_i18n;
|
544 |
var mailchimp = window.mc4wp_vars.mailchimp;
|
545 |
var countries = window.mc4wp_vars.countries;
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
var registeredFields = [];
|
547 |
/**
|
548 |
* Reset all previously registered fields
|
551 |
function reset() {
|
552 |
// clear all of our fields
|
553 |
registeredFields.forEach(fields.deregister);
|
554 |
+
m.redraw();
|
555 |
}
|
556 |
/**
|
557 |
* Helper function to quickly register a field and store it in local scope
|
655 |
|
656 |
|
657 |
function registerInterestCategory(interestCategory) {
|
|
|
658 |
var fieldType = getFieldType(interestCategory.type);
|
659 |
var data = {
|
660 |
title: interestCategory.title,
|
663 |
choices: interestCategory.interests,
|
664 |
acceptsMultipleValues: fieldType === 'checkbox'
|
665 |
};
|
666 |
+
register(i18n.interestCategories, data, false);
|
667 |
}
|
668 |
/**
|
669 |
* Register all fields belonging to a list
|
689 |
list.merge_fields.forEach(registerMergeField); // loop through groupings
|
690 |
|
691 |
list.interest_categories.forEach(registerInterestCategory);
|
692 |
+
m.redraw();
|
693 |
}
|
694 |
/**
|
695 |
* Register all lists fields
|
713 |
|
714 |
function registerCustomFields(lists) {
|
715 |
var choices;
|
|
|
716 |
register(i18n.listFields, {
|
717 |
name: 'EMAIL',
|
718 |
title: i18n.emailAddress,
|
721 |
type: 'email'
|
722 |
}, true); // register submit button
|
723 |
|
724 |
+
register(i18n.formFields, {
|
725 |
name: '',
|
726 |
value: i18n.subscribe,
|
727 |
type: 'submit',
|
734 |
choices[lists[key].id] = lists[key].name;
|
735 |
}
|
736 |
|
737 |
+
register(i18n.formFields, {
|
738 |
name: '_mc4wp_lists',
|
739 |
type: 'checkbox',
|
740 |
title: i18n.listChoice,
|
746 |
subscribe: 'Subscribe',
|
747 |
unsubscribe: 'Unsubscribe'
|
748 |
};
|
749 |
+
register(i18n.formFields, {
|
750 |
name: '_mc4wp_action',
|
751 |
type: 'radio',
|
752 |
title: i18n.formAction,
|
754 |
value: 'subscribe',
|
755 |
help: i18n.formActionDescription
|
756 |
}, true);
|
757 |
+
register(i18n.formFields, {
|
758 |
name: 'AGREE_TO_TERMS',
|
759 |
value: 1,
|
760 |
type: 'terms-checkbox',
|
774 |
registerCustomFields(mailchimp.lists);
|
775 |
|
776 |
},{"./fields.js":6,"mithril":28}],6:[function(require,module,exports){
|
777 |
+
"use strict";
|
|
|
|
|
778 |
|
779 |
+
var fields = {};
|
|
|
|
|
780 |
var listeners = {};
|
781 |
|
782 |
+
function Field(data) {
|
783 |
return {
|
784 |
name: data.name,
|
785 |
title: data.title || data.name,
|
800 |
acceptsMultipleValues: data.acceptsMultipleValues,
|
801 |
link: data.link || ''
|
802 |
};
|
803 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
804 |
|
805 |
+
function FieldChoice(data) {
|
806 |
return {
|
807 |
title: data.title || data.label,
|
808 |
selected: data.selected || false,
|
809 |
value: data.value || data.label,
|
810 |
label: data.label
|
811 |
};
|
812 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
|
814 |
function createChoices(data) {
|
815 |
+
var choices;
|
816 |
|
817 |
if (typeof data.map === 'function') {
|
818 |
choices = data.map(function (choiceLabel) {
|
832 |
|
833 |
return choices;
|
834 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
835 |
|
836 |
function register(category, data) {
|
837 |
+
// if a field with the exact same name already exists,
|
838 |
+
// update its forceRequired property
|
839 |
+
var existingField = fields[data.name];
|
840 |
|
841 |
if (existingField) {
|
|
|
842 |
if (!existingField.forceRequired && data.forceRequired) {
|
843 |
existingField.forceRequired = true;
|
844 |
+
}
|
|
|
845 |
|
846 |
+
return existingField;
|
847 |
} // array of choices given? convert to FieldChoice objects
|
848 |
|
849 |
|
859 |
return choice;
|
860 |
});
|
861 |
}
|
|
|
|
|
|
|
|
|
|
|
862 |
} // create Field object
|
863 |
|
864 |
|
865 |
var field = new Field(data);
|
866 |
field.category = category; // add to array
|
867 |
|
868 |
+
fields[data.name] = field; // trigger event
|
|
|
|
|
|
|
869 |
|
870 |
emit('change');
|
871 |
return field;
|
882 |
listeners[event] = listeners[event] || [];
|
883 |
listeners[event].push(func);
|
884 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
885 |
|
886 |
function deregister(field) {
|
887 |
+
delete fields[field.name];
|
|
|
|
|
|
|
|
|
|
|
888 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
|
890 |
function get(name) {
|
891 |
return fields[name];
|
892 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
|
894 |
function getAll() {
|
895 |
+
return Object.values(fields);
|
|
|
|
|
|
|
|
|
|
|
896 |
}
|
897 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
898 |
function getAllWhere(searchKey, searchValue) {
|
899 |
+
return getAll().filter(function (field) {
|
900 |
return field[searchKey] === searchValue;
|
901 |
});
|
902 |
}
|
|
|
|
|
|
|
|
|
903 |
|
904 |
module.exports = {
|
905 |
get: get,
|
906 |
getAll: getAll,
|
907 |
+
getAllWhere: getAllWhere,
|
908 |
deregister: deregister,
|
909 |
register: register,
|
|
|
910 |
on: on
|
911 |
};
|
912 |
|
913 |
+
},{}],7:[function(require,module,exports){
|
914 |
+
"use strict";
|
915 |
|
916 |
+
// load CodeMirror & plugins
|
917 |
var CodeMirror = require('codemirror');
|
918 |
|
919 |
require('codemirror/mode/xml/xml');
|
1057 |
module.exports = FormEditor;
|
1058 |
|
1059 |
},{"codemirror":19,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchbrackets.js":15,"codemirror/addon/edit/matchtags.js":16,"codemirror/addon/fold/xml-fold.js":17,"codemirror/addon/selection/active-line.js":18,"codemirror/mode/css/css":20,"codemirror/mode/htmlmixed/htmlmixed":21,"codemirror/mode/javascript/javascript":22,"codemirror/mode/xml/xml":23}],8:[function(require,module,exports){
|
1060 |
+
"use strict";
|
1061 |
|
1062 |
var m = require('mithril');
|
1063 |
|
1138 |
fields.on('change', helpers.debounce(updateFields, 600));
|
1139 |
|
1140 |
},{"../helpers.js":9,"./fields.js":6,"./form-editor.js":7,"mithril":28}],9:[function(require,module,exports){
|
1141 |
+
"use strict";
|
|
|
|
|
1142 |
|
1143 |
+
function debounce(func, wait, immediate) {
|
1144 |
var timeout;
|
1145 |
return function () {
|
1146 |
var context = this;
|
1153 |
}, wait);
|
1154 |
if (callNow) func.apply(context, args);
|
1155 |
};
|
1156 |
+
}
|
1157 |
|
1158 |
+
module.exports = {
|
1159 |
+
debounce: debounce
|
1160 |
+
};
|
1161 |
|
1162 |
},{}],10:[function(require,module,exports){
|
1163 |
+
"use strict";
|
1164 |
|
1165 |
var editor = require('./form-editor/form-editor.js');
|
1166 |
|
1238 |
document.body.addEventListener('change', mailchimpListsNotice);
|
1239 |
|
1240 |
},{"./form-editor/fields.js":6,"./form-editor/form-editor.js":7,"./settings":12}],11:[function(require,module,exports){
|
1241 |
+
"use strict";
|
1242 |
|
1243 |
var m = require('mithril');
|
1244 |
|
1311 |
module.exports = Overlay;
|
1312 |
|
1313 |
},{"mithril":28}],12:[function(require,module,exports){
|
1314 |
+
"use strict";
|
1315 |
|
1316 |
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
1317 |
|
1379 |
};
|
1380 |
|
1381 |
},{}],13:[function(require,module,exports){
|
1382 |
+
"use strict";
|
1383 |
|
1384 |
var editor = require('./admin/form-editor/form-editor.js');
|
1385 |
|
2549 |
for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
|
2550 |
order.push(new BidiSpan(0, start, i$7));
|
2551 |
} else {
|
2552 |
+
var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0;
|
2553 |
for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
|
2554 |
for (var j$2 = pos; j$2 < i$7;) {
|
2555 |
if (countsAsNum.test(types[j$2])) {
|
2556 |
+
if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }
|
2557 |
var nstart = j$2;
|
2558 |
for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
|
2559 |
order.splice(at, 0, new BidiSpan(2, nstart, j$2));
|
2560 |
+
at += isRTL;
|
2561 |
pos = j$2;
|
2562 |
} else { ++j$2; }
|
2563 |
}
|
5615 |
}
|
5616 |
|
5617 |
function setScrollTop(cm, val, forceScroll) {
|
5618 |
+
val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));
|
5619 |
if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
|
5620 |
cm.doc.scrollTop = val;
|
5621 |
cm.display.scrollbars.setScrollTop(val);
|
5625 |
// Sync scroller and scrollbar, ensure the gutter elements are
|
5626 |
// aligned.
|
5627 |
function setScrollLeft(cm, val, isScroller, forceScroll) {
|
5628 |
+
val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));
|
5629 |
if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
|
5630 |
cm.doc.scrollLeft = val;
|
5631 |
alignHorizontally(cm);
|
6212 |
update.visible = visibleLines(cm.display, cm.doc, viewport);
|
6213 |
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
|
6214 |
{ break }
|
6215 |
+
} else if (first) {
|
6216 |
+
update.visible = visibleLines(cm.display, cm.doc, viewport);
|
6217 |
}
|
6218 |
if (!updateDisplayIfNeeded(cm, update)) { break }
|
6219 |
updateHeightsInViewport(cm);
|
8563 |
text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),
|
8564 |
origin: "paste"};
|
8565 |
makeChange(cm.doc, change);
|
8566 |
+
setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));
|
8567 |
})();
|
8568 |
}
|
8569 |
};
|
8896 |
|
8897 |
function endOfLine(visually, cm, lineObj, lineNo, dir) {
|
8898 |
if (visually) {
|
8899 |
+
if (cm.doc.direction == "rtl") { dir = -dir; }
|
8900 |
var order = getOrder(lineObj, cm.doc.direction);
|
8901 |
if (order) {
|
8902 |
var part = dir < 0 ? lst(order) : order[0];
|
9151 |
var line = getLine(cm.doc, start.line);
|
9152 |
var order = getOrder(line, cm.doc.direction);
|
9153 |
if (!order || order[0].level == 0) {
|
9154 |
+
var firstNonWS = Math.max(start.ch, line.text.search(/\S/));
|
9155 |
var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
|
9156 |
return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
|
9157 |
}
|
10707 |
var oldPos = pos;
|
10708 |
var origDir = dir;
|
10709 |
var lineObj = getLine(doc, pos.line);
|
10710 |
+
var lineDir = visually && doc.direction == "rtl" ? -dir : dir;
|
10711 |
function findNextLine() {
|
10712 |
var l = pos.line + lineDir;
|
10713 |
if (l < doc.first || l >= doc.first + doc.size) { return false }
|
10872 |
|
10873 |
ContentEditableInput.prototype.prepareSelection = function () {
|
10874 |
var result = prepareSelection(this.cm, false);
|
10875 |
+
result.focus = document.activeElement == this.div;
|
10876 |
return result
|
10877 |
};
|
10878 |
|
10968 |
|
10969 |
ContentEditableInput.prototype.focus = function () {
|
10970 |
if (this.cm.options.readOnly != "nocursor") {
|
10971 |
+
if (!this.selectionInEditor() || document.activeElement != this.div)
|
10972 |
{ this.showSelection(this.prepareSelection(), true); }
|
10973 |
this.div.focus();
|
10974 |
}
|
11800 |
|
11801 |
addLegacyProps(CodeMirror);
|
11802 |
|
11803 |
+
CodeMirror.version = "5.52.2";
|
11804 |
|
11805 |
return CodeMirror;
|
11806 |
|
12264 |
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
12265 |
"animation-direction", "animation-duration", "animation-fill-mode",
|
12266 |
"animation-iteration-count", "animation-name", "animation-play-state",
|
12267 |
+
"animation-timing-function", "appearance", "azimuth", "backdrop-filter",
|
12268 |
+
"backface-visibility", "background", "background-attachment",
|
12269 |
+
"background-blend-mode", "background-clip", "background-color",
|
12270 |
+
"background-image", "background-origin", "background-position",
|
12271 |
+
"background-position-x", "background-position-y", "background-repeat",
|
12272 |
+
"background-size", "baseline-shift", "binding", "bleed", "block-size",
|
12273 |
+
"bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target",
|
12274 |
+
"border", "border-bottom", "border-bottom-color", "border-bottom-left-radius",
|
12275 |
+
"border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
|
12276 |
+
"border-collapse", "border-color", "border-image", "border-image-outset",
|
12277 |
"border-image-repeat", "border-image-slice", "border-image-source",
|
12278 |
+
"border-image-width", "border-left", "border-left-color", "border-left-style",
|
12279 |
+
"border-left-width", "border-radius", "border-right", "border-right-color",
|
12280 |
+
"border-right-style", "border-right-width", "border-spacing", "border-style",
|
12281 |
+
"border-top", "border-top-color", "border-top-left-radius",
|
12282 |
+
"border-top-right-radius", "border-top-style", "border-top-width",
|
12283 |
+
"border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
|
12284 |
+
"break-after", "break-before", "break-inside", "caption-side", "caret-color",
|
12285 |
+
"clear", "clip", "color", "color-profile", "column-count", "column-fill",
|
12286 |
+
"column-gap", "column-rule", "column-rule-color", "column-rule-style",
|
12287 |
+
"column-rule-width", "column-span", "column-width", "columns", "contain",
|
12288 |
+
"content", "counter-increment", "counter-reset", "crop", "cue", "cue-after",
|
12289 |
+
"cue-before", "cursor", "direction", "display", "dominant-baseline",
|
12290 |
+
"drop-initial-after-adjust", "drop-initial-after-align",
|
12291 |
+
"drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
|
12292 |
+
"drop-initial-value", "elevation", "empty-cells", "fit", "fit-position",
|
12293 |
+
"flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
|
12294 |
+
"flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
|
12295 |
+
"font", "font-family", "font-feature-settings", "font-kerning",
|
12296 |
+
"font-language-override", "font-optical-sizing", "font-size",
|
12297 |
+
"font-size-adjust", "font-stretch", "font-style", "font-synthesis",
|
12298 |
+
"font-variant", "font-variant-alternates", "font-variant-caps",
|
12299 |
+
"font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
|
12300 |
+
"font-variant-position", "font-variation-settings", "font-weight", "gap",
|
12301 |
+
"grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows",
|
12302 |
+
"grid-column", "grid-column-end", "grid-column-gap", "grid-column-start",
|
12303 |
+
"grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start",
|
12304 |
+
"grid-template", "grid-template-areas", "grid-template-columns",
|
12305 |
+
"grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon",
|
12306 |
+
"image-orientation", "image-rendering", "image-resolution", "inline-box-align",
|
12307 |
+
"inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline",
|
12308 |
+
"inset-inline-end", "inset-inline-start", "isolation", "justify-content",
|
12309 |
+
"justify-items", "justify-self", "left", "letter-spacing", "line-break",
|
12310 |
+
"line-height", "line-height-step", "line-stacking", "line-stacking-ruby",
|
12311 |
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
12312 |
"list-style-image", "list-style-position", "list-style-type", "margin",
|
12313 |
+
"margin-bottom", "margin-left", "margin-right", "margin-top", "marks",
|
12314 |
+
"marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed",
|
12315 |
+
"marquee-style", "max-block-size", "max-height", "max-inline-size",
|
12316 |
+
"max-width", "min-block-size", "min-height", "min-inline-size", "min-width",
|
12317 |
+
"mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right",
|
12318 |
+
"nav-up", "object-fit", "object-position", "offset", "offset-anchor",
|
12319 |
+
"offset-distance", "offset-path", "offset-position", "offset-rotate",
|
12320 |
+
"opacity", "order", "orphans", "outline", "outline-color", "outline-offset",
|
12321 |
+
"outline-style", "outline-width", "overflow", "overflow-style",
|
12322 |
+
"overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom",
|
12323 |
+
"padding-left", "padding-right", "padding-top", "page", "page-break-after",
|
12324 |
+
"page-break-before", "page-break-inside", "page-policy", "pause",
|
12325 |
+
"pause-after", "pause-before", "perspective", "perspective-origin", "pitch",
|
12326 |
+
"pitch-range", "place-content", "place-items", "place-self", "play-during",
|
12327 |
+
"position", "presentation-level", "punctuation-trim", "quotes",
|
12328 |
+
"region-break-after", "region-break-before", "region-break-inside",
|
12329 |
+
"region-fragment", "rendering-intent", "resize", "rest", "rest-after",
|
12330 |
+
"rest-before", "richness", "right", "rotate", "rotation", "rotation-point",
|
12331 |
+
"row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span",
|
12332 |
+
"scale", "scroll-behavior", "scroll-margin", "scroll-margin-block",
|
12333 |
+
"scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom",
|
12334 |
+
"scroll-margin-inline", "scroll-margin-inline-end",
|
12335 |
+
"scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right",
|
12336 |
+
"scroll-margin-top", "scroll-padding", "scroll-padding-block",
|
12337 |
+
"scroll-padding-block-end", "scroll-padding-block-start",
|
12338 |
+
"scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end",
|
12339 |
+
"scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right",
|
12340 |
+
"scroll-padding-top", "scroll-snap-align", "scroll-snap-type",
|
12341 |
+
"shape-image-threshold", "shape-inside", "shape-margin", "shape-outside",
|
12342 |
+
"size", "speak", "speak-as", "speak-header", "speak-numeral",
|
12343 |
+
"speak-punctuation", "speech-rate", "stress", "string-set", "tab-size",
|
12344 |
+
"table-layout", "target", "target-name", "target-new", "target-position",
|
12345 |
+
"text-align", "text-align-last", "text-combine-upright", "text-decoration",
|
12346 |
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
12347 |
+
"text-decoration-skip-ink", "text-decoration-style", "text-emphasis",
|
12348 |
+
"text-emphasis-color", "text-emphasis-position", "text-emphasis-style",
|
12349 |
+
"text-height", "text-indent", "text-justify", "text-orientation",
|
12350 |
+
"text-outline", "text-overflow", "text-rendering", "text-shadow",
|
12351 |
+
"text-size-adjust", "text-space-collapse", "text-transform",
|
12352 |
+
"text-underline-position", "text-wrap", "top", "transform", "transform-origin",
|
12353 |
+
"transform-style", "transition", "transition-delay", "transition-duration",
|
12354 |
+
"transition-property", "transition-timing-function", "translate",
|
12355 |
+
"unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance",
|
12356 |
+
"voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate",
|
12357 |
+
"voice-stress", "voice-volume", "volume", "white-space", "widows", "width",
|
12358 |
+
"will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index",
|
12359 |
// SVG-specific
|
12360 |
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
|
12361 |
"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
|
12369 |
], propertyKeywords = keySet(propertyKeywords_);
|
12370 |
|
12371 |
var nonStandardPropertyKeywords_ = [
|
12372 |
+
"border-block", "border-block-color", "border-block-end",
|
12373 |
+
"border-block-end-color", "border-block-end-style", "border-block-end-width",
|
12374 |
+
"border-block-start", "border-block-start-color", "border-block-start-style",
|
12375 |
+
"border-block-start-width", "border-block-style", "border-block-width",
|
12376 |
+
"border-inline", "border-inline-color", "border-inline-end",
|
12377 |
+
"border-inline-end-color", "border-inline-end-style",
|
12378 |
+
"border-inline-end-width", "border-inline-start", "border-inline-start-color",
|
12379 |
+
"border-inline-start-style", "border-inline-start-width",
|
12380 |
+
"border-inline-style", "border-inline-width", "margin-block",
|
12381 |
+
"margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
|
12382 |
+
"margin-inline-start", "padding-block", "padding-block-end",
|
12383 |
+
"padding-block-start", "padding-inline", "padding-inline-end",
|
12384 |
+
"padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
|
12385 |
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
|
12386 |
"scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
|
12387 |
+
"scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration",
|
12388 |
+
"searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"
|
|
|
12389 |
], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
|
12390 |
|
12391 |
var fontProperties_ = [
|
12392 |
+
"font-display", "font-family", "src", "unicode-range", "font-variant",
|
12393 |
+
"font-feature-settings", "font-stretch", "font-weight", "font-style"
|
12394 |
], fontProperties = keySet(fontProperties_);
|
12395 |
|
12396 |
var counterDescriptors_ = [
|
13242 |
}
|
13243 |
function parenExpr(type) {
|
13244 |
if (type != "(") return pass()
|
13245 |
+
return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
|
13246 |
}
|
13247 |
function expressionInner(type, value, noComma) {
|
13248 |
if (cx.state.fatArrowAt == cx.stream.start) {
|
13271 |
}
|
13272 |
|
13273 |
function maybeoperatorComma(type, value) {
|
13274 |
+
if (type == ",") return cont(maybeexpression);
|
13275 |
return maybeoperatorNoComma(type, value, false);
|
13276 |
}
|
13277 |
function maybeoperatorNoComma(type, value, noComma) {
|
assets/js/forms-admin.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function o(a,l,s){function c(t,e){if(!l[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(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 c(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var u="function"==typeof require&&require,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){"use strict";var r=window.mc4wp_forms_i18n,i=e("mithril"),o={showType:function(e){var t=e.type;return t=t.charAt(0).toUpperCase()+t.slice(1),i("div",[i("label",r.fieldType),i("span",t)])},label:function(t){return i("div",[i("label",r.fieldLabel),i("input.widefat",{type:"text",value:t.label,onchange:function(e){t.label=e.target.value},placeholder:t.title})])},value:function(t){var e="hidden"===t.type;return i("div",[i("label",[e?r.value:r.initialValue," ",e?"":i("small",{style:"float: right; font-weight: normal;"},r.optional)]),i("input.widefat",{type:"text",value:t.value,onchange:function(e){t.value=e.target.value}}),e?"":i("p.help",r.valueHelp)])},numberMinMax:function(t){return i("div",[i("div.row",[i("div.col.col-3",[i("label",r.min),i("input",{type:"number",onchange:function(e){t.min=e.target.value}})]),i("div.col.col-3",[i("label",r.max),i("input",{type:"number",onchange:function(e){t.max=e.target.value}})])])])},isRequired:function(t){var e,n={type:"checkbox",checked:t.required,onchange:function(e){t.required=e.target.checked}};return t.forceRequired&&(n.required=!0,n.disabled=!0,e=i("p.help",r.forceRequired)),i("div",[i("label.cb-wrap",[i("input",n),r.isFieldRequired]),e])},placeholder:function(t){return i("div",[i("label",[r.placeholder," ",i("small",{style:"float: right; font-weight: normal;"},r.optional)]),i("input.widefat",{type:"text",value:t.placeholder,onchange:function(e){t.placeholder=e.target.value},placeholder:""}),i("p.help",r.placeholderHelp)])},useParagraphs:function(t){return i("div",[i("label.cb-wrap",[i("input",{type:"checkbox",checked:t.wrap,onchange:function(e){t.wrap=e.target.checked}}),r.wrapInParagraphTags])])},choiceType:function(t){var e=[i("option",{value:"select",selected:"select"===t.type&&"selected"},r.dropdown),i("option",{value:"radio",selected:"radio"===t.type&&"selected"},r.radioButtons)];return t.acceptsMultipleValues&&e.push(i("option",{value:"checkbox",selected:"checkbox"===t.type&&"selected"},r.checkboxes)),i("div",[i("label",r.choiceType),i("select",{value:t.type,onchange:function(e){t.type=e.target.value}},e)])},choices:function(n){var e=[];return e.push(i("div",[i("label",r.choices),i("div.limit-height",[i("table",n.choices.map(function(t,e){return i("tr",{"data-id":e},[i("td.cb",i("input",{name:"selected",type:"checkbox"===n.type?"checkbox":"radio",onchange:function(t){n.choices=n.choices.map(function(e){return e.value===t.target.value?e.selected=!e.selected:"checkbox"!==n.type&&(e.selected=!1),e})},checked:t.selected,value:t.value,title:r.preselect})),i("td.stretch",i("input.widefat",{type:"text",value:t.label,placeholder:t.title,onchange:function(e){t.label=e.target.value}})),i("td",i("span",{title:r.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(n,e)},""))])}))])])),e},linkToTerms:function(t){return i("div",[i("label",r.agreeToTermsLink),i("input.widefat",{type:"text",value:t.link,onchange:function(e){t.link=e.target.value},placeholder:"https://..."})])}};t.exports=o},{mithril:28}],2:[function(e,t,n){"use strict";var r={},i=e("./field-forms-rows.js");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[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},r.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type&&"radio"!==e.type||t.push(i.isRequired(e)),t},r.hidden=function(e){return e.placeholder="",e.label="",e.wrap=!1,[i.showType(e),i.value(e)]},r.submit=function(e){return e.label="",e.placeholder="",[i.value(e),i.useParagraphs(e)]},r["terms-checkbox"]=function(e){return[i.label(e),i.linkToTerms(e),i.isRequired(e),i.useParagraphs(e)]},r.number=function(e){return[r.text(e),i.numberMinMax(e)]},t.exports=r},{"./field-forms-rows.js":1}],3:[function(e,t,n){"use strict";function o(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")}var a=e("html"),l=e("mithril"),s={};s.select=function(e){var t={name:e.name,required:e.required},n=!1,r=e.choices.map(function(e){return e.selected&&(n=!0),l("option",{value:e.value!==e.label?e.value:void 0,selected:e.selected,oncreate:o},e.label)}),i=e.placeholder;return 0<i.length&&r.unshift(l("option",{disabled:!0,value:"",selected:!n,oncreate:o},i)),l("select",t,r)},s["terms-checkbox"]=function(e){var t;return t=0<e.link.length?l("a",{href:e.link,target:"_blank"},e.label):e.label,l("label",[l("input",{name:e.name,type:"checkbox",value:e.value,required:e.required})," ",t])},s.checkbox=function(r){return r.choices.map(function(e){var t=r.name+("checkbox"===r.type?"[]":""),n=r.required&&"radio"===r.type;return l("label",[l("input",{name:t,type:r.type,value:e.value,checked:e.selected,required:n,oncreate:o})," ",l("span",e.label)])})},s.radio=s.checkbox,s.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=o,l("input",t)},t.exports=function(e){var t=0<e.label.length&&e.showLabel?l("label",{},e.label):"",n="function"==typeof s[e.type]?s[e.type](e):s.default(e),r=e.wrap?l("p",[t,n]):[t,n],i=document.createElement("div");return l.render(i,r),a.prettyPrint(i.innerHTML)+"\n"}},{html:24,mithril:28}],4:[function(e,t,n){"use strict";var i,o=e("mithril"),r=e("./form-editor.js"),a=e("./fields.js"),l=window.mc4wp_forms_i18n,s=e("./field-generator.js"),c=e("../overlay.js"),u=e("./field-forms.js");function d(e){(i=a.get(e))&&"hidden"===i.type&&0<i.choices.length&&(i.value=i.choices.map(function(e){return e.label}).join("|")),o.redraw()}function f(){var e=s(i);r.insert(e),d(""),o.redraw()}r.on("blur",o.redraw);var h=document.getElementById("mc4wp-field-wizard");h&&o.mount(h,{view:function(){var e=a.getCategories(),n=a.getAll(),t=o("div.available-fields.small-margin",[o("h4",l.chooseField),e.map(function(t){var e=n.filter(function(e){return e.category===t});if(e.length)return o("div.tiny-margin",[o("strong",t),e.map(function(e){var t="button";e.forceRequired&&(t+=" is-required");var n=e.inFormContent;return null!==n&&(t+=" "+(n?"in-form":"not-in-form")),o("button",{className:t,type:"button",onclick:function(e){return d(e.target.value)},value:e.index},e.title)})])})]),r=null;return i&&(r=o(c,{onClose:d},o("div.field-wizard",[o("h3",[i.title,i.forceRequired?o("span.red","*"):"",i.name.length?o("code",i.name):""]),i.help.length?o("p",o.trust(i.help)):"",u.render(i),o("p",[o("button",{class:"button-primary",type:"button",onkeydown:function(e){13===e.keyCode&&f()},onclick:f},l.addToForm)])]))),[t,r]}})},{"../overlay.js":11,"./field-forms.js":2,"./field-generator.js":3,"./fields.js":6,"./form-editor.js":7,mithril:28}],5:[function(e,t,n){"use strict";var r=e("mithril"),i=e("./fields.js"),o=window.mc4wp.settings,a=window.mc4wp_vars.ajaxurl,l=window.mc4wp_forms_i18n,s=window.mc4wp_vars.mailchimp,c=window.mc4wp_vars.countries,u=[];function d(e,t,n){var r=i.register(e,t);n||u.push(r)}function f(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function h(e){var t=l.listFields,n=f(e.type),r={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:n,choices:e.options.choices,acceptsMultipleValues:!1};return"address"!==r.type?d(t,r,!1):(d(t,{name:r.name+"[addr1]",type:"text",mailchimpType:"address",title:l.streetAddress},!1),d(t,{name:r.name+"[city]",type:"text",mailchimpType:"address",title:l.city},!1),d(t,{name:r.name+"[state]",type:"text",mailchimpType:"address",title:l.state},!1),d(t,{name:r.name+"[zip]",type:"text",mailchimpType:"address",title:l.zip},!1),d(t,{name:r.name+"[country]",type:"select",mailchimpType:"address",title:l.country,choices:c},!1)),!0}function p(e){var t=l.interestCategories,n=f(e.type);d(t,{title:e.title,name:"INTERESTS["+e.id+"]",type:n,choices:e.interests,acceptsMultipleValues:"checkbox"===n},!1)}function m(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(h),e.interest_categories.forEach(p)}function g(e){var t=a+"?action=mc4wp_get_list_details&ids="+e.map(function(e){return e.id}).join(",");r.request({url:t,method:"GET"}).then(function(e){u.forEach(i.deregister),e.forEach(m)})}o.on("selectedLists.change",g),g(o.getSelectedLists()),function(e){var t,n=l.formFields;for(var r in d(l.listFields,{name:"EMAIL",title:l.emailAddress,required:!0,forceRequired:!0,type:"email"},!0),d(n,{name:"",value:l.subscribe,type:"submit",title:l.submitButton},!0),t={},e)t[e[r].id]=e[r].name;d(n,{name:"_mc4wp_lists",type:"checkbox",title:l.listChoice,choices:t,help:l.listChoiceDescription,acceptsMultipleValues:!0},!0),t={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},d(n,{name:"_mc4wp_action",type:"radio",title:l.formAction,choices:t,value:"subscribe",help:l.formActionDescription},!0),d(n,{name:"AGREE_TO_TERMS",value:1,type:"terms-checkbox",label:l.agreeToTerms,title:l.agreeToTermsShort,showLabel:!1,required:!0},!0)}(s.lists)},{"./fields.js":6,mithril:28}],6:[function(e,t,n){"use strict";function i(e){return{name:e.name,title:e.title||e.name,type:e.type,mailchimpType:e.mailchimpType||null,label:e.label||e.title||"",showLabel:"boolean"!=typeof e.showLabel||e.showLabel,value:e.value||"",placeholder:e.placeholder||"",required:"boolean"==typeof e.required&&e.required,forceRequired:"boolean"==typeof e.forceRequired&&e.forceRequired,wrap:"boolean"!=typeof e.wrap||e.wrap,min:e.min,max:e.max,help:e.help||"",choices:e.choices||[],inFormContent:null,acceptsMultipleValues:e.acceptsMultipleValues,link:e.link||""}}var o,a=e("mithril"),l=[],s=[],c={},u=function(e){return{title:e.title||e.label,selected:e.selected||!1,value:e.value||e.label,label:e.label}};function d(t,n){return l.filter(function(e){return e[t]===n})}t.exports={get:function(e){return l[e]},getAll:function(){return l=l.map(function(e,t){return e.index=t,e})},getCategories:function(){return s.sort(function(e,t){return"Form fields"!==e?-1:1})},deregister:function(e){var t=l.indexOf(e);-1<t&&(delete l[t],a.redraw())},register:function(e,t){var n=d("name",t.name).shift();if(!n){t.choices&&(t.choices=function(n){return"function"==typeof n.map?n.map(function(e){return new u({label:e})}):Object.keys(n).map(function(e){var t=n[e];return new u({label:t,value:e})})}(t.choices),t.value&&(t.choices=t.choices.map(function(e){return e.value===t.value&&(e.selected=!0),e}))),s.indexOf(e)<0&&s.push(e);var r=new i(t);return r.category=e,l.push(r),o&&window.clearTimeout(o),o=window.setTimeout(a.redraw,600),function(e,t){c[e]=c[e]||[],c[e].forEach(function(e){return e.apply(null,t)})}("change"),r}!n.forceRequired&&t.forceRequired&&(n.forceRequired=!0)},getAllWhere:d,on:function(e,t){c[e]=c[e]||[],c[e].push(t)}}},{mithril:28}],7:[function(e,t,n){"use strict";var r=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}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()},c&&(window.addEventListener("load",function(){r.signal(i,"change")}),c.addEventListener("change",function(){s=!0,h()}),l.innerHTML=c.value.toLowerCase(),r&&(i=r.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&&(u.addEventListener("load",f),f.call()),t.exports=a},{codemirror:19,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchbrackets.js":15,"codemirror/addon/edit/matchtags.js":16,"codemirror/addon/fold/xml-fold.js":17,"codemirror/addon/selection/active-line.js":18,"codemirror/mode/css/css":20,"codemirror/mode/htmlmixed/htmlmixed":21,"codemirror/mode/javascript/javascript":22,"codemirror/mode/xml/xml":23}],8:[function(e,t,n){"use strict";var r=e("mithril"),i=e("../helpers.js"),o=e("./form-editor.js"),a=e("./fields.js"),l=/\[(\w+)\]/g,s=/\[\]$/,c=document.getElementById("required-fields");function u(){a.getAll().forEach(function(e){if(!(e.name.length<=0)){var t=e.name;if("checkbox"===e.type&&(t+="[]"),e.inFormContent=o.containsField(t),"address"===e.mailchimpType){void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired);var n=e.name.replace(l,"");0<o.query('[name^="'+n+'"]').length?e.forceRequired=!0:e.forceRequired=e.originalRequiredValue}}}),function(){var r=a.getAllWhere("forceRequired",!0).map(function(e){return e.name.toUpperCase().replace(l,".$1")}),e=o.query("[required]");[].forEach.call(e,function(e){var t=e.name;if(t&&!(t.length<0)&&"_"!==t[0]){var n=(t=(t=t.replace(l,".$1")).replace(s,"")).indexOf(".");n=0<n?n:t.length,t=t.substr(0,n).toUpperCase()+t.substr(n),-1===r.indexOf(t)&&r.push(t)}}),c.value=r.join(",")}(),r.redraw()}o.on("change",i.debounce(u,600)),a.on("change",i.debounce(u,600))},{"../helpers.js":9,"./fields.js":6,"./form-editor.js":7,mithril:28}],9:[function(e,t,n){"use strict";var r={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)}}};t.exports=r},{}],10:[function(e,t,n){"use strict";var r=e("./form-editor/form-editor.js"),i=e("./form-editor/fields.js"),o=e("./settings"),a={};function l(e,t){a[e]=t,c()}function s(e){delete a[e],c()}function c(){var e="";for(var t in a)e+='<div class="notice notice-warning inline"><p>'+a[t]+"</p></div>";var n=document.querySelector(".mc4wp-notices");if(!n){(n=document.createElement("div")).className="mc4wp-notices";var r=document.querySelector("h1, h2");r.parentNode.insertBefore(n,r.nextSibling)}n.innerHTML=e}function u(){-1<r.getValue().toLowerCase().indexOf('name="groupings')?l("deprecated_groupings","Your form contains deprecated <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."):s("deprecated_groupings")}function d(){var e=i.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?l("required_fields_missing",t):s("required_fields_missing")}u(),r.on("focus",u),r.on("blur",u),d(),r.on("blur",d),r.on("focus",d),document.body.addEventListener("change",function(){0<o.getSelectedLists().length?s("no_lists_selected"):l("no_lists_selected",'<strong>Heads up!</strong> You have not yet selected a Mailchimp list to subscribe people to. Please select at least one list from the <a href="javascript:void(0)" data-tab="settings" class="tab-link">settings tab</a>.')})},{"./form-editor/fields.js":6,"./form-editor/form-editor.js":7,"./settings":12}],11:[function(e,t,n){"use strict";var a=e("mithril"),l=window.mc4wp_forms_i18n;t.exports=function(e){var i,t=e.attrs.onClose;function n(){t.apply(null)}function r(e){27===e.keyCode&&n(),13===e.keyCode&&e.preventDefault()}function o(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,n=(e-i.clientWidth-40)/2,r=(t-i.clientHeight-40)/2;i.style.left=(0<n?n:0)+"px",i.style.top=(0<r?r:0)+"px"}return{oncreate:function(){document.addEventListener("keydown",r),window.addEventListener("resize",o)},onremove:function(){document.removeEventListener("keydown",r),window.removeEventListener("resize",o)},view:function(e){return[a("div.overlay-wrap",a("div.overlay",{oncreate:function(e){i=e.dom,o()}},[a("span",{class:"close dashicons dashicons-no",title:l.close,onclick:n}),e.children])),a("div.overlay-background",{title:l.close,onclick:n})]}}}},{mithril:28}],12:[function(e,t,n){"use strict";function r(e){return(r="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)}var i=document.getElementById("mc4wp-admin").querySelectorAll(".mc4wp-list-input"),o=window.mc4wp_vars.mailchimp.lists,a=[],l={};function s(){return a=[],[].forEach.call(i,function(e){"boolean"==typeof e.checked&&!e.checked||"object"!==r(o[e.value])||a.push(o[e.value])}),function(){var e=document.querySelectorAll(".lists--only-selected > *");[].forEach.call(e,function(e){var t=0<function(t,n){return a.filter(function(e){return e[t]===n})}("id",e.getAttribute("data-list-id")).length;e.style.display=t?"":"none"})}(),function(e,t){l[e]=l[e]||[],l[e].forEach(function(e){return e.apply(null,t)})}("selectedLists.change",[a]),a}[].forEach.call(i,function(e){e.addEventListener("change",s)}),s(),t.exports={getSelectedLists:function(){return a},on:function(e,t){l[e]=l[e]||[],l[e].push(t)}}},{}],13:[function(e,t,n){"use strict";var r=e("./admin/form-editor/form-editor.js");e("./admin/form-editor/form-watcher.js"),e("./admin/form-editor/field-helper.js"),e("./admin/form-editor/field-manager.js"),e("./admin/notices.js"),window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=r},{"./admin/form-editor/field-helper.js":4,"./admin/form-editor/field-manager.js":5,"./admin/form-editor/form-editor.js":7,"./admin/form-editor/form-watcher.js":8,"./admin/notices.js":10}],14:[function(e,t,n){var r;r=function(w){w.defineOption("autoCloseTags",!1,function(e,t,n){if(n!=w.Init&&n&&e.removeKeyMap("autoCloseTags"),t){var r={name:"autoCloseTags"};"object"==typeof t&&!t.whenClosing||(r["'/'"]=function(e){return function(e){return e.getOption("disableInput")?w.Pass:i(e,!0)}(e)}),"object"==typeof t&&!t.whenOpening||(r["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return w.Pass;for(var t=e.listSelections(),n=[],r=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return w.Pass;var o=t[i].head,a=e.getTokenAt(o),l=w.innerMode(e.getMode(),a.state),s=l.state,c=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(s),u=c&&c.name;if(!u)return w.Pass;var d="html"==l.mode.configuration,f="object"==typeof r&&r.dontCloseTags||d&&x,h="object"==typeof r&&r.indentTags||d&&k;a.end>o.ch&&(u=u.slice(0,u.length-a.end+o.ch));var p=u.toLowerCase();if(!u||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&c.close||a.string.indexOf("/")==o.ch-a.start-1||f&&-1<C(f,p)||T(e,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(s)||[],u,o,!0))return w.Pass;var m="object"==typeof r&&r.emptyTags;if(m&&-1<C(m,u))n[i]={text:"/>",newPos:w.Pos(o.line,o.ch+2)};else{var g=h&&-1<C(h,p);n[i]={indent:g,text:">"+(g?"\n\n":"")+"</"+u+">",newPos:g?w.Pos(o.line+1,0):w.Pos(o.line,o.ch+1)}}}var v="object"==typeof r&&r.dontIndentOnAutoClose;for(i=t.length-1;0<=i;i--){var y=n[i];e.replaceRange(y.text,t[i].head,t[i].anchor,"+insert");var b=e.listSelections().slice(0);b[i]={head:y.newPos,anchor:y.newPos},e.setSelections(b),!v&&y.indent&&(e.indentLine(y.newPos.line,null,!0),e.indentLine(y.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(r)}});var x=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 n=e.listSelections(),r=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,l=0;l<n.length;l++){if(!n[l].empty())return w.Pass;var s=n[l].head,c=e.getTokenAt(s),u=w.innerMode(e.getMode(),c.state),d=u.state;if(t&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return w.Pass;var f,h="xml"!=u.mode.name&&"htmlmixed"==e.getMode().name;if(h&&"javascript"==u.mode.name)f=i+"script";else if(h&&"css"==u.mode.name)f=i+"style";else{var p=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(d);if(!p||p.length&&T(e,p,p[p.length-1],s))return w.Pass;f=i+p[p.length-1]}">"!=e.getLine(s.line).charAt(c.end)&&(f+=">"),r[l]=f}if(e.replaceSelections(r),n=e.listSelections(),!a)for(l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&e.indentLine(n[l].head.line)}function C(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function T(e,t,n,r,i){if(!w.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=w.scanForClosingTag(e,r,null,o);if(!a||a.tag!=n)return!1;for(var l=i?1:0,s=t.length-1;0<=s&&t[s]==n;s--)++l;r=a.to;for(s=1;s<l;s++){var c=w.scanForClosingTag(e,r,null,o);if(!c||c.tag!=n)return!1;r=c.to}return!0}w.commands.closeTag=function(e){return i(e)}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../fold/xml-fold":17}],15:[function(e,t,n){var r;r=function(r){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=r.Pos,v={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function y(e){return e&&e.bracketRegex||/[(){}[\]]/}function d(e,t,n){var r=e.getLineHandle(t.line),i=t.ch-1,o=n&&n.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=y(n),l=!o&&0<=i&&a.test(r.text.charAt(i))&&v[r.text.charAt(i)]||a.test(r.text.charAt(i+1))&&v[r.text.charAt(++i)];if(!l)return null;var s=">"==l.charAt(1)?1:-1;if(n&&n.strict&&0<s!=(i==t.ch))return null;var c=e.getTokenTypeAt(g(t.line,i+1)),u=f(e,g(t.line,i+(0<s?1:0)),s,c||null,n);return null==u?null:{from:g(t.line,i),to:u&&u.pos,match:u&&u.ch==l.charAt(0),forward:0<s}}function f(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,l=[],s=y(i),c=0<n?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=n){var d=e.getLine(u);if(d){var f=0<n?0:d.length-1,h=0<n?d.length:-1;if(!(d.length>o))for(u==t.line&&(f=t.ch-(n<0?1:0));f!=h;f+=n){var p=d.charAt(f);if(s.test(p)&&(void 0===r||e.getTokenTypeAt(g(u,f+1))==r)){var m=v[p];if(m&&">"==m.charAt(1)==0<n)l.push(p);else{if(!l.length)return{pos:g(u,f),ch:p};l.pop()}}}}}return u-n!=(0<n?e.lastLine():e.firstLine())&&null}function t(e,t,n){for(var r=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,n);if(l&&e.getLine(l.from.line).length<=r){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(l.from,g(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=r&&i.push(e.markText(l.to,g(l.to.line,l.to.ch+1),{className:s}))}}if(i.length){u&&e.state.focused&&e.focus();function c(){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)})}r.defineOption("matchBrackets",!1,function(e,t,n){n&&n!=r.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))}),r.defineExtension("matchBrackets",function(){t(this,!0)}),r.defineExtension("findMatchingBracket",function(e,t,n){return!n&&"boolean"!=typeof t||(t=n?(n.strict=t,n):t?{strict:!0}:null),d(this,e,t)}),r.defineExtension("scanForBracket",function(e,t,n,r){return f(this,e,t,n,r)})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],16:[function(e,t,n){var r;r=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 r(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 n=a.findMatchingTag(o,e,t);if(n){if(o.state.matchBothTags){var r="open"==n.at?n.open:n.close;r&&(o.state.tagHit=o.markText(r.from,r.to,{className:"CodeMirror-matchingtag"}))}var i="close"==n.at?n.open:n.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&r(e)}a.defineOption("matchTags",!1,function(e,t,n){n&&n!=a.Init&&(e.off("cursorActivity",r),e.off("viewportChange",i),l(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",r),e.on("viewportChange",i),r(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var n="close"==t.at?t.open:t.close;n&&e.extendSelection(n.to,n.from)}}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../fold/xml-fold":17}],17:[function(e,t,n){var r;r=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",r=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,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function i(e,t){var n=e.cm.getTokenTypeAt(s(e.line,t));return n&&/\btag\b/.test(n)}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 n=e.text.lastIndexOf("/",t),r=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"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)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){r.lastIndex=e.ch;var t=r.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 n=e.text.lastIndexOf("/",t),r=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var n=[];;){var r,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(r=d(e)))return;if("selfClose"!=r)if(i[1]){for(var l=n.length-1;0<=l;--l)if(n[l]==i[2]){n.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 n.push(i[2])}}function g(e,t){for(var n=[];;){var r=p(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=f(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;0<=l;--l)if(n[l]==a[2]){n.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 n=new u(e,t.line,0);;){var r=h(n);if(!r||n.line!=t.line)return;var i=d(n);if(!i)return;if(!r[1]&&"selfClose"!=i){var o=s(n.line,n.ch),a=m(n,r[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,n){var r=new u(e,t.line,t.ch,n);if(-1!=r.text.indexOf(">")||-1!=r.text.indexOf("<")){var i=d(r),o=i&&s(r.line,r.ch),a=i&&f(r);if(i&&a&&!(0<c(r,t))){var l={from:s(r.line,r.ch),to:o,tag:a[2]};return"selfClose"==i?{open:l,close:null,at:"open"}:a[1]?{open:g(r,a[2]),close:l,at:"close"}:{open:l,close:m(r=new u(e,o.line,o.ch,n),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new u(e,t.line,t.ch,n);;){var o=g(i,r);if(!o)break;var a=m(new u(e,t.line,t.ch,n),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,n,r){return m(new u(e,t.line,t.ch,r?{from:0,to:r}:null),n)}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],18:[function(e,t,n){var r;r=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 n=[],r=0;r<e.length;r++){var i=e[r],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);n[n.length-1]!=a&&n.push(a)}}!function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}(t.state.activeLines,n)&&t.operation(function(){u(t);for(var e=0;e<n.length;e++)t.addLineClass(n[e],"wrap",l),t.addLineClass(n[e],"background",s),t.addLineClass(n[e],"gutter",c);t.state.activeLines=n})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,n){var r=n!=i.Init&&n;t!=r&&(r&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],19:[function(e,t,n){var r,i;r=this,i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=n||r||i,k=x&&(n?document.documentMode||6:+(i||r)[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]))&&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 n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[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,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"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,n,r){var i=N(e,t,n,r);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 z(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?" ":"")+t)}function D(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=" "+n[r]);return t}S=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t=t||{},e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function j(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}u?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(P=function(e){try{e.select()}catch(e){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}W.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},W.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var R=30,B={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},U={origin:"*mouse"},K={origin:"+move"};function V(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||t<=i+a)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,t<=(i+=n-i%n))return r}}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 n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Z(){}function J(e,t){var n;return n=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&I(t,n),n}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 ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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)&&re.test(e)}function oe(e,t,n){for(;(n<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=n<t?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var le=null;function se(e,t,n){var r;le=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"==n?r=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:le=i)}return null!=r?r:le}var ce,ue,de,fe,he,pe,me,ge=(ce="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ue="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",de=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,fe=/[stwN]/,he=/[LRr]/,pe=/[Lb1n]/,me=/[1n]/,function(e,t){var n="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!de.test(e))return!1;for(var r,i=e.length,o=[],a=0;a<i;++a)o.push((r=e.charCodeAt(a))<=247?ce.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?ue.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L");for(var l=0,s=n;l<i;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=n;u<i;++u){var f=o[u];"1"==f&&"r"==d?o[u]="n":he.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=n;x<i;++x){var C=o[x];"L"==k&&"1"==C?o[x]="L":he.test(C)&&(k=C)}for(var T=0;T<i;++T)if(fe.test(o[T])){var S=void 0;for(S=T+1;S<i&&fe.test(o[S]);++S);for(var L="L"==(T?o[T-1]:n),M=L==("L"==(S<i?o[S]:n))?L?"L":"R":n,A=T;A<S;++A)o[A]=M;T=S-1}for(var O,N=[],_=0;_<i;)if(pe.test(o[_])){var E=_;for(++_;_<i&&pe.test(o[_]);++_);N.push(new ve(0,E,_))}else{var z=_,D=N.length;for(++_;_<i&&"L"!=o[_];++_);for(var P=z;P<_;)if(me.test(o[P])){z<P&&N.splice(D,0,new ve(1,z,P));var F=P;for(++P;P<_&&me.test(o[P]);++P);N.splice(D,0,new ve(2,F,P)),z=P}else++P;z<_&&N.splice(D,0,new ve(1,z,_))}return"ltr"==t&&(1==N[0].level&&(O=e.match(/^\s+/))&&(N[0].from=O[0].length,N.unshift(new ve(0,0,O[0].length))),1==Y(N).level&&(O=e.match(/\s+$/))&&(Y(N).to-=O[0].length,N.push(new ve(0,i-O[0].length,i)))),"rtl"==t?N.reverse():N});function ve(e,t,n){this.level=e,this.from=t,this.to=n}function ye(e,t){var n=e.order;return null==n&&(n=e.order=ge(e.text,t)),n}var be=[],we=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||be).concat(n)}};function xe(e,t){return e._handlers&&e._handlers[t]||be}function ke(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);-1<o&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var n=xe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Te(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,n||t.type,e,t),Ne(t)||t.codemirrorIgnore}function Se(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function Le(e,t){return 0<xe(e,t).length}function Me(e){e.prototype.on=function(e,t){we(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _e(e){Ae(e),Oe(e)}function Ee(e){return e.target||e.srcElement}function ze(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 De,Pe,Fe=function(){if(x&&k<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Ie(e){if(null==De){var t=N("span","");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&k<8))}var n=De?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function je(e){if(null!=Pe)return Pe;var t=A(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return M(e),!(!n||n.left==n.right)&&(Pe=r.right-n.right<3)}var We,He=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){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?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Re=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)},Be="oncopy"in(We=N("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),qe=null;var Ue={},Ke={};function Ve(e){if("string"==typeof e&&Ke.hasOwnProperty(e))e=Ke[e];else if(e&&"string"==typeof e.name&&Ke.hasOwnProperty(e.name)){var t=Ke[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 Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Ve(t);var n=Ue[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if($e.hasOwnProperty(t.name)){var i=$e[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var $e={};function Ye(e,t){I(t,$e.hasOwnProperty(e)?$e[e]:$e[e]={})}function Xe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ze(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Je(e,t,n){return!e.startState||e.startState(t,n)}var Qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function et(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function tt(e,n,r){var i=[],o=n.line;return e.iter(n.line,r.line+1,function(e){var t=e.text;o==r.line&&(t=t.slice(0,r.ch)),o==n.line&&(t=t.slice(n.ch)),i.push(t),++o}),i}function nt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function rt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function it(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;r=(t=r).parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ot(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}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 n+a}function at(e,t){return t>=e.first&&t<e.first+e.size}function lt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function st(e,t,n){if(void 0===n&&(n=null),!(this instanceof st))return new st(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ut(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function dt(e){return st(e.line,e.ch)}function ft(e,t){return ct(e,t)<0?t:e}function ht(e,t){return ct(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function mt(e,t){if(t.line<e.first)return st(e.first,0);var n=e.first+e.size-1;return t.line>n?st(n,et(e,n).text.length):function(e,t){var n=e.ch;return null==n||t<n?st(e.line,t):n<0?st(e.line,0):e}(t,et(e,t.line).text.length)}function gt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=mt(e,t[r]);return n}Qe.prototype.eol=function(){return this.pos>=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qe.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},Qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&0<r.index?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}function i(e){return n?e.toLowerCase():e}if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var vt=function(e,t){this.state=e,this.lookAhead=t},yt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function bt(t,n,r,e){var s=[t.state.modeGen],i={};At(t,n.text,t.doc.mode,r,function(e,t){return s.push(e,t)},i,e);for(var c=r.state,o=function(e){r.baseTokens=s;var o=t.state.overlays[e],a=1,l=0;r.state=!0,At(t,n.text,o.mode,r,function(e,t){for(var n=a;l<e;){var r=s[a];e<r&&s.splice(a,1,e,s[a+1],r),a+=2,l=Math.min(e,r)}if(t)if(o.opaque)s.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n<a;n+=2){var i=s[n+1];s[n+1]=(i?i+" ":"")+"overlay "+t}},i),r.state=c,r.baseTokens=null,r.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:s,classes:i.bgClass||i.textClass?i:null}}function wt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=xt(e,it(t)),i=t.text.length>e.options.maxHighlightLength&&Xe(e.doc.mode,r.state),o=bt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xt(n,r,e){var t=n.doc,i=n.display;if(!t.mode.startState)return new yt(t,!0,r);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=et(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof vt?c.lookAhead:0)<=o.modeFrontier))return l;var u=j(s.text,null,e.options.tabSize);(null==i||u<r)&&(i=l-1,r=u)}return i}(n,r,e),a=o>t.first&&et(t,o-1).stateAfter,l=a?yt.fromSaved(t,a,o):new yt(t,Je(t.mode),o);return t.iter(o,r,function(e){kt(n,e.text,l);var t=l.line;e.stateAfter=t==r-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?l.save():null,l.nextLine()}),e&&(t.modeFrontier=l.line),l}function kt(e,t,n,r){var i=e.doc.mode,o=new Qe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Ct(i,n.state);!o.eol();)Tt(i,o,n.state),o.start=o.pos}function Ct(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ze(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Tt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ze(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},yt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},yt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},yt.fromSaved=function(e,t,n){return t instanceof vt?new yt(e,Xe(e.mode,t.state),n,t.lookAhead):new yt(e,Xe(e.mode,t),n)},yt.prototype.save=function(e){var t=!1!==e?Xe(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new vt(t,this.maxLookAhead):t};var St=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Lt(e,t,n,r){var i,o,a=e.doc,l=a.mode,s=et(a,(t=mt(a,t)).line),c=xt(e,t.line,n),u=new Qe(s.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Tt(l,u,c.state),r&&o.push(new St(u,i,Xe(a.mode,c.state)));return r?o:new St(u,i,c.state)}function Mt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function At(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Qe(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&Mt(Ct(n,r.state),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&kt(e,t,r,d.pos),d.pos=t.length,null):Mt(Tt(n,d,r.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 Ot=!1,Nt=!1;function _t(e,t,n){this.marker=e,this.from=t,this.to=n}function Et(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n=n||[]).push(e[r]);return n}function Dt(e,t){if(t.full)return null;var n=at(e,t.from.line)&&et(e,t.from.line).markedSpans,r=at(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ct(t.from,t.to),l=function(e,t,n){var r;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&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r=r||[]).push(new _t(a,o.from,l?null:o.to))}}return r}(n,i,a),s=function(e,t,n){var r;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&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r=r||[]).push(new _t(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,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=Et(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)Et(l,m.marker)||(m.from=u,c&&(l=l||[]).push(m));else m.from+=u,c&&(l=l||[]).push(m)}l=l&&Pt(l),s&&s!=l&&(s=Pt(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 _t(l[b].marker,null,null));for(var w=0;w<y;++w)g.push(v);g.push(s)}return g}function Pt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ft(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function It(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function jt(e){return e.inclusiveLeft?-1:0}function Wt(e){return e.inclusiveRight?1:0}function Ht(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ct(r.from,i.from)||jt(e)-jt(t);if(o)return-o;var a=ct(r.to,i.to)||Wt(e)-Wt(t);return a||t.id-e.id}function Rt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ht(n,i.marker)<0)&&(n=i.marker);return n}function Bt(e){return Rt(e,!0)}function qt(e){return Rt(e,!1)}function Ut(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ht(n,o.marker)<0)&&(n=o.marker)}return n}function Kt(e,t,n,r,i){var o=et(e,t),a=Nt&&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=ct(c.from,n)||jt(s.marker)-jt(i),d=ct(c.to,r)||Wt(s.marker)-Wt(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=ct(c.to,n):0<ct(c.to,n))||0<=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(c.from,r)<=0:ct(c.from,r)<0)))return!0}}}function Vt(e){for(var t;t=Bt(e);)e=t.find(-1,!0).line;return e}function Gt(e,t){var n=et(e,t),r=Vt(n);return n==r?t:it(r)}function $t(e,t){if(t>e.lastLine())return t;var n,r=et(e,t);if(!Yt(e,r))return t;for(;n=qt(r);)r=n.find(1,!0).line;return it(r)+1}function Yt(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Xt(e,t,r))return!0}}function Xt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Xt(e,r.line,Et(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.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==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Xt(e,t,i))return!0}function Zt(e){for(var t=0,n=(e=Vt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Jt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Bt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=qt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Qt(e){var n=e.display,t=e.doc;n.maxLine=et(t,t.first),n.maxLineLength=Jt(n.maxLine),n.maxLineChanged=!0,t.iter(function(e){var t=Jt(e);t>n.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}var en=function(e,t,n){this.text=e,It(this,t),this.height=n?n(this):1};en.prototype.lineNo=function(){return it(this)},Me(en);var tn={},nn={};function rn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?nn:tn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var n=O("span",null,null,b?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,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;r.pos=0,r.addToken=ln,je(e.display.measure)&&(a=ye(o,e.doc.direction))&&(r.addToken=sn(r.addToken,a)),r.map=[],un(o,r,wt(e,o,t!=e.display.externalMeasured&&it(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=D(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=D(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ie(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function an(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,n,r,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(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+=1+h;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),n||r||i||u||o){var y=n||"";r&&(y+=r),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 sn(d,f){return function(e,t,n,r,i,o,a){n=n?n+" 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,n,r,i,o,a);d(e,t.slice(0,c.to-l),n,r,null,o,a),r=null,t=t.slice(c.to-l),l=c.to}}}function cn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",n.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function un(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)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<r.length;++w){var x=r[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||Ht(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)cn(t,0,y[S]);if(d&&(d.from||0)==p){if(cn(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=n[m++]),a=rn(n[m++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),rn(n[O+1],t.cm.options))}function dn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=qt(e);)e=t.find(1,!0).line,(n=n||[]).push(e);return n}(t),this.size=this.rest?it(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Yt(e,t)}function fn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new dn(e.doc,et(e.doc,o),o);r=o+a.size,i.push(a)}return i}var hn=null;var pn=null;function mn(e,t){var n=xe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);hn?r=hn.delayedCallbacks:pn?r=pn:(r=pn=[],setTimeout(gn,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function gn(){var e=pn;pn=null;for(var t=0;t<e.length;++t)e[t]()}function vn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?wn(e,t):"gutter"==o?kn(e,t,n,r):"class"==o?xn(e,t):"widget"==o&&Cn(e,t,r)}t.changes=null}function yn(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 bn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):on(e,t)}function wn(e,t){var n=t.text.className,r=bn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,xn(e,t)):n&&(t.text.className=n)}function xn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=yn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?yn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function kn(e,t,n,r){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=yn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.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=yn(t),l=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.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",lt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function Cn(e,t,n){t.alignable&&(t.alignable=null);for(var r=T("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Tn(e,t,n)}function Tn(e,t,n){if(Sn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Sn(e,t.rest[r],t,n,!1)}function Sn(e,t,n,r,i){if(t.widgets)for(var o=yn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Ln(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),mn(s,"redraw")}}function Ln(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Mn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function An(e,t){for(var n=Ee(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function On(e){return e.lineSpace.offsetTop}function Nn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function En(e){return R-e.display.nativeBarWidth}function zn(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function Dn(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Pn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(it(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fn(e,t,n,r){return Wn(e,jn(e,t),n,r)}function In(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[pr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function jn(e,t){var n=it(t),r=In(e,n);r&&!r.text?r=null:r&&r.changes&&(vn(e,r,n,cr(e)),e.curOp.forceUpdate=!0);var i=Pn(r=r||function(e,t){var n=it(t=Vt(t)),r=e.display.externalMeasured=new dn(e.doc,t,n);r.lineN=n;var i=r.built=on(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}(e,t),t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Wn(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&zn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){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-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Bn(t.map,n,r),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():qn(S(a,l,s).getClientRects(),r)).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!=qe)return qe;var t=A(e,N("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return qe=1<Math.abs(n.left-r.left)}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;0<l&&(c=r="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==r?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+sr(e.display),top:f.top,bottom:f.bottom}:Rn}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,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Hn,Rn={left:0,right:0,top:0,bottom:0};function Bn(e,t,n){for(var r,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(r=e[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function qn(e,t){var n=Rn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;0<=i&&(n=e[i]).left==n.right;i--);return n}function Un(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 Kn(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Un(e.display.view[t])}function Vn(e){Kn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Gn(){return a&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $n(){return a&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Mn(e.widgets[n]));return t}function Xn(e,t,n,r,i){if(!i){var o=Yn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r=r||"local";var a=Zt(t);if("local"==r?a+=On(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:$n());var s=l.left+("window"==r?0:Gn());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Zn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Gn(),i-=$n();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Jn(e,t,n,r,i){return Xn(e,r=r||et(e.doc,t.line),Fn(e,r,t.ch,i),n)}function Qn(r,e,i,o,a,l){function s(e,t){var n=Wn(r,a,e,t?"right":"left",l);return t?n.left=n.right:n.right=n.left,Xn(r,o,n,i)}o=o||et(r.doc,e.line),a=a||jn(r,o);var c=ye(o,r.doc.direction),t=e.ch,n=e.sticky;if(t>=o.text.length?(t=o.text.length,n="before"):t<=0&&(t=0,n="after"),!c)return s("before"==n?t-1:t,"before"==n);function u(e,t,n){return s(n?e-1:e,1==c[t].level!=n)}var d=se(c,t,n),f=le,h=u(t,d,"before"==n);return null!=f&&(h.other=u(t,f,"before"!=n)),h}function er(e,t){var n=0;t=mt(e.doc,t),e.options.lineWrapping||(n=sr(e.display)*t.ch);var r=et(e.doc,t.line),i=Zt(r)+On(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function tr(e,t,n,r,i){var o=st(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function nr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return tr(r.first,0,null,-1,-1);var i=ot(r,n),o=r.first+r.size-1;if(o<i)return tr(r.first+r.size-1,et(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=et(r,i);;){var l=ar(e,a,i,t,n),s=Ut(a,l.ch+(0<l.xRel||0<l.outside?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=et(r,i=c.line)}}function rr(t,e,n,r){r-=Yn(e);var i=e.text.length,o=ae(function(e){return Wn(t,n,e-1).bottom<=r},i,0);return{begin:o,end:i=ae(function(e){return Wn(t,n,e).top>r},o,i)}}function ir(e,t,n,r){return rr(e,t,n=n||jn(e,t),Xn(e,t,Wn(e,n,r),"line").top)}function or(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function ar(n,e,t,r,i){i-=Zt(e);var o=jn(n,e),a=Yn(e),l=0,s=e.text.length,c=!0,u=ye(e,n.doc.direction);if(u){var d=(n.options.lineWrapping?function(e,t,n,r,i,o,a){var l=rr(e,t,r,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=Wn(e,r,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(r,i,o,a,l,s,c){var e=ae(function(e){var t=l[e],n=1!=t.level;return or(Qn(r,st(o,n?t.to:t.from,n?"before":"after"),"line",i,a),s,c,!0)},0,l.length-1),t=l[e];if(0<e){var n=1!=t.level,u=Qn(r,st(o,n?t.from:t.to,n?"after":"before"),"line",i,a);or(u,s,c,!0)&&u.top>c&&(t=l[e-1])}return t})(n,e,t,o,u,r,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=Wn(n,o,e);return t.top+=a,t.bottom+=a,!!or(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(p=e,m=t),!0)},l,s),v=!1;if(m){var y=r-m.left<m.right-r,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":Wn(n,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Qn(n,st(t,g,h),"line",e,o);f=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return tr(t,g=oe(e.text,g,1),h,v,r-f)}function lr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Hn){Hn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hn.appendChild(document.createTextNode("x")),Hn.appendChild(N("br"));Hn.appendChild(document.createTextNode("x"))}A(e.measure,Hn);var n=Hn.offsetHeight/50;return 3<n&&(e.cachedTextHeight=n),M(e.measure),n||1}function sr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function cr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:ur(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ur(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function dr(r){var i=lr(r.display),o=r.options.lineWrapping,a=o&&Math.max(5,r.display.scroller.clientWidth/sr(r.display)-3);return function(e){if(Yt(r.doc,e))return 0;var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;n++)e.widgets[n].height&&(t+=e.widgets[n].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function fr(e){var t=e.doc,n=dr(e);t.iter(function(e){var t=n(e);t!=e.height&&rt(e,t)})}function hr(e,t,n,r){var i=e.display;if(!n&&"true"==Ee(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=nr(e,o,a);if(r&&0<c.xRel&&(s=et(e.doc,c.line).text).length==c.ch){var u=j(s,s.length,e.options.tabSize)-s.length;c=st(c.line,Math.max(0,Math.round((o-_n(e.display).left)/sr(e.display))-u))}return c}function pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function mr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r=r||0;var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&Gt(e.doc,t)<i.viewTo&&vr(e);else if(n<=i.viewFrom)Nt&&$t(e.doc,n+r)>i.viewFrom?vr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)vr(e);else if(t<=i.viewFrom){var o=yr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):vr(e)}else if(n>=i.viewTo){var a=yr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):vr(e)}else{var l=yr(e,t,t,-1),s=yr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(fn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):vr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function gr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[pr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function yr(e,t,n,r){var i,o=pr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<r){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;Gt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function br(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function wr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function xr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&kr(e,l.head,i),s||Tr(e,l,o)}}return r}function kr(e,t,n){var r=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Cr(e,t){return e.top-t.top||e.left-t.left}function Tr(a,e,t){var n=a.display,r=a.doc,i=document.createDocumentFragment(),o=_n(a.display),L=o.left,M=Math.max(n.sizerWidth,zn(a)-n.sizer.offsetLeft)-o.right,A="ltr"==r.direction;function O(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?M-e:n)+"px;\n height: "+(r-t)+"px"))}function l(n,y,b){var w,x,o=et(r,n),k=o.text.length;function C(e,t){return Jn(a,st(n,e),"div",o,t)}function T(e,t,n){var r=ir(a,o,null,e),i="ltr"==t==("after"==n)?"left":"right";return C("after"==n?r.begin:r.end-(/\s/.test(o.text.charAt(r.end-1))?2:1),i)[i]}var S=ye(o,r.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(S,y||0,null==b?k:b,function(e,t,n,r){var i="ltr"==n,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==r,u=!S||r==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,n,"before"),g=A?L:T(t,n,"after"),A&&s&&u?M:a.right):(p=A?T(e,n,"before"):L,m=!A&&l&&c?M:o.right,g=!A&&s&&u?L:a.left,A?T(t,n,"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||Cr(o,w)<0)&&(w=o),Cr(a,w)<0&&(w=a),(!x||Cr(o,x)<0)&&(x=o),Cr(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=et(r,s.line),d=et(r,c.line),f=Vt(u)==Vt(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 Sr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Lr(e){e.state.focused||(e.display.input.focus(),Ar(e))}function Mr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))},100)}function Ar(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,z(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()),Sr(e))}function Or(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ce(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 Nr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],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-n,n=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((.005<u||u<-.005)&&(rt(i.line,a),_r(i.line),i.rest))for(var d=0;d<i.rest.length;d++)_r(i.rest[d]);if(l>e.display.sizerWidth){var f=Math.ceil(l/sr(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function _r(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Er(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-On(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ot(t,r),a=ot(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?a=ot(t,Zt(et(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=ot(t,Zt(et(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function zr(e,t){var n=e.display,r=lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Dn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Nn(n),s=t.top<r,c=t.bottom>l-r;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:n.scroller.scrollLeft,f=zn(e)-(e.options.fixedGutter?n.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 Dr(e,t){null!=t&&(Ir(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pr(e){Ir(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Fr(e,t,n){null==t&&null==n||Ir(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ir(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,jr(e,er(e,t.from),er(e,t.to),t.margin))}function jr(e,t,n,r){var i=zr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Fr(e,i.scrollLeft,i.scrollTop)}function Wr(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||di(e,{top:t}),Hr(e,t,!0),m&&di(e),ai(e,100))}function Hr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Rr(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,pi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Nn(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?n:0,docHeight:r,scrollHeight:r+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function qr(e,t,n){this.cm=n;var r=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");r.tabIndex=i.tabIndex=-1,e(r),e(i),we(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),we(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r: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=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qr.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 W,this.disableVert=new W},qr.prototype.enableZeroWidthBar=function(n,r,i){n.style.pointerEvents="auto",r.set(1e3,function e(){var t=n.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=n?n.style.pointerEvents="none":r.set(1e3,e)})},qr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};function Ur(){}function Kr(e,t){t=t||Br(e);var n=e.display.barWidth,r=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Nr(e),Vr(e,Br(e)),n=e.display.barWidth,r=e.display.barHeight}function Vr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ur.prototype.update=function(){return{bottom:0,right:0}},Ur.prototype.setScrollLeft=function(){},Ur.prototype.setScrollTop=function(){},Ur.prototype.clear=function(){};var Gr={native:qr,null:Ur};function $r(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&L(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Gr[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),we(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?Rr(n,e):Wr(n,e)},n),n.display.scrollbars.addClass&&z(n.display.wrapper,n.display.scrollbars.addClass)}var Yr=0;function Xr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yr},function(e){hn?hn.ops.push(e):e.ownsGroup=hn={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Zr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{hn=null,t(n)}}(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,n=0;n<t.length;n++)Jr(t[n]);for(var r=0;r<t.length;r++)(i=t[r]).updatedDisplay=i.mustUpdate&&ci(i.cm,i.update);var i;for(var o=0;o<t.length;o++)Qr(t[o]);for(var a=0;a<t.length;a++)ei(t[a]);for(var l=0;l<t.length;l++)ti(t[l])}(e)})}function Jr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Nr(t),e.barMeasure=Br(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-zn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ei(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),!e.updatedDisplay&&e.startHeight==t.doc.height||Kr(t,e.barMeasure),e.updatedDisplay&&hi(t,e.barMeasure),e.selectionChanged&&Sr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Lr(e.cm)}function ti(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ui(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Hr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Rr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!Te(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=N("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.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,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?st(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?st(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Qn(e,t),s=n&&n!=t?Qn(e,n):l,c=zr(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Wr(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(Rr(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return i}(t,mt(r,e.scrollToPos.from),mt(r,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||Ce(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Ce(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();Xr(e);try{return t()}finally{Zr(e)}}function ri(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xr(e);try{return t.apply(e,arguments)}finally{Zr(e)}}}function ii(e){return function(){if(this.curOp)return e.apply(this,arguments);Xr(this);try{return e.apply(this,arguments)}finally{Zr(this)}}}function oi(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Xr(e);try{return t.apply(this,arguments)}finally{Zr(e)}}}function ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(li,e))}function li(s){var c=s.doc;if(!(c.highlightFrontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=xt(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,n=e.text.length>s.options.maxHighlightLength?Xe(c.mode,d.state):null,r=bt(s,e,d,!0);n&&(d.state=n),e.styles=r.styles;var i=e.styleClasses,o=r.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&&kt(s,e.text,d),e.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>u)return ai(s,s.options.workDelay),!0}),c.highlightFrontier=d.line,c.modeFrontier=Math.max(c.modeFrontier,d.line),f.length&&ni(s,function(){for(var e=0;e<f.length;e++)gr(s,f[e],"text")})}}var si=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Er(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=zn(e),this.force=n,this.dims=cr(e),this.events=[]};function ci(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return vr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==br(e))return!1;mi(e)&&(vr(e),t.dims=cr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=Gt(e.doc,o),a=$t(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=fn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=fn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(pr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(fn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Zt(et(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=br(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=E();if(!t||!_(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return 4<s&&(n.lineDiv.style.display="none"),function(n,e,t){var r=n.display,i=n.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(e){var t=e.nextSibling;return b&&w&&n.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var s=r.view,c=r.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<H(d.changes,"gutter")&&(f=!1),vn(n,d,c,t)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(lt(n.options,c)))),a=d.node.nextSibling}else{var h=(g=c,v=t,void 0,y=bn(p=n,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),xn(p,m),kn(p,m,g,v),Tn(p,m,v),m.node);o.insertBefore(h,a)}c+=d.size}var p,m,g,v,y;for(;a;)a=l(a)}(e,n.updateLineNumbers,t.dims),4<s&&(n.lineDiv.style.display=""),n.renderedView=n.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(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ai(e,400)),!(n.updateLineNumbers=null)}function ui(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=zn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Nn(e.display)-Dn(e),n.top)}),t.visible=Er(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ci(e,t);r=!1){Nr(e);var i=Br(e);wr(e),Kr(e,i),hi(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 di(e,t){var n=new si(e,t);if(ci(e,n)){Nr(e),ui(e,n);var r=Br(e);wr(e),Kr(e,r),hi(e,r),n.finish()}}function fi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function hi(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+En(e)+"px"}function pi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ur(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function mi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=lt(e.options,t.first+t.size-1),r=e.display;if(n.length==r.lineNumChars)return!1;var i=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",fi(e.display),!0}function gi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function vi(e){var t=e.gutters,n=e.gutterSpecs;M(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(N("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&((e.lineGutter=l).style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",fi(e)}function yi(e){vi(e.display),mr(e),pi(e)}function bi(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=O("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[o],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: "+R+"px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),x&&k<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),b||m&&f||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=gi(r.gutters,r.lineNumbers),vi(i),n.init(i)}si.prototype.signal=function(e,t){Le(e,t)&&this.events.push(arguments)},si.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};var wi=0,xi=null;function ki(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Ci(e){var t=ki(e);return t.x*=xi,t.y*=xi,t}function Ti(e,t){var n=ki(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&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(r&&!m&&!g&&null!=xi)return i&&s&&Wr(e,Math.max(0,a.scrollTop+i*xi)),Rr(e,Math.max(0,a.scrollLeft+r*xi)),(!i||i&&s)&&Ae(t),void(o.wheelStartX=null);if(i&&null!=xi){var f=i*xi,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),di(e,{top:h,bottom:p})}wi<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(xi=(xi*wi+n)/(wi+1),++wi)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}x?xi=-.53:m?xi=15:a?xi=-.7:s&&(xi=-1/3);var Si=function(e,t){this.ranges=e,this.primIndex=t};Si.prototype.primary=function(){return this.ranges[this.primIndex]},Si.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 n=this.ranges[t],r=e.ranges[t];if(!ut(n.anchor,r.anchor)||!ut(n.head,r.head))return!1}return!0},Si.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Li(dt(this.ranges[t].anchor),dt(this.ranges[t].head));return new Si(e,this.primIndex)},Si.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Si.prototype.contains=function(e,t){t=t||e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(0<=ct(t,r.from())&&ct(e,r.to())<=0)return n}return-1};var Li=function(e,t){this.anchor=e,this.head=t};function Mi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return ct(e.from(),t.from())}),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ct(l.to(),a.from());if(r&&!a.empty()?0<s:0<=s){var c=ht(l.from(),a.from()),u=ft(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Li(d?u:c,d?c:u))}}return new Si(t,n)}function Ai(e,t){return new Si([new Li(e,t||e)],0)}function Oi(e){return e.text?st(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return Oi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Oi(t).ch-t.to.ch),st(n,r)}function _i(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Li(Ni(i.anchor,t),Ni(i.head,t)))}return Mi(e.cm,n,e.sel.primIndex)}function Ei(e,t,n){return e.line==t.line?st(n.line,e.ch-t.ch+n.ch):st(n.line+(e.line-t.line),e.ch)}function zi(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Di(e)}function Di(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,ai(e,100),e.state.modeGen++,e.curOp&&mr(e)}function Pi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fi(e,r,t,i){function o(e){return t?t[e]:null}function n(e,t,n){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ft(e),It(e,n);var i=r?r(e):1;i!=e.height&&rt(e,i)}(e,t,n,i),mn(e,"change",e,r)}function a(e,t){for(var n=[],r=e;r<t;++r)n.push(new en(c[r],o(r),i));return n}var l=r.from,s=r.to,c=r.text,u=et(e,l.line),d=et(e,s.line),f=Y(c),h=o(c.length-1),p=s.line-l.line;if(r.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Pi(e,r)){var m=a(0,c.length-1);n(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)n(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 en(f+u.text.slice(s.ch),h,i)),n(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,g)}else if(1==c.length)n(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{n(u,u.text.slice(0,l.ch)+c[0],o(0)),n(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)}mn(e,"change",e,r)}function Ii(e,l,s){!function e(t,n,r){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=n){var a=r&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function ji(e,t){if(t.cm)throw new Error("This document is already in use.");fr((e.doc=t).cm=e),zi(e),Wi(e),e.options.lineWrapping||Qt(e),e.options.mode=t.modeOption,mr(e)}function Wi(e){("rtl"==e.doc.direction?z:L)(e.display.lineDiv,"CodeMirror-rtl")}function Hi(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 Ri(e,t){var n={from:dt(t.from),to:Oi(t),text:tt(e,t.from,t.to)};return Vi(e,n,t.from.line,t.to.line+1),Ii(e,function(e){return Vi(e,n,t.from.line,t.to.line+1)},!0),n}function Bi(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function qi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Bi(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))a=Y(o.changes),0==ct(t.from,t.to)&&0==ct(t.from,a.to)?a.to=Oi(t):o.changes.push(Ri(e,t));else{var s=Y(i.done);for(s&&s.ranges||Ki(e.sel,i.done),o={changes:[Ri(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(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ce(e,"historyAdded")}function Ui(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Ki(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function Ki(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vi(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Gi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t=t||e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function $i(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Gi(n[i]));return r}(e,t),r=Dt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[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&&(n[i]=a)}return n}function Yi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Si.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.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<H(t,Number(u[1]))&&(Y(l)[d]=c[d],delete c[d])}}}return r}function Xi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ct(t,i)<0;o!=ct(n,i)<0?(i=t,t=n):o!=ct(t,n)<0&&(t=n)}return new Li(i,t)}return new Li(n||t,t)}function Zi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),no(e,new Si([Xi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Xi(e.sel.ranges[o],t[o],null,i);no(e,Mi(e.cm,r,e.sel.primIndex),n)}function Qi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,no(e,Mi(e.cm,i,e.sel.primIndex),r)}function eo(e,t,n,r){no(e,Ai(t,n),r)}function to(e,t,n){var r=e.history.done,i=Y(r);i&&i.ranges?ro(e,r[r.length-1]=t,n):no(e,t,n)}function no(e,t,n){ro(e,t,n),Ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ro(e,t,n){(Le(e,"beforeSelectionChange")||e.cm&&Le(e.cm,"beforeSelectionChange"))&&(t=function(n,e,t){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new Li(mt(n,e[t].anchor),mt(n,e[t].head))},origin:t&&t.origin};return Ce(n,"beforeSelectionChange",n,r),n.cm&&Ce(n.cm,"beforeSelectionChange",n.cm,r),r.ranges!=e.ranges?Mi(n.cm,r.ranges,r.ranges.length-1):e}(e,t,n));var r=n&&n.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);io(e,ao(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Pr(e.cm)}function io(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),mn(e,"cursorActivity",e))}function oo(e){io(e,ao(e,e.sel,null,!1))}function ao(e,t,n,r){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=so(e,a.anchor,l&&l.anchor,n,r),c=so(e,a.head,l&&l.head,n,r);!i&&s==a.anchor&&c==a.head||((i=i||t.ranges.slice(0,o))[o]=new Li(s,c))}return i?Mi(e.cm,i,t.primIndex):t}function lo(e,t,n,r,i){var o=et(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(Ce(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(d=co(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=ct(d,n))&&(r<0?f<0:0<f))return lo(e,d,t,r,i)}var h=s.find(r<0?-1:1);return(r<0?c:u)&&(h=co(e,h,r,h.line==t.line?o:null)),h?lo(e,h,t,r,i):null}}return t}function so(e,t,n,r,i){var o=r||1,a=lo(e,t,n,o,i)||!i&&lo(e,t,n,o,!0)||lo(e,t,n,-o,i)||!i&&lo(e,t,n,-o,!0);return a||(e.cantEdit=!0,st(e.first,0))}function co(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?mt(e,st(t.line-1)):null:0<n&&t.ch==(r||et(e,t.line)).text.length?t.line<e.first+e.size-1?st(t.line+1,0):null:new st(t.line,t.ch+n)}function uo(e){e.setSelection(st(e.firstLine(),0),st(e.lastLine()),q)}function fo(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,n,r){e&&(o.from=mt(i,e)),t&&(o.to=mt(i,t)),n&&(o.text=n),void 0!==r&&(o.origin=r)}),Ce(i,"beforeChange",i,o),i.cm&&Ce(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function ho(e,t,n){if(e.cm){if(!e.cm.curOp)return ri(e.cm,ho)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"))||(t=fo(e,t,!0))){var r=Ot&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r=r||[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ct(c.to,l.from)<0||0<ct(c.from,l.to))){var u=[s,1],d=ct(c.from,l.from),f=ct(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(r)for(var i=r.length-1;0<=i;--i)po(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else po(e,t)}}function po(e,n){if(1!=n.text.length||""!=n.text[0]||0!=ct(n.from,n.to)){var t=_i(e,n);qi(e,n,t,e.cm?e.cm.curOp.id:NaN),vo(e,n,t,Dt(e,n));var r=[];Ii(e,function(e,t){t||-1!=H(r,e.history)||(xo(e.history,n),r.push(e.history)),vo(e,n,null,Dt(e,n))})}}function mo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,n=i.history,r=i.sel,l="undo"==o?n.done:n.undone,s="undo"==o?n.undone:n.done,c=0;c<l.length&&(a=l[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=l.length){for(n.lastOrigin=n.lastSelOrigin=null;;){if(!(a=l.pop()).ranges){if(t)return void l.push(a);break}if(Ki(a,s),e&&!a.equals(i.sel))return void no(i,a,{clearRedo:!1});r=a}var u=[];Ki(r,s),s.push({changes:u,generation:n.generation}),n.generation=a.generation||++n.maxGeneration;for(var d=Le(i,"beforeChange")||i.cm&&Le(i.cm,"beforeChange"),f=function(e){var n=a.changes[e];if(n.origin=o,d&&!fo(i,n,!1))return l.length=0,{};u.push(Ri(i,n));var t=e?_i(i,n):Y(l);vo(i,n,t,$i(i,n)),!e&&i.cm&&i.cm.scrollIntoView({from:n.from,to:Oi(n)});var r=[];Ii(i,function(e,t){t||-1!=H(r,e.history)||(xo(e.history,n),r.push(e.history)),vo(e,n,null,$i(e,n))})},h=a.changes.length-1;0<=h;--h){var p=f(h);if(p)return p.v}}}}function go(e,t){if(0!=t&&(e.first+=t,e.sel=new Si(X(e.sel.ranges,function(e){return new Li(st(e.anchor.line+t,e.anchor.ch),st(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)gr(e.cm,r,"gutter")}}function vo(e,t,n,r){if(e.cm&&!e.cm.curOp)return ri(e.cm,vo)(e,t,n,r);if(t.to.line<e.first)go(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);go(e,i),t={from:st(e.first,0),to:st(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:st(o,et(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tt(e,t.from,t.to),n=n||_i(e,t),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=it(Vt(et(r,o.line))),r.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0}));-1<r.sel.contains(t.from,t.to)&&Se(e);Fi(r,t,n,dr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(e){var t=Jt(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 n=e.first,r=t-1;n<r;r--){var i=et(e,r).stateAfter;if(i&&(!(i instanceof vt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}})(r,o.line),ai(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?mr(e):o.line!=a.line||1!=t.text.length||Pi(e.doc,t)?mr(e,o.line,a.line+1,c):gr(e,o.line,"text");var u=Le(e,"changes"),d=Le(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&mn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Fi(e,t,r),ro(e,n,q),e.cantEdit&&so(e,st(e.firstLine(),0))&&(e.cantEdit=!1)}}function yo(e,t,n,r,i){var o;ct(r=r||n,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ho(e,{from:n,to:r,text:t,origin:i})}function bo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function wo(e,t,n,r){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++)bo(o.ranges[l].anchor,t,n,r),bo(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=st(c.from.line+r,c.from.ch),c.to=st(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;wo(e.done,n,r,i),wo(e.undone,n,r,i)}function ko(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=et(e,pt(e,t)):i=it(t),null==i?null:(r(o,i)&&e.cm&&gr(e.cm,i,n),o)}function Co(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function To(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Li.prototype.from=function(){return ht(this.anchor,this.head)},Li.prototype.to=function(){return ft(this.anchor,this.head)},Li.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Co.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,(o=i).parent=null,Ft(o),mn(i,"delete")}var o;this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},To.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof Co))){var l=[];this.collapse(l),this.children=[new Co(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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Co(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,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 To(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new To(e.children);(r.parent=e).children=[r,t],e=r}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};function So(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t}function Lo(e,t,n){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Dr(e,n)}So.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=it(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Mn(this);rt(n,Math.max(0,n.height-o)),e&&(ni(e,function(){Lo(e,n,-o),gr(e,r,"widget")}),mn(e,"lineWidgetCleared",e,this,r))}},So.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Mn(this)-t;i&&(Yt(this.doc,r)||rt(r,r.height+i),n&&ni(n,function(){n.curOp.forceUpdate=!0,Lo(n,r,i),mn(n,"lineWidgetChanged",n,e,it(r))}))},Me(So);var Mo=0,Ao=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Mo};function Oo(t,n,r,e,i){if(e&&e.shared)return function(e,n,r,i,o){(i=I(i)).shared=!1;var a=[Oo(e,n,r,i,o)],l=a[0],s=i.widgetNode;return Ii(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(Oo(e,mt(e,n),mt(e,r),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=Y(a)}),new No(a,l)}(t,n,r,e,i);if(t.cm&&!t.cm.curOp)return ri(t.cm,Oo)(t,n,r,e,i);var o=new Ao(t,i),a=ct(n,r);if(e&&I(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(Kt(t,n.line,n,r,o)||n.line!=r.line&&Kt(t,r.line,n,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nt=!0}o.addToHistory&&qi(t,{from:n,to:r,origin:"markText"},t.sel,NaN);var l,s=n.line,c=t.cm;if(t.iter(s,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&Vt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&rt(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new _t(o,s==n.line?n.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&t.iter(n.line,r.line+1,function(e){Yt(t,e)&&rt(e,0)}),o.clearOnEnter&&we(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ot=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++Mo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)mr(c,n.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=n.line;u<=r.line;u++)gr(c,u,"text");o.atomic&&oo(c.doc),mn(c,"markerAdded",c,o)}return o}Ao.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xr(e),Le(this,"clear")){var n=this.find();n&&mn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Et(a.markedSpans,this);e&&!this.collapsed?gr(e,it(a),"text"):e&&(null!=l.to&&(i=it(a)),null!=l.from&&(r=it(a))),a.markedSpans=zt(a.markedSpans,l),null==l.from&&this.collapsed&&!Yt(this.doc,a)&&e&&rt(a,lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Vt(this.lines[s]),u=Jt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&mr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oo(e.doc)),e&&mn(e,"markerCleared",e,this,r,i),t&&Zr(e),this.parent&&this.parent.clear()}},Ao.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Et(o.markedSpans,this);if(null!=a.from&&(n=st(t?o:it(o),a.from),-1==e))return n;if(null!=a.to&&(r=st(t?o:it(o),a.to),1==e))return r}return n&&{from:n,to:r}},Ao.prototype.changed=function(){var o=this,a=this.find(-1,!0),l=this,s=this.doc.cm;a&&s&&ni(s,function(){var e=a.line,t=it(a.line),n=In(s,t);if(n&&(Un(n),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Yt(l.doc,e)&&null!=l.height){var r=l.height;l.height=null;var i=Mn(l)-r;i&&rt(e,e.height+i)}mn(s,"markerChanged",s,o)})},Ao.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ao.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Me(Ao);var No=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function _o(e){return e.findMarks(st(e.first,0),e.clipPos(st(e.lastLine())),function(e){return e.parent})}function Eo(o){for(var e=function(e){var t=o[e],n=[t.primary.doc];Ii(t.primary.doc,function(e){return n.push(e)});for(var r=0;r<t.markers.length;r++){var i=t.markers[r];-1==H(n,i.doc)&&(i.parent=null,t.markers.splice(r--,1))}},t=0;t<o.length;t++)e(t)}No.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();mn(this,"clear")}},No.prototype.find=function(e,t){return this.primary.find(e,t)},Me(No);var zo=0,Do=function(e,t,n,r,i){if(!(this instanceof Do))return new Do(e,t,n,r,i);null==n&&(n=0),To.call(this,[new Co([new en("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=st(n,0);this.sel=Ai(o),this.history=new Hi(null),this.id=++zo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fi(this,{from:o,to:o,text:e}),no(this,Ai(o),q)};Do.prototype=J(To.prototype,{constructor:Do,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=nt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:oi(function(e){var t=st(this.first,0),n=this.first+this.size-1;ho(this,{from:t,to:st(n,et(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Fr(this.cm,0,0),no(this,Ai(t),q)}),replaceRange:function(e,t,n,r){yo(this,e,t=mt(this,t),n=n?mt(this,n):t,r)},getRange:function(e,t,n){var r=tt(this,mt(this,e),mt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e))return et(this,e)},getLineNumber:function(e){return it(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=et(this,e)),Vt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return mt(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:oi(function(e,t,n){eo(this,mt(this,"number"==typeof e?st(e,t||0):e),null,n)}),setSelection:oi(function(e,t,n){eo(this,mt(this,e),mt(this,t||e),n)}),extendSelection:oi(function(e,t,n){Zi(this,mt(this,e),t&&mt(this,t),n)}),extendSelections:oi(function(e,t){Ji(this,gt(this,e),t)}),extendSelectionsBy:oi(function(e,t){Ji(this,gt(this,X(this.sel.ranges,e)),t)}),setSelections:oi(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Li(mt(this,e[i].anchor),mt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),no(this,Mi(this.cm,r,t),n)}}),addSelection:oi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Li(mt(this,e),mt(this,t||e))),no(this,Mi(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=tt(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=tt(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:oi(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=st(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ei(l.from,i,o),c=Ei(Oi(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],d=ct(u.head,u.anchor)<0;r[a]=new Li(d?c:s,d?s:c)}else r[a]=new Li(s,s)}return new Si(r,e.sel.primIndex)}(this,r,t),s=r.length-1;0<=s;s--)ho(this,r[s]);l?to(this,l):this.cm&&Pr(this.cm)}),undo:oi(function(){mo(this,"undo")}),redo:oi(function(){mo(this,"redo")}),undoSelection:oi(function(){mo(this,"undo",!0)}),redoSelection:oi(function(){mo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var t=this;this.history=new Hi(this.history.maxGeneration),Ii(this,function(e){return e.history=t.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Yi(this.history.done),undone:Yi(this.history.undone)}},setHistory:function(e){var t=this.history=new Hi(this.history.maxGeneration);t.done=Yi(e.done.slice(0),null,!0),t.undone=Yi(e.undone.slice(0),null,!0)},setGutterMarker:oi(function(e,n,r){return ko(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[n]=r)&&ne(t)&&(e.gutterMarkers=null),!0})}),clearGutter:oi(function(t){var n=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ko(n,e,"gutter",function(){return e.gutterMarkers[t]=null,ne(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!at(this,e))return null;if(!(e=et(this,t=e)))return null}else if(null==(t=it(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:oi(function(e,n,r){return ko(this,e,"gutter"==n?"gutter":"class",function(e){var t="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(e[t]){if(T(r).test(e[t]))return!1;e[t]+=" "+r}else e[t]=r;return!0})}),removeLineClass:oi(function(e,o,a){return ko(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",n=e[t];if(!n)return!1;if(null==a)e[t]=null;else{var r=n.match(T(a));if(!r)return!1;var i=r.index+r[0].length;e[t]=n.slice(0,r.index)+(r.index&&i!=n.length?" ":"")+n.slice(i)||null}return!0})}),addLineWidget:oi(function(e,t,n){return function(r,e,t,n){var i=new So(r,t,n),o=r.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ko(r,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==i.insertAt?t.push(i):t.splice(Math.min(t.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!Yt(r,e)){var n=Zt(e)<r.scrollTop;rt(e,e.height+Mn(i)),n&&Dr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&mn(o,"lineWidgetAdded",o,i,"number"==typeof e?e:it(e)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Oo(this,mt(this,e),mt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Oo(this,e=mt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=et(this,(e=mt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(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=mt(this,i),o=mt(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 n=0;n<t.length;n++){var r=t[n];null!=r.to&&s==i.line&&i.ch>=r.to||null==r.from&&s!=i.line||null!=r.from&&s==o.line&&r.from>=o.ch||a&&!a(r.marker)||l.push(r.marker.parent||r.marker)}++s}),l},getAllMarks:function(){var r=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;n<t.length;++n)null!=t[n].from&&r.push(t[n].marker)}),r},posFromIndex:function(n){var r,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(n<t)return r=n,!0;n-=t,++i}),mt(this,st(i,r))},indexFromPos:function(e){var t=(e=mt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Do(nt(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Do(nt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ct(o,a)){var l=Oo(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,_o(this)),r},unlinkDoc:function(e){if(e instanceof Na&&(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),Eo(_o(this));break}}if(e.history==this.history){var n=[e.id];Ii(e,function(e){return n.push(e.id)},!0),e.history=new Hi(null),e.history.done=Yi(this.history.done,n),e.history.undone=Yi(this.history.undone,n)}},iterLinkedDocs:function(e){Ii(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&function(e){ni(e,function(){Wi(e),mr(e)})}(this.cm))})}),Do.prototype.eachLine=Do.prototype.iter;var Po=0;function Fo(e){var r=this;if(Io(r),!Te(r,e)&&!An(r.display,e)){Ae(e),x&&(Po=+new Date);var t=hr(r,e,!0),n=e.dataTransfer.files;if(t&&!r.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(){++a==i&&ri(r,function(){var e={from:t=mt(r.doc,t),to:t,text:r.doc.splitLines(o.filter(function(e){return null!=e}).join(r.doc.lineSeparator())),origin:"paste"};ho(r.doc,e),to(r.doc,Ai(t,Oi(e)))})()},s=function(e,t){if(r.options.allowDropFileTypes&&-1==H(r.options.allowDropFileTypes,e.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[t]=e),l()},n.readAsText(e)}},c=0;c<n.length;c++)s(n[c],c);else{if(r.state.draggingText&&-1<r.doc.sel.contains(t))return r.state.draggingText(e),void setTimeout(function(){return r.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(r.state.draggingText&&!r.state.draggingText.copy&&(d=r.listSelections()),ro(r.doc,Ai(t,t)),d)for(var f=0;f<d.length;++f)yo(r.doc,"",d[f].anchor,d[f].head,"drag");r.replaceSelection(u,"around","paste"),r.display.input.focus()}}catch(e){}}}}function Io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function jo(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var e=0;e<n.length;e++)t(n[e])})}}var Wo=!1;function Ho(){Wo||(function(){var e;we(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,jo(Ro)},100))}),we(window,"blur",function(){return jo(Or)})}(),Wo=!0)}function Ro(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Bo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},qo=0;qo<10;qo++)Bo[qo+48]=Bo[qo+96]=String(qo);for(var Uo=65;Uo<=90;Uo++)Bo[Uo]=String.fromCharCode(Uo);for(var Ko=1;Ko<=12;Ko++)Bo[Ko+111]=Bo[Ko+63235]="F"+Ko;var Vo={};function Go(e){var t,n,r,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))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $o(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=X(n.split(" "),Go),o=0;o<i.length;o++){var a=void 0,l=void 0;a=o==i.length-1?(l=i.join(" "),r):(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[n]}for(var c in t)e[c]=t[c];return e}function Yo(e,t,n,r){var i=(t=Qo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Yo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Yo(e,t.fallthrough[o],n,r);if(a)return a}}}function Xo(e){var t="string"==typeof e?e:Bo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Zo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Jo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var n=Bo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Zo(n,e,t))}function Qo(e){return"string"==typeof e?Vo[e]:e}function ea(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&ct(o.from,Y(r).to)<=0;){var a=r.pop();if(ct(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ni(t,function(){for(var e=r.length-1;0<=e;e--)yo(t.doc,"",r[e].from,r[e].to,"+delete");Pr(t)})}function ta(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function na(e,t,n){var r=ta(e,t.ch,n);return null==r?null:new st(t.line,r,n<0?"after":"before")}function ra(e,t,n,r,i){if(e){"rtl"==t.getOption("direction")&&(i=-i);var o=ye(n,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=jn(t,n);a=i<0?n.text.length-1:0;var u=Wn(t,c,a).top;a=ae(function(e){return Wn(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=ta(n,a,1))}else a=i<0?l.to:l.from;return new st(r,a,s)}}return new st(r,i<0?n.text.length:0,i<0?"before":"after")}Vo.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"},Vo.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"},Vo.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"},Vo.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"]},Vo.default=w?Vo.macDefault:Vo.pcDefault;var ia={selectAll:uo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(n){return ea(n,function(e){if(e.empty()){var t=et(n.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<n.lastLine()?{from:e.head,to:st(e.head.line+1,0)}:{from:e.head,to:st(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return ea(t,function(e){return{from:st(e.from().line,0),to:mt(t.doc,st(e.to().line+1,0))}})},delLineLeft:function(e){return ea(e,function(e){return{from:st(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(n){return ea(n,function(e){var t=n.charCoords(e.head,"div").top+5;return{from:n.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(r){return ea(r,function(e){var t=r.charCoords(e.head,"div").top+5,n=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(st(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(st(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return oa(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return aa(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var n=et(e.doc,t),r=function(e){for(var t;t=qt(e);)e=t.find(1,!0).line;return e}(n);r!=n&&(t=it(r));return ra(!0,e,n,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div")},K)},goLineLeft:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5;return n.coordsChar({left:0,top:t},"div")},K)},goLineLeftSmart:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5,n=r.coordsChar({left:0,top:t},"div");return n.ch<r.getLine(n.line).search(/\S/)?aa(r,e.head):n},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=j(e.getLine(o.line),o.ch,r);t.push($(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return ni(a,function(){for(var e=a.listSelections(),t=[],n=0;n<e.length;n++)if(e[n].empty()){var r=e[n].head,i=et(a.doc,r.line).text;if(i)if(r.ch==i.length&&(r=new st(r.line,r.ch-1)),0<r.ch)r=new st(r.line,r.ch+1),a.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),st(r.line,r.ch-2),r,"+transpose");else if(r.line>a.doc.first){var o=et(a.doc,r.line-1).text;o&&(r=new st(r.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),st(r.line-1,o.length-1),r,"+transpose"))}t.push(new Li(r,r))}a.setSelections(t)})},newlineAndIndent:function(r){return ni(r,function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=r.listSelections();for(var n=0;n<e.length;n++)r.indentLine(e[n].from().line,null,!0);Pr(r)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function oa(e,t){var n=et(e.doc,t),r=Vt(n);return r!=n&&(t=it(r)),ra(!0,e,r,t,1)}function aa(e,t){var n=oa(e,t.line),r=et(e.doc,n.line),i=ye(r,e.doc.direction);if(i&&0!=i[0].level)return n;var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return st(n.line,a?0:o,n.sticky)}function la(e,t,n){if("string"==typeof t&&!(t=ia[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var sa=new W;function ca(e,t,n,r){var i=e.state.keySeq;if(i){if(Xo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:sa.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ua(e,i+" "+t,n,r))return!0}return ua(e,t,n,r)}function ua(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Yo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Yo(t,e.options.extraKeys,n,e)||Yo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&mn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Ae(n),Sr(e)),!!i}function da(t,e){var n=Jo(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?ca(t,"Shift-"+n,e,function(e){return la(t,e,!0)})||ca(t,n,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return la(t,e)}):ca(t,n,e,function(e){return la(t,e)}))}var fa=null;function ha(e){if(this.curOp.focus=E(),!Te(this,e)){x&&k<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var n=da(this,e);g&&(fa=n?t:null,!n&&88==t&&!Be&&(w?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),m&&!w&&!n&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),ke(document,"keyup",n),ke(document,"mouseover",n))}z(t,"CodeMirror-crosshair"),we(document,"keyup",n),we(document,"mouseover",n)}(this)}}function pa(e){16==e.keyCode&&(this.doc.sel.shift=!1),Te(this,e)}function ma(e){if(!(An(this.display,e)||Te(this,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var t=e.keyCode,n=e.charCode;if(g&&t==fa)return fa=null,void Ae(e);if(!g||e.which&&!(e.which<10)||!da(this,e)){var r=String.fromCharCode(null==n?t:n);"\b"==r||function(t,e,n){return ca(t,"'"+n+"'",e,function(e){return la(t,e,!0)})}(this,e,r)||this.display.input.onKeyPress(e)}}}var ga,va,ya=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ba(e){var t=this,n=t.display;if(!(Te(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,An(n,e))b||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!ka(t,e)){var r=hr(t,e),i=ze(e),o=r?function(e,t){var n=+new Date;return va&&va.compare(n,e,t)?(ga=va=null,"triple"):ga&&ga.compare(n,e,t)?(va=new ya(n,e,t),ga=null,"double"):(ga=new ya(n,e,t),va=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(n,e,r,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ca(n,Zo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=ia[e]),!e)return!1;var t=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),t=e(n,r)!=B}finally{n.state.suppressEdits=!1}return t})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){x?setTimeout(F(Lr,e),0):e.curOp.focus=E();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=h?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}null!=i.extend&&!e.doc.extend||(i.extend=e.doc.extend||n.shiftKey);null==i.addNew&&(i.addNew=w?n.metaKey:n.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?n.altKey:n.ctrlKey));return i}(e,n,r),a=e.doc.sel;e.options.dragDrop&&Fe&&!e.isReadOnly()&&"single"==n&&-1<(i=a.contains(t))&&(ct((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ct(i.to(),t)||t.xRel<0)?function(t,n,r,i){var o=t.display,a=!1,l=ri(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,ke(o.wrapper.ownerDocument,"mouseup",l),ke(o.wrapper.ownerDocument,"mousemove",s),ke(o.scroller,"dragstart",c),ke(o.scroller,"drop",l),a||(Ae(e),i.addNew||Zi(t.doc,r,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(n.clientX-e.clientX)+Math.abs(n.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();we(o.wrapper.ownerDocument,"mouseup",l),we(o.wrapper.ownerDocument,"mousemove",s),we(o.scroller,"dragstart",c),we(o.scroller,"drop",l),Mr(t),setTimeout(function(){return o.input.focus()},20)}(e,r,t,o):function(g,e,v,y){var a=g.display,b=g.doc;Ae(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 Li(v,v)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new Li(v,v)),v=hr(g,e,!0,!0),x=-1;else{var n=wa(g,v,y.unit);w=y.extend?Xi(w,n.anchor,n.head,y.extend):n}y.addNew?-1==x?(x=t.length,no(b,Mi(g,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(no(b,Mi(g,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Qi(b,x,w,U):(no(b,new Si([w],x=0),U),k=b.sel);var C=v;function l(e){if(0!=ct(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],n=g.options.tabSize,r=j(et(b,v.line).text,v.ch,n),i=j(et(b,e.line).text,e.ch,n),o=Math.min(r,i),a=Math.max(r,i),l=Math.min(v.line,e.line),s=Math.min(g.lastLine(),Math.max(v.line,e.line));l<=s;l++){var c=et(b,l).text,u=V(c,o,n);o==a?t.push(new Li(st(l,u),st(l,u))):c.length>u&&t.push(new Li(st(l,u),st(l,V(c,a,n))))}t.length||t.push(new Li(v,v)),no(b,Mi(g,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var d,f=w,h=wa(g,e,y.unit),p=f.anchor;p=0<ct(h.anchor,p)?(d=h.head,ht(f.from(),h.anchor)):(d=h.anchor,ft(f.to(),h.head));var m=k.ranges.slice(0);m[x]=function(e,t){var n=t.anchor,r=t.head,i=et(e.doc,n.line);if(0==ct(n,r)&&n.sticky==r.sticky)return t;var o=ye(i);if(!o)return t;var a=se(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)s=0<(r.line-n.line)*("ltr"==e.doc.direction?1:-1);else{var u=se(o,r.ch,r.sticky),d=u-a||(r.ch-n.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 n.ch==p&&n.sticky==m?t:new Li(new st(n.line,p,m),r)}(g,new Li(mt(b,p),d)),no(b,Mi(g,m,x),U)}}var s=a.wrapper.getBoundingClientRect(),c=0;function r(e){g.state.selectingText=!1,c=1/0,e&&(Ae(e),a.input.focus()),ke(a.wrapper.ownerDocument,"mousemove",i),ke(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=ri(g,function(e){0!==e.buttons&&ze(e)?function e(t){var n=++c,r=hr(g,t,!0,"rectangle"==y.unit);if(r)if(0!=ct(r,C)){g.curOp.focus=E(),l(r);var i=Er(a,b);(r.line>=i.to||r.line<i.from)&&setTimeout(ri(g,function(){c==n&&e(t)}),150)}else{var o=t.clientY<s.top?-20:t.clientY>s.bottom?20:0;o&&setTimeout(ri(g,function(){c==n&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):r(e)}),o=ri(g,r);g.state.selectingText=o,we(a.wrapper.ownerDocument,"mousemove",i),we(a.wrapper.ownerDocument,"mouseup",o)}(e,r,t,o)}(t,r,o,e):Ee(e)==n.scroller&&Ae(e):2==i?(r&&Zi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?t.display.input.onContextMenu(e):Mr(t)))}}function wa(e,t,n){if("char"==n)return new Li(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Li(st(t.line,0),mt(e.doc,st(t.line+1,0)));var r=n(e,t);return new Li(r.from,r.to)}function xa(e,t,n,r){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;r&&Ae(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Le(e,n))return Ne(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return Ce(e,n,e,ot(e.doc,o),e.display.gutterSpecs[s].className,t),Ne(t)}}function ka(e,t){return xa(e,t,"gutterClick",!0)}function Ca(e,t){An(e.display,t)||function(e,t){return!!Le(e,"gutterContextMenu")&&xa(e,t,"gutterContextMenu",!1)}(e,t)||Te(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function Ta(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vn(e)}ya.prototype.compare=function(e,t,n){return this.time+400>e&&0==ct(t,this.pos)&&n==this.button};var Sa={toString:function(){return"CodeMirror.Init"}},La={},Ma={};function Aa(e,t,n){if(!t!=!(n&&n!=Sa)){var r=e.display.dragFunctions,i=t?we:ke;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Oa(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Qt(e)),fr(e),mr(e),Vn(e),setTimeout(function(){return Kr(e)},100)}function Na(e,t){var n=this;if(!(this instanceof Na))return new Na(e,t);this.options=t=t?I(t):{},I(La,t,!1);var r=t.value;"string"==typeof r?r=new Do(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Na.inputStyles[t.inputStyle](this),o=this.display=new bi(e,r,i,t);for(var a in Ta(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(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 W,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&k<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(i){var o=i.display;we(o.scroller,"mousedown",ri(i,ba)),we(o.scroller,"dblclick",x&&k<11?ri(i,function(e){if(!Te(i,e)){var t=hr(i,e);if(t&&!ka(i,e)&&!An(i.display,e)){Ae(e);var n=i.findWordAt(t);Zi(i.doc,n.anchor,n.head)}}}):function(e){return Te(i,e)||Ae(e)});we(o.scroller,"contextmenu",function(e){return Ca(i,e)}),we(o.input.getField(),"contextmenu",function(e){o.scroller.contains(e.target)||Ca(i,e)});var n,r={end:0};function a(){o.activeTouch&&(n=setTimeout(function(){return o.activeTouch=null},1e3),(r=o.activeTouch).end=+new Date)}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return 400<n*n+r*r}we(o.scroller,"touchstart",function(e){if(!Te(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ka(i,e)){o.input.ensurePolled(),clearTimeout(n);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-r.end<=300?r:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),we(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),we(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!An(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var n,r=i.coordsChar(o.activeTouch,"page");n=!t.prev||l(t,t.prev)?new Li(r,r):!t.prev.prev||l(t,t.prev.prev)?i.findWordAt(r):new Li(st(r.line,0),mt(i.doc,st(r.line+1,0))),i.setSelection(n.anchor,n.head),i.focus(),Ae(e)}a()}),we(o.scroller,"touchcancel",a),we(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Wr(i,o.scroller.scrollTop),Rr(i,o.scroller.scrollLeft,!0),Ce(i,"scroll",i))}),we(o.scroller,"mousewheel",function(e){return Ti(i,e)}),we(o.scroller,"DOMMouseScroll",function(e){return Ti(i,e)}),we(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){Te(i,e)||_e(e)},over:function(e){Te(i,e)||(function(e,t){var n=hr(e,t);if(n){var r=document.createDocumentFragment();kr(e,n,r),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,r)}}(i,e),_e(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||+new Date-Po<100))_e(t);else if(!Te(e,t)&&!An(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),g&&n.parentNode.removeChild(n)}}(i,e)},drop:ri(i,Fo),leave:function(e){Te(i,e)||Io(i)}};var e=o.input.getField();we(e,"keyup",function(e){return pa.call(i,e)}),we(e,"keydown",ri(i,ha)),we(e,"keypress",ri(i,ma)),we(e,"focus",function(e){return Ar(i,e)}),we(e,"blur",function(e){return Or(i,e)})}(this),Ho(),Xr(this),this.curOp.forceUpdate=!0,ji(this,r),t.autofocus&&!f||this.hasFocus()?setTimeout(F(Ar,this),20):Or(this),Ma)Ma.hasOwnProperty(a)&&Ma[a](this,t[a],Sa);mi(this),t.finishInit&&t.finishInit(this);for(var l=0;l<_a.length;++l)_a[l](this);Zr(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Na.defaults=La,Na.optionHandlers=Ma;var _a=[];function Ea(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=xt(e,t).state:n="prev");var a=e.options.tabSize,l=et(o,t),s=j(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==B||150<c)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(et(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),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 yo(o,d,st(t,0),st(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=st(t,u.length);Qi(o,p,new Li(g,g));break}}}Na.defineInitHook=function(e){return _a.push(e)};var za=null;function Da(e){za=e}function Pa(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r=r||o.sel;var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=He(t),c=null;if(l&&1<r.ranges.length)if(za&&za.text.join("\n")==t){if(r.ranges.length%za.text.length==0){c=[];for(var u=0;u<za.text.length;u++)c.push(o.splitLines(za.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,function(e){return[e]}));for(var d=e.curOp.updateInput,f=r.ranges.length-1;0<=f;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&0<n?p=st(p.line,p.ch-n):e.state.overwrite&&!l?m=st(m.line,Math.min(et(o,m.line).text.length,m.ch+Y(s).length)):l&&za&&za.lineWise&&za.text.join("\n")==t&&(p=m=st(p.line,0)));var g={from:p,to:m,text:c?c[f%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};ho(e.doc,g),mn(e,"inputRead",e,g)}t&&!l&&Ia(e,t),Pr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ni(t,function(){return Pa(t,n,0,null,"paste")}),!0}function Ia(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;0<=r;r--){var i=n.ranges[r];if(!(100<i.head.ch||r&&n.ranges[r-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=Ea(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(et(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ea(e,i.head.line,"smart"));a&&mn(e,"electricInput",e,i.head.line)}}}function ja(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:st(i,0),head:st(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Wa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ha(){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"),Wa(e),t}function Ra(n,r,i,e,o){var t=r,a=i,l=et(n,r.line),s=o&&n.cm&&"rtl"==n.cm.getOption("direction")?-i:i;function c(e){var t;if(null==(t=o?function(t,n,l,e){var s=ye(n,t.doc.direction);if(!s)return na(n,l,e);l.ch>=n.text.length?(l.ch=n.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var r=se(s,l.ch,l.sticky),i=s[r];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>l.ch:i.from<l.ch))return na(n,l,e);function c(e,t){return ta(n,e instanceof st?e.ch:e,t)}function o(e){return t.options.lineWrapping?(a=a||jn(t,n),ir(t,n,a,e)):{begin:0,end:n.text.length}}var a,u=o("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 st(l.line,f,h)}}function p(e,t,n){for(var r=function(e,t){return t?new st(l.line,c(e,1),"before"):new st(l.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),a=o?n.begin:c(n.end,-1);if(i.from<=a&&a<i.to)return r(a,o);if(a=o?i.from:c(i.to,-1),n.begin<=a&&a<n.end)return r(a,o)}}var m=p(r+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==n.text.length||!(m=p(0<e?0:s.length-1,e,o(g)))?null:m}(n.cm,l,r,i):na(l,r,i))){if(e||!function(){var e=r.line+s;return!(e<n.first||e>=n.first+n.size)&&(r=new st(e,r.ch,r.sticky),l=et(n,e))}())return!1;r=ra(o,n.cm,l,r.line,s)}else r=t;return!0}if("char"==e)c();else if("column"==e)c(!0);else if("word"==e||"group"==e)for(var u=null,d="group"==e,f=n.cm&&n.cm.getHelper(r,"wordChars"),h=!0;!(i<0)||c(!h);h=!1){var p=l.text.charAt(r.ch)||"\n",m=te(p,f)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||h||m||(m="s"),u&&u!=m){i<0&&(i=1,c(),r.sticky="after");break}if(m&&(u=m),0<i&&!c(!h))break}var g=so(n,r,t,a,!0);return ut(t,g)&&(g.hitSide=!0),g}function Ba(e,t,n,r){var i,o,a=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*lr(e.display),3);i=(0<n?t.bottom:t.top)+n*c}else"line"==r&&(i=0<n?t.bottom+3:t.top-3);for(;(o=nr(e,l,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}function qa(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Ua(e,t){var n=In(e,t.line);if(!n||n.hidden)return null;var r=et(e.doc,t.line),i=Pn(n,r,t.line),o=ye(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var l=Bn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ka(e,t){return t&&(e.bad=!0),e}function Va(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ka(e.clipPos(st(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ga(o,t,n)}}function Ga(c,e,t){var n=c.text.firstChild,r=!1;if(!e||!_(n,e))return Ka(st(it(c.line),0),!0);if(e==n&&(r=!0,e=n.childNodes[t],t=0,!e)){var i=c.rest?Y(c.rest):c.line;return Ka(st(it(i),i.text.length),r)}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!=n;)a=a.parentNode;var u=c.measure,d=u.maps;function l(e,t,n){for(var r=-1;r<(d?d.length:0);r++)for(var i=r<0?u.map:d[r],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=it(r<0?c.line:c.rest[r]),s=i[o]+n;return(n<0||a!=e)&&(s=i[o+(n?1:0)]),st(l,s)}}}var s=l(o,a,t);if(s)return Ka(s,r);for(var f=a.nextSibling,h=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(s=l(f,f.firstChild,0))return Ka(st(s.line,s.ch-h),r);h+=f.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(s=l(p,p.firstChild,-1))return Ka(st(s.line,s.ch+m),r);m+=p.textContent.length}}qa.prototype.init=function(e){var t=this,a=this,l=a.cm,s=a.div=e.lineDiv;function n(e){if(!Te(l,e)){if(l.somethingSelected())Da({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=ja(l);Da({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 n=za.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var r=Ha(),i=r.firstChild;l.display.lineSpace.insertBefore(r,l.display.lineSpace.firstChild),i.value=za.text.join("\n");var o=document.activeElement;P(i),setTimeout(function(){l.display.lineSpace.removeChild(r),o.focus(),o==s&&a.showPrimarySelection()},50)}}Wa(s,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),we(s,"paste",function(e){Te(l,e)||Fa(e,l)||k<=11&&setTimeout(ri(l,function(){return t.updateFromDOM()}),20)}),we(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),we(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),we(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(s,"touchstart",function(){return a.forceCompositionEnd()}),we(s,"input",function(){t.composing||t.readFromDOMSoon()}),we(s,"copy",n),we(s,"cut",n)},qa.prototype.prepareSelection=function(){var e=xr(this.cm,!1);return e.focus=this.cm.state.focused,e},qa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},qa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Va(t,e.anchorNode,e.anchorOffset),a=Va(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ct(ht(o,a),r)||0!=ct(ft(o,a),i)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Ua(t,r)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ua(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()}}},qa.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)},qa.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},qa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},qa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},qa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},qa.prototype.blur=function(){this.div.blur()},qa.prototype.getField=function(){return this.div},qa.prototype.supportsTouch=function(){return!0},qa.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():ni(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},qa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},qa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(d&&a&&this.cm.display.gutterSpecs.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 n=Va(t,e.anchorNode,e.anchorOffset),r=Va(t,e.focusNode,e.focusOffset);n&&r&&ni(t,function(){no(t.doc,Ai(n,r),q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},qa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=st(a.line-1,et(r.doc,a.line-1).length)),l.ch==et(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=st(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;n=a.line==i.viewFrom||0==(e=pr(r,a.line))?(t=it(i.view[0].line),i.view[0].node):(t=it(i.view[e].line),i.view[e-1].node.nextSibling);var s,c,u=pr(r,l.line);if(c=u==i.view.length-1?(s=i.viewTo-1,i.lineDiv.lastChild):(s=it(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(l,e,t,s,c){var n="",u=!1,d=l.doc.lineSeparator(),f=!1;function h(){u&&(n+=d,f&&(n+=d),u=f=!1)}function p(e){e&&(h(),n+=e)}function m(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void p(t);var n,r=e.getAttribute("cm-marker");if(r){var i=l.findMarks(st(s,0),st(c+1,0),function(t){return function(e){return e.id==t}}(+r));return void(i.length&&(n=i[0].find(0))&&p(tt(l.doc,n.from,n.to).join(d)))}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&&h();for(var a=0;a<e.childNodes.length;a++)m(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(f=!0),o&&(u=!0)}else 3==e.nodeType&&p(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;m(e),e!=t;)e=e.nextSibling,f=!1;return n}(r,n,c,t,s)),f=tt(r.doc,st(t,0),st(s,et(r.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=st(t,h),k=st(s,f.length?Y(f).length-p:0);return 1<d.length||d[0]||ct(x,k)?(yo(r.doc,d,x,k,"+input"),!0):void 0},qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},qa.prototype.reset=function(){this.forceCompositionEnd()},qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qa.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))},qa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ni(this.cm,function(){return mr(e.cm)})},qa.prototype.setUneditable=function(e){e.contentEditable="false"},qa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ri(this.cm,Pa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},qa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},qa.prototype.onContextMenu=function(){},qa.prototype.resetPosition=function(){},qa.prototype.needsContentAttribute=!0;function $a(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null}var Ya,Xa,Za,Ja,Qa;function el(e,t,r,n){Ya.defaults[e]=t,r&&(Xa[e]=n?function(e,t,n){n!=Sa&&r(e,t,n)}:r)}$a.prototype.init=function(n){var e=this,r=this,i=this.cm;this.createField(n);var o=this.textarea;function t(e){if(!Te(i,e)){if(i.somethingSelected())Da({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=ja(i);Da({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,q):(r.prevInput="",o.value=t.text.join("\n"),P(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild),u&&(o.style.width="0px"),we(o,"input",function(){x&&9<=k&&e.hasSelection&&(e.hasSelection=null),r.poll()}),we(o,"paste",function(e){Te(i,e)||Fa(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())}),we(o,"cut",t),we(o,"copy",t),we(n.scroller,"paste",function(e){if(!An(n,e)&&!Te(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),we(n.lineSpace,"selectstart",function(e){An(n,e)||Ae(e)}),we(o,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),we(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},$a.prototype.createField=function(e){this.wrapper=Ha(),this.textarea=this.wrapper.firstChild},$a.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=xr(e);if(e.options.moveInputWithCursor){var i=Qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},$a.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")},$a.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),x&&9<=k&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",x&&9<=k&&(this.hasSelection=null))}},$a.prototype.getField=function(){return this.textarea},$a.prototype.supportsTouch=function(){return!1},$a.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},$a.prototype.blur=function(){this.textarea.blur()},$a.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$a.prototype.receivedFocus=function(){this.slowPoll()},$a.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$a.prototype.fastPoll=function(){var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,function e(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))})},$a.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Re(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!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||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return ni(t,function(){Pa(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?n.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},$a.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$a.prototype.onKeyPress=function(){x&&9<=k&&(this.hasSelection=null),this.fastPoll()},$a.prototype.onContextMenu=function(e){var n=this,r=n.cm,i=r.display,o=n.textarea;n.contextMenuPending&&n.contextMenuPending();var t=hr(r,e),a=i.scroller.scrollTop;if(t&&!g){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(t)&&ri(r,no)(r.doc,Ai(t),q);var l,s=o.style.cssText,c=n.wrapper.style.cssText,u=n.wrapper.offsetParent.getBoundingClientRect();if(n.wrapper.style.cssText="position: static",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&&(l=window.scrollY),i.input.focus(),b&&window.scrollTo(null,l),i.input.reset(),r.somethingSelected()||(o.value=n.prevInput=" "),n.contextMenuPending=h,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=k&&f(),C){_e(e);var d=function(){ke(window,"mouseup",d),setTimeout(h,20)};we(window,"mouseup",d)}else setTimeout(h,50)}function f(){if(null!=o.selectionStart){var e=r.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,n.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=r.doc.sel}}function h(){if(n.contextMenuPending==h&&(n.contextMenuPending=!1,n.wrapper.style.cssText=c,o.style.cssText=s,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==r.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==n.prevInput?ri(r,uo)(r):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},$a.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},$a.prototype.setUneditable=function(){},$a.prototype.needsContentAttribute=!1,Xa=(Ya=Na).optionHandlers,Ya.defineOption=el,Ya.Init=Sa,el("value","",function(e,t){return e.setValue(t)},!0),el("mode",null,function(e,t){e.doc.modeOption=t,zi(e)},!0),el("indentUnit",2,zi,!0),el("indentWithTabs",!1),el("smartIndent",!0),el("tabSize",4,function(e){Di(e),Vn(e),mr(e)},!0),el("lineSeparator",null,function(e,r){if(e.doc.lineSep=r){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var n=e.text.indexOf(r,t);if(-1==n)break;t=n+r.length,i.push(st(o,n))}o++});for(var t=i.length-1;0<=t;t--)yo(e.doc,r,i[t],st(i[t].line,i[t].ch+r.length))}}),el("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Sa&&e.refresh()}),el("specialCharPlaceholder",an,function(e){return e.refresh()},!0),el("electricChars",!0),el("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),el("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),el("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),el("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),el("rtlMoveVisually",!p),el("wholeLineUpdateBefore",!0),el("theme","default",function(e){Ta(e),yi(e)},!0),el("keyMap","default",function(e,t,n){var r=Qo(t),i=n!=Sa&&Qo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),el("extraKeys",null),el("configureMouse",null),el("lineWrapping",!1,Oa,!0),el("gutters",[],function(e,t){e.display.gutterSpecs=gi(t,e.options.lineNumbers),yi(e)},!0),el("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ur(e.display)+"px":"0",e.refresh()},!0),el("coverGutterNextToScrollbar",!1,function(e){return Kr(e)},!0),el("scrollbarStyle","native",function(e){$r(e),Kr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),el("lineNumbers",!1,function(e,t){e.display.gutterSpecs=gi(e.options.gutters,t),yi(e)},!0),el("firstLineNumber",1,yi,!0),el("lineNumberFormatter",function(e){return e},yi,!0),el("showCursorWhenSelecting",!1,wr,!0),el("resetSelectionOnContextMenu",!0),el("lineWiseCopyCut",!0),el("pasteLinesPerSelection",!0),el("selectionsMayTouch",!1),el("readOnly",!1,function(e,t){"nocursor"==t&&(Or(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),el("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),el("dragDrop",!0,Aa),el("allowDropFileTypes",null),el("cursorBlinkRate",530),el("cursorScrollMargin",0),el("cursorHeight",1,wr,!0),el("singleCursorHeightPerLine",!0,wr,!0),el("workTime",100),el("workDelay",100),el("flattenSpans",!0,Di,!0),el("addModeClass",!1,Di,!0),el("pollInterval",100),el("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),el("historyEventDelay",1250),el("viewportMargin",10,function(e){return e.refresh()},!0),el("maxHighlightLength",1e4,Di,!0),el("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),el("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),el("autofocus",null),el("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),el("phrases",null),Ja=(Za=Na).optionHandlers,Qa=Za.helpers={},Za.prototype={constructor:Za,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,Ja.hasOwnProperty(e)&&ri(this,Ja[e])(this,t,r),Ce(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"](Qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ii(function(e,t){var n=e.token?e:Za.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:n,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,mr(this)}),removeOverlay:ii(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void mr(this)}}),indentLine:ii(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),at(this.doc,e)&&Ea(this,e,t,n)}),indentSelection:ii(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ea(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Pr(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)Ea(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&0<c[r].from().ch&&Qi(this.doc,r,new Li(o,c[r].to()),q)}}}),getTokenAt:function(e,t){return Lt(this,e,t)},getLineTokens:function(e,t){return Lt(this,st(e),t,!0)},getTokenTypeAt:function(e){e=mt(this.doc,e);var t,n=wt(this,et(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=1+a}}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?Za.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!Qa.hasOwnProperty(t))return n;var r=Qa[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var l=0;l<r._global.length;l++){var s=r._global[l];s.pred(i,this)&&-1==H(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;return xt(this,(e=pt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Qn(this,null==e?n.head:"object"==typeof e?mt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Jn(this,mt(this.doc,e),t||"page")},coordsChar:function(e,t){return nr(this,(e=Zn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Zn(this,{top:e,left:0},t||"page").top,ot(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,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),r=et(this.doc,e)}else r=e;return Xn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Zt(r):0)},defaultTextHeight:function(){return lr(this.display)},defaultCharWidth:function(){return sr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=Qn(this,mt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&function(e,t){var n=zr(e,t);null!=n.scrollTop&&Wr(e,n.scrollTop),null!=n.scrollLeft&&Rr(e,n.scrollLeft)}(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:ii(ha),triggerOnKeyPress:ii(ma),triggerOnKeyUp:pa,triggerOnMouseDown:ii(ba),execCommand:function(e){if(ia.hasOwnProperty(e))return ia[e].call(null,this)},triggerElectric:ii(function(e){Ia(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=mt(this.doc,e),a=0;a<t&&!(o=Ra(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ii(function(t,n){var r=this;this.extendSelectionsBy(function(e){return r.display.shift||r.doc.extend||e.empty()?Ra(r.doc,e.head,t,n,r.options.rtlMoveVisually):t<0?e.from():e.to()},K)}),deleteH:ii(function(n,r){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):ea(this,function(e){var t=Ra(i,e.head,n,r,!1);return n<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=mt(this.doc,e),l=0;l<t;++l){var s=Qn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Ba(this,s,i,n)).hitSide)break}return a},moveV:ii(function(r,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 r<0?e.from():e.to();var t=Qn(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var n=Ba(o,t,r,i);return"page"==i&&e==a.sel.primary()&&Dr(o,Jn(o,n,"div").top-t.top),n},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=et(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),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<n&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Li(st(e.line,n),st(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii(function(e,t){Fr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:Dn(this),clientWidth:zn(this)}},scrollIntoView:ii(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:st(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?function(e,t){Ir(e),e.curOp.scrollToPos=t}(this,e):jr(this,e.from,e.to,e.margin)}),setSize:ii(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Kn(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){gr(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(e){return ni(this,e)},startOperation:function(){return Xr(this)},endOperation:function(){return Zr(this)},refresh:ii(function(){var e=this.display.cachedTextHeight;mr(this),this.curOp.forceUpdate=!0,Vn(this),Fr(this,this.doc.scrollLeft,this.doc.scrollTop),fi(this.display),(null==e||.5<Math.abs(e-lr(this.display)))&&fr(this),Ce(this,"refresh",this)}),swapDoc:ii(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ji(this,e),Vn(this),this.display.input.reset(),Fr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,mn(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Me(Za),Za.registerHelper=function(e,t,n){Qa.hasOwnProperty(e)||(Qa[e]=Za[e]={_global:[]}),Qa[e][t]=n},Za.registerGlobalHelper=function(e,t,n,r){Za.registerHelper(e,t,r),Qa[e]._global.push({pred:n,val:r})};var tl,nl="iter insert remove copy getEditor constructor".split(" ");for(var rl in Do.prototype)Do.prototype.hasOwnProperty(rl)&&H(nl,rl)<0&&(Na.prototype[rl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Do.prototype[rl]));return Me(Do),Na.inputStyles={textarea:$a,contenteditable:qa},Na.defineMode=function(e){Na.defaults.mode||"null"==e||(Na.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}.apply(this,arguments)},Na.defineMIME=function(e,t){Ke[e]=t},Na.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Na.defineMIME("text/plain","null"),Na.defineExtension=function(e,t){Na.prototype[e]=t},Na.defineDocExtension=function(e,t){Do.prototype[e]=t},Na.fromTextArea=function(t,n){if((n=n?I(n):{}).value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var e=E();n.autofocus=e==t||null!=t.getAttribute("autofocus")&&e==document.body}function r(){t.value=l.getValue()}var i;if(t.form&&(we(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(ke(t.form,"submit",r),n.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var l=Na(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},n);return l},(tl=Na).off=ke,tl.on=we,tl.wheelEventPixels=Ci,tl.Doc=Do,tl.splitLines=He,tl.countColumn=j,tl.findColumn=V,tl.isWordChar=ee,tl.Pass=B,tl.signal=Ce,tl.Line=en,tl.changeEnd=Oi,tl.scrollbarModel=Gr,tl.Pos=st,tl.cmpPos=ct,tl.modes=Ue,tl.mimeModes=Ke,tl.resolveMode=Ve,tl.getMode=Ge,tl.modeExtensions=$e,tl.extendMode=Ye,tl.copyState=Xe,tl.startState=Je,tl.innerMode=Ze,tl.commands=ia,tl.keyMap=Vo,tl.keyName=Jo,tl.isModifierKey=Xo,tl.lookupKey=Yo,tl.normalizeKeyMap=$o,tl.StringStream=Qe,tl.SharedTextMarker=No,tl.TextMarker=Ao,tl.LineWidget=So,tl.e_preventDefault=Ae,tl.e_stopPropagation=Oe,tl.e_stop=_e,tl.addClass=z,tl.contains=_,tl.rmClass=L,tl.keyNames=Bo,Na.version="5.51.0",Na},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).CodeMirror=i()},{}],20:[function(e,t,n){var r;r=function(N){"use strict";function e(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}N.defineMode("css",function(e,t){var n=t.inline;t.propertyKeywords||(t=N.resolveMode("text/css"));var r,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 r=t,e}function x(i){return function(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==i&&!r){")"==i&&e.backUp(1);break}r=!r&&"\\"==n}return n!=i&&(r||")"==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,n){this.type=e,this.indent=t,this.prev=n}function T(e,t,n,r){return e.context=new C(n,t.indentation()+(!1===r?0:o),e.context),n}function S(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,n){return O[n.context.type](e,t,n)}function M(e,t,n,r){for(var i=r||1;0<i;i--)n.context=n.context.prev;return L(e,t,n)}function A(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,n){if("{"==e)return T(n,t,"block");if("}"==e&&n.context.prev)return S(n);if(b&&/@component/i.test(e))return T(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(n,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(n,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return T(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?O.top(e,t,n):(i="error","block");var r=t.current().toLowerCase();return d.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,n){return":"==e?T(n,t,"prop"):L(e,t,n)},prop:function(e,t,n){if(";"==e)return S(n);if("{"==e&&v)return T(n,t,"propBlock");if("}"==e||"{"==e)return M(e,t,n);if("("==e)return T(n,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(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?S(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?M(e,t,n):")"==e?S(n):"("==e?T(n,t,"parens"):"interpolation"==e?T(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):L(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):O.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return T(n,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,n);if("{"==e)return S(n)&&T(n,t,v?"block":"top");if("interpolation"==e)return T(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":s.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":u.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"string-2":g.hasOwnProperty(r)?"atom":m.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?M(e,t,n):"{"==e?S(n)&&T(n,t,v?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?S(n):"{"==e||"}"==e?M(e,t,n,2):O.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?T(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,S(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?T(n,t,"top"):L(e,t,n)},at:function(e,t,n){return";"==e?S(n):"{"==e||"}"==e?M(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?S(n):"{"==e||";"==e?M(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new C(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?w(null,"compare"):'"'==n||"'"==n?(t.tokenize=x(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==n?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?w(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=k),w("variable callee","variable")):/[\w\\\-]/.test(n)?(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 n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,"comment"!=r&&(t.state=O[t.state](r,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-o)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],n=e(t),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(r),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(r).concat(o).concat(l).concat(c).concat(d).concat(m).concat(v);function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}N.registerHelper("hintWords","css",b),N.defineMIME("text/css",{documentTypes:n,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:n,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 n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],21:[function(e,t,n){var r;r=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 r={};function m(e,t){var n=e.match(function(e){var t=r[e];return t||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;0<=o;o--)r.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,n=e&&e.scriptTypes;if(o(i,f),t&&o(t,f),n)for(var r=n.length-1;0<=r;r--)f.script.unshift(["type",n[r].matches,n[r].mode]);function h(e,t){var n,r=d.token(e,t.htmlState),i=/\btag\b/.test(r);if(i&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(n))t.inTag=n+" ";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 n=0;n<e.length;n++){var r=e[n];if(!r[0]||r[1].test(m(t,r[0])))return r[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):function(e,t,n){var r=e.current(),i=r.search(t);return-1<i?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,c,t.localMode.token(e,t.localState))},t.localMode=l,t.localState=p.startState(l,d.indent(t.htmlState,"",""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return r}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,n){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t,n):e.localMode.indent?e.localMode.indent(e.localState,t,n):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 n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../css/css":20,"../javascript/javascript":22,"../xml/xml":23}],22:[function(e,t,n){var r;r=function(tt){"use strict";tt.defineMode("javascript",function(e,c){var t,n,r,i,o,a,u=e.indentUnit,d=c.statementIndent,l=c.jsonld,s=c.json||l,f=c.typescript,h=c.wordCharacters||/[\w$\xa1-\uffff]/,p=(t=m("keyword a"),n=m("keyword b"),r=m("keyword c"),i=m("keyword d"),o=m("operator"),a={type:"atom",style:"atom"},{if:m("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:m("new"),delete:r,void:r,throw:r,debugger:m("debugger"),var:m("var"),const:m("var"),let:m("var"),function:m("function"),catch:m("catch"),for:m("for"),switch:m("switch"),case:m("case"),default:m("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:m("this"),class:m("class"),super:m("atom"),yield:r,export:m("export"),import:m("import"),extends:r,await:r});function m(e){return{type:e,style:"keyword"}}var g,v,y=/[+\-*&%=<>!?|~^@]/,b=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function w(e,t,n){return g=e,v=n,t}function x(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=function(i){return function(e,t){var n,r=!1;if(l&&"@"==e.peek()&&e.match(b))return t.tokenize=x,w("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=x),w("string","string")}}(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if("."==n&&e.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return w(n);if("="==n&&e.eat(">"))return w("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if("/"==n)return e.eat("*")?(t.tokenize=k)(e,t):e.eat("/")?(e.skipToEnd(),w("comment","comment")):et(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(e.eat("="),w("operator","operator",e.current()));if("`"==n)return(t.tokenize=C)(e,t);if("#"==n)return e.skipToEnd(),w("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),w("comment","comment");if(y.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),w("operator","operator",e.current());if(h.test(n)){e.eatWhile(h);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return w(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",r)}return w("variable","variable",r)}}function k(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=x;break}r="*"==n}return w("comment","comment")}function C(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=x;break}r=!r&&"\\"==n}return w("quasi","string-2",e.current())}var T="([{}])";function S(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(f){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;0<=a;--a){var l=e.string.charAt(a),s=T.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(h.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var L={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function M(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function A(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var O={state:null,column:null,marked:null,cc:null};function N(){for(var e=arguments.length-1;0<=e;e--)O.cc.push(arguments[e])}function _(){return N.apply(null,arguments),!0}function E(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function z(e){var t=O.state;if(O.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,n){{if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new P(r,n.vars,!0):null}return E(t,n.vars)?n:new P(n.prev,new F(t,n.vars),!1)}return null}}(e,t.context);if(null!=n)return void(t.context=n)}else if(!E(e,t.localVars))return void(t.localVars=new F(e,t.localVars));c.globalVars&&!E(e,t.globalVars)&&(t.globalVars=new F(e,t.globalVars))}function D(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function P(e,t,n){this.prev=e,this.vars=t,this.block=n}function F(e,t){this.name=e,this.next=t}var I=new F("this",new F("arguments",null));function j(){O.state.context=new P(O.state.context,O.state.localVars,!1),O.state.localVars=I}function W(){O.state.context=new P(O.state.context,O.state.localVars,!0),O.state.localVars=null}function H(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function R(r,i){function e(){var e=O.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var n=e.lexical;n&&")"==n.type&&n.align;n=n.prev)t=n.indented;e.lexical=new M(t,O.stream.column(),r,null,e.lexical,i)}return e.lex=!0,e}function B(){var e=O.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function q(n){return function e(t){return t==n?_():";"==n||"}"==t||")"==t||"]"==t?N():_(e)}}function U(e,t){return"var"==e?_(R("vardef",t),Se,q(";"),B):"keyword a"==e?_(R("form"),$,U,B):"keyword b"==e?_(R("form"),U,B):"keyword d"==e?O.stream.match(/^\s*$/,!1)?_():_(R("stat"),X,q(";"),B):"debugger"==e?_(q(";")):"{"==e?_(R("}"),W,fe,B,H):";"==e?_():"if"==e?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==B&&O.state.cc.pop()(),_(R("form"),$,U,B,_e)):"function"==e?_(Pe):"for"==e?_(R("form"),Ee,U,B):"class"==e||f&&"interface"==t?(O.marked="keyword",_(R("form","class"==e?e:t),He,B)):"variable"==e?f&&"declare"==t?(O.marked="keyword",_(U)):f&&("module"==t||"enum"==t||"type"==t)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==t?_(Je):"type"==t?_(Ie,q("operator"),ve,q(";")):_(R("form"),Le,q("{"),R("}"),fe,B,B)):f&&"namespace"==t?(O.marked="keyword",_(R("form"),V,U,B)):f&&"abstract"==t?(O.marked="keyword",_(U)):_(R("stat"),oe):"switch"==e?_(R("form"),$,q("{"),R("}","switch"),W,fe,B,B,H):"case"==e?_(V,q(":")):"default"==e?_(q(":")):"catch"==e?_(R("form"),j,K,U,B,H):"export"==e?_(R("stat"),Ue,B):"import"==e?_(R("stat"),Ve,B):"async"==e?_(U):"@"==t?_(V,U):N(R("stat"),V,q(";"),B)}function K(e){if("("==e)return _(je,q(")"))}function V(e,t){return Y(e,t,!1)}function G(e,t){return Y(e,t,!0)}function $(e){return"("!=e?N():_(R(")"),V,q(")"),B)}function Y(e,t,n){if(O.state.fatArrowAt==O.stream.start){var r=n?ne:te;if("("==e)return _(j,R(")"),ue(je,")"),B,q("=>"),r,H);if("variable"==e)return N(j,Le,q("=>"),r,H)}var i=n?J:Z;return L.hasOwnProperty(e)?_(i):"function"==e?_(Pe,i):"class"==e||f&&"interface"==t?(O.marked="keyword",_(R("form"),We,B)):"keyword c"==e||"async"==e?_(n?G:V):"("==e?_(R(")"),X,q(")"),B,i):"operator"==e||"spread"==e?_(n?G:V):"["==e?_(R("]"),Ze,B,i):"{"==e?de(le,"}",null,i):"quasi"==e?N(Q,i):"new"==e?_(function(t){return function(e){return"."==e?_(t?ie:re):"variable"==e&&f?_(ke,t?J:Z):N(t?G:V)}}(n)):"import"==e?_(V):_()}function X(e){return e.match(/[;\}\)\],]/)?N():N(V)}function Z(e,t){return","==e?_(V):J(e,t,!1)}function J(e,t,n){var r=0==n?Z:J,i=0==n?V:G;return"=>"==e?_(j,n?ne:te,H):"operator"==e?/\+\+|--/.test(t)||f&&"!"==t?_(r):f&&"<"==t&&O.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?_(R(">"),ue(ve,">"),B,r):"?"==t?_(V,q(":"),i):_(i):"quasi"==e?N(Q,r):";"!=e?"("==e?de(G,")","call",r):"."==e?_(ae,r):"["==e?_(R("]"),X,q("]"),B,r):f&&"as"==t?(O.marked="keyword",_(ve,r)):"regexp"==e?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),_(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?N():"${"!=t.slice(t.length-2)?_(Q):_(V,ee)}function ee(e){if("}"==e)return O.marked="string-2",O.state.tokenize=C,_(Q)}function te(e){return S(O.stream,O.state),N("{"==e?U:V)}function ne(e){return S(O.stream,O.state),N("{"==e?U:G)}function re(e,t){if("target"==t)return O.marked="keyword",_(Z)}function ie(e,t){if("target"==t)return O.marked="keyword",_(J)}function oe(e){return":"==e?_(B,U):N(Z,q(";"),B)}function ae(e){if("variable"==e)return O.marked="property",_()}function le(e,t){if("async"==e)return O.marked="property",_(le);if("variable"==e||"keyword"==O.style){return O.marked="property","get"==t||"set"==t?_(se):(f&&O.state.fatArrowAt==O.stream.start&&(n=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+n[0].length),_(ce));var n}else{if("number"==e||"string"==e)return O.marked=l?"property":O.style+" property",_(ce);if("jsonld-keyword"==e)return _(ce);if(f&&D(t))return O.marked="keyword",_(le);if("["==e)return _(V,he,q("]"),ce);if("spread"==e)return _(G,ce);if("*"==t)return O.marked="keyword",_(le);if(":"==e)return N(ce)}}function se(e){return"variable"!=e?N(ce):(O.marked="property",_(Pe))}function ce(e){return":"==e?_(G):"("==e?N(Pe):void 0}function ue(r,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var n=O.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),_(function(e,t){return e==i||t==i?N():N(r)},a)}return e==i||t==i?_():o&&-1<o.indexOf(";")?N(r):_(q(i))}return function(e,t){return e==i||t==i?_():N(r,a)}}function de(e,t,n){for(var r=3;r<arguments.length;r++)O.cc.push(arguments[r]);return _(R(t,n),ue(e,t),B)}function fe(e){return"}"==e?_():N(U,fe)}function he(e,t){if(f){if(":"==e)return _(ve);if("?"==t)return _(he)}}function pe(e,t){if(f&&(":"==e||"in"==t))return _(ve)}function me(e){if(f&&":"==e)return O.stream.match(/^\s*\w+\s+is\b/,!1)?_(V,ge,ve):_(ve)}function ge(e,t){if("is"==t)return O.marked="keyword",_()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(O.marked="keyword",_("typeof"==t?G:ve)):"variable"==e||"void"==t?(O.marked="type",_(xe)):"|"==t||"&"==t?_(ve):"string"==e||"number"==e||"atom"==e?_(xe):"["==e?_(R("]"),ue(ve,"]",","),B,xe):"{"==e?_(R("}"),ue(be,"}",",;"),B,xe):"("==e?_(ue(we,")"),ye,xe):"<"==e?_(ue(ve,">"),ve):void 0}function ye(e){if("=>"==e)return _(ve)}function be(e,t){return"variable"==e||"keyword"==O.style?(O.marked="property",_(be)):"?"==t||"number"==e||"string"==e?_(be):":"==e?_(ve):"["==e?_(q("variable"),pe,q("]"),be):"("==e?N(Fe,be):void 0}function we(e,t){return"variable"==e&&O.stream.match(/^\s*[?:]/,!1)||"?"==t?_(we):":"==e?_(ve):"spread"==e?_(we):N(ve)}function xe(e,t){return"<"==t?_(R(">"),ue(ve,">"),B,xe):"|"==t||"."==e||"&"==t?_(ve):"["==e?_(ve,q("]"),xe):"extends"==t||"implements"==t?(O.marked="keyword",_(ve)):"?"==t?_(ve,q(":"),ve):void 0}function ke(e,t){if("<"==t)return _(R(">"),ue(ve,">"),B,xe)}function Ce(){return N(ve,Te)}function Te(e,t){if("="==t)return _(ve)}function Se(e,t){return"enum"==t?(O.marked="keyword",_(Je)):N(Le,he,Oe,Ne)}function Le(e,t){return f&&D(t)?(O.marked="keyword",_(Le)):"variable"==e?(z(t),_()):"spread"==e?_(Le):"["==e?de(Ae,"]"):"{"==e?de(Me,"}"):void 0}function Me(e,t){return"variable"!=e||O.stream.match(/^\s*:/,!1)?("variable"==e&&(O.marked="property"),"spread"==e?_(Le):"}"==e?N():"["==e?_(V,q("]"),q(":"),Me):_(q(":"),Le,Oe)):(z(t),_(Oe))}function Ae(){return N(Le,Oe)}function Oe(e,t){if("="==t)return _(G)}function Ne(e){if(","==e)return _(Se)}function _e(e,t){if("keyword b"==e&&"else"==t)return _(R("form","else"),U,B)}function Ee(e,t){return"await"==t?_(Ee):"("==e?_(R(")"),ze,B):void 0}function ze(e){return"var"==e?_(Se,De):"variable"==e?_(De):N(De)}function De(e,t){return")"==e?_():";"==e?_(De):"in"==t||"of"==t?(O.marked="keyword",_(V,De)):N(V,De)}function Pe(e,t){return"*"==t?(O.marked="keyword",_(Pe)):"variable"==e?(z(t),_(Pe)):"("==e?_(j,R(")"),ue(je,")"),B,me,U,H):f&&"<"==t?_(R(">"),ue(Ce,">"),B,Pe):void 0}function Fe(e,t){return"*"==t?(O.marked="keyword",_(Fe)):"variable"==e?(z(t),_(Fe)):"("==e?_(j,R(")"),ue(je,")"),B,me,H):f&&"<"==t?_(R(">"),ue(Ce,">"),B,Fe):void 0}function Ie(e,t){return"keyword"==e||"variable"==e?(O.marked="type",_(Ie)):"<"==t?_(R(">"),ue(Ce,">"),B):void 0}function je(e,t){return"@"==t&&_(V,je),"spread"==e?_(je):f&&D(t)?(O.marked="keyword",_(je)):f&&"this"==e?_(he,Oe):N(Le,he,Oe)}function We(e,t){return"variable"==e?He(e,t):Re(e,t)}function He(e,t){if("variable"==e)return z(t),_(Re)}function Re(e,t){return"<"==t?_(R(">"),ue(Ce,">"),B,Re):"extends"==t||"implements"==t||f&&","==e?("implements"==t&&(O.marked="keyword"),_(f?ve:V,Re)):"{"==e?_(R("}"),Be,B):void 0}function Be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||f&&D(t))&&O.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",_(Be)):"variable"==e||"keyword"==O.style?(O.marked="property",_(f?qe:Pe,Be)):"number"==e||"string"==e?_(f?qe:Pe,Be):"["==e?_(V,he,q("]"),f?qe:Pe,Be):"*"==t?(O.marked="keyword",_(Be)):f&&"("==e?N(Fe,Be):";"==e||","==e?_(Be):"}"==e?_():"@"==t?_(V,Be):void 0}function qe(e,t){if("?"==t)return _(qe);if(":"==e)return _(ve,Oe);if("="==t)return _(G);var n=O.state.lexical.prev;return N(n&&"interface"==n.info?Fe:Pe)}function Ue(e,t){return"*"==t?(O.marked="keyword",_(Xe,q(";"))):"default"==t?(O.marked="keyword",_(V,q(";"))):"{"==e?_(ue(Ke,"}"),Xe,q(";")):N(U)}function Ke(e,t){return"as"==t?(O.marked="keyword",_(q("variable"))):"variable"==e?N(G,Ke):void 0}function Ve(e){return"string"==e?_():"("==e?N(V):N(Ge,$e,Xe)}function Ge(e,t){return"{"==e?de(Ge,"}"):("variable"==e&&z(t),"*"==t&&(O.marked="keyword"),_(Ye))}function $e(e){if(","==e)return _(Ge,$e)}function Ye(e,t){if("as"==t)return O.marked="keyword",_(Ge)}function Xe(e,t){if("from"==t)return O.marked="keyword",_(V)}function Ze(e){return"]"==e?_():N(ue(G,"]"))}function Je(){return N(R("form"),Le,q("{"),R("}"),ue(Qe,"}"),B,B)}function Qe(){return N(Le,Oe)}function et(e,t,n){return t.tokenize==x&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return B.lex=H.lex=!0,{startState:function(e){var t={tokenize:x,lastType:"sof",cc:[],lexical:new M((e||0)-u,0,"block",!1),localVars:c.localVars,context:c.localVars&&new P(null,null,!1),indented:e||0};return c.globalVars&&"object"==typeof c.globalVars&&(t.globalVars=c.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=k&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==g?n:(t.lastType="operator"!=g||"++"!=v&&"--"!=v?g:"incdec",function(e,t,n,r,i){var o=e.cc;for(O.state=e,O.stream=i,O.marked=null,O.cc=o,O.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():s?V:U)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return O.marked?O.marked:"variable"==n&&A(e,r)?"variable-2":t}}}(t,n,g,v,e))},indent:function(e,t){if(e.tokenize==k)return tt.Pass;if(e.tokenize!=x)return 0;var n,r=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==B)i=i.prev;else if(a!=_e)break}for(;("stat"==i.type||"form"==i.type)&&("}"==r||(n=e.cc[e.cc.length-1])&&(n==Z||n==J)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;d&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l=i.type,s=r==l;return"vardef"==l?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==l&&"{"==r?i.indented:"form"==l?i.indented+u:"stat"==l?i.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||y.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,t)?d||u:0):"switch"!=i.info||s||0==c.doubleIndentSwitch?i.align?i.column+(s?0:1):i.indented+(s?0:u):i.indented+(/^(?:case|default)\b/.test(t)?u:2*u)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:et,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=V&&t!=G||e.cc.pop()}}}),tt.registerHelper("wordChars","javascript",/[\w$]/),tt.defineMIME("text/javascript","javascript"),tt.defineMIME("text/ecmascript","javascript"),tt.defineMIME("application/javascript","javascript"),tt.defineMIME("application/x-javascript","javascript"),tt.defineMIME("application/ecmascript","javascript"),tt.defineMIME("application/json",{name:"javascript",json:!0}),tt.defineMIME("application/x-json",{name:"javascript",json:!0}),tt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),tt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),tt.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],23:[function(e,t,n){var r;r=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 i,o,a=e.indentUnit,l={},n=t.htmlMode?T:S;for(var r in n)l[r]=n[r];for(var r in t)l[r]=t[r];function s(t,n){function e(e){return(n.tokenize=e)(t,n)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(u("atom","]]>")):null:t.match("--")?e(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function r(i){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=r(i+1),t.tokenize(e,t);if(">"==n){if(1!=i)return t.tokenize=r(i-1),t.tokenize(e,t);t.tokenize=s;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=u("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",n.tokenize=c,"tag bracket"):"&"!=r?(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 c(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=s,i=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return i="equals",null;if("<"!=n)return/[\'\"]/.test(n)?(t.tokenize=function(n){function e(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=c;break}return"string"}return e.isInAttribute=!0,e}(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=s,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}function u(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=s;break}e.next()}return n}}function d(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.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 n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,n){return"word"==e?(n.tagName=t.current(),o="tag",b):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,n)):(o="error",m)}function g(e,t,n){if("word"!=e)return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,n)):(o="error",y);var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,n){return"endTag"!=e?(o="error",v):(f(n),p)}function y(e,t,n){return o="error",v(e,0,n)}function b(e,t,n){if("word"==e)return o="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new d(n,r,i==n.indented)),p}function w(e,t,n){return"equals"==e?x:(l.allowMissing||(o="error"),b(e,0,n))}function x(e,t,n){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",b):(o="error",b(e,0,n))}function k(e,t,n){return"string"==e?k:b(e,0,n)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,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;i=null;var n=t.tokenize(e,t);return(n||i)&&"comment"!=n&&(o=null,t.state=t.state(i||n,e,t),o&&(n="error"==o?n+" error":o)),n},indent:function(e,t,n){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(r&&r.noIndent)return C.Pass;if(e.tokenize!=c&&e.tokenize!=s)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;r;){if(r.tagName==i[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(i)for(;r;){var o=l.contextGrabbers[r.tagName];if(!o||!o.hasOwnProperty(i[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+a:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}}),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 n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],24:[function(e,t,n){t.exports={prettyPrint:function(e,t){var n,r,i,o,a,c;for(r=(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"],(n=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 n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.get_content=function(){for(var e="",t=[],n=!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&&(n=!0),this.line_char_count--;else{if(n){if(this.line_char_count>=this.max_char){t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;n=!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="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var r=n.exec(this.input),i=r?r.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,n="",r=[],i=!1;do{if(this.pos>=this.input.length)return r.length?r.join(""):["","TK_EOF"];n=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(n,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==n&&'"'!==n||r[1]&&"!"===r[1]||(n+=this.get_unformatted(n),i=!0),"="===n&&(i=!1),r.length&&"="!==r[r.length-1]&&">"!==n&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,r),this.line_char_count=0):(r.push(" "),this.line_char_count++),i=!1),"<"===n&&(e=this.pos-1),r.push(n))}while(">"!==n);var o,a=r.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);r.push(s),0<e&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&r.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(1+t),this.Utils.whitespace)&&r.push(this.input.charAt(1+t)),this.tag_type="SINGLE"}else if("!"===l.charAt(0))if(-1!=l.indexOf("[if")){if(-1!=a.indexOf("!IE")){s=this.get_unformatted("--\x3e",a);r.push(s)}this.tag_type="START"}else if(-1!=l.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=l.indexOf("[cdata[")){s=this.get_unformatted("]]>",a);r.push(s),this.tag_type="SINGLE"}else{s=this.get_unformatted("--\x3e",a);r.push(s),this.tag_type="SINGLE"}else"/"===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 r.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",r="",i=!0;do{if(this.pos>=this.input.length)return r;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===n||"\r"===n){r+="\n",this.line_char_count=0;continue}}r+=n,this.line_char_count++,i=!0}while(-1==r.toLowerCase().indexOf(e));return r},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,n,r,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=i,this.indent_level=0,this.max_char=r;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 n=0;n<this.indent_level;n++)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,r,o,a);;){var l=n.get_token();if(n.token_text=l[0],n.token_type=l[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent(),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var s=n.token_text.match(/\w+/)[0],u=n.output[n.output.length-1].match(/<\s*(\w+)/);null!==u&&u[1]===s||n.print_newline(!0,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var d=n.token_text.match(/^\s*<([a-z]+)/i);d&&n.Utils.in_array(d[1],c)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_CONTENT":""!==n.token_text&&n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.output.push("\n");var f=n.token_text;if("TK_SCRIPT"==n.token_type)var h="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==n.token_type)h="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var p=0;else if("separate"==t.indent_scripts)p=-n.indent_level;else p=1;var m=n.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(n.indent_string).length-1,v=n.get_full_indent(p-g);f=f.replace(/^\s*/,m).replace(/\r\n|\r|\n/g,"\n"+v).replace(/\s*$/,"")}f&&(n.print_token(f),n.print_newline(!0,n.output))}n.current_mode="TAG"}n.last_token=n.token_type,n.last_text=n.token_text}return n.output.join("")}}},{}],25:[function(e,t,n){"use strict";var s=e("../render/vnode");t.exports=function(r,e,t){var i=[],n=!1,o=!1;function a(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<i.length;e+=2)try{r(i[e],s(i[e+1]),l)}catch(e){t.error(e)}n=!1}function l(){o||(o=!0,e(function(){o=!1,a()}))}return l.sync=a,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=i.indexOf(e);0<=n&&(i.splice(n,2),r(e,[],l)),null!=t&&(i.push(e,t),r(e,s(t),l))},redraw:l}}},{"../render/vnode":44}],26:[function(e,t,n){(function(k){"use strict";var C=e("../render/vnode"),a=e("../render/hyperscript"),T=e("../promise/promise"),o=e("../pathname/build"),S=e("../pathname/parse"),L=e("../pathname/compileTemplate"),M=e("../pathname/assign"),A={};t.exports=function(f,h){var s;function p(e,t,n){if(e=o(e,t),null!=s){s();var r=n?n.state:null,i=n?n.title:null;n&&n.replace?f.history.replaceState(r,i,x.prefix+e):f.history.pushState(r,i,x.prefix+e)}else f.location.href=x.prefix+e}var m,g,v,y,b=A,w=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,c=0,u=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:L(e)}}),i="function"==typeof k?k:setTimeout,d=T.resolve(),o=!1;if((s=null)!=t){var a=S(t);if(!u.some(function(e){return e.check(a)}))throw new ReferenceError("Default route doesn't match any known routes")}function l(){o=!1;var e=f.location.hash;"#"!==x.prefix[0]&&(e=f.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=f.location.pathname+e)[0]&&(e="/"+e));var a=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length),l=S(a);function s(){if(a===t)throw new Error("Could not resolve default route "+t);p(t,null,{replace:!0})}M(l.params,f.history.state),function t(n){for(;n<u.length;n++)if(u[n].check(l)){var r=u[n].component,e=u[n].route,i=r,o=y=function(e){if(o===y){if(e===w)return t(n+1);m=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,g=l.params,v=a,y=null,b=r.render?r:null,2===c?h.redraw():(c=2,h.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},o(i)):r.onmatch?d.then(function(){return r.onmatch(l.params,a,e)}).then(o,s):o("div"))}s()}(0)}return s=function(){o||(o=!0,i(l))},"function"==typeof f.history.pushState?(r=function(){f.removeEventListener("popstate",s,!1)},f.addEventListener("popstate",s,!1)):"#"===x.prefix[0]&&(s=null,r=function(){f.removeEventListener("hashchange",l,!1)},f.addEventListener("hashchange",l,!1)),h.mount(e,{onbeforeupdate:function(){return!(!(c=c?2:1)||A===b)},oncreate:l,onremove:r,view:function(){if(c&&A!==b){var e=[C(m,g.key,g)];return b&&(e=b.render(e[0])),e}}})}return x.set=function(e,t,n){null!=y&&((n=n||{}).replace=!0),y=null,p(e,t,n)},x.get=function(){return v},x.prefix="#!",x.Link={view:function(e){var n,r,i=e.attrs.options,t={};M(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null;var o=a(e.attrs.selector||"a",t,e.children);return(o.attrs.disabled=Boolean(o.attrs.disabled))?(o.attrs.href=null,o.attrs["aria-disabled"]="true",o.attrs.onclick=null):(n=o.attrs.onclick,r=o.attrs.href,o.attrs.href=x.prefix+r,o.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null==n||"object"!=typeof n||"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,i))}),o}},x.param=function(e){return g&&null!=e?g[e]:g},x}}).call(this,e("timers").setImmediate)},{"../pathname/assign":30,"../pathname/build":31,"../pathname/compileTemplate":32,"../pathname/parse":33,"../promise/promise":35,"../render/hyperscript":40,"../render/vnode":44,timers:49}],27:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":39,"./render/hyperscript":40,"./render/trust":43}],28:[function(e,t,n){"use strict";function r(){return i.apply(this,arguments)}var i=e("./hyperscript"),o=e("./request"),a=e("./mount-redraw");r.m=i,r.trust=i.trust,r.fragment=i.fragment,r.mount=a.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=a.redraw,r.request=o.request,r.jsonp=o.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":27,"./mount-redraw":29,"./pathname/build":31,"./pathname/parse":33,"./promise/polyfill":34,"./querystring/build":36,"./querystring/parse":37,"./render":38,"./render/vnode":44,"./request":45,"./route":47}],29:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":25,"./render":38}],30:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],31:[function(e,t,n){"use strict";var m=e("../querystring/build"),g=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),i=n<0?e.length:n,o=t<0?i:t,a=e.slice(0,o),l={};g(l,r);var s=a.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete l[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))}),c=s.indexOf("?"),u=s.indexOf("#"),d=u<0?s.length:u,f=c<0?d:c,h=s.slice(0,f);0<=t&&(h+=e.slice(t,i)),0<=c&&(h+=(t<0?"?":"&")+s.slice(c,d));var p=m(l);return p&&(h+=(t<0&&c<0?"?":"&")+p),0<=n&&(h+=e.slice(n)),0<=u&&(h+=(n<0?"":"&")+s.slice(u)),h}},{"../querystring/build":36,"./assign":30}],32:[function(e,t,n){"use strict";var l=e("./parse");t.exports=function(e){var r=l(e),i=Object.keys(r.params),o=[],a=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(o.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<i.length;t++)if(r.params[i[t]]!==e.params[i[t]])return!1;if(!o.length)return a.test(e.path);var n=a.exec(e.path);if(null==n)return!1;for(t=0;t<o.length;t++)e.params[o[t].k]=o[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":33}],33:[function(e,t,n){"use strict";var a=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),r=n<0?e.length:n,i=t<0?r:t,o=e.slice(0,i).replace(/\/{2,}/g,"/");return o?("/"!==o[0]&&(o="/"+o),1<o.length&&"/"===o[o.length-1]&&(o=o.slice(0,-1))):o="/",{path:o,params:t<0?{}:a(e.slice(t+1,r))}}},{"../querystring/parse":37}],34:[function(e,t,n){(function(n){"use strict";var f=function(e){if(!(this instanceof f))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),c=o._instance={resolvers:a,rejectors:l},u="function"==typeof n?n: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))u(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,c.state=i,c.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");d(e.bind(n))}}catch(e){s(e)}}}function d(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)}}d(e)};f.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 f(function(e,t){i=e,o=t});return n(e,a.resolvers,i,!0),n(t,a.rejectors,o,!1),r},f.prototype.catch=function(e){return this.then(null,e)},f.prototype.finally=function(t){return this.then(function(e){return f.resolve(t()).then(function(){return e})},function(e){return f.resolve(t()).then(function(){return f.reject(e)})})},f.resolve=function(t){return t instanceof f?t:new f(function(e){e(t)})},f.reject=function(n){return new f(function(e,t){t(n)})},f.all=function(l){return new f(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)})},f.race=function(r){return new f(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=f}).call(this,e("timers").setImmediate)},{timers:49}],35:[function(n,r,e){(function(e){"use strict";var t=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=t:window.Promise.prototype.finally||(window.Promise.prototype.finally=t.prototype.finally),r.exports=window.Promise):void 0!==e?(void 0===e.Promise?e.Promise=t:e.Promise.prototype.finally||(e.Promise.prototype.finally=t.prototype.finally),r.exports=e.Promise):r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":34}],36:[function(e,t,n){"use strict";t.exports=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):""))}}},{}],37:[function(e,t,n){"use strict";t.exports=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(/\]\[?|\[/),c=r;-1<a.indexOf("[")&&s.pop();for(var u=0;u<s.length;u++){var d=s[u],f=s[u+1],h=""==f||!isNaN(parseInt(f,10));if(""===d)null==n[a=s.slice(0,u).join()]&&(n[a]=Array.isArray(c)?c.length:0),d=n[a]++;else if("__proto__"===d)break;if(u===s.length-1)c[d]=l;else{var p=Object.getOwnPropertyDescriptor(c,d);null!=p&&(p=p.value),null==p&&(c[d]=p=h?[]:{}),c=p}}}return r}},{}],38:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":42}],39:[function(e,t,n){"use strict";var r=e("../render/vnode"),i=e("./hyperscriptVnode");t.exports=function(){var e=i.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":44,"./hyperscriptVnode":41}],40:[function(e,t,n){"use strict";var s=e("../render/vnode"),r=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},d={}.hasOwnProperty;function f(e){for(var t in e)if(d.call(e,t))return!1;return!0}t.exports=function(e){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.");var t=r.apply(1,arguments);return"string"==typeof e&&(t.children=s.normalizeChildren(t.children),"["!==e)?function(e,t){var n=t.attrs,r=s.normalizeChildren(t.children),i=d.call(n,"class"),o=i?n.class:n.className;if(t.tag=e.tag,t.attrs=null,t.children=void 0,!f(e.attrs)&&!f(n)){var a={};for(var l in n)d.call(n,l)&&(a[l]=n[l]);n=a}for(var l in e.attrs)d.call(e.attrs,l)&&"className"!==l&&!d.call(n,l)&&(n[l]=e.attrs[l]);for(var l in null==o&&null==e.attrs.className||(n.className=null!=o?null!=e.attrs.className?String(e.attrs.className)+" "+String(o):o:null!=e.attrs.className?e.attrs.className:null),i&&(n.class=null),n)if(d.call(n,l)&&"key"!==l){t.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?t.text=r[0].children:t.children=r,t}(u[e]||function(e){for(var t,n="div",r=[],i={};t=c.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),t):(t.tag=e,t)}},{"../render/vnode":44,"./hyperscriptVnode":41}],41:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":44}],42:[function(e,t,n){"use strict";var I=e("../render/vnode");t.exports=function(e){var s,u=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function d(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function c(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function f(e){var t=e.state;try{return this.apply(t,arguments)}finally{c(e,t)}}function h(){try{return u.activeElement}catch(e){return null}}function A(e,t,n,r,i,o,a){for(var l=n;l<r;l++){var s=t[l];null!=s&&O(e,s,i,a,o)}}function O(e,t,n,r,i){var o=t.tag;if("string"==typeof o)switch(t.state={},null!=t.attrs&&L(t.attrs,t,n),o){case"#":!function(e,t,n){t.dom=u.createTextNode(t.children),g(e,t.dom,n)}(e,t,i);break;case"<":l(e,t,r,i);break;case"[":!function(e,t,n,r,i){var o=u.createDocumentFragment();if(null!=t.children){var a=t.children;A(o,a,0,a.length,n,null,r)}t.dom=o.firstChild,t.domSize=o.childNodes.length,g(e,o,i)}(e,t,n,r,i);break;default:!function(e,t,n,r,i){var o=t.tag,a=t.attrs,l=a&&a.is,s=(r=d(t)||r)?l?u.createElementNS(r,o,{is:l}):u.createElementNS(r,o):l?u.createElement(o,{is:l}):u.createElement(o);t.dom=s,null!=a&&function(e,t,n){for(var r in t)x(e,r,null,t[r],n)}(t,a,r);if(g(e,s,i),!v(t)&&(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[I("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children)){var c=t.children;A(s,c,0,c.length,n,null,r),"select"===t.tag&&null!=a&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&x(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,a)}}(e,t,n,r,i)}else!function(e,t,n,r,i){(function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}L(e.state,e,t),null!=e.attrs&&L(e.attrs,e,t);if(e.instance=I.normalize(f.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(t,n),null!=t.instance?(O(e,t.instance,n,r,i),t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0):t.domSize=0}(e,t,n,r,i)}var p={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function l(e,t,n,r){var i=t.children.match(/^\s*?<(\w+)/im)||[],o=u.createElement(p[i[1]]||"div");"http://www.w3.org/2000/svg"===n?(o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",o=o.firstChild):o.innerHTML=t.children,t.dom=o.firstChild,t.domSize=o.childNodes.length,t.instance=[];for(var a,l=u.createDocumentFragment();a=o.firstChild;)t.instance.push(a),l.appendChild(a);g(e,l,r)}function m(e,t,n,r,i,o){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)A(e,n,0,n.length,r,i,o);else if(null==n||0===n.length)P(e,t,0,t.length);else{var a=null!=t[0]&&null!=t[0].key,l=null!=n[0]&&null!=n[0].key,s=0,c=0;if(!a)for(;c<t.length&&null==t[c];)c++;if(!l)for(;s<n.length&&null==n[s];)s++;if(null===l&&null==a)return;if(a!=l)P(e,t,c,t.length),A(e,n,s,n.length,r,i,o);else if(l){for(var u,d,f,h,p,m=t.length-1,g=n.length-1;c<=m&&s<=g&&(f=t[m],h=n[g],f.key===h.key);)f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),m--,g--;for(;c<=m&&s<=g&&(u=t[c],d=n[s],u.key===d.key);)c++,s++,u!==d&&N(e,u,d,r,z(t,c,i),o);for(;c<=m&&s<=g&&s!==g&&u.key===h.key&&f.key===d.key;)D(e,f,p=z(t,c,i)),f!==d&&N(e,f,d,r,p,o),++s<=--g&&D(e,u,i),u!==h&&N(e,u,h,r,i,o),null!=h.dom&&(i=h.dom),c++,f=t[--m],h=n[g],u=t[c],d=n[s];for(;c<=m&&s<=g&&f.key===h.key;)f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),g--,f=t[--m],h=n[g];if(g<s)P(e,t,c,m+1);else if(m<c)A(e,n,s,g+1,r,i,o);else{var v,y,b=i,w=g-s+1,x=new Array(w),k=0,C=0,T=2147483647,S=0;for(C=0;C<w;C++)x[C]=-1;for(C=g;s<=C;C--){null==v&&(v=_(t,c,m+1));var L=v[(h=n[C]).key];null!=L&&(T=L<T?L:-1,f=t[x[C-s]=L],t[L]=null,f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),S++)}if(i=b,S!==m-c+1&&P(e,t,c,m+1),0===S)A(e,n,s,g+1,r,i,o);else if(-1===T)for(k=(y=function(e){var t=[0],n=0,r=0,i=0,o=E.length=e.length;for(i=0;i<o;i++)E[i]=e[i];for(i=0;i<o;++i)if(-1!==e[i]){var a=t[t.length-1];if(e[a]<e[i])E[i]=a,t.push(i);else{for(n=0,r=t.length-1;n<r;){var l=(n>>>1)+(r>>>1)+(n&r&1);e[t[l]]<e[i]?n=1+l:r=l}e[i]<e[t[n]]&&(0<n&&(E[i]=t[n-1]),t[n]=i)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=E[r];return E.length=0,t}(x)).length-1,C=g;s<=C;C--)d=n[C],-1===x[C-s]?O(e,d,r,o,i):y[k]===C-s?k--:D(e,d,i),null!=d.dom&&(i=n[C].dom);else for(C=g;s<=C;C--)d=n[C],-1===x[C-s]&&O(e,d,r,o,i),null!=d.dom&&(i=n[C].dom)}}else{var M=t.length<n.length?t.length:n.length;for(s=s<c?s:c;s<M;s++)(u=t[s])===(d=n[s])||null==u&&null==d||(null==u?O(e,d,r,o,z(t,s+1,i)):null==d?F(e,u):N(e,u,d,r,z(t,s+1,i),o));t.length>M&&P(e,t,s,t.length),n.length>M&&A(e,n,s,n.length,r,i,o)}}}function N(e,t,n,r,i,o){var a=t.tag;if(a===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=f.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=f.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof a)switch(null!=n.attrs&&M(n.attrs,n,r),a){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":!function(e,t,n,r,i){t.children!==n.children?(y(e,t),l(e,n,r,i)):(n.dom=t.dom,n.domSize=t.domSize,n.instance=t.instance)}(e,t,n,o,i);break;case"[":!function(e,t,n,r,i,o){m(e,t.children,n.children,r,i,o);var a=0,l=n.children;if((n.dom=null)!=l){for(var s=0;s<l.length;s++){var c=l[s];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),a+=c.domSize||1)}1!==a&&(n.domSize=a)}}(e,t,n,r,i,o);break;default:!function(e,t,n,r){var i=t.dom=e.dom;r=d(t)||r,"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)x(e,i,t&&t[i],n[i],r);var o;if(null!=t)for(var i in t)null==(o=t[i])||null!=n&&null!=n[i]||k(e,i,o,r)})(t,e.attrs,t.attrs,r),v(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=[I("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[I("#",void 0,void 0,t.text,void 0,void 0)]),m(i,e.children,t.children,n,null,r)))}(t,n,r,o)}else!function(e,t,n,r,i,o){if(n.instance=I.normalize(f.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");M(n.state,n,r),null!=n.attrs&&M(n.attrs,n,r);null!=n.instance?(null==t.instance?O(e,n.instance,r,o,i):N(e,t.instance,n.instance,r,i,o),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(F(e,t.instance),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o)}else F(e,t),O(e,n,r,o,i)}function _(e,t,n){for(var r=Object.create(null);t<n;t++){var i=e[t];if(null!=i){var o=i.key;null!=o&&(r[o]=t)}}return r}var E=[];function z(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function D(e,t,n){var r=u.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var i=0;i<r.instance.length;i++)n.appendChild(r.instance[i]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(var i=0;i<r.children.length;i++){var o=r.children[i];null!=o&&e(t,n,o)}break}}(e,r,t),g(e,r,n)}function g(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function v(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;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");return!0}function P(e,t,n,r){for(var i=n;i<r;i++){var o=t[i];null!=o&&F(e,o)}}function F(e,t){var n,r,i,o=0,a=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(i=f.call(t.state.onbeforeremove,t))&&"function"==typeof i.then&&(o=1,n=i);t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(i=f.call(t.attrs.onbeforeremove,t))&&"function"==typeof i.then&&(o|=2,r=i);if(c(t,a),o){if(null!=n){var l=function(){1&o&&((o&=2)||s())};n.then(l,l)}if(null!=r){l=function(){2&o&&((o&=1)||s())};r.then(l,l)}}else w(t),b(e,t);function s(){c(t,a),w(t),b(e,t)}}function y(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function b(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)y(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&b(e,r)}}break}}function w(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&f.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&f.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&w(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&w(r)}}}function x(e,t,n,r,i){if("key"!==t&&"is"!==t&&null!=r&&!o(t)&&(n!==r||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===h()||"option"===e.tag&&e.dom.parentNode===u.activeElement}(e,t)||"object"==typeof r)){if("o"===t[0]&&"n"===t[1])return S(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)T(e.dom,n,r);else if(a(e,t,i)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===h())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function k(e,t,n,r){if("key"!==t&&"is"!==t&&null!=n&&!o(t))if("o"!==t[0]||"n"!==t[1]||o(t))if("style"===t)T(e.dom,n,null);else if(!a(e,t,r)||"className"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===h())||"input"===e.tag&&"type"===t){var i=t.indexOf(":");-1!==i&&(t=t.slice(i+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null;else S(e,t,void 0)}function o(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function a(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function C(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function T(e,t,n){if(t===n);else if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(i=n[r])&&e.style.setProperty(C(r),String(i))}else{for(var r in n){var i;null!=(i=n[r])&&(i=String(i))!==String(t[r])&&e.style.setProperty(C(r),i)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(C(r))}}function i(){this._=s}function S(e,t,n){if(null!=e.events){if(e.events[t]===n)return;null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}else null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new i,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function L(e,t,n){"function"==typeof e.oninit&&f.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(f.bind(e.oncreate,t))}function M(e,t,n){"function"==typeof e.onupdate&&n.push(f.bind(e.onupdate,t))}return(i.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],i=h(),o=e.namespaceURI;null==e.vnodes&&(e.textContent=""),t=I.normalizeChildren(Array.isArray(t)?t:[t]);var a=s;try{s="function"==typeof n?n:void 0,m(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===o?void 0:o)}finally{s=a}e.vnodes=t,null!=i&&h()!==i&&"function"==typeof i.focus&&i.focus();for(var l=0;l<r.length;l++)r[l]()}}},{"../render/vnode":44}],43:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return null==e&&(e=""),r("<",void 0,void 0,e,void 0,void 0)}},{"../render/vnode":44}],44:[function(e,t,n){"use strict";function i(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,events:void 0,instance:void 0}}i.normalize=function(e){return Array.isArray(e)?i("[",void 0,void 0,i.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:i("#",void 0,void 0,String(e),void 0,void 0)},i.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=i.normalize(e[r])}return t},t.exports=i},{}],45:[function(e,t,n){"use strict";var r=e("./promise/promise"),i=e("./mount-redraw");t.exports=e("./request/request")(window,r,i.redraw)},{"./mount-redraw":29,"./promise/promise":35,"./request/request":46}],46:[function(e,t,n){"use strict";var c=e("../pathname/build");t.exports=function(p,n,l){var a=0;function s(e){return new n(e)}function e(a){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){a(c(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var i=0;function o(){0==--i&&"function"==typeof l&&l()}return function t(n){var r=n.then;n.constructor=s;n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)};return n}(e)}}function m(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return!0;return!1}return s.prototype=n.prototype,s.__proto__=n,{request:e(function(o,a,l,s){var e,t=null!=a.method?a.method.toUpperCase():"GET",n=a.body,r=!(null!=a.serialize&&a.serialize!==JSON.serialize||n instanceof p.FormData),c=a.responseType||("function"==typeof a.extract?"":"json"),i=new p.XMLHttpRequest,u=!1,d=i,f=i.abort;for(var h in i.abort=function(){u=!0,f.call(this)},i.open(t,o,!1!==a.async,"string"==typeof a.user?a.user:void 0,"string"==typeof a.password?a.password:void 0),r&&null!=n&&!m(a,/^content-type$/i)&&i.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof a.deserialize||m(a,/^accept$/i)||i.setRequestHeader("Accept","application/json, text/*"),a.withCredentials&&(i.withCredentials=a.withCredentials),a.timeout&&(i.timeout=a.timeout),i.responseType=c,a.headers)!{}.hasOwnProperty.call(a.headers,h)||i.setRequestHeader(h,a.headers[h]);i.onreadystatechange=function(e){if(!u&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(o),r=e.target.response;if("json"===c?e.target.responseType||"function"==typeof a.extract||(r=JSON.parse(e.target.responseText)):c&&"text"!==c||null==r&&(r=e.target.responseText),"function"==typeof a.extract?(r=a.extract(e.target,a),n=!0):"function"==typeof a.deserialize&&(r=a.deserialize(r)),n)l(r);else{try{t=e.target.responseText}catch(e){t=r}var i=new Error(t);i.code=e.target.status,i.response=r,s(i)}}catch(e){s(e)}},"function"==typeof a.config&&(i=a.config(i,a,o)||i)!==d&&(e=i.abort,i.abort=function(){u=!0,e.call(this)}),null==n?i.send():"function"==typeof a.serialize?i.send(a.serialize(n)):n instanceof p.FormData?i.send(n):i.send(JSON.stringify(n))}),jsonp:e(function(e,t,n,r){var i=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+a++,o=p.document.createElement("script");p[i]=function(e){delete p[i],o.parentNode.removeChild(o),n(e)},o.onerror=function(){delete p[i],o.parentNode.removeChild(o),r(new Error("JSONP request failed"))},o.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(i),p.document.documentElement.appendChild(o)})}}},{"../pathname/build":31}],47:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":26,"./mount-redraw":29}],48:[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 c,u=[],d=!1,f=-1;function h(){d&&c&&(d=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!d){var e=s(h);d=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,d=!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 m(e,t){this.fun=e,this.array=t}function g(){}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];u.push(new m(e,t)),1!==u.length||d||s(p)},m.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=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,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}},{}],49:[function(s,e,c){(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}c.setTimeout=function(){return new l(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new l(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},c.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},c._unrefActive=c.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},c.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),c.clearImmediate(t))}),t},c.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":48,timers:49}]},{},[13]);
|
1 |
+
!function o(a,l,s){function c(t,e){if(!l[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(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 c(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var u="function"==typeof require&&require,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){"use strict";var r=window.mc4wp_forms_i18n,i=e("mithril"),o={showType:function(e){var t=e.type;return t=t.charAt(0).toUpperCase()+t.slice(1),i("div",[i("label",r.fieldType),i("span",t)])},label:function(t){return i("div",[i("label",r.fieldLabel),i("input.widefat",{type:"text",value:t.label,onchange:function(e){t.label=e.target.value},placeholder:t.title})])},value:function(t){var e="hidden"===t.type;return i("div",[i("label",[e?r.value:r.initialValue," ",e?"":i("small",{style:"float: right; font-weight: normal;"},r.optional)]),i("input.widefat",{type:"text",value:t.value,onchange:function(e){t.value=e.target.value}}),e?"":i("p.help",r.valueHelp)])},numberMinMax:function(t){return i("div",[i("div.row",[i("div.col.col-3",[i("label",r.min),i("input",{type:"number",onchange:function(e){t.min=e.target.value}})]),i("div.col.col-3",[i("label",r.max),i("input",{type:"number",onchange:function(e){t.max=e.target.value}})])])])},isRequired:function(t){var e,n={type:"checkbox",checked:t.required,onchange:function(e){t.required=e.target.checked}};return t.forceRequired&&(n.required=!0,n.disabled=!0,e=i("p.help",r.forceRequired)),i("div",[i("label.cb-wrap",[i("input",n),r.isFieldRequired]),e])},placeholder:function(t){return i("div",[i("label",[r.placeholder," ",i("small",{style:"float: right; font-weight: normal;"},r.optional)]),i("input.widefat",{type:"text",value:t.placeholder,onchange:function(e){t.placeholder=e.target.value},placeholder:""}),i("p.help",r.placeholderHelp)])},useParagraphs:function(t){return i("div",[i("label.cb-wrap",[i("input",{type:"checkbox",checked:t.wrap,onchange:function(e){t.wrap=e.target.checked}}),r.wrapInParagraphTags])])},choiceType:function(t){var e=[i("option",{value:"select",selected:"select"===t.type&&"selected"},r.dropdown),i("option",{value:"radio",selected:"radio"===t.type&&"selected"},r.radioButtons)];return t.acceptsMultipleValues&&e.push(i("option",{value:"checkbox",selected:"checkbox"===t.type&&"selected"},r.checkboxes)),i("div",[i("label",r.choiceType),i("select",{value:t.type,onchange:function(e){t.type=e.target.value}},e)])},choices:function(n){var e=[];return e.push(i("div",[i("label",r.choices),i("div.limit-height",[i("table",n.choices.map(function(t,e){return i("tr",{"data-id":e},[i("td.cb",i("input",{name:"selected",type:"checkbox"===n.type?"checkbox":"radio",onchange:function(t){n.choices=n.choices.map(function(e){return e.value===t.target.value?e.selected=!e.selected:"checkbox"!==n.type&&(e.selected=!1),e})},checked:t.selected,value:t.value,title:r.preselect})),i("td.stretch",i("input.widefat",{type:"text",value:t.label,placeholder:t.title,onchange:function(e){t.label=e.target.value}})),i("td",i("span",{title:r.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices.splice(e,1)}.bind(n,e)},""))])}))])])),e},linkToTerms:function(t){return i("div",[i("label",r.agreeToTermsLink),i("input.widefat",{type:"text",value:t.link,onchange:function(e){t.link=e.target.value},placeholder:"https://..."})])}};t.exports=o},{mithril:28}],2:[function(e,t,n){"use strict";var r={},i=e("./field-forms-rows.js");r.render=function(e){var t=e.type;return"function"==typeof r[t]?r[t](e):-1<["select","radio","checkbox"].indexOf(t)?r.choice(e):r.text(e)},r.text=function(e){return[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},r.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type&&"radio"!==e.type||t.push(i.isRequired(e)),t},r.hidden=function(e){return e.placeholder="",e.label="",e.wrap=!1,[i.showType(e),i.value(e)]},r.submit=function(e){return e.label="",e.placeholder="",[i.value(e),i.useParagraphs(e)]},r["terms-checkbox"]=function(e){return[i.label(e),i.linkToTerms(e),i.isRequired(e),i.useParagraphs(e)]},r.number=function(e){return[r.text(e),i.numberMinMax(e)]},t.exports=r},{"./field-forms-rows.js":1}],3:[function(e,t,n){"use strict";function o(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")}var a=e("html"),l=e("mithril"),s={};s.select=function(e){var t={name:e.name,required:e.required},n=!1,r=e.choices.map(function(e){return e.selected&&(n=!0),l("option",{value:e.value!==e.label?e.value:void 0,selected:e.selected,oncreate:o},e.label)}),i=e.placeholder;return 0<i.length&&r.unshift(l("option",{disabled:!0,value:"",selected:!n,oncreate:o},i)),l("select",t,r)},s["terms-checkbox"]=function(e){var t;return t=0<e.link.length?l("a",{href:e.link,target:"_blank"},e.label):e.label,l("label",[l("input",{name:e.name,type:"checkbox",value:e.value,required:e.required})," ",t])},s.checkbox=function(r){return r.choices.map(function(e){var t=r.name+("checkbox"===r.type?"[]":""),n=r.required&&"radio"===r.type;return l("label",[l("input",{name:t,type:r.type,value:e.value,checked:e.selected,required:n,oncreate:o})," ",l("span",e.label)])})},s.radio=s.checkbox,s.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=o,l("input",t)},t.exports=function(e){var t=0<e.label.length&&e.showLabel?l("label",{},e.label):"",n="function"==typeof s[e.type]?s[e.type](e):s.default(e),r=e.wrap?l("p",[t,n]):[t,n],i=document.createElement("div");return l.render(i,r),a.prettyPrint(i.innerHTML)+"\n"}},{html:24,mithril:28}],4:[function(e,t,n){"use strict";var r,i=e("mithril"),o=e("./form-editor.js"),a=e("./fields.js"),l=window.mc4wp_forms_i18n,s=e("./field-generator.js"),c=e("../overlay.js"),u=e("./field-forms.js");function d(e){(r=null!==e?a.get(e):null)&&"hidden"===r.type&&0<r.choices.length&&(r.value=r.choices.map(function(e){return e.label}).join("|")),i.redraw()}function f(){var e=s(r);o.insert(e),d(null)}o.on("blur",i.redraw);var h=document.getElementById("mc4wp-field-wizard");h&&i.mount(h,{view:function(){var n=a.getAll(),e=i("div.available-fields.small-margin",[i("h4",l.chooseField),[l.listFields,l.interestCategories,l.formFields].map(function(t){var e=n.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 n=e.inFormContent;return null!==n&&(t+=" "+(n?"in-form":"not-in-form")),i("button",{className:t,type:"button",onclick:function(e){return d(e.target.value)},value:e.name},e.title)})])})]),t=null;return r&&(t=i(c,{onClose:function(){return d(null)}},i("div.field-wizard",[i("h3",[r.title,r.forceRequired?i("span.red","*"):"",r.name.length?i("code",r.name):""]),r.help.length?i("p",i.trust(r.help)):"",u.render(r),i("p",[i("button",{class:"button-primary",type:"button",onkeydown:function(e){13===e.keyCode&&f()},onclick:f},l.addToForm)])]))),[e,t]}})},{"../overlay.js":11,"./field-forms.js":2,"./field-generator.js":3,"./fields.js":6,"./form-editor.js":7,mithril:28}],5:[function(e,t,n){"use strict";var r=e("mithril"),i=e("./fields.js"),o=window.mc4wp.settings,a=window.mc4wp_vars.ajaxurl,l=window.mc4wp_forms_i18n,s=window.mc4wp_vars.mailchimp,c=window.mc4wp_vars.countries,u=[];function d(e,t,n){var r=i.register(e,t);n||u.push(r)}function f(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function h(e){var t=l.listFields,n=f(e.type),r={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:n,choices:e.options.choices,acceptsMultipleValues:!1};return"address"!==r.type?d(t,r,!1):(d(t,{name:r.name+"[addr1]",type:"text",mailchimpType:"address",title:l.streetAddress},!1),d(t,{name:r.name+"[city]",type:"text",mailchimpType:"address",title:l.city},!1),d(t,{name:r.name+"[state]",type:"text",mailchimpType:"address",title:l.state},!1),d(t,{name:r.name+"[zip]",type:"text",mailchimpType:"address",title:l.zip},!1),d(t,{name:r.name+"[country]",type:"select",mailchimpType:"address",title:l.country,choices:c},!1)),!0}function p(e){var t=f(e.type),n={title:e.title,name:"INTERESTS["+e.id+"]",type:t,choices:e.interests,acceptsMultipleValues:"checkbox"===t};d(l.interestCategories,n,!1)}function m(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(h),e.interest_categories.forEach(p),r.redraw()}function g(e){var t=a+"?action=mc4wp_get_list_details&ids="+e.map(function(e){return e.id}).join(",");r.request({url:t,method:"GET"}).then(function(e){u.forEach(i.deregister),r.redraw(),e.forEach(m)})}o.on("selectedLists.change",g),g(o.getSelectedLists()),function(e){var t;for(var n in d(l.listFields,{name:"EMAIL",title:l.emailAddress,required:!0,forceRequired:!0,type:"email"},!0),d(l.formFields,{name:"",value:l.subscribe,type:"submit",title:l.submitButton},!0),t={},e)t[e[n].id]=e[n].name;d(l.formFields,{name:"_mc4wp_lists",type:"checkbox",title:l.listChoice,choices:t,help:l.listChoiceDescription,acceptsMultipleValues:!0},!0),t={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},d(l.formFields,{name:"_mc4wp_action",type:"radio",title:l.formAction,choices:t,value:"subscribe",help:l.formActionDescription},!0),d(l.formFields,{name:"AGREE_TO_TERMS",value:1,type:"terms-checkbox",label:l.agreeToTerms,title:l.agreeToTermsShort,showLabel:!1,required:!0},!0)}(s.lists)},{"./fields.js":6,mithril:28}],6:[function(e,t,n){"use strict";var i={},o={};function a(e){return{name:e.name,title:e.title||e.name,type:e.type,mailchimpType:e.mailchimpType||null,label:e.label||e.title||"",showLabel:"boolean"!=typeof e.showLabel||e.showLabel,value:e.value||"",placeholder:e.placeholder||"",required:"boolean"==typeof e.required&&e.required,forceRequired:"boolean"==typeof e.forceRequired&&e.forceRequired,wrap:"boolean"!=typeof e.wrap||e.wrap,min:e.min,max:e.max,help:e.help||"",choices:e.choices||[],inFormContent:null,acceptsMultipleValues:e.acceptsMultipleValues,link:e.link||""}}function l(e){return{title:e.title||e.label,selected:e.selected||!1,value:e.value||e.label,label:e.label}}function r(){return Object.values(i)}t.exports={get:function(e){return i[e]},getAll:r,getAllWhere:function(t,n){return r().filter(function(e){return e[t]===n})},deregister:function(e){delete i[e.name]},register:function(e,t){var n=i[t.name];if(n)return!n.forceRequired&&t.forceRequired&&(n.forceRequired=!0),n;t.choices&&(t.choices=function(t){return"function"==typeof t.map?t.map(function(e){return new l({label:e})}):Object.keys(t).map(function(e){return new l({label:t[e],value:e})})}(t.choices),t.value&&(t.choices=t.choices.map(function(e){return e.value===t.value&&(e.selected=!0),e})));var r=new a(t);return r.category=e,i[t.name]=r,function(e,t){o[e]=o[e]||[],o[e].forEach(function(e){return e.apply(null,t)})}("change"),r},on:function(e,t){o[e]=o[e]||[],o[e].push(t)}}},{}],7:[function(e,t,n){"use strict";var r=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}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()},c&&(window.addEventListener("load",function(){r.signal(i,"change")}),c.addEventListener("change",function(){s=!0,h()}),l.innerHTML=c.value.toLowerCase(),r&&(i=r.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&&(u.addEventListener("load",f),f.call()),t.exports=a},{codemirror:19,"codemirror/addon/edit/closetag.js":14,"codemirror/addon/edit/matchbrackets.js":15,"codemirror/addon/edit/matchtags.js":16,"codemirror/addon/fold/xml-fold.js":17,"codemirror/addon/selection/active-line.js":18,"codemirror/mode/css/css":20,"codemirror/mode/htmlmixed/htmlmixed":21,"codemirror/mode/javascript/javascript":22,"codemirror/mode/xml/xml":23}],8:[function(e,t,n){"use strict";var r=e("mithril"),i=e("../helpers.js"),o=e("./form-editor.js"),a=e("./fields.js"),l=/\[(\w+)\]/g,s=/\[\]$/,c=document.getElementById("required-fields");function u(){a.getAll().forEach(function(e){if(!(e.name.length<=0)){var t=e.name;if("checkbox"===e.type&&(t+="[]"),e.inFormContent=o.containsField(t),"address"===e.mailchimpType){void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired);var n=e.name.replace(l,"");0<o.query('[name^="'+n+'"]').length?e.forceRequired=!0:e.forceRequired=e.originalRequiredValue}}}),function(){var r=a.getAllWhere("forceRequired",!0).map(function(e){return e.name.toUpperCase().replace(l,".$1")}),e=o.query("[required]");[].forEach.call(e,function(e){var t=e.name;if(t&&!(t.length<0)&&"_"!==t[0]){var n=(t=(t=t.replace(l,".$1")).replace(s,"")).indexOf(".");n=0<n?n:t.length,t=t.substr(0,n).toUpperCase()+t.substr(n),-1===r.indexOf(t)&&r.push(t)}}),c.value=r.join(",")}(),r.redraw()}o.on("change",i.debounce(u,600)),a.on("change",i.debounce(u,600))},{"../helpers.js":9,"./fields.js":6,"./form-editor.js":7,mithril:28}],9:[function(e,t,n){"use strict";t.exports={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)}}}},{}],10:[function(e,t,n){"use strict";var r=e("./form-editor/form-editor.js"),i=e("./form-editor/fields.js"),o=e("./settings"),a={};function l(e,t){a[e]=t,c()}function s(e){delete a[e],c()}function c(){var e="";for(var t in a)e+='<div class="notice notice-warning inline"><p>'+a[t]+"</p></div>";var n=document.querySelector(".mc4wp-notices");if(!n){(n=document.createElement("div")).className="mc4wp-notices";var r=document.querySelector("h1, h2");r.parentNode.insertBefore(n,r.nextSibling)}n.innerHTML=e}function u(){-1<r.getValue().toLowerCase().indexOf('name="groupings')?l("deprecated_groupings","Your form contains deprecated <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."):s("deprecated_groupings")}function d(){var e=i.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?l("required_fields_missing",t):s("required_fields_missing")}u(),r.on("focus",u),r.on("blur",u),d(),r.on("blur",d),r.on("focus",d),document.body.addEventListener("change",function(){0<o.getSelectedLists().length?s("no_lists_selected"):l("no_lists_selected",'<strong>Heads up!</strong> You have not yet selected a Mailchimp list to subscribe people to. Please select at least one list from the <a href="javascript:void(0)" data-tab="settings" class="tab-link">settings tab</a>.')})},{"./form-editor/fields.js":6,"./form-editor/form-editor.js":7,"./settings":12}],11:[function(e,t,n){"use strict";var a=e("mithril"),l=window.mc4wp_forms_i18n;t.exports=function(e){var i,t=e.attrs.onClose;function n(){t.apply(null)}function r(e){27===e.keyCode&&n(),13===e.keyCode&&e.preventDefault()}function o(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,n=(e-i.clientWidth-40)/2,r=(t-i.clientHeight-40)/2;i.style.left=(0<n?n:0)+"px",i.style.top=(0<r?r:0)+"px"}return{oncreate:function(){document.addEventListener("keydown",r),window.addEventListener("resize",o)},onremove:function(){document.removeEventListener("keydown",r),window.removeEventListener("resize",o)},view:function(e){return[a("div.overlay-wrap",a("div.overlay",{oncreate:function(e){i=e.dom,o()}},[a("span",{class:"close dashicons dashicons-no",title:l.close,onclick:n}),e.children])),a("div.overlay-background",{title:l.close,onclick:n})]}}}},{mithril:28}],12:[function(e,t,n){"use strict";function r(e){return(r="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)}var i=document.getElementById("mc4wp-admin").querySelectorAll(".mc4wp-list-input"),o=window.mc4wp_vars.mailchimp.lists,a=[],l={};function s(){return a=[],[].forEach.call(i,function(e){"boolean"==typeof e.checked&&!e.checked||"object"!==r(o[e.value])||a.push(o[e.value])}),function(){var e=document.querySelectorAll(".lists--only-selected > *");[].forEach.call(e,function(e){var t=0<function(t,n){return a.filter(function(e){return e[t]===n})}("id",e.getAttribute("data-list-id")).length;e.style.display=t?"":"none"})}(),function(e,t){l[e]=l[e]||[],l[e].forEach(function(e){return e.apply(null,t)})}("selectedLists.change",[a]),a}[].forEach.call(i,function(e){e.addEventListener("change",s)}),s(),t.exports={getSelectedLists:function(){return a},on:function(e,t){l[e]=l[e]||[],l[e].push(t)}}},{}],13:[function(e,t,n){"use strict";var r=e("./admin/form-editor/form-editor.js");e("./admin/form-editor/form-watcher.js"),e("./admin/form-editor/field-helper.js"),e("./admin/form-editor/field-manager.js"),e("./admin/notices.js"),window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=r},{"./admin/form-editor/field-helper.js":4,"./admin/form-editor/field-manager.js":5,"./admin/form-editor/form-editor.js":7,"./admin/form-editor/form-watcher.js":8,"./admin/notices.js":10}],14:[function(e,t,n){var r;r=function(w){w.defineOption("autoCloseTags",!1,function(e,t,n){if(n!=w.Init&&n&&e.removeKeyMap("autoCloseTags"),t){var r={name:"autoCloseTags"};"object"==typeof t&&!t.whenClosing||(r["'/'"]=function(e){return function(e){return e.getOption("disableInput")?w.Pass:i(e,!0)}(e)}),"object"==typeof t&&!t.whenOpening||(r["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return w.Pass;for(var t=e.listSelections(),n=[],r=e.getOption("autoCloseTags"),i=0;i<t.length;i++){if(!t[i].empty())return w.Pass;var o=t[i].head,a=e.getTokenAt(o),l=w.innerMode(e.getMode(),a.state),s=l.state,c=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(s),u=c&&c.name;if(!u)return w.Pass;var d="html"==l.mode.configuration,f="object"==typeof r&&r.dontCloseTags||d&&x,h="object"==typeof r&&r.indentTags||d&&k;a.end>o.ch&&(u=u.slice(0,u.length-a.end+o.ch));var p=u.toLowerCase();if(!u||"string"==a.type&&(a.end!=o.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||1==a.string.length)||"tag"==a.type&&c.close||a.string.indexOf("/")==o.ch-a.start-1||f&&-1<C(f,p)||T(e,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(s)||[],u,o,!0))return w.Pass;var m="object"==typeof r&&r.emptyTags;if(m&&-1<C(m,u))n[i]={text:"/>",newPos:w.Pos(o.line,o.ch+2)};else{var g=h&&-1<C(h,p);n[i]={indent:g,text:">"+(g?"\n\n":"")+"</"+u+">",newPos:g?w.Pos(o.line+1,0):w.Pos(o.line,o.ch+1)}}}var v="object"==typeof r&&r.dontIndentOnAutoClose;for(i=t.length-1;0<=i;i--){var y=n[i];e.replaceRange(y.text,t[i].head,t[i].anchor,"+insert");var b=e.listSelections().slice(0);b[i]={head:y.newPos,anchor:y.newPos},e.setSelections(b),!v&&y.indent&&(e.indentLine(y.newPos.line,null,!0),e.indentLine(y.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(r)}});var x=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 n=e.listSelections(),r=[],i=t?"/":"</",o=e.getOption("autoCloseTags"),a="object"==typeof o&&o.dontIndentOnSlash,l=0;l<n.length;l++){if(!n[l].empty())return w.Pass;var s=n[l].head,c=e.getTokenAt(s),u=w.innerMode(e.getMode(),c.state),d=u.state;if(t&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return w.Pass;var f,h="xml"!=u.mode.name&&"htmlmixed"==e.getMode().name;if(h&&"javascript"==u.mode.name)f=i+"script";else if(h&&"css"==u.mode.name)f=i+"style";else{var p=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(d);if(!p||p.length&&T(e,p,p[p.length-1],s))return w.Pass;f=i+p[p.length-1]}">"!=e.getLine(s.line).charAt(c.end)&&(f+=">"),r[l]=f}if(e.replaceSelections(r),n=e.listSelections(),!a)for(l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&e.indentLine(n[l].head.line)}function C(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function T(e,t,n,r,i){if(!w.scanForClosingTag)return!1;var o=Math.min(e.lastLine()+1,r.line+500),a=w.scanForClosingTag(e,r,null,o);if(!a||a.tag!=n)return!1;for(var l=i?1:0,s=t.length-1;0<=s&&t[s]==n;s--)++l;r=a.to;for(s=1;s<l;s++){var c=w.scanForClosingTag(e,r,null,o);if(!c||c.tag!=n)return!1;r=c.to}return!0}w.commands.closeTag=function(e){return i(e)}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../fold/xml-fold":17}],15:[function(e,t,n){var r;r=function(r){var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=r.Pos,v={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function y(e){return e&&e.bracketRegex||/[(){}[\]]/}function d(e,t,n){var r=e.getLineHandle(t.line),i=t.ch-1,o=n&&n.afterCursor;null==o&&(o=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var a=y(n),l=!o&&0<=i&&a.test(r.text.charAt(i))&&v[r.text.charAt(i)]||a.test(r.text.charAt(i+1))&&v[r.text.charAt(++i)];if(!l)return null;var s=">"==l.charAt(1)?1:-1;if(n&&n.strict&&0<s!=(i==t.ch))return null;var c=e.getTokenTypeAt(g(t.line,i+1)),u=f(e,g(t.line,i+(0<s?1:0)),s,c||null,n);return null==u?null:{from:g(t.line,i),to:u&&u.pos,match:u&&u.ch==l.charAt(0),forward:0<s}}function f(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,l=[],s=y(i),c=0<n?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=n){var d=e.getLine(u);if(d){var f=0<n?0:d.length-1,h=0<n?d.length:-1;if(!(d.length>o))for(u==t.line&&(f=t.ch-(n<0?1:0));f!=h;f+=n){var p=d.charAt(f);if(s.test(p)&&(void 0===r||e.getTokenTypeAt(g(u,f+1))==r)){var m=v[p];if(m&&">"==m.charAt(1)==0<n)l.push(p);else{if(!l.length)return{pos:g(u,f),ch:p};l.pop()}}}}}return u-n!=(0<n?e.lastLine():e.firstLine())&&null}function t(e,t,n){for(var r=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,n);if(l&&e.getLine(l.from.line).length<=r){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(l.from,g(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=r&&i.push(e.markText(l.to,g(l.to.line,l.to.ch+1),{className:s}))}}if(i.length){u&&e.state.focused&&e.focus();function c(){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)})}r.defineOption("matchBrackets",!1,function(e,t,n){n&&n!=r.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))}),r.defineExtension("matchBrackets",function(){t(this,!0)}),r.defineExtension("findMatchingBracket",function(e,t,n){return!n&&"boolean"!=typeof t||(t=n?(n.strict=t,n):t?{strict:!0}:null),d(this,e,t)}),r.defineExtension("scanForBracket",function(e,t,n,r){return f(this,e,t,n,r)})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],16:[function(e,t,n){var r;r=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 r(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 n=a.findMatchingTag(o,e,t);if(n){if(o.state.matchBothTags){var r="open"==n.at?n.open:n.close;r&&(o.state.tagHit=o.markText(r.from,r.to,{className:"CodeMirror-matchingtag"}))}var i="close"==n.at?n.open:n.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&r(e)}a.defineOption("matchTags",!1,function(e,t,n){n&&n!=a.Init&&(e.off("cursorActivity",r),e.off("viewportChange",i),l(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",r),e.on("viewportChange",i),r(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var n="close"==t.at?t.open:t.close;n&&e.extendSelection(n.to,n.from)}}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../fold/xml-fold":17}],17:[function(e,t,n){var r;r=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",r=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,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function i(e,t){var n=e.cm.getTokenTypeAt(s(e.line,t));return n&&/\btag\b/.test(n)}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 n=e.text.lastIndexOf("/",t),r=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"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)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){r.lastIndex=e.ch;var t=r.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 n=e.text.lastIndexOf("/",t),r=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function m(e,t){for(var n=[];;){var r,i=h(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(r=d(e)))return;if("selfClose"!=r)if(i[1]){for(var l=n.length-1;0<=l;--l)if(n[l]==i[2]){n.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 n.push(i[2])}}function g(e,t){for(var n=[];;){var r=p(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=f(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;0<=l;--l)if(n[l]==a[2]){n.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 n=new u(e,t.line,0);;){var r=h(n);if(!r||n.line!=t.line)return;var i=d(n);if(!i)return;if(!r[1]&&"selfClose"!=i){var o=s(n.line,n.ch),a=m(n,r[2]);return a&&0<c(a.from,o)?{from:o,to:a.from}:null}}}),e.findMatchingTag=function(e,t,n){var r=new u(e,t.line,t.ch,n);if(-1!=r.text.indexOf(">")||-1!=r.text.indexOf("<")){var i=d(r),o=i&&s(r.line,r.ch),a=i&&f(r);if(i&&a&&!(0<c(r,t))){var l={from:s(r.line,r.ch),to:o,tag:a[2]};return"selfClose"==i?{open:l,close:null,at:"open"}:a[1]?{open:g(r,a[2]),close:l,at:"close"}:{open:l,close:m(r=new u(e,o.line,o.ch,n),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new u(e,t.line,t.ch,n);;){var o=g(i,r);if(!o)break;var a=m(new u(e,t.line,t.ch,n),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,n,r){return m(new u(e,t.line,t.ch,r?{from:0,to:r}:null),n)}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],18:[function(e,t,n){var r;r=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 n=[],r=0;r<e.length;r++){var i=e[r],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);n[n.length-1]!=a&&n.push(a)}}!function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}(t.state.activeLines,n)&&t.operation(function(){u(t);for(var e=0;e<n.length;e++)t.addLineClass(n[e],"wrap",l),t.addLineClass(n[e],"background",s),t.addLineClass(n[e],"gutter",c);t.state.activeLines=n})}function a(e,t){o(e,t.ranges)}i.defineOption("styleActiveLine",!1,function(e,t,n){var r=n!=i.Init&&n;t!=r&&(r&&(e.off("beforeSelectionChange",a),u(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],19:[function(e,t,n){var r,i;r=this,i=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=n||r||i,k=x&&(n?document.documentMode||6:+(i||r)[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]))&&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 n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[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,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"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,n,r){var i=N(e,t,n,r);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 z(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?" ":"")+t)}function D(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=" "+n[r]);return t}S=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t=t||{},e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function j(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}u?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(P=function(e){try{e.select()}catch(e){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}W.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},W.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var R=30,B={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},U={origin:"*mouse"},K={origin:"+move"};function V(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||t<=i+a)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,t<=(i+=n-i%n))return r}}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 n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Z(){}function J(e,t){var n;return n=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&I(t,n),n}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 ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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)&&re.test(e)}function oe(e,t,n){for(;(n<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=n<t?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var le=null;function se(e,t,n){var r;le=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"==n?r=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:le=i)}return null!=r?r:le}var ce,ue,de,fe,he,pe,me,ge=(ce="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ue="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",de=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,fe=/[stwN]/,he=/[LRr]/,pe=/[Lb1n]/,me=/[1n]/,function(e,t){var n="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!de.test(e))return!1;for(var r,i=e.length,o=[],a=0;a<i;++a)o.push((r=e.charCodeAt(a))<=247?ce.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?ue.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L");for(var l=0,s=n;l<i;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=n;u<i;++u){var f=o[u];"1"==f&&"r"==d?o[u]="n":he.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=n;x<i;++x){var C=o[x];"L"==k&&"1"==C?o[x]="L":he.test(C)&&(k=C)}for(var T=0;T<i;++T)if(fe.test(o[T])){var S=void 0;for(S=T+1;S<i&&fe.test(o[S]);++S);for(var L="L"==(T?o[T-1]:n),M=L==("L"==(S<i?o[S]:n))?L?"L":"R":n,A=T;A<S;++A)o[A]=M;T=S-1}for(var O,N=[],_=0;_<i;)if(pe.test(o[_])){var E=_;for(++_;_<i&&pe.test(o[_]);++_);N.push(new ve(0,E,_))}else{var z=_,D=N.length,P="rtl"==t?1:0;for(++_;_<i&&"L"!=o[_];++_);for(var F=z;F<_;)if(me.test(o[F])){z<F&&(N.splice(D,0,new ve(1,z,F)),D+=P);var I=F;for(++F;F<_&&me.test(o[F]);++F);N.splice(D,0,new ve(2,I,F)),D+=P,z=F}else++F;z<_&&N.splice(D,0,new ve(1,z,_))}return"ltr"==t&&(1==N[0].level&&(O=e.match(/^\s+/))&&(N[0].from=O[0].length,N.unshift(new ve(0,0,O[0].length))),1==Y(N).level&&(O=e.match(/\s+$/))&&(Y(N).to-=O[0].length,N.push(new ve(0,i-O[0].length,i)))),"rtl"==t?N.reverse():N});function ve(e,t,n){this.level=e,this.from=t,this.to=n}function ye(e,t){var n=e.order;return null==n&&(n=e.order=ge(e.text,t)),n}var be=[],we=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||be).concat(n)}};function xe(e,t){return e._handlers&&e._handlers[t]||be}function ke(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);-1<o&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var n=xe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Te(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,n||t.type,e,t),Ne(t)||t.codemirrorIgnore}function Se(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function Le(e,t){return 0<xe(e,t).length}function Me(e){e.prototype.on=function(e,t){we(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _e(e){Ae(e),Oe(e)}function Ee(e){return e.target||e.srcElement}function ze(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 De,Pe,Fe=function(){if(x&&k<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Ie(e){if(null==De){var t=N("span","");A(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&k<8))}var n=De?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function je(e){if(null!=Pe)return Pe;var t=A(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return M(e),!(!n||n.left==n.right)&&(Pe=r.right-n.right<3)}var We,He=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){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?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Re=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)},Be="oncopy"in(We=N("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),qe=null;var Ue={},Ke={};function Ve(e){if("string"==typeof e&&Ke.hasOwnProperty(e))e=Ke[e];else if(e&&"string"==typeof e.name&&Ke.hasOwnProperty(e.name)){var t=Ke[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 Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Ve(t);var n=Ue[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if($e.hasOwnProperty(t.name)){var i=$e[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var $e={};function Ye(e,t){I(t,$e.hasOwnProperty(e)?$e[e]:$e[e]={})}function Xe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ze(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Je(e,t,n){return!e.startState||e.startState(t,n)}var Qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function et(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function tt(e,n,r){var i=[],o=n.line;return e.iter(n.line,r.line+1,function(e){var t=e.text;o==r.line&&(t=t.slice(0,r.ch)),o==n.line&&(t=t.slice(n.ch)),i.push(t),++o}),i}function nt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function rt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function it(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;r=(t=r).parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ot(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}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 n+a}function at(e,t){return t>=e.first&&t<e.first+e.size}function lt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function st(e,t,n){if(void 0===n&&(n=null),!(this instanceof st))return new st(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ut(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function dt(e){return st(e.line,e.ch)}function ft(e,t){return ct(e,t)<0?t:e}function ht(e,t){return ct(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function mt(e,t){if(t.line<e.first)return st(e.first,0);var n=e.first+e.size-1;return t.line>n?st(n,et(e,n).text.length):function(e,t){var n=e.ch;return null==n||t<n?st(e.line,t):n<0?st(e.line,0):e}(t,et(e,t.line).text.length)}function gt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=mt(e,t[r]);return n}Qe.prototype.eol=function(){return this.pos>=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qe.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},Qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&0<r.index?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}function i(e){return n?e.toLowerCase():e}if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var vt=function(e,t){this.state=e,this.lookAhead=t},yt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function bt(t,n,r,e){var s=[t.state.modeGen],i={};At(t,n.text,t.doc.mode,r,function(e,t){return s.push(e,t)},i,e);for(var c=r.state,o=function(e){r.baseTokens=s;var o=t.state.overlays[e],a=1,l=0;r.state=!0,At(t,n.text,o.mode,r,function(e,t){for(var n=a;l<e;){var r=s[a];e<r&&s.splice(a,1,e,s[a+1],r),a+=2,l=Math.min(e,r)}if(t)if(o.opaque)s.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n<a;n+=2){var i=s[n+1];s[n+1]=(i?i+" ":"")+"overlay "+t}},i),r.state=c,r.baseTokens=null,r.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:s,classes:i.bgClass||i.textClass?i:null}}function wt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=xt(e,it(t)),i=t.text.length>e.options.maxHighlightLength&&Xe(e.doc.mode,r.state),o=bt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xt(n,r,e){var t=n.doc,i=n.display;if(!t.mode.startState)return new yt(t,!0,r);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=et(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof vt?c.lookAhead:0)<=o.modeFrontier))return l;var u=j(s.text,null,e.options.tabSize);(null==i||u<r)&&(i=l-1,r=u)}return i}(n,r,e),a=o>t.first&&et(t,o-1).stateAfter,l=a?yt.fromSaved(t,a,o):new yt(t,Je(t.mode),o);return t.iter(o,r,function(e){kt(n,e.text,l);var t=l.line;e.stateAfter=t==r-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?l.save():null,l.nextLine()}),e&&(t.modeFrontier=l.line),l}function kt(e,t,n,r){var i=e.doc.mode,o=new Qe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&Ct(i,n.state);!o.eol();)Tt(i,o,n.state),o.start=o.pos}function Ct(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ze(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Tt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ze(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},yt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},yt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},yt.fromSaved=function(e,t,n){return t instanceof vt?new yt(e,Xe(e.mode,t.state),n,t.lookAhead):new yt(e,Xe(e.mode,t),n)},yt.prototype.save=function(e){var t=!1!==e?Xe(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new vt(t,this.maxLookAhead):t};var St=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Lt(e,t,n,r){var i,o,a=e.doc,l=a.mode,s=et(a,(t=mt(a,t)).line),c=xt(e,t.line,n),u=new Qe(s.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Tt(l,u,c.state),r&&o.push(new St(u,i,Xe(a.mode,c.state)));return r?o:new St(u,i,c.state)}function Mt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function At(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Qe(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&Mt(Ct(n,r.state),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&kt(e,t,r,d.pos),d.pos=t.length,null):Mt(Tt(n,d,r.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 Ot=!1,Nt=!1;function _t(e,t,n){this.marker=e,this.from=t,this.to=n}function Et(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n=n||[]).push(e[r]);return n}function Dt(e,t){if(t.full)return null;var n=at(e,t.from.line)&&et(e,t.from.line).markedSpans,r=at(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ct(t.from,t.to),l=function(e,t,n){var r;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&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r=r||[]).push(new _t(a,o.from,l?null:o.to))}}return r}(n,i,a),s=function(e,t,n){var r;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&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r=r||[]).push(new _t(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,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=Et(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)Et(l,m.marker)||(m.from=u,c&&(l=l||[]).push(m));else m.from+=u,c&&(l=l||[]).push(m)}l=l&&Pt(l),s&&s!=l&&(s=Pt(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 _t(l[b].marker,null,null));for(var w=0;w<y;++w)g.push(v);g.push(s)}return g}function Pt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ft(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function It(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function jt(e){return e.inclusiveLeft?-1:0}function Wt(e){return e.inclusiveRight?1:0}function Ht(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ct(r.from,i.from)||jt(e)-jt(t);if(o)return-o;var a=ct(r.to,i.to)||Wt(e)-Wt(t);return a||t.id-e.id}function Rt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Ht(n,i.marker)<0)&&(n=i.marker);return n}function Bt(e){return Rt(e,!0)}function qt(e){return Rt(e,!1)}function Ut(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ht(n,o.marker)<0)&&(n=o.marker)}return n}function Kt(e,t,n,r,i){var o=et(e,t),a=Nt&&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=ct(c.from,n)||jt(s.marker)-jt(i),d=ct(c.to,r)||Wt(s.marker)-Wt(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=ct(c.to,n):0<ct(c.to,n))||0<=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(c.from,r)<=0:ct(c.from,r)<0)))return!0}}}function Vt(e){for(var t;t=Bt(e);)e=t.find(-1,!0).line;return e}function Gt(e,t){var n=et(e,t),r=Vt(n);return n==r?t:it(r)}function $t(e,t){if(t>e.lastLine())return t;var n,r=et(e,t);if(!Yt(e,r))return t;for(;n=qt(r);)r=n.find(1,!0).line;return it(r)+1}function Yt(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Xt(e,t,r))return!0}}function Xt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Xt(e,r.line,Et(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.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==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Xt(e,t,i))return!0}function Zt(e){for(var t=0,n=(e=Vt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function Jt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Bt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=qt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Qt(e){var n=e.display,t=e.doc;n.maxLine=et(t,t.first),n.maxLineLength=Jt(n.maxLine),n.maxLineChanged=!0,t.iter(function(e){var t=Jt(e);t>n.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}var en=function(e,t,n){this.text=e,It(this,t),this.height=n?n(this):1};en.prototype.lineNo=function(){return it(this)},Me(en);var tn={},nn={};function rn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?nn:tn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var n=O("span",null,null,b?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,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;r.pos=0,r.addToken=ln,je(e.display.measure)&&(a=ye(o,e.doc.direction))&&(r.addToken=sn(r.addToken,a)),r.map=[],un(o,r,wt(e,o,t!=e.display.externalMeasured&&it(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=D(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=D(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ie(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function an(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,n,r,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(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+=1+h;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),n||r||i||u||o){var y=n||"";r&&(y+=r),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 sn(d,f){return function(e,t,n,r,i,o,a){n=n?n+" 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,n,r,i,o,a);d(e,t.slice(0,c.to-l),n,r,null,o,a),r=null,t=t.slice(c.to-l),l=c.to}}}function cn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",n.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function un(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)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<r.length;++w){var x=r[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||Ht(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)cn(t,0,y[S]);if(d&&(d.from||0)==p){if(cn(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=n[m++]),a=rn(n[m++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),rn(n[O+1],t.cm.options))}function dn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=qt(e);)e=t.find(1,!0).line,(n=n||[]).push(e);return n}(t),this.size=this.rest?it(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Yt(e,t)}function fn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new dn(e.doc,et(e.doc,o),o);r=o+a.size,i.push(a)}return i}var hn=null;var pn=null;function mn(e,t){var n=xe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);hn?r=hn.delayedCallbacks:pn?r=pn:(r=pn=[],setTimeout(gn,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},a=0;a<n.length;++a)o(a)}}function gn(){var e=pn;pn=null;for(var t=0;t<e.length;++t)e[t]()}function vn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?wn(e,t):"gutter"==o?kn(e,t,n,r):"class"==o?xn(e,t):"widget"==o&&Cn(e,t,r)}t.changes=null}function yn(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 bn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):on(e,t)}function wn(e,t){var n=t.text.className,r=bn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,xn(e,t)):n&&(t.text.className=n)}function xn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=yn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?yn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function kn(e,t,n,r){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=yn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.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=yn(t),l=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.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",lt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function Cn(e,t,n){t.alignable&&(t.alignable=null);for(var r=T("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Tn(e,t,n)}function Tn(e,t,n){if(Sn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Sn(e,t.rest[r],t,n,!1)}function Sn(e,t,n,r,i){if(t.widgets)for(var o=yn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Ln(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),mn(s,"redraw")}}function Ln(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Mn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function An(e,t){for(var n=Ee(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function On(e){return e.lineSpace.offsetTop}function Nn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function En(e){return R-e.display.nativeBarWidth}function zn(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function Dn(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Pn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(it(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fn(e,t,n,r){return Wn(e,jn(e,t),n,r)}function In(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[pr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function jn(e,t){var n=it(t),r=In(e,n);r&&!r.text?r=null:r&&r.changes&&(vn(e,r,n,cr(e)),e.curOp.forceUpdate=!0);var i=Pn(r=r||function(e,t){var n=it(t=Vt(t)),r=e.display.externalMeasured=new dn(e.doc,t,n);r.lineN=n;var i=r.built=on(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}(e,t),t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Wn(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&zn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){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-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Bn(t.map,n,r),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():qn(S(a,l,s).getClientRects(),r)).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!=qe)return qe;var t=A(e,N("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return qe=1<Math.abs(n.left-r.left)}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;0<l&&(c=r="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==r?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+sr(e.display),top:f.top,bottom:f.bottom}:Rn}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,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Hn,Rn={left:0,right:0,top:0,bottom:0};function Bn(e,t,n){for(var r,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(r=e[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function qn(e,t){var n=Rn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;0<=i&&(n=e[i]).left==n.right;i--);return n}function Un(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 Kn(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Un(e.display.view[t])}function Vn(e){Kn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Gn(){return a&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $n(){return a&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Mn(e.widgets[n]));return t}function Xn(e,t,n,r,i){if(!i){var o=Yn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r=r||"local";var a=Zt(t);if("local"==r?a+=On(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:$n());var s=l.left+("window"==r?0:Gn());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Zn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Gn(),i-=$n();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Jn(e,t,n,r,i){return Xn(e,r=r||et(e.doc,t.line),Fn(e,r,t.ch,i),n)}function Qn(r,e,i,o,a,l){function s(e,t){var n=Wn(r,a,e,t?"right":"left",l);return t?n.left=n.right:n.right=n.left,Xn(r,o,n,i)}o=o||et(r.doc,e.line),a=a||jn(r,o);var c=ye(o,r.doc.direction),t=e.ch,n=e.sticky;if(t>=o.text.length?(t=o.text.length,n="before"):t<=0&&(t=0,n="after"),!c)return s("before"==n?t-1:t,"before"==n);function u(e,t,n){return s(n?e-1:e,1==c[t].level!=n)}var d=se(c,t,n),f=le,h=u(t,d,"before"==n);return null!=f&&(h.other=u(t,f,"before"!=n)),h}function er(e,t){var n=0;t=mt(e.doc,t),e.options.lineWrapping||(n=sr(e.display)*t.ch);var r=et(e.doc,t.line),i=Zt(r)+On(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function tr(e,t,n,r,i){var o=st(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function nr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return tr(r.first,0,null,-1,-1);var i=ot(r,n),o=r.first+r.size-1;if(o<i)return tr(r.first+r.size-1,et(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=et(r,i);;){var l=ar(e,a,i,t,n),s=Ut(a,l.ch+(0<l.xRel||0<l.outside?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=et(r,i=c.line)}}function rr(t,e,n,r){r-=Yn(e);var i=e.text.length,o=ae(function(e){return Wn(t,n,e-1).bottom<=r},i,0);return{begin:o,end:i=ae(function(e){return Wn(t,n,e).top>r},o,i)}}function ir(e,t,n,r){return rr(e,t,n=n||jn(e,t),Xn(e,t,Wn(e,n,r),"line").top)}function or(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function ar(n,e,t,r,i){i-=Zt(e);var o=jn(n,e),a=Yn(e),l=0,s=e.text.length,c=!0,u=ye(e,n.doc.direction);if(u){var d=(n.options.lineWrapping?function(e,t,n,r,i,o,a){var l=rr(e,t,r,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=Wn(e,r,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(r,i,o,a,l,s,c){var e=ae(function(e){var t=l[e],n=1!=t.level;return or(Qn(r,st(o,n?t.to:t.from,n?"before":"after"),"line",i,a),s,c,!0)},0,l.length-1),t=l[e];if(0<e){var n=1!=t.level,u=Qn(r,st(o,n?t.from:t.to,n?"after":"before"),"line",i,a);or(u,s,c,!0)&&u.top>c&&(t=l[e-1])}return t})(n,e,t,o,u,r,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=Wn(n,o,e);return t.top+=a,t.bottom+=a,!!or(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(p=e,m=t),!0)},l,s),v=!1;if(m){var y=r-m.left<m.right-r,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":Wn(n,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Qn(n,st(t,g,h),"line",e,o);f=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return tr(t,g=oe(e.text,g,1),h,v,r-f)}function lr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Hn){Hn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hn.appendChild(document.createTextNode("x")),Hn.appendChild(N("br"));Hn.appendChild(document.createTextNode("x"))}A(e.measure,Hn);var n=Hn.offsetHeight/50;return 3<n&&(e.cachedTextHeight=n),M(e.measure),n||1}function sr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function cr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:ur(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ur(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function dr(r){var i=lr(r.display),o=r.options.lineWrapping,a=o&&Math.max(5,r.display.scroller.clientWidth/sr(r.display)-3);return function(e){if(Yt(r.doc,e))return 0;var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;n++)e.widgets[n].height&&(t+=e.widgets[n].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function fr(e){var t=e.doc,n=dr(e);t.iter(function(e){var t=n(e);t!=e.height&&rt(e,t)})}function hr(e,t,n,r){var i=e.display;if(!n&&"true"==Ee(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=nr(e,o,a);if(r&&0<c.xRel&&(s=et(e.doc,c.line).text).length==c.ch){var u=j(s,s.length,e.options.tabSize)-s.length;c=st(c.line,Math.max(0,Math.round((o-_n(e.display).left)/sr(e.display))-u))}return c}function pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function mr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r=r||0;var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&Gt(e.doc,t)<i.viewTo&&vr(e);else if(n<=i.viewFrom)Nt&&$t(e.doc,n+r)>i.viewFrom?vr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)vr(e);else if(t<=i.viewFrom){var o=yr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):vr(e)}else if(n>=i.viewTo){var a=yr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):vr(e)}else{var l=yr(e,t,t,-1),s=yr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(fn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):vr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function gr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[pr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function yr(e,t,n,r){var i,o=pr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<r){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;Gt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function br(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function wr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function xr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&kr(e,l.head,i),s||Tr(e,l,o)}}return r}function kr(e,t,n){var r=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Cr(e,t){return e.top-t.top||e.left-t.left}function Tr(a,e,t){var n=a.display,r=a.doc,i=document.createDocumentFragment(),o=_n(a.display),L=o.left,M=Math.max(n.sizerWidth,zn(a)-n.sizer.offsetLeft)-o.right,A="ltr"==r.direction;function O(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?M-e:n)+"px;\n height: "+(r-t)+"px"))}function l(n,y,b){var w,x,o=et(r,n),k=o.text.length;function C(e,t){return Jn(a,st(n,e),"div",o,t)}function T(e,t,n){var r=ir(a,o,null,e),i="ltr"==t==("after"==n)?"left":"right";return C("after"==n?r.begin:r.end-(/\s/.test(o.text.charAt(r.end-1))?2:1),i)[i]}var S=ye(o,r.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(S,y||0,null==b?k:b,function(e,t,n,r){var i="ltr"==n,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==r,u=!S||r==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,n,"before"),g=A?L:T(t,n,"after"),A&&s&&u?M:a.right):(p=A?T(e,n,"before"):L,m=!A&&l&&c?M:o.right,g=!A&&s&&u?L:a.left,A?T(t,n,"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||Cr(o,w)<0)&&(w=o),Cr(a,w)<0&&(w=a),(!x||Cr(o,x)<0)&&(x=o),Cr(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=et(r,s.line),d=et(r,c.line),f=Vt(u)==Vt(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 Sr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Lr(e){e.state.focused||(e.display.input.focus(),Ar(e))}function Mr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))},100)}function Ar(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,z(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()),Sr(e))}function Or(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ce(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 Nr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],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-n,n=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((.005<u||u<-.005)&&(rt(i.line,a),_r(i.line),i.rest))for(var d=0;d<i.rest.length;d++)_r(i.rest[d]);if(l>e.display.sizerWidth){var f=Math.ceil(l/sr(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function _r(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Er(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-On(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ot(t,r),a=ot(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?a=ot(t,Zt(et(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=ot(t,Zt(et(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function zr(e,t){var n=e.display,r=lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Dn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Nn(n),s=t.top<r,c=t.bottom>l-r;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:n.scroller.scrollLeft,f=zn(e)-(e.options.fixedGutter?n.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 Dr(e,t){null!=t&&(Ir(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pr(e){Ir(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Fr(e,t,n){null==t&&null==n||Ir(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ir(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,jr(e,er(e,t.from),er(e,t.to),t.margin))}function jr(e,t,n,r){var i=zr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Fr(e,i.scrollLeft,i.scrollTop)}function Wr(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||di(e,{top:t}),Hr(e,t,!0),m&&di(e),ai(e,100))}function Hr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Rr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,pi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Nn(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?n:0,docHeight:r,scrollHeight:r+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function qr(e,t,n){this.cm=n;var r=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");r.tabIndex=i.tabIndex=-1,e(r),e(i),we(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),we(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r: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=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qr.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 W,this.disableVert=new W},qr.prototype.enableZeroWidthBar=function(n,r,i){n.style.pointerEvents="auto",r.set(1e3,function e(){var t=n.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=n?n.style.pointerEvents="none":r.set(1e3,e)})},qr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};function Ur(){}function Kr(e,t){t=t||Br(e);var n=e.display.barWidth,r=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Nr(e),Vr(e,Br(e)),n=e.display.barWidth,r=e.display.barHeight}function Vr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ur.prototype.update=function(){return{bottom:0,right:0}},Ur.prototype.setScrollLeft=function(){},Ur.prototype.setScrollTop=function(){},Ur.prototype.clear=function(){};var Gr={native:qr,null:Ur};function $r(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&L(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Gr[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),we(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?Rr(n,e):Wr(n,e)},n),n.display.scrollbars.addClass&&z(n.display.wrapper,n.display.scrollbars.addClass)}var Yr=0;function Xr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yr},function(e){hn?hn.ops.push(e):e.ownsGroup=hn={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Zr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{hn=null,t(n)}}(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,n=0;n<t.length;n++)Jr(t[n]);for(var r=0;r<t.length;r++)(i=t[r]).updatedDisplay=i.mustUpdate&&ci(i.cm,i.update);var i;for(var o=0;o<t.length;o++)Qr(t[o]);for(var a=0;a<t.length;a++)ei(t[a]);for(var l=0;l<t.length;l++)ti(t[l])}(e)})}function Jr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Nr(t),e.barMeasure=Br(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-zn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ei(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),!e.updatedDisplay&&e.startHeight==t.doc.height||Kr(t,e.barMeasure),e.updatedDisplay&&hi(t,e.barMeasure),e.selectionChanged&&Sr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Lr(e.cm)}function ti(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ui(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Hr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Rr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!Te(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=N("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.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,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?st(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?st(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Qn(e,t),s=n&&n!=t?Qn(e,n):l,c=zr(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Wr(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(Rr(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return i}(t,mt(r,e.scrollToPos.from),mt(r,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||Ce(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Ce(o[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();Xr(e);try{return t()}finally{Zr(e)}}function ri(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xr(e);try{return t.apply(e,arguments)}finally{Zr(e)}}}function ii(e){return function(){if(this.curOp)return e.apply(this,arguments);Xr(this);try{return e.apply(this,arguments)}finally{Zr(this)}}}function oi(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Xr(e);try{return t.apply(this,arguments)}finally{Zr(e)}}}function ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(li,e))}function li(s){var c=s.doc;if(!(c.highlightFrontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=xt(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,n=e.text.length>s.options.maxHighlightLength?Xe(c.mode,d.state):null,r=bt(s,e,d,!0);n&&(d.state=n),e.styles=r.styles;var i=e.styleClasses,o=r.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&&kt(s,e.text,d),e.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>u)return ai(s,s.options.workDelay),!0}),c.highlightFrontier=d.line,c.modeFrontier=Math.max(c.modeFrontier,d.line),f.length&&ni(s,function(){for(var e=0;e<f.length;e++)gr(s,f[e],"text")})}}var si=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Er(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=zn(e),this.force=n,this.dims=cr(e),this.events=[]};function ci(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return vr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==br(e))return!1;mi(e)&&(vr(e),t.dims=cr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=Gt(e.doc,o),a=$t(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=fn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=fn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(pr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(fn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Zt(et(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=br(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=E();if(!t||!_(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return 4<s&&(n.lineDiv.style.display="none"),function(n,e,t){var r=n.display,i=n.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(e){var t=e.nextSibling;return b&&w&&n.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var s=r.view,c=r.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<H(d.changes,"gutter")&&(f=!1),vn(n,d,c,t)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(lt(n.options,c)))),a=d.node.nextSibling}else{var h=(g=c,v=t,void 0,y=bn(p=n,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),xn(p,m),kn(p,m,g,v),Tn(p,m,v),m.node);o.insertBefore(h,a)}c+=d.size}var p,m,g,v,y;for(;a;)a=l(a)}(e,n.updateLineNumbers,t.dims),4<s&&(n.lineDiv.style.display=""),n.renderedView=n.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(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ai(e,400)),!(n.updateLineNumbers=null)}function ui(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=zn(e))r&&(t.visible=Er(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Nn(e.display)-Dn(e),n.top)}),t.visible=Er(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ci(e,t))break;Nr(e);var i=Br(e);wr(e),Kr(e,i),hi(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 di(e,t){var n=new si(e,t);if(ci(e,n)){Nr(e),ui(e,n);var r=Br(e);wr(e),Kr(e,r),hi(e,r),n.finish()}}function fi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function hi(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+En(e)+"px"}function pi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ur(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function mi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=lt(e.options,t.first+t.size-1),r=e.display;if(n.length==r.lineNumChars)return!1;var i=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",fi(e.display),!0}function gi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function vi(e){var t=e.gutters,n=e.gutterSpecs;M(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(N("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&((e.lineGutter=l).style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",fi(e)}function yi(e){vi(e.display),mr(e),pi(e)}function bi(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=O("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[o],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: "+R+"px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),x&&k<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),b||m&&f||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=gi(r.gutters,r.lineNumbers),vi(i),n.init(i)}si.prototype.signal=function(e,t){Le(e,t)&&this.events.push(arguments)},si.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};var wi=0,xi=null;function ki(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Ci(e){var t=ki(e);return t.x*=xi,t.y*=xi,t}function Ti(e,t){var n=ki(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&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(r&&!m&&!g&&null!=xi)return i&&s&&Wr(e,Math.max(0,a.scrollTop+i*xi)),Rr(e,Math.max(0,a.scrollLeft+r*xi)),(!i||i&&s)&&Ae(t),void(o.wheelStartX=null);if(i&&null!=xi){var f=i*xi,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),di(e,{top:h,bottom:p})}wi<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(xi=(xi*wi+n)/(wi+1),++wi)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}x?xi=-.53:m?xi=15:a?xi=-.7:s&&(xi=-1/3);var Si=function(e,t){this.ranges=e,this.primIndex=t};Si.prototype.primary=function(){return this.ranges[this.primIndex]},Si.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 n=this.ranges[t],r=e.ranges[t];if(!ut(n.anchor,r.anchor)||!ut(n.head,r.head))return!1}return!0},Si.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Li(dt(this.ranges[t].anchor),dt(this.ranges[t].head));return new Si(e,this.primIndex)},Si.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Si.prototype.contains=function(e,t){t=t||e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(0<=ct(t,r.from())&&ct(e,r.to())<=0)return n}return-1};var Li=function(e,t){this.anchor=e,this.head=t};function Mi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return ct(e.from(),t.from())}),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ct(l.to(),a.from());if(r&&!a.empty()?0<s:0<=s){var c=ht(l.from(),a.from()),u=ft(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Li(d?u:c,d?c:u))}}return new Si(t,n)}function Ai(e,t){return new Si([new Li(e,t||e)],0)}function Oi(e){return e.text?st(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return Oi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Oi(t).ch-t.to.ch),st(n,r)}function _i(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Li(Ni(i.anchor,t),Ni(i.head,t)))}return Mi(e.cm,n,e.sel.primIndex)}function Ei(e,t,n){return e.line==t.line?st(n.line,e.ch-t.ch+n.ch):st(n.line+(e.line-t.line),e.ch)}function zi(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Di(e)}function Di(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,ai(e,100),e.state.modeGen++,e.curOp&&mr(e)}function Pi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fi(e,r,t,i){function o(e){return t?t[e]:null}function n(e,t,n){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ft(e),It(e,n);var i=r?r(e):1;i!=e.height&&rt(e,i)}(e,t,n,i),mn(e,"change",e,r)}function a(e,t){for(var n=[],r=e;r<t;++r)n.push(new en(c[r],o(r),i));return n}var l=r.from,s=r.to,c=r.text,u=et(e,l.line),d=et(e,s.line),f=Y(c),h=o(c.length-1),p=s.line-l.line;if(r.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Pi(e,r)){var m=a(0,c.length-1);n(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)n(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 en(f+u.text.slice(s.ch),h,i)),n(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,g)}else if(1==c.length)n(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{n(u,u.text.slice(0,l.ch)+c[0],o(0)),n(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)}mn(e,"change",e,r)}function Ii(e,l,s){!function e(t,n,r){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=n){var a=r&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function ji(e,t){if(t.cm)throw new Error("This document is already in use.");fr((e.doc=t).cm=e),zi(e),Wi(e),e.options.lineWrapping||Qt(e),e.options.mode=t.modeOption,mr(e)}function Wi(e){("rtl"==e.doc.direction?z:L)(e.display.lineDiv,"CodeMirror-rtl")}function Hi(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 Ri(e,t){var n={from:dt(t.from),to:Oi(t),text:tt(e,t.from,t.to)};return Vi(e,n,t.from.line,t.to.line+1),Ii(e,function(e){return Vi(e,n,t.from.line,t.to.line+1)},!0),n}function Bi(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function qi(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Bi(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))a=Y(o.changes),0==ct(t.from,t.to)&&0==ct(t.from,a.to)?a.to=Oi(t):o.changes.push(Ri(e,t));else{var s=Y(i.done);for(s&&s.ranges||Ki(e.sel,i.done),o={changes:[Ri(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(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ce(e,"historyAdded")}function Ui(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Ki(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function Ki(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vi(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Gi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t=t||e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function $i(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Gi(n[i]));return r}(e,t),r=Dt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[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&&(n[i]=a)}return n}function Yi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Si.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];r.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<H(t,Number(u[1]))&&(Y(l)[d]=c[d],delete c[d])}}}return r}function Xi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ct(t,i)<0;o!=ct(n,i)<0?(i=t,t=n):o!=ct(t,n)<0&&(t=n)}return new Li(i,t)}return new Li(n||t,t)}function Zi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),no(e,new Si([Xi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Xi(e.sel.ranges[o],t[o],null,i);no(e,Mi(e.cm,r,e.sel.primIndex),n)}function Qi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,no(e,Mi(e.cm,i,e.sel.primIndex),r)}function eo(e,t,n,r){no(e,Ai(t,n),r)}function to(e,t,n){var r=e.history.done,i=Y(r);i&&i.ranges?ro(e,r[r.length-1]=t,n):no(e,t,n)}function no(e,t,n){ro(e,t,n),Ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ro(e,t,n){(Le(e,"beforeSelectionChange")||e.cm&&Le(e.cm,"beforeSelectionChange"))&&(t=function(n,e,t){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new Li(mt(n,e[t].anchor),mt(n,e[t].head))},origin:t&&t.origin};return Ce(n,"beforeSelectionChange",n,r),n.cm&&Ce(n.cm,"beforeSelectionChange",n.cm,r),r.ranges!=e.ranges?Mi(n.cm,r.ranges,r.ranges.length-1):e}(e,t,n));var r=n&&n.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);io(e,ao(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Pr(e.cm)}function io(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),mn(e,"cursorActivity",e))}function oo(e){io(e,ao(e,e.sel,null,!1))}function ao(e,t,n,r){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=so(e,a.anchor,l&&l.anchor,n,r),c=so(e,a.head,l&&l.head,n,r);!i&&s==a.anchor&&c==a.head||((i=i||t.ranges.slice(0,o))[o]=new Li(s,c))}return i?Mi(e.cm,i,t.primIndex):t}function lo(e,t,n,r,i){var o=et(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(Ce(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(d=co(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=ct(d,n))&&(r<0?f<0:0<f))return lo(e,d,t,r,i)}var h=s.find(r<0?-1:1);return(r<0?c:u)&&(h=co(e,h,r,h.line==t.line?o:null)),h?lo(e,h,t,r,i):null}}return t}function so(e,t,n,r,i){var o=r||1,a=lo(e,t,n,o,i)||!i&&lo(e,t,n,o,!0)||lo(e,t,n,-o,i)||!i&&lo(e,t,n,-o,!0);return a||(e.cantEdit=!0,st(e.first,0))}function co(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?mt(e,st(t.line-1)):null:0<n&&t.ch==(r||et(e,t.line)).text.length?t.line<e.first+e.size-1?st(t.line+1,0):null:new st(t.line,t.ch+n)}function uo(e){e.setSelection(st(e.firstLine(),0),st(e.lastLine()),q)}function fo(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,n,r){e&&(o.from=mt(i,e)),t&&(o.to=mt(i,t)),n&&(o.text=n),void 0!==r&&(o.origin=r)}),Ce(i,"beforeChange",i,o),i.cm&&Ce(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function ho(e,t,n){if(e.cm){if(!e.cm.curOp)return ri(e.cm,ho)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"))||(t=fo(e,t,!0))){var r=Ot&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r=r||[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ct(c.to,l.from)<0||0<ct(c.from,l.to))){var u=[s,1],d=ct(c.from,l.from),f=ct(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(r)for(var i=r.length-1;0<=i;--i)po(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else po(e,t)}}function po(e,n){if(1!=n.text.length||""!=n.text[0]||0!=ct(n.from,n.to)){var t=_i(e,n);qi(e,n,t,e.cm?e.cm.curOp.id:NaN),vo(e,n,t,Dt(e,n));var r=[];Ii(e,function(e,t){t||-1!=H(r,e.history)||(xo(e.history,n),r.push(e.history)),vo(e,n,null,Dt(e,n))})}}function mo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,n=i.history,r=i.sel,l="undo"==o?n.done:n.undone,s="undo"==o?n.undone:n.done,c=0;c<l.length&&(a=l[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=l.length){for(n.lastOrigin=n.lastSelOrigin=null;;){if(!(a=l.pop()).ranges){if(t)return void l.push(a);break}if(Ki(a,s),e&&!a.equals(i.sel))return void no(i,a,{clearRedo:!1});r=a}var u=[];Ki(r,s),s.push({changes:u,generation:n.generation}),n.generation=a.generation||++n.maxGeneration;for(var d=Le(i,"beforeChange")||i.cm&&Le(i.cm,"beforeChange"),f=function(e){var n=a.changes[e];if(n.origin=o,d&&!fo(i,n,!1))return l.length=0,{};u.push(Ri(i,n));var t=e?_i(i,n):Y(l);vo(i,n,t,$i(i,n)),!e&&i.cm&&i.cm.scrollIntoView({from:n.from,to:Oi(n)});var r=[];Ii(i,function(e,t){t||-1!=H(r,e.history)||(xo(e.history,n),r.push(e.history)),vo(e,n,null,$i(e,n))})},h=a.changes.length-1;0<=h;--h){var p=f(h);if(p)return p.v}}}}function go(e,t){if(0!=t&&(e.first+=t,e.sel=new Si(X(e.sel.ranges,function(e){return new Li(st(e.anchor.line+t,e.anchor.ch),st(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)gr(e.cm,r,"gutter")}}function vo(e,t,n,r){if(e.cm&&!e.cm.curOp)return ri(e.cm,vo)(e,t,n,r);if(t.to.line<e.first)go(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);go(e,i),t={from:st(e.first,0),to:st(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:st(o,et(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tt(e,t.from,t.to),n=n||_i(e,t),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=it(Vt(et(r,o.line))),r.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0}));-1<r.sel.contains(t.from,t.to)&&Se(e);Fi(r,t,n,dr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(e){var t=Jt(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 n=e.first,r=t-1;n<r;r--){var i=et(e,r).stateAfter;if(i&&(!(i instanceof vt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}})(r,o.line),ai(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?mr(e):o.line!=a.line||1!=t.text.length||Pi(e.doc,t)?mr(e,o.line,a.line+1,c):gr(e,o.line,"text");var u=Le(e,"changes"),d=Le(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&mn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Fi(e,t,r),ro(e,n,q),e.cantEdit&&so(e,st(e.firstLine(),0))&&(e.cantEdit=!1)}}function yo(e,t,n,r,i){var o;ct(r=r||n,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ho(e,{from:n,to:r,text:t,origin:i})}function bo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function wo(e,t,n,r){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++)bo(o.ranges[l].anchor,t,n,r),bo(o.ranges[l].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=st(c.from.line+r,c.from.ch),c.to=st(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;wo(e.done,n,r,i),wo(e.undone,n,r,i)}function ko(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=et(e,pt(e,t)):i=it(t),null==i?null:(r(o,i)&&e.cm&&gr(e.cm,i,n),o)}function Co(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function To(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Li.prototype.from=function(){return ht(this.anchor,this.head)},Li.prototype.to=function(){return ft(this.anchor,this.head)},Li.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Co.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,(o=i).parent=null,Ft(o),mn(i,"delete")}var o;this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},To.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof Co))){var l=[];this.collapse(l),this.children=[new Co(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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&50<i.lines.length){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Co(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,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 To(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new To(e.children);(r.parent=e).children=[r,t],e=r}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};function So(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t}function Lo(e,t,n){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Dr(e,n)}So.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=it(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Mn(this);rt(n,Math.max(0,n.height-o)),e&&(ni(e,function(){Lo(e,n,-o),gr(e,r,"widget")}),mn(e,"lineWidgetCleared",e,this,r))}},So.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Mn(this)-t;i&&(Yt(this.doc,r)||rt(r,r.height+i),n&&ni(n,function(){n.curOp.forceUpdate=!0,Lo(n,r,i),mn(n,"lineWidgetChanged",n,e,it(r))}))},Me(So);var Mo=0,Ao=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Mo};function Oo(t,n,r,e,i){if(e&&e.shared)return function(e,n,r,i,o){(i=I(i)).shared=!1;var a=[Oo(e,n,r,i,o)],l=a[0],s=i.widgetNode;return Ii(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(Oo(e,mt(e,n),mt(e,r),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=Y(a)}),new No(a,l)}(t,n,r,e,i);if(t.cm&&!t.cm.curOp)return ri(t.cm,Oo)(t,n,r,e,i);var o=new Ao(t,i),a=ct(n,r);if(e&&I(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(Kt(t,n.line,n,r,o)||n.line!=r.line&&Kt(t,r.line,n,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nt=!0}o.addToHistory&&qi(t,{from:n,to:r,origin:"markText"},t.sel,NaN);var l,s=n.line,c=t.cm;if(t.iter(s,r.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&Vt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&rt(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new _t(o,s==n.line?n.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&t.iter(n.line,r.line+1,function(e){Yt(t,e)&&rt(e,0)}),o.clearOnEnter&&we(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ot=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++Mo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)mr(c,n.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=n.line;u<=r.line;u++)gr(c,u,"text");o.atomic&&oo(c.doc),mn(c,"markerAdded",c,o)}return o}Ao.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xr(e),Le(this,"clear")){var n=this.find();n&&mn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Et(a.markedSpans,this);e&&!this.collapsed?gr(e,it(a),"text"):e&&(null!=l.to&&(i=it(a)),null!=l.from&&(r=it(a))),a.markedSpans=zt(a.markedSpans,l),null==l.from&&this.collapsed&&!Yt(this.doc,a)&&e&&rt(a,lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Vt(this.lines[s]),u=Jt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&mr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oo(e.doc)),e&&mn(e,"markerCleared",e,this,r,i),t&&Zr(e),this.parent&&this.parent.clear()}},Ao.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Et(o.markedSpans,this);if(null!=a.from&&(n=st(t?o:it(o),a.from),-1==e))return n;if(null!=a.to&&(r=st(t?o:it(o),a.to),1==e))return r}return n&&{from:n,to:r}},Ao.prototype.changed=function(){var o=this,a=this.find(-1,!0),l=this,s=this.doc.cm;a&&s&&ni(s,function(){var e=a.line,t=it(a.line),n=In(s,t);if(n&&(Un(n),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Yt(l.doc,e)&&null!=l.height){var r=l.height;l.height=null;var i=Mn(l)-r;i&&rt(e,e.height+i)}mn(s,"markerChanged",s,o)})},Ao.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ao.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Me(Ao);var No=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function _o(e){return e.findMarks(st(e.first,0),e.clipPos(st(e.lastLine())),function(e){return e.parent})}function Eo(o){for(var e=function(e){var t=o[e],n=[t.primary.doc];Ii(t.primary.doc,function(e){return n.push(e)});for(var r=0;r<t.markers.length;r++){var i=t.markers[r];-1==H(n,i.doc)&&(i.parent=null,t.markers.splice(r--,1))}},t=0;t<o.length;t++)e(t)}No.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();mn(this,"clear")}},No.prototype.find=function(e,t){return this.primary.find(e,t)},Me(No);var zo=0,Do=function(e,t,n,r,i){if(!(this instanceof Do))return new Do(e,t,n,r,i);null==n&&(n=0),To.call(this,[new Co([new en("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=st(n,0);this.sel=Ai(o),this.history=new Hi(null),this.id=++zo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fi(this,{from:o,to:o,text:e}),no(this,Ai(o),q)};Do.prototype=J(To.prototype,{constructor:Do,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=nt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:oi(function(e){var t=st(this.first,0),n=this.first+this.size-1;ho(this,{from:t,to:st(n,et(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Fr(this.cm,0,0),no(this,Ai(t),q)}),replaceRange:function(e,t,n,r){yo(this,e,t=mt(this,t),n=n?mt(this,n):t,r)},getRange:function(e,t,n){var r=tt(this,mt(this,e),mt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e))return et(this,e)},getLineNumber:function(e){return it(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=et(this,e)),Vt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return mt(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:oi(function(e,t,n){eo(this,mt(this,"number"==typeof e?st(e,t||0):e),null,n)}),setSelection:oi(function(e,t,n){eo(this,mt(this,e),mt(this,t||e),n)}),extendSelection:oi(function(e,t,n){Zi(this,mt(this,e),t&&mt(this,t),n)}),extendSelections:oi(function(e,t){Ji(this,gt(this,e),t)}),extendSelectionsBy:oi(function(e,t){Ji(this,gt(this,X(this.sel.ranges,e)),t)}),setSelections:oi(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Li(mt(this,e[i].anchor),mt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),no(this,Mi(this.cm,r,t),n)}}),addSelection:oi(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Li(mt(this,e),mt(this,t||e))),no(this,Mi(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=tt(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=tt(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:oi(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=st(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ei(l.from,i,o),c=Ei(Oi(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],d=ct(u.head,u.anchor)<0;r[a]=new Li(d?c:s,d?s:c)}else r[a]=new Li(s,s)}return new Si(r,e.sel.primIndex)}(this,r,t),s=r.length-1;0<=s;s--)ho(this,r[s]);l?to(this,l):this.cm&&Pr(this.cm)}),undo:oi(function(){mo(this,"undo")}),redo:oi(function(){mo(this,"redo")}),undoSelection:oi(function(){mo(this,"undo",!0)}),redoSelection:oi(function(){mo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var t=this;this.history=new Hi(this.history.maxGeneration),Ii(this,function(e){return e.history=t.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Yi(this.history.done),undone:Yi(this.history.undone)}},setHistory:function(e){var t=this.history=new Hi(this.history.maxGeneration);t.done=Yi(e.done.slice(0),null,!0),t.undone=Yi(e.undone.slice(0),null,!0)},setGutterMarker:oi(function(e,n,r){return ko(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[n]=r)&&ne(t)&&(e.gutterMarkers=null),!0})}),clearGutter:oi(function(t){var n=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ko(n,e,"gutter",function(){return e.gutterMarkers[t]=null,ne(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!at(this,e))return null;if(!(e=et(this,t=e)))return null}else if(null==(t=it(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:oi(function(e,n,r){return ko(this,e,"gutter"==n?"gutter":"class",function(e){var t="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(e[t]){if(T(r).test(e[t]))return!1;e[t]+=" "+r}else e[t]=r;return!0})}),removeLineClass:oi(function(e,o,a){return ko(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",n=e[t];if(!n)return!1;if(null==a)e[t]=null;else{var r=n.match(T(a));if(!r)return!1;var i=r.index+r[0].length;e[t]=n.slice(0,r.index)+(r.index&&i!=n.length?" ":"")+n.slice(i)||null}return!0})}),addLineWidget:oi(function(e,t,n){return function(r,e,t,n){var i=new So(r,t,n),o=r.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ko(r,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==i.insertAt?t.push(i):t.splice(Math.min(t.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!Yt(r,e)){var n=Zt(e)<r.scrollTop;rt(e,e.height+Mn(i)),n&&Dr(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&mn(o,"lineWidgetAdded",o,i,"number"==typeof e?e:it(e)),i}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Oo(this,mt(this,e),mt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Oo(this,e=mt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=et(this,(e=mt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(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=mt(this,i),o=mt(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 n=0;n<t.length;n++){var r=t[n];null!=r.to&&s==i.line&&i.ch>=r.to||null==r.from&&s!=i.line||null!=r.from&&s==o.line&&r.from>=o.ch||a&&!a(r.marker)||l.push(r.marker.parent||r.marker)}++s}),l},getAllMarks:function(){var r=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;n<t.length;++n)null!=t[n].from&&r.push(t[n].marker)}),r},posFromIndex:function(n){var r,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(n<t)return r=n,!0;n-=t,++i}),mt(this,st(i,r))},indexFromPos:function(e){var t=(e=mt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Do(nt(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Do(nt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ct(o,a)){var l=Oo(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,_o(this)),r},unlinkDoc:function(e){if(e instanceof Na&&(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),Eo(_o(this));break}}if(e.history==this.history){var n=[e.id];Ii(e,function(e){return n.push(e.id)},!0),e.history=new Hi(null),e.history.done=Yi(this.history.done,n),e.history.undone=Yi(this.history.undone,n)}},iterLinkedDocs:function(e){Ii(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&function(e){ni(e,function(){Wi(e),mr(e)})}(this.cm))})}),Do.prototype.eachLine=Do.prototype.iter;var Po=0;function Fo(e){var r=this;if(Io(r),!Te(r,e)&&!An(r.display,e)){Ae(e),x&&(Po=+new Date);var t=hr(r,e,!0),n=e.dataTransfer.files;if(t&&!r.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(){++a==i&&ri(r,function(){var e={from:t=mt(r.doc,t),to:t,text:r.doc.splitLines(o.filter(function(e){return null!=e}).join(r.doc.lineSeparator())),origin:"paste"};ho(r.doc,e),to(r.doc,Ai(mt(r.doc,t),mt(r.doc,Oi(e))))})()},s=function(e,t){if(r.options.allowDropFileTypes&&-1==H(r.options.allowDropFileTypes,e.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[t]=e),l()},n.readAsText(e)}},c=0;c<n.length;c++)s(n[c],c);else{if(r.state.draggingText&&-1<r.doc.sel.contains(t))return r.state.draggingText(e),void setTimeout(function(){return r.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(r.state.draggingText&&!r.state.draggingText.copy&&(d=r.listSelections()),ro(r.doc,Ai(t,t)),d)for(var f=0;f<d.length;++f)yo(r.doc,"",d[f].anchor,d[f].head,"drag");r.replaceSelection(u,"around","paste"),r.display.input.focus()}}catch(e){}}}}function Io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function jo(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var e=0;e<n.length;e++)t(n[e])})}}var Wo=!1;function Ho(){Wo||(function(){var e;we(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,jo(Ro)},100))}),we(window,"blur",function(){return jo(Or)})}(),Wo=!0)}function Ro(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Bo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},qo=0;qo<10;qo++)Bo[qo+48]=Bo[qo+96]=String(qo);for(var Uo=65;Uo<=90;Uo++)Bo[Uo]=String.fromCharCode(Uo);for(var Ko=1;Ko<=12;Ko++)Bo[Ko+111]=Bo[Ko+63235]="F"+Ko;var Vo={};function Go(e){var t,n,r,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))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $o(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=X(n.split(" "),Go),o=0;o<i.length;o++){var a=void 0,l=void 0;a=o==i.length-1?(l=i.join(" "),r):(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[n]}for(var c in t)e[c]=t[c];return e}function Yo(e,t,n,r){var i=(t=Qo(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Yo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Yo(e,t.fallthrough[o],n,r);if(a)return a}}}function Xo(e){var t="string"==typeof e?e:Bo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Zo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Jo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var n=Bo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Zo(n,e,t))}function Qo(e){return"string"==typeof e?Vo[e]:e}function ea(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&ct(o.from,Y(r).to)<=0;){var a=r.pop();if(ct(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ni(t,function(){for(var e=r.length-1;0<=e;e--)yo(t.doc,"",r[e].from,r[e].to,"+delete");Pr(t)})}function ta(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function na(e,t,n){var r=ta(e,t.ch,n);return null==r?null:new st(t.line,r,n<0?"after":"before")}function ra(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ye(n,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=jn(t,n);a=i<0?n.text.length-1:0;var u=Wn(t,c,a).top;a=ae(function(e){return Wn(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=ta(n,a,1))}else a=i<0?l.to:l.from;return new st(r,a,s)}}return new st(r,i<0?n.text.length:0,i<0?"before":"after")}Vo.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"},Vo.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"},Vo.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"},Vo.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"]},Vo.default=w?Vo.macDefault:Vo.pcDefault;var ia={selectAll:uo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(n){return ea(n,function(e){if(e.empty()){var t=et(n.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<n.lastLine()?{from:e.head,to:st(e.head.line+1,0)}:{from:e.head,to:st(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return ea(t,function(e){return{from:st(e.from().line,0),to:mt(t.doc,st(e.to().line+1,0))}})},delLineLeft:function(e){return ea(e,function(e){return{from:st(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(n){return ea(n,function(e){var t=n.charCoords(e.head,"div").top+5;return{from:n.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(r){return ea(r,function(e){var t=r.charCoords(e.head,"div").top+5,n=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(st(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(st(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return oa(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return aa(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var n=et(e.doc,t),r=function(e){for(var t;t=qt(e);)e=t.find(1,!0).line;return e}(n);r!=n&&(t=it(r));return ra(!0,e,n,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div")},K)},goLineLeft:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5;return n.coordsChar({left:0,top:t},"div")},K)},goLineLeftSmart:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5,n=r.coordsChar({left:0,top:t},"div");return n.ch<r.getLine(n.line).search(/\S/)?aa(r,e.head):n},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=j(e.getLine(o.line),o.ch,r);t.push($(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return ni(a,function(){for(var e=a.listSelections(),t=[],n=0;n<e.length;n++)if(e[n].empty()){var r=e[n].head,i=et(a.doc,r.line).text;if(i)if(r.ch==i.length&&(r=new st(r.line,r.ch-1)),0<r.ch)r=new st(r.line,r.ch+1),a.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),st(r.line,r.ch-2),r,"+transpose");else if(r.line>a.doc.first){var o=et(a.doc,r.line-1).text;o&&(r=new st(r.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),st(r.line-1,o.length-1),r,"+transpose"))}t.push(new Li(r,r))}a.setSelections(t)})},newlineAndIndent:function(r){return ni(r,function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=r.listSelections();for(var n=0;n<e.length;n++)r.indentLine(e[n].from().line,null,!0);Pr(r)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function oa(e,t){var n=et(e.doc,t),r=Vt(n);return r!=n&&(t=it(r)),ra(!0,e,r,t,1)}function aa(e,t){var n=oa(e,t.line),r=et(e.doc,n.line),i=ye(r,e.doc.direction);if(i&&0!=i[0].level)return n;var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return st(n.line,a?0:o,n.sticky)}function la(e,t,n){if("string"==typeof t&&!(t=ia[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var sa=new W;function ca(e,t,n,r){var i=e.state.keySeq;if(i){if(Xo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:sa.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ua(e,i+" "+t,n,r))return!0}return ua(e,t,n,r)}function ua(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Yo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Yo(t,e.options.extraKeys,n,e)||Yo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&mn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Ae(n),Sr(e)),!!i}function da(t,e){var n=Jo(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?ca(t,"Shift-"+n,e,function(e){return la(t,e,!0)})||ca(t,n,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return la(t,e)}):ca(t,n,e,function(e){return la(t,e)}))}var fa=null;function ha(e){if(this.curOp.focus=E(),!Te(this,e)){x&&k<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var n=da(this,e);g&&(fa=n?t:null,!n&&88==t&&!Be&&(w?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),m&&!w&&!n&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),ke(document,"keyup",n),ke(document,"mouseover",n))}z(t,"CodeMirror-crosshair"),we(document,"keyup",n),we(document,"mouseover",n)}(this)}}function pa(e){16==e.keyCode&&(this.doc.sel.shift=!1),Te(this,e)}function ma(e){if(!(An(this.display,e)||Te(this,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var t=e.keyCode,n=e.charCode;if(g&&t==fa)return fa=null,void Ae(e);if(!g||e.which&&!(e.which<10)||!da(this,e)){var r=String.fromCharCode(null==n?t:n);"\b"==r||function(t,e,n){return ca(t,"'"+n+"'",e,function(e){return la(t,e,!0)})}(this,e,r)||this.display.input.onKeyPress(e)}}}var ga,va,ya=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ba(e){var t=this,n=t.display;if(!(Te(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,An(n,e))b||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));else if(!ka(t,e)){var r=hr(t,e),i=ze(e),o=r?function(e,t){var n=+new Date;return va&&va.compare(n,e,t)?(ga=va=null,"triple"):ga&&ga.compare(n,e,t)?(va=new ya(n,e,t),ga=null,"double"):(ga=new ya(n,e,t),va=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(n,e,r,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ca(n,Zo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=ia[e]),!e)return!1;var t=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),t=e(n,r)!=B}finally{n.state.suppressEdits=!1}return t})}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){x?setTimeout(F(Lr,e),0):e.curOp.focus=E();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=h?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}null!=i.extend&&!e.doc.extend||(i.extend=e.doc.extend||n.shiftKey);null==i.addNew&&(i.addNew=w?n.metaKey:n.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?n.altKey:n.ctrlKey));return i}(e,n,r),a=e.doc.sel;e.options.dragDrop&&Fe&&!e.isReadOnly()&&"single"==n&&-1<(i=a.contains(t))&&(ct((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ct(i.to(),t)||t.xRel<0)?function(t,n,r,i){var o=t.display,a=!1,l=ri(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,ke(o.wrapper.ownerDocument,"mouseup",l),ke(o.wrapper.ownerDocument,"mousemove",s),ke(o.scroller,"dragstart",c),ke(o.scroller,"drop",l),a||(Ae(e),i.addNew||Zi(t.doc,r,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(n.clientX-e.clientX)+Math.abs(n.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();we(o.wrapper.ownerDocument,"mouseup",l),we(o.wrapper.ownerDocument,"mousemove",s),we(o.scroller,"dragstart",c),we(o.scroller,"drop",l),Mr(t),setTimeout(function(){return o.input.focus()},20)}(e,r,t,o):function(g,e,v,y){var a=g.display,b=g.doc;Ae(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 Li(v,v)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new Li(v,v)),v=hr(g,e,!0,!0),x=-1;else{var n=wa(g,v,y.unit);w=y.extend?Xi(w,n.anchor,n.head,y.extend):n}y.addNew?-1==x?(x=t.length,no(b,Mi(g,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(no(b,Mi(g,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Qi(b,x,w,U):(no(b,new Si([w],x=0),U),k=b.sel);var C=v;function l(e){if(0!=ct(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],n=g.options.tabSize,r=j(et(b,v.line).text,v.ch,n),i=j(et(b,e.line).text,e.ch,n),o=Math.min(r,i),a=Math.max(r,i),l=Math.min(v.line,e.line),s=Math.min(g.lastLine(),Math.max(v.line,e.line));l<=s;l++){var c=et(b,l).text,u=V(c,o,n);o==a?t.push(new Li(st(l,u),st(l,u))):c.length>u&&t.push(new Li(st(l,u),st(l,V(c,a,n))))}t.length||t.push(new Li(v,v)),no(b,Mi(g,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var d,f=w,h=wa(g,e,y.unit),p=f.anchor;p=0<ct(h.anchor,p)?(d=h.head,ht(f.from(),h.anchor)):(d=h.anchor,ft(f.to(),h.head));var m=k.ranges.slice(0);m[x]=function(e,t){var n=t.anchor,r=t.head,i=et(e.doc,n.line);if(0==ct(n,r)&&n.sticky==r.sticky)return t;var o=ye(i);if(!o)return t;var a=se(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)s=0<(r.line-n.line)*("ltr"==e.doc.direction?1:-1);else{var u=se(o,r.ch,r.sticky),d=u-a||(r.ch-n.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 n.ch==p&&n.sticky==m?t:new Li(new st(n.line,p,m),r)}(g,new Li(mt(b,p),d)),no(b,Mi(g,m,x),U)}}var s=a.wrapper.getBoundingClientRect(),c=0;function r(e){g.state.selectingText=!1,c=1/0,e&&(Ae(e),a.input.focus()),ke(a.wrapper.ownerDocument,"mousemove",i),ke(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=ri(g,function(e){0!==e.buttons&&ze(e)?function e(t){var n=++c,r=hr(g,t,!0,"rectangle"==y.unit);if(r)if(0!=ct(r,C)){g.curOp.focus=E(),l(r);var i=Er(a,b);(r.line>=i.to||r.line<i.from)&&setTimeout(ri(g,function(){c==n&&e(t)}),150)}else{var o=t.clientY<s.top?-20:t.clientY>s.bottom?20:0;o&&setTimeout(ri(g,function(){c==n&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):r(e)}),o=ri(g,r);g.state.selectingText=o,we(a.wrapper.ownerDocument,"mousemove",i),we(a.wrapper.ownerDocument,"mouseup",o)}(e,r,t,o)}(t,r,o,e):Ee(e)==n.scroller&&Ae(e):2==i?(r&&Zi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?t.display.input.onContextMenu(e):Mr(t)))}}function wa(e,t,n){if("char"==n)return new Li(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Li(st(t.line,0),mt(e.doc,st(t.line+1,0)));var r=n(e,t);return new Li(r.from,r.to)}function xa(e,t,n,r){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;r&&Ae(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Le(e,n))return Ne(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return Ce(e,n,e,ot(e.doc,o),e.display.gutterSpecs[s].className,t),Ne(t)}}function ka(e,t){return xa(e,t,"gutterClick",!0)}function Ca(e,t){An(e.display,t)||function(e,t){return!!Le(e,"gutterContextMenu")&&xa(e,t,"gutterContextMenu",!1)}(e,t)||Te(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function Ta(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vn(e)}ya.prototype.compare=function(e,t,n){return this.time+400>e&&0==ct(t,this.pos)&&n==this.button};var Sa={toString:function(){return"CodeMirror.Init"}},La={},Ma={};function Aa(e,t,n){if(!t!=!(n&&n!=Sa)){var r=e.display.dragFunctions,i=t?we:ke;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Oa(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),Qt(e)),fr(e),mr(e),Vn(e),setTimeout(function(){return Kr(e)},100)}function Na(e,t){var n=this;if(!(this instanceof Na))return new Na(e,t);this.options=t=t?I(t):{},I(La,t,!1);var r=t.value;"string"==typeof r?r=new Do(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Na.inputStyles[t.inputStyle](this),o=this.display=new bi(e,r,i,t);for(var a in Ta(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(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 W,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&k<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(i){var o=i.display;we(o.scroller,"mousedown",ri(i,ba)),we(o.scroller,"dblclick",x&&k<11?ri(i,function(e){if(!Te(i,e)){var t=hr(i,e);if(t&&!ka(i,e)&&!An(i.display,e)){Ae(e);var n=i.findWordAt(t);Zi(i.doc,n.anchor,n.head)}}}):function(e){return Te(i,e)||Ae(e)});we(o.scroller,"contextmenu",function(e){return Ca(i,e)}),we(o.input.getField(),"contextmenu",function(e){o.scroller.contains(e.target)||Ca(i,e)});var n,r={end:0};function a(){o.activeTouch&&(n=setTimeout(function(){return o.activeTouch=null},1e3),(r=o.activeTouch).end=+new Date)}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return 400<n*n+r*r}we(o.scroller,"touchstart",function(e){if(!Te(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ka(i,e)){o.input.ensurePolled(),clearTimeout(n);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-r.end<=300?r:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),we(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),we(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!An(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var n,r=i.coordsChar(o.activeTouch,"page");n=!t.prev||l(t,t.prev)?new Li(r,r):!t.prev.prev||l(t,t.prev.prev)?i.findWordAt(r):new Li(st(r.line,0),mt(i.doc,st(r.line+1,0))),i.setSelection(n.anchor,n.head),i.focus(),Ae(e)}a()}),we(o.scroller,"touchcancel",a),we(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Wr(i,o.scroller.scrollTop),Rr(i,o.scroller.scrollLeft,!0),Ce(i,"scroll",i))}),we(o.scroller,"mousewheel",function(e){return Ti(i,e)}),we(o.scroller,"DOMMouseScroll",function(e){return Ti(i,e)}),we(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){Te(i,e)||_e(e)},over:function(e){Te(i,e)||(function(e,t){var n=hr(e,t);if(n){var r=document.createDocumentFragment();kr(e,n,r),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,r)}}(i,e),_e(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||+new Date-Po<100))_e(t);else if(!Te(e,t)&&!An(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),g&&n.parentNode.removeChild(n)}}(i,e)},drop:ri(i,Fo),leave:function(e){Te(i,e)||Io(i)}};var e=o.input.getField();we(e,"keyup",function(e){return pa.call(i,e)}),we(e,"keydown",ri(i,ha)),we(e,"keypress",ri(i,ma)),we(e,"focus",function(e){return Ar(i,e)}),we(e,"blur",function(e){return Or(i,e)})}(this),Ho(),Xr(this),this.curOp.forceUpdate=!0,ji(this,r),t.autofocus&&!f||this.hasFocus()?setTimeout(F(Ar,this),20):Or(this),Ma)Ma.hasOwnProperty(a)&&Ma[a](this,t[a],Sa);mi(this),t.finishInit&&t.finishInit(this);for(var l=0;l<_a.length;++l)_a[l](this);Zr(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Na.defaults=La,Na.optionHandlers=Ma;var _a=[];function Ea(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=xt(e,t).state:n="prev");var a=e.options.tabSize,l=et(o,t),s=j(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==B||150<c)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(et(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),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 yo(o,d,st(t,0),st(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=st(t,u.length);Qi(o,p,new Li(g,g));break}}}Na.defineInitHook=function(e){return _a.push(e)};var za=null;function Da(e){za=e}function Pa(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r=r||o.sel;var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=He(t),c=null;if(l&&1<r.ranges.length)if(za&&za.text.join("\n")==t){if(r.ranges.length%za.text.length==0){c=[];for(var u=0;u<za.text.length;u++)c.push(o.splitLines(za.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,function(e){return[e]}));for(var d=e.curOp.updateInput,f=r.ranges.length-1;0<=f;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&0<n?p=st(p.line,p.ch-n):e.state.overwrite&&!l?m=st(m.line,Math.min(et(o,m.line).text.length,m.ch+Y(s).length)):l&&za&&za.lineWise&&za.text.join("\n")==t&&(p=m=st(p.line,0)));var g={from:p,to:m,text:c?c[f%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};ho(e.doc,g),mn(e,"inputRead",e,g)}t&&!l&&Ia(e,t),Pr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ni(t,function(){return Pa(t,n,0,null,"paste")}),!0}function Ia(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;0<=r;r--){var i=n.ranges[r];if(!(100<i.head.ch||r&&n.ranges[r-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=Ea(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(et(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ea(e,i.head.line,"smart"));a&&mn(e,"electricInput",e,i.head.line)}}}function ja(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:st(i,0),head:st(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Wa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ha(){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"),Wa(e),t}function Ra(n,r,i,e,o){var t=r,a=i,l=et(n,r.line),s=o&&"rtl"==n.direction?-i:i;function c(e){var t;if(null==(t=o?function(t,n,l,e){var s=ye(n,t.doc.direction);if(!s)return na(n,l,e);l.ch>=n.text.length?(l.ch=n.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var r=se(s,l.ch,l.sticky),i=s[r];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>l.ch:i.from<l.ch))return na(n,l,e);function c(e,t){return ta(n,e instanceof st?e.ch:e,t)}function o(e){return t.options.lineWrapping?(a=a||jn(t,n),ir(t,n,a,e)):{begin:0,end:n.text.length}}var a,u=o("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 st(l.line,f,h)}}function p(e,t,n){for(var r=function(e,t){return t?new st(l.line,c(e,1),"before"):new st(l.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),a=o?n.begin:c(n.end,-1);if(i.from<=a&&a<i.to)return r(a,o);if(a=o?i.from:c(i.to,-1),n.begin<=a&&a<n.end)return r(a,o)}}var m=p(r+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==n.text.length||!(m=p(0<e?0:s.length-1,e,o(g)))?null:m}(n.cm,l,r,i):na(l,r,i))){if(e||!function(){var e=r.line+s;return!(e<n.first||e>=n.first+n.size)&&(r=new st(e,r.ch,r.sticky),l=et(n,e))}())return!1;r=ra(o,n.cm,l,r.line,s)}else r=t;return!0}if("char"==e)c();else if("column"==e)c(!0);else if("word"==e||"group"==e)for(var u=null,d="group"==e,f=n.cm&&n.cm.getHelper(r,"wordChars"),h=!0;!(i<0)||c(!h);h=!1){var p=l.text.charAt(r.ch)||"\n",m=te(p,f)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||h||m||(m="s"),u&&u!=m){i<0&&(i=1,c(),r.sticky="after");break}if(m&&(u=m),0<i&&!c(!h))break}var g=so(n,r,t,a,!0);return ut(t,g)&&(g.hitSide=!0),g}function Ba(e,t,n,r){var i,o,a=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*lr(e.display),3);i=(0<n?t.bottom:t.top)+n*c}else"line"==r&&(i=0<n?t.bottom+3:t.top-3);for(;(o=nr(e,l,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}function qa(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Ua(e,t){var n=In(e,t.line);if(!n||n.hidden)return null;var r=et(e.doc,t.line),i=Pn(n,r,t.line),o=ye(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var l=Bn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ka(e,t){return t&&(e.bad=!0),e}function Va(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ka(e.clipPos(st(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ga(o,t,n)}}function Ga(c,e,t){var n=c.text.firstChild,r=!1;if(!e||!_(n,e))return Ka(st(it(c.line),0),!0);if(e==n&&(r=!0,e=n.childNodes[t],t=0,!e)){var i=c.rest?Y(c.rest):c.line;return Ka(st(it(i),i.text.length),r)}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!=n;)a=a.parentNode;var u=c.measure,d=u.maps;function l(e,t,n){for(var r=-1;r<(d?d.length:0);r++)for(var i=r<0?u.map:d[r],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=it(r<0?c.line:c.rest[r]),s=i[o]+n;return(n<0||a!=e)&&(s=i[o+(n?1:0)]),st(l,s)}}}var s=l(o,a,t);if(s)return Ka(s,r);for(var f=a.nextSibling,h=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(s=l(f,f.firstChild,0))return Ka(st(s.line,s.ch-h),r);h+=f.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(s=l(p,p.firstChild,-1))return Ka(st(s.line,s.ch+m),r);m+=p.textContent.length}}qa.prototype.init=function(e){var t=this,a=this,l=a.cm,s=a.div=e.lineDiv;function n(e){if(!Te(l,e)){if(l.somethingSelected())Da({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=ja(l);Da({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 n=za.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var r=Ha(),i=r.firstChild;l.display.lineSpace.insertBefore(r,l.display.lineSpace.firstChild),i.value=za.text.join("\n");var o=document.activeElement;P(i),setTimeout(function(){l.display.lineSpace.removeChild(r),o.focus(),o==s&&a.showPrimarySelection()},50)}}Wa(s,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),we(s,"paste",function(e){Te(l,e)||Fa(e,l)||k<=11&&setTimeout(ri(l,function(){return t.updateFromDOM()}),20)}),we(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),we(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),we(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(s,"touchstart",function(){return a.forceCompositionEnd()}),we(s,"input",function(){t.composing||t.readFromDOMSoon()}),we(s,"copy",n),we(s,"cut",n)},qa.prototype.prepareSelection=function(){var e=xr(this.cm,!1);return e.focus=document.activeElement==this.div,e},qa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},qa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Va(t,e.anchorNode,e.anchorOffset),a=Va(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ct(ht(o,a),r)||0!=ct(ft(o,a),i)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Ua(t,r)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ua(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()}}},qa.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)},qa.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},qa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},qa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},qa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},qa.prototype.blur=function(){this.div.blur()},qa.prototype.getField=function(){return this.div},qa.prototype.supportsTouch=function(){return!0},qa.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():ni(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},qa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},qa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(d&&a&&this.cm.display.gutterSpecs.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 n=Va(t,e.anchorNode,e.anchorOffset),r=Va(t,e.focusNode,e.focusOffset);n&&r&&ni(t,function(){no(t.doc,Ai(n,r),q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},qa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=st(a.line-1,et(r.doc,a.line-1).length)),l.ch==et(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=st(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;n=a.line==i.viewFrom||0==(e=pr(r,a.line))?(t=it(i.view[0].line),i.view[0].node):(t=it(i.view[e].line),i.view[e-1].node.nextSibling);var s,c,u=pr(r,l.line);if(c=u==i.view.length-1?(s=i.viewTo-1,i.lineDiv.lastChild):(s=it(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(l,e,t,s,c){var n="",u=!1,d=l.doc.lineSeparator(),f=!1;function h(){u&&(n+=d,f&&(n+=d),u=f=!1)}function p(e){e&&(h(),n+=e)}function m(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void p(t);var n,r=e.getAttribute("cm-marker");if(r){var i=l.findMarks(st(s,0),st(c+1,0),function(t){return function(e){return e.id==t}}(+r));return void(i.length&&(n=i[0].find(0))&&p(tt(l.doc,n.from,n.to).join(d)))}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&&h();for(var a=0;a<e.childNodes.length;a++)m(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(f=!0),o&&(u=!0)}else 3==e.nodeType&&p(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;m(e),e!=t;)e=e.nextSibling,f=!1;return n}(r,n,c,t,s)),f=tt(r.doc,st(t,0),st(s,et(r.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=st(t,h),k=st(s,f.length?Y(f).length-p:0);return 1<d.length||d[0]||ct(x,k)?(yo(r.doc,d,x,k,"+input"),!0):void 0},qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},qa.prototype.reset=function(){this.forceCompositionEnd()},qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qa.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))},qa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ni(this.cm,function(){return mr(e.cm)})},qa.prototype.setUneditable=function(e){e.contentEditable="false"},qa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ri(this.cm,Pa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},qa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},qa.prototype.onContextMenu=function(){},qa.prototype.resetPosition=function(){},qa.prototype.needsContentAttribute=!0;function $a(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null}var Ya,Xa,Za,Ja,Qa;function el(e,t,r,n){Ya.defaults[e]=t,r&&(Xa[e]=n?function(e,t,n){n!=Sa&&r(e,t,n)}:r)}$a.prototype.init=function(n){var e=this,r=this,i=this.cm;this.createField(n);var o=this.textarea;function t(e){if(!Te(i,e)){if(i.somethingSelected())Da({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=ja(i);Da({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,q):(r.prevInput="",o.value=t.text.join("\n"),P(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild),u&&(o.style.width="0px"),we(o,"input",function(){x&&9<=k&&e.hasSelection&&(e.hasSelection=null),r.poll()}),we(o,"paste",function(e){Te(i,e)||Fa(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())}),we(o,"cut",t),we(o,"copy",t),we(n.scroller,"paste",function(e){if(!An(n,e)&&!Te(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),we(n.lineSpace,"selectstart",function(e){An(n,e)||Ae(e)}),we(o,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),we(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},$a.prototype.createField=function(e){this.wrapper=Ha(),this.textarea=this.wrapper.firstChild},$a.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=xr(e);if(e.options.moveInputWithCursor){var i=Qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},$a.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")},$a.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),x&&9<=k&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",x&&9<=k&&(this.hasSelection=null))}},$a.prototype.getField=function(){return this.textarea},$a.prototype.supportsTouch=function(){return!1},$a.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},$a.prototype.blur=function(){this.textarea.blur()},$a.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$a.prototype.receivedFocus=function(){this.slowPoll()},$a.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$a.prototype.fastPoll=function(){var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,function e(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))})},$a.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Re(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!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||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return ni(t,function(){Pa(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?n.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},$a.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$a.prototype.onKeyPress=function(){x&&9<=k&&(this.hasSelection=null),this.fastPoll()},$a.prototype.onContextMenu=function(e){var n=this,r=n.cm,i=r.display,o=n.textarea;n.contextMenuPending&&n.contextMenuPending();var t=hr(r,e),a=i.scroller.scrollTop;if(t&&!g){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(t)&&ri(r,no)(r.doc,Ai(t),q);var l,s=o.style.cssText,c=n.wrapper.style.cssText,u=n.wrapper.offsetParent.getBoundingClientRect();if(n.wrapper.style.cssText="position: static",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&&(l=window.scrollY),i.input.focus(),b&&window.scrollTo(null,l),i.input.reset(),r.somethingSelected()||(o.value=n.prevInput=" "),n.contextMenuPending=h,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=k&&f(),C){_e(e);var d=function(){ke(window,"mouseup",d),setTimeout(h,20)};we(window,"mouseup",d)}else setTimeout(h,50)}function f(){if(null!=o.selectionStart){var e=r.somethingSelected(),t=""+(e?o.value:"");o.value="⇚",o.value=t,n.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=r.doc.sel}}function h(){if(n.contextMenuPending==h&&(n.contextMenuPending=!1,n.wrapper.style.cssText=c,o.style.cssText=s,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==r.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==n.prevInput?ri(r,uo)(r):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},$a.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},$a.prototype.setUneditable=function(){},$a.prototype.needsContentAttribute=!1,Xa=(Ya=Na).optionHandlers,Ya.defineOption=el,Ya.Init=Sa,el("value","",function(e,t){return e.setValue(t)},!0),el("mode",null,function(e,t){e.doc.modeOption=t,zi(e)},!0),el("indentUnit",2,zi,!0),el("indentWithTabs",!1),el("smartIndent",!0),el("tabSize",4,function(e){Di(e),Vn(e),mr(e)},!0),el("lineSeparator",null,function(e,r){if(e.doc.lineSep=r){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var n=e.text.indexOf(r,t);if(-1==n)break;t=n+r.length,i.push(st(o,n))}o++});for(var t=i.length-1;0<=t;t--)yo(e.doc,r,i[t],st(i[t].line,i[t].ch+r.length))}}),el("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Sa&&e.refresh()}),el("specialCharPlaceholder",an,function(e){return e.refresh()},!0),el("electricChars",!0),el("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),el("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),el("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),el("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),el("rtlMoveVisually",!p),el("wholeLineUpdateBefore",!0),el("theme","default",function(e){Ta(e),yi(e)},!0),el("keyMap","default",function(e,t,n){var r=Qo(t),i=n!=Sa&&Qo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),el("extraKeys",null),el("configureMouse",null),el("lineWrapping",!1,Oa,!0),el("gutters",[],function(e,t){e.display.gutterSpecs=gi(t,e.options.lineNumbers),yi(e)},!0),el("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ur(e.display)+"px":"0",e.refresh()},!0),el("coverGutterNextToScrollbar",!1,function(e){return Kr(e)},!0),el("scrollbarStyle","native",function(e){$r(e),Kr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),el("lineNumbers",!1,function(e,t){e.display.gutterSpecs=gi(e.options.gutters,t),yi(e)},!0),el("firstLineNumber",1,yi,!0),el("lineNumberFormatter",function(e){return e},yi,!0),el("showCursorWhenSelecting",!1,wr,!0),el("resetSelectionOnContextMenu",!0),el("lineWiseCopyCut",!0),el("pasteLinesPerSelection",!0),el("selectionsMayTouch",!1),el("readOnly",!1,function(e,t){"nocursor"==t&&(Or(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),el("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),el("dragDrop",!0,Aa),el("allowDropFileTypes",null),el("cursorBlinkRate",530),el("cursorScrollMargin",0),el("cursorHeight",1,wr,!0),el("singleCursorHeightPerLine",!0,wr,!0),el("workTime",100),el("workDelay",100),el("flattenSpans",!0,Di,!0),el("addModeClass",!1,Di,!0),el("pollInterval",100),el("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),el("historyEventDelay",1250),el("viewportMargin",10,function(e){return e.refresh()},!0),el("maxHighlightLength",1e4,Di,!0),el("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),el("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),el("autofocus",null),el("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),el("phrases",null),Ja=(Za=Na).optionHandlers,Qa=Za.helpers={},Za.prototype={constructor:Za,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,Ja.hasOwnProperty(e)&&ri(this,Ja[e])(this,t,r),Ce(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"](Qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ii(function(e,t){var n=e.token?e:Za.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:n,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,mr(this)}),removeOverlay:ii(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void mr(this)}}),indentLine:ii(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),at(this.doc,e)&&Ea(this,e,t,n)}),indentSelection:ii(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ea(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Pr(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)Ea(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&0<c[r].from().ch&&Qi(this.doc,r,new Li(o,c[r].to()),q)}}}),getTokenAt:function(e,t){return Lt(this,e,t)},getLineTokens:function(e,t){return Lt(this,st(e),t,!0)},getTokenTypeAt:function(e){e=mt(this.doc,e);var t,n=wt(this,et(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=1+a}}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?Za.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!Qa.hasOwnProperty(t))return n;var r=Qa[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var l=0;l<r._global.length;l++){var s=r._global[l];s.pred(i,this)&&-1==H(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;return xt(this,(e=pt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Qn(this,null==e?n.head:"object"==typeof e?mt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Jn(this,mt(this.doc,e),t||"page")},coordsChar:function(e,t){return nr(this,(e=Zn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Zn(this,{top:e,left:0},t||"page").top,ot(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,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),r=et(this.doc,e)}else r=e;return Xn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Zt(r):0)},defaultTextHeight:function(){return lr(this.display)},defaultCharWidth:function(){return sr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=Qn(this,mt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&function(e,t){var n=zr(e,t);null!=n.scrollTop&&Wr(e,n.scrollTop),null!=n.scrollLeft&&Rr(e,n.scrollLeft)}(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:ii(ha),triggerOnKeyPress:ii(ma),triggerOnKeyUp:pa,triggerOnMouseDown:ii(ba),execCommand:function(e){if(ia.hasOwnProperty(e))return ia[e].call(null,this)},triggerElectric:ii(function(e){Ia(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=mt(this.doc,e),a=0;a<t&&!(o=Ra(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ii(function(t,n){var r=this;this.extendSelectionsBy(function(e){return r.display.shift||r.doc.extend||e.empty()?Ra(r.doc,e.head,t,n,r.options.rtlMoveVisually):t<0?e.from():e.to()},K)}),deleteH:ii(function(n,r){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):ea(this,function(e){var t=Ra(i,e.head,n,r,!1);return n<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=mt(this.doc,e),l=0;l<t;++l){var s=Qn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Ba(this,s,i,n)).hitSide)break}return a},moveV:ii(function(r,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 r<0?e.from():e.to();var t=Qn(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var n=Ba(o,t,r,i);return"page"==i&&e==a.sel.primary()&&Dr(o,Jn(o,n,"div").top-t.top),n},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=et(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),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<n&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new Li(st(e.line,n),st(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii(function(e,t){Fr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:Dn(this),clientWidth:zn(this)}},scrollIntoView:ii(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:st(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?function(e,t){Ir(e),e.curOp.scrollToPos=t}(this,e):jr(this,e.from,e.to,e.margin)}),setSize:ii(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Kn(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){gr(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(e){return ni(this,e)},startOperation:function(){return Xr(this)},endOperation:function(){return Zr(this)},refresh:ii(function(){var e=this.display.cachedTextHeight;mr(this),this.curOp.forceUpdate=!0,Vn(this),Fr(this,this.doc.scrollLeft,this.doc.scrollTop),fi(this.display),(null==e||.5<Math.abs(e-lr(this.display)))&&fr(this),Ce(this,"refresh",this)}),swapDoc:ii(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ji(this,e),Vn(this),this.display.input.reset(),Fr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,mn(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Me(Za),Za.registerHelper=function(e,t,n){Qa.hasOwnProperty(e)||(Qa[e]=Za[e]={_global:[]}),Qa[e][t]=n},Za.registerGlobalHelper=function(e,t,n,r){Za.registerHelper(e,t,r),Qa[e]._global.push({pred:n,val:r})};var tl,nl="iter insert remove copy getEditor constructor".split(" ");for(var rl in Do.prototype)Do.prototype.hasOwnProperty(rl)&&H(nl,rl)<0&&(Na.prototype[rl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Do.prototype[rl]));return Me(Do),Na.inputStyles={textarea:$a,contenteditable:qa},Na.defineMode=function(e){Na.defaults.mode||"null"==e||(Na.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}.apply(this,arguments)},Na.defineMIME=function(e,t){Ke[e]=t},Na.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Na.defineMIME("text/plain","null"),Na.defineExtension=function(e,t){Na.prototype[e]=t},Na.defineDocExtension=function(e,t){Do.prototype[e]=t},Na.fromTextArea=function(t,n){if((n=n?I(n):{}).value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var e=E();n.autofocus=e==t||null!=t.getAttribute("autofocus")&&e==document.body}function r(){t.value=l.getValue()}var i;if(t.form&&(we(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(ke(t.form,"submit",r),n.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var l=Na(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},n);return l},(tl=Na).off=ke,tl.on=we,tl.wheelEventPixels=Ci,tl.Doc=Do,tl.splitLines=He,tl.countColumn=j,tl.findColumn=V,tl.isWordChar=ee,tl.Pass=B,tl.signal=Ce,tl.Line=en,tl.changeEnd=Oi,tl.scrollbarModel=Gr,tl.Pos=st,tl.cmpPos=ct,tl.modes=Ue,tl.mimeModes=Ke,tl.resolveMode=Ve,tl.getMode=Ge,tl.modeExtensions=$e,tl.extendMode=Ye,tl.copyState=Xe,tl.startState=Je,tl.innerMode=Ze,tl.commands=ia,tl.keyMap=Vo,tl.keyName=Jo,tl.isModifierKey=Xo,tl.lookupKey=Yo,tl.normalizeKeyMap=$o,tl.StringStream=Qe,tl.SharedTextMarker=No,tl.TextMarker=Ao,tl.LineWidget=So,tl.e_preventDefault=Ae,tl.e_stopPropagation=Oe,tl.e_stop=_e,tl.addClass=z,tl.contains=_,tl.rmClass=L,tl.keyNames=Bo,Na.version="5.52.2",Na},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).CodeMirror=i()},{}],20:[function(e,t,n){var r;r=function(N){"use strict";function e(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}N.defineMode("css",function(e,t){var n=t.inline;t.propertyKeywords||(t=N.resolveMode("text/css"));var r,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 r=t,e}function x(i){return function(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==i&&!r){")"==i&&e.backUp(1);break}r=!r&&"\\"==n}return n!=i&&(r||")"==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,n){this.type=e,this.indent=t,this.prev=n}function T(e,t,n,r){return e.context=new C(n,t.indentation()+(!1===r?0:o),e.context),n}function S(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function L(e,t,n){return O[n.context.type](e,t,n)}function M(e,t,n,r){for(var i=r||1;0<i;i--)n.context=n.context.prev;return L(e,t,n)}function A(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,n){if("{"==e)return T(n,t,"block");if("}"==e&&n.context.prev)return S(n);if(b&&/@component/i.test(e))return T(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(n,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(n,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return T(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?O.top(e,t,n):(i="error","block");var r=t.current().toLowerCase();return d.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,n){return":"==e?T(n,t,"prop"):L(e,t,n)},prop:function(e,t,n){if(";"==e)return S(n);if("{"==e&&v)return T(n,t,"propBlock");if("}"==e||"{"==e)return M(e,t,n);if("("==e)return T(n,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(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?S(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?M(e,t,n):")"==e?S(n):"("==e?T(n,t,"parens"):"interpolation"==e?T(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):L(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):O.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return T(n,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,n);if("{"==e)return S(n)&&T(n,t,v?"block":"top");if("interpolation"==e)return T(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":s.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":u.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"string-2":g.hasOwnProperty(r)?"atom":m.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?M(e,t,n):"{"==e?S(n)&&T(n,t,v?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?S(n):"{"==e||"}"==e?M(e,t,n,2):O.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?T(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):L(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,S(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?T(n,t,"top"):L(e,t,n)},at:function(e,t,n){return";"==e?S(n):"{"==e||"}"==e?M(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?S(n):"{"==e||";"==e?M(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new C(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?w(null,"compare"):'"'==n||"'"==n?(t.tokenize=x(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==n?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?w(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=k),w("variable callee","variable")):/[\w\\\-]/.test(n)?(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 n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,"comment"!=r&&(t.state=O[t.state](r,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-o)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],n=e(t),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(r),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","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","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","contain","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-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","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-variation-settings","font-weight","gap","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","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","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-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","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","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","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-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","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","translate","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","writing-mode","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=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=e(d),h=e(["font-display","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(r).concat(o).concat(l).concat(c).concat(d).concat(m).concat(v);function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}N.registerHelper("hintWords","css",b),N.defineMIME("text/css",{documentTypes:n,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:n,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 n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],21:[function(e,t,n){var r;r=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 r={};function m(e,t){var n=e.match(function(e){var t=r[e];return t||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;0<=o;o--)r.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,n=e&&e.scriptTypes;if(o(i,f),t&&o(t,f),n)for(var r=n.length-1;0<=r;r--)f.script.unshift(["type",n[r].matches,n[r].mode]);function h(e,t){var n,r=d.token(e,t.htmlState),i=/\btag\b/.test(r);if(i&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(n))t.inTag=n+" ";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 n=0;n<e.length;n++){var r=e[n];if(!r[0]||r[1].test(m(t,r[0])))return r[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):function(e,t,n){var r=e.current(),i=r.search(t);return-1<i?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,c,t.localMode.token(e,t.localState))},t.localMode=l,t.localState=p.startState(l,d.indent(t.htmlState,"",""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return r}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,n){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t,n):e.localMode.indent?e.localMode.indent(e.localState,t,n):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 n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],r):r(CodeMirror)},{"../../lib/codemirror":19,"../css/css":20,"../javascript/javascript":22,"../xml/xml":23}],22:[function(e,t,n){var r;r=function(tt){"use strict";tt.defineMode("javascript",function(e,c){var t,n,r,i,o,a,u=e.indentUnit,d=c.statementIndent,l=c.jsonld,s=c.json||l,f=c.typescript,h=c.wordCharacters||/[\w$\xa1-\uffff]/,p=(t=m("keyword a"),n=m("keyword b"),r=m("keyword c"),i=m("keyword d"),o=m("operator"),a={type:"atom",style:"atom"},{if:m("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:m("new"),delete:r,void:r,throw:r,debugger:m("debugger"),var:m("var"),const:m("var"),let:m("var"),function:m("function"),catch:m("catch"),for:m("for"),switch:m("switch"),case:m("case"),default:m("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:m("this"),class:m("class"),super:m("atom"),yield:r,export:m("export"),import:m("import"),extends:r,await:r});function m(e){return{type:e,style:"keyword"}}var g,v,y=/[+\-*&%=<>!?|~^@]/,b=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function w(e,t,n){return g=e,v=n,t}function x(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=function(i){return function(e,t){var n,r=!1;if(l&&"@"==e.peek()&&e.match(b))return t.tokenize=x,w("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=x),w("string","string")}}(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if("."==n&&e.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return w(n);if("="==n&&e.eat(">"))return w("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if("/"==n)return e.eat("*")?(t.tokenize=k)(e,t):e.eat("/")?(e.skipToEnd(),w("comment","comment")):et(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(e.eat("="),w("operator","operator",e.current()));if("`"==n)return(t.tokenize=C)(e,t);if("#"==n)return e.skipToEnd(),w("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),w("comment","comment");if(y.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),w("operator","operator",e.current());if(h.test(n)){e.eatWhile(h);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return w(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",r)}return w("variable","variable",r)}}function k(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=x;break}r="*"==n}return w("comment","comment")}function C(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=x;break}r=!r&&"\\"==n}return w("quasi","string-2",e.current())}var T="([{}])";function S(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(f){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;0<=a;--a){var l=e.string.charAt(a),s=T.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(h.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var L={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function M(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function A(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var O={state:null,column:null,marked:null,cc:null};function N(){for(var e=arguments.length-1;0<=e;e--)O.cc.push(arguments[e])}function _(){return N.apply(null,arguments),!0}function E(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function z(e){var t=O.state;if(O.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,n){{if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new P(r,n.vars,!0):null}return E(t,n.vars)?n:new P(n.prev,new F(t,n.vars),!1)}return null}}(e,t.context);if(null!=n)return void(t.context=n)}else if(!E(e,t.localVars))return void(t.localVars=new F(e,t.localVars));c.globalVars&&!E(e,t.globalVars)&&(t.globalVars=new F(e,t.globalVars))}function D(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function P(e,t,n){this.prev=e,this.vars=t,this.block=n}function F(e,t){this.name=e,this.next=t}var I=new F("this",new F("arguments",null));function j(){O.state.context=new P(O.state.context,O.state.localVars,!1),O.state.localVars=I}function W(){O.state.context=new P(O.state.context,O.state.localVars,!0),O.state.localVars=null}function H(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function R(r,i){function e(){var e=O.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var n=e.lexical;n&&")"==n.type&&n.align;n=n.prev)t=n.indented;e.lexical=new M(t,O.stream.column(),r,null,e.lexical,i)}return e.lex=!0,e}function B(){var e=O.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function q(n){return function e(t){return t==n?_():";"==n||"}"==t||")"==t||"]"==t?N():_(e)}}function U(e,t){return"var"==e?_(R("vardef",t),Se,q(";"),B):"keyword a"==e?_(R("form"),$,U,B):"keyword b"==e?_(R("form"),U,B):"keyword d"==e?O.stream.match(/^\s*$/,!1)?_():_(R("stat"),X,q(";"),B):"debugger"==e?_(q(";")):"{"==e?_(R("}"),W,fe,B,H):";"==e?_():"if"==e?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==B&&O.state.cc.pop()(),_(R("form"),$,U,B,_e)):"function"==e?_(Pe):"for"==e?_(R("form"),Ee,U,B):"class"==e||f&&"interface"==t?(O.marked="keyword",_(R("form","class"==e?e:t),He,B)):"variable"==e?f&&"declare"==t?(O.marked="keyword",_(U)):f&&("module"==t||"enum"==t||"type"==t)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==t?_(Je):"type"==t?_(Ie,q("operator"),ve,q(";")):_(R("form"),Le,q("{"),R("}"),fe,B,B)):f&&"namespace"==t?(O.marked="keyword",_(R("form"),V,U,B)):f&&"abstract"==t?(O.marked="keyword",_(U)):_(R("stat"),oe):"switch"==e?_(R("form"),$,q("{"),R("}","switch"),W,fe,B,B,H):"case"==e?_(V,q(":")):"default"==e?_(q(":")):"catch"==e?_(R("form"),j,K,U,B,H):"export"==e?_(R("stat"),Ue,B):"import"==e?_(R("stat"),Ve,B):"async"==e?_(U):"@"==t?_(V,U):N(R("stat"),V,q(";"),B)}function K(e){if("("==e)return _(je,q(")"))}function V(e,t){return Y(e,t,!1)}function G(e,t){return Y(e,t,!0)}function $(e){return"("!=e?N():_(R(")"),X,q(")"),B)}function Y(e,t,n){if(O.state.fatArrowAt==O.stream.start){var r=n?ne:te;if("("==e)return _(j,R(")"),ue(je,")"),B,q("=>"),r,H);if("variable"==e)return N(j,Le,q("=>"),r,H)}var i=n?J:Z;return L.hasOwnProperty(e)?_(i):"function"==e?_(Pe,i):"class"==e||f&&"interface"==t?(O.marked="keyword",_(R("form"),We,B)):"keyword c"==e||"async"==e?_(n?G:V):"("==e?_(R(")"),X,q(")"),B,i):"operator"==e||"spread"==e?_(n?G:V):"["==e?_(R("]"),Ze,B,i):"{"==e?de(le,"}",null,i):"quasi"==e?N(Q,i):"new"==e?_(function(t){return function(e){return"."==e?_(t?ie:re):"variable"==e&&f?_(ke,t?J:Z):N(t?G:V)}}(n)):"import"==e?_(V):_()}function X(e){return e.match(/[;\}\)\],]/)?N():N(V)}function Z(e,t){return","==e?_(X):J(e,t,!1)}function J(e,t,n){var r=0==n?Z:J,i=0==n?V:G;return"=>"==e?_(j,n?ne:te,H):"operator"==e?/\+\+|--/.test(t)||f&&"!"==t?_(r):f&&"<"==t&&O.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?_(R(">"),ue(ve,">"),B,r):"?"==t?_(V,q(":"),i):_(i):"quasi"==e?N(Q,r):";"!=e?"("==e?de(G,")","call",r):"."==e?_(ae,r):"["==e?_(R("]"),X,q("]"),B,r):f&&"as"==t?(O.marked="keyword",_(ve,r)):"regexp"==e?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),_(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?N():"${"!=t.slice(t.length-2)?_(Q):_(V,ee)}function ee(e){if("}"==e)return O.marked="string-2",O.state.tokenize=C,_(Q)}function te(e){return S(O.stream,O.state),N("{"==e?U:V)}function ne(e){return S(O.stream,O.state),N("{"==e?U:G)}function re(e,t){if("target"==t)return O.marked="keyword",_(Z)}function ie(e,t){if("target"==t)return O.marked="keyword",_(J)}function oe(e){return":"==e?_(B,U):N(Z,q(";"),B)}function ae(e){if("variable"==e)return O.marked="property",_()}function le(e,t){if("async"==e)return O.marked="property",_(le);if("variable"==e||"keyword"==O.style){return O.marked="property","get"==t||"set"==t?_(se):(f&&O.state.fatArrowAt==O.stream.start&&(n=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+n[0].length),_(ce));var n}else{if("number"==e||"string"==e)return O.marked=l?"property":O.style+" property",_(ce);if("jsonld-keyword"==e)return _(ce);if(f&&D(t))return O.marked="keyword",_(le);if("["==e)return _(V,he,q("]"),ce);if("spread"==e)return _(G,ce);if("*"==t)return O.marked="keyword",_(le);if(":"==e)return N(ce)}}function se(e){return"variable"!=e?N(ce):(O.marked="property",_(Pe))}function ce(e){return":"==e?_(G):"("==e?N(Pe):void 0}function ue(r,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var n=O.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),_(function(e,t){return e==i||t==i?N():N(r)},a)}return e==i||t==i?_():o&&-1<o.indexOf(";")?N(r):_(q(i))}return function(e,t){return e==i||t==i?_():N(r,a)}}function de(e,t,n){for(var r=3;r<arguments.length;r++)O.cc.push(arguments[r]);return _(R(t,n),ue(e,t),B)}function fe(e){return"}"==e?_():N(U,fe)}function he(e,t){if(f){if(":"==e)return _(ve);if("?"==t)return _(he)}}function pe(e,t){if(f&&(":"==e||"in"==t))return _(ve)}function me(e){if(f&&":"==e)return O.stream.match(/^\s*\w+\s+is\b/,!1)?_(V,ge,ve):_(ve)}function ge(e,t){if("is"==t)return O.marked="keyword",_()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(O.marked="keyword",_("typeof"==t?G:ve)):"variable"==e||"void"==t?(O.marked="type",_(xe)):"|"==t||"&"==t?_(ve):"string"==e||"number"==e||"atom"==e?_(xe):"["==e?_(R("]"),ue(ve,"]",","),B,xe):"{"==e?_(R("}"),ue(be,"}",",;"),B,xe):"("==e?_(ue(we,")"),ye,xe):"<"==e?_(ue(ve,">"),ve):void 0}function ye(e){if("=>"==e)return _(ve)}function be(e,t){return"variable"==e||"keyword"==O.style?(O.marked="property",_(be)):"?"==t||"number"==e||"string"==e?_(be):":"==e?_(ve):"["==e?_(q("variable"),pe,q("]"),be):"("==e?N(Fe,be):void 0}function we(e,t){return"variable"==e&&O.stream.match(/^\s*[?:]/,!1)||"?"==t?_(we):":"==e?_(ve):"spread"==e?_(we):N(ve)}function xe(e,t){return"<"==t?_(R(">"),ue(ve,">"),B,xe):"|"==t||"."==e||"&"==t?_(ve):"["==e?_(ve,q("]"),xe):"extends"==t||"implements"==t?(O.marked="keyword",_(ve)):"?"==t?_(ve,q(":"),ve):void 0}function ke(e,t){if("<"==t)return _(R(">"),ue(ve,">"),B,xe)}function Ce(){return N(ve,Te)}function Te(e,t){if("="==t)return _(ve)}function Se(e,t){return"enum"==t?(O.marked="keyword",_(Je)):N(Le,he,Oe,Ne)}function Le(e,t){return f&&D(t)?(O.marked="keyword",_(Le)):"variable"==e?(z(t),_()):"spread"==e?_(Le):"["==e?de(Ae,"]"):"{"==e?de(Me,"}"):void 0}function Me(e,t){return"variable"!=e||O.stream.match(/^\s*:/,!1)?("variable"==e&&(O.marked="property"),"spread"==e?_(Le):"}"==e?N():"["==e?_(V,q("]"),q(":"),Me):_(q(":"),Le,Oe)):(z(t),_(Oe))}function Ae(){return N(Le,Oe)}function Oe(e,t){if("="==t)return _(G)}function Ne(e){if(","==e)return _(Se)}function _e(e,t){if("keyword b"==e&&"else"==t)return _(R("form","else"),U,B)}function Ee(e,t){return"await"==t?_(Ee):"("==e?_(R(")"),ze,B):void 0}function ze(e){return"var"==e?_(Se,De):"variable"==e?_(De):N(De)}function De(e,t){return")"==e?_():";"==e?_(De):"in"==t||"of"==t?(O.marked="keyword",_(V,De)):N(V,De)}function Pe(e,t){return"*"==t?(O.marked="keyword",_(Pe)):"variable"==e?(z(t),_(Pe)):"("==e?_(j,R(")"),ue(je,")"),B,me,U,H):f&&"<"==t?_(R(">"),ue(Ce,">"),B,Pe):void 0}function Fe(e,t){return"*"==t?(O.marked="keyword",_(Fe)):"variable"==e?(z(t),_(Fe)):"("==e?_(j,R(")"),ue(je,")"),B,me,H):f&&"<"==t?_(R(">"),ue(Ce,">"),B,Fe):void 0}function Ie(e,t){return"keyword"==e||"variable"==e?(O.marked="type",_(Ie)):"<"==t?_(R(">"),ue(Ce,">"),B):void 0}function je(e,t){return"@"==t&&_(V,je),"spread"==e?_(je):f&&D(t)?(O.marked="keyword",_(je)):f&&"this"==e?_(he,Oe):N(Le,he,Oe)}function We(e,t){return"variable"==e?He(e,t):Re(e,t)}function He(e,t){if("variable"==e)return z(t),_(Re)}function Re(e,t){return"<"==t?_(R(">"),ue(Ce,">"),B,Re):"extends"==t||"implements"==t||f&&","==e?("implements"==t&&(O.marked="keyword"),_(f?ve:V,Re)):"{"==e?_(R("}"),Be,B):void 0}function Be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||f&&D(t))&&O.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",_(Be)):"variable"==e||"keyword"==O.style?(O.marked="property",_(f?qe:Pe,Be)):"number"==e||"string"==e?_(f?qe:Pe,Be):"["==e?_(V,he,q("]"),f?qe:Pe,Be):"*"==t?(O.marked="keyword",_(Be)):f&&"("==e?N(Fe,Be):";"==e||","==e?_(Be):"}"==e?_():"@"==t?_(V,Be):void 0}function qe(e,t){if("?"==t)return _(qe);if(":"==e)return _(ve,Oe);if("="==t)return _(G);var n=O.state.lexical.prev;return N(n&&"interface"==n.info?Fe:Pe)}function Ue(e,t){return"*"==t?(O.marked="keyword",_(Xe,q(";"))):"default"==t?(O.marked="keyword",_(V,q(";"))):"{"==e?_(ue(Ke,"}"),Xe,q(";")):N(U)}function Ke(e,t){return"as"==t?(O.marked="keyword",_(q("variable"))):"variable"==e?N(G,Ke):void 0}function Ve(e){return"string"==e?_():"("==e?N(V):N(Ge,$e,Xe)}function Ge(e,t){return"{"==e?de(Ge,"}"):("variable"==e&&z(t),"*"==t&&(O.marked="keyword"),_(Ye))}function $e(e){if(","==e)return _(Ge,$e)}function Ye(e,t){if("as"==t)return O.marked="keyword",_(Ge)}function Xe(e,t){if("from"==t)return O.marked="keyword",_(V)}function Ze(e){return"]"==e?_():N(ue(G,"]"))}function Je(){return N(R("form"),Le,q("{"),R("}"),ue(Qe,"}"),B,B)}function Qe(){return N(Le,Oe)}function et(e,t,n){return t.tokenize==x&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return B.lex=H.lex=!0,{startState:function(e){var t={tokenize:x,lastType:"sof",cc:[],lexical:new M((e||0)-u,0,"block",!1),localVars:c.localVars,context:c.localVars&&new P(null,null,!1),indented:e||0};return c.globalVars&&"object"==typeof c.globalVars&&(t.globalVars=c.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=k&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==g?n:(t.lastType="operator"!=g||"++"!=v&&"--"!=v?g:"incdec",function(e,t,n,r,i){var o=e.cc;for(O.state=e,O.stream=i,O.marked=null,O.cc=o,O.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():s?V:U)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return O.marked?O.marked:"variable"==n&&A(e,r)?"variable-2":t}}}(t,n,g,v,e))},indent:function(e,t){if(e.tokenize==k)return tt.Pass;if(e.tokenize!=x)return 0;var n,r=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==B)i=i.prev;else if(a!=_e)break}for(;("stat"==i.type||"form"==i.type)&&("}"==r||(n=e.cc[e.cc.length-1])&&(n==Z||n==J)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;d&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l=i.type,s=r==l;return"vardef"==l?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==l&&"{"==r?i.indented:"form"==l?i.indented+u:"stat"==l?i.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||y.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,t)?d||u:0):"switch"!=i.info||s||0==c.doubleIndentSwitch?i.align?i.column+(s?0:1):i.indented+(s?0:u):i.indented+(/^(?:case|default)\b/.test(t)?u:2*u)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:et,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=V&&t!=G||e.cc.pop()}}}),tt.registerHelper("wordChars","javascript",/[\w$]/),tt.defineMIME("text/javascript","javascript"),tt.defineMIME("text/ecmascript","javascript"),tt.defineMIME("application/javascript","javascript"),tt.defineMIME("application/x-javascript","javascript"),tt.defineMIME("application/ecmascript","javascript"),tt.defineMIME("application/json",{name:"javascript",json:!0}),tt.defineMIME("application/x-json",{name:"javascript",json:!0}),tt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),tt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),tt.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],23:[function(e,t,n){var r;r=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 i,o,a=e.indentUnit,l={},n=t.htmlMode?T:S;for(var r in n)l[r]=n[r];for(var r in t)l[r]=t[r];function s(t,n){function e(e){return(n.tokenize=e)(t,n)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(u("atom","]]>")):null:t.match("--")?e(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function r(i){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=r(i+1),t.tokenize(e,t);if(">"==n){if(1!=i)return t.tokenize=r(i-1),t.tokenize(e,t);t.tokenize=s;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=u("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",n.tokenize=c,"tag bracket"):"&"!=r?(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 c(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=s,i=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return i="equals",null;if("<"!=n)return/[\'\"]/.test(n)?(t.tokenize=function(n){function e(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=c;break}return"string"}return e.isInAttribute=!0,e}(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=s,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}function u(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=s;break}e.next()}return n}}function d(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.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 n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,n){return"word"==e?(n.tagName=t.current(),o="tag",b):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,n)):(o="error",m)}function g(e,t,n){if("word"!=e)return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,n)):(o="error",y);var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,n){return"endTag"!=e?(o="error",v):(f(n),p)}function y(e,t,n){return o="error",v(e,0,n)}function b(e,t,n){if("word"==e)return o="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new d(n,r,i==n.indented)),p}function w(e,t,n){return"equals"==e?x:(l.allowMissing||(o="error"),b(e,0,n))}function x(e,t,n){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",b):(o="error",b(e,0,n))}function k(e,t,n){return"string"==e?k:b(e,0,n)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,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;i=null;var n=t.tokenize(e,t);return(n||i)&&"comment"!=n&&(o=null,t.state=t.state(i||n,e,t),o&&(n="error"==o?n+" error":o)),n},indent:function(e,t,n){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(r&&r.noIndent)return C.Pass;if(e.tokenize!=c&&e.tokenize!=s)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;r;){if(r.tagName==i[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(i)for(;r;){var o=l.contextGrabbers[r.tagName];if(!o||!o.hasOwnProperty(i[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+a:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}}),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 n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":19}],24:[function(e,t,n){t.exports={prettyPrint:function(e,t){var n,r,i,o,a,c;for(r=(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"],(n=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 n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.get_content=function(){for(var e="",t=[],n=!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&&(n=!0),this.line_char_count--;else{if(n){if(this.line_char_count>=this.max_char){t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;n=!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="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var r=n.exec(this.input),i=r?r.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,n="",r=[],i=!1;do{if(this.pos>=this.input.length)return r.length?r.join(""):["","TK_EOF"];n=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(n,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==n&&'"'!==n||r[1]&&"!"===r[1]||(n+=this.get_unformatted(n),i=!0),"="===n&&(i=!1),r.length&&"="!==r[r.length-1]&&">"!==n&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,r),this.line_char_count=0):(r.push(" "),this.line_char_count++),i=!1),"<"===n&&(e=this.pos-1),r.push(n))}while(">"!==n);var o,a=r.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);r.push(s),0<e&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&r.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(1+t),this.Utils.whitespace)&&r.push(this.input.charAt(1+t)),this.tag_type="SINGLE"}else if("!"===l.charAt(0))if(-1!=l.indexOf("[if")){if(-1!=a.indexOf("!IE")){s=this.get_unformatted("--\x3e",a);r.push(s)}this.tag_type="START"}else if(-1!=l.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=l.indexOf("[cdata[")){s=this.get_unformatted("]]>",a);r.push(s),this.tag_type="SINGLE"}else{s=this.get_unformatted("--\x3e",a);r.push(s),this.tag_type="SINGLE"}else"/"===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 r.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",r="",i=!0;do{if(this.pos>=this.input.length)return r;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===n||"\r"===n){r+="\n",this.line_char_count=0;continue}}r+=n,this.line_char_count++,i=!0}while(-1==r.toLowerCase().indexOf(e));return r},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,n,r,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=i,this.indent_level=0,this.max_char=r;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 n=0;n<this.indent_level;n++)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,r,o,a);;){var l=n.get_token();if(n.token_text=l[0],n.token_type=l[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent(),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var s=n.token_text.match(/\w+/)[0],u=n.output[n.output.length-1].match(/<\s*(\w+)/);null!==u&&u[1]===s||n.print_newline(!0,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var d=n.token_text.match(/^\s*<([a-z]+)/i);d&&n.Utils.in_array(d[1],c)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_CONTENT":""!==n.token_text&&n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.output.push("\n");var f=n.token_text;if("TK_SCRIPT"==n.token_type)var h="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==n.token_type)h="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var p=0;else if("separate"==t.indent_scripts)p=-n.indent_level;else p=1;var m=n.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(n.indent_string).length-1,v=n.get_full_indent(p-g);f=f.replace(/^\s*/,m).replace(/\r\n|\r|\n/g,"\n"+v).replace(/\s*$/,"")}f&&(n.print_token(f),n.print_newline(!0,n.output))}n.current_mode="TAG"}n.last_token=n.token_type,n.last_text=n.token_text}return n.output.join("")}}},{}],25:[function(e,t,n){"use strict";var s=e("../render/vnode");t.exports=function(r,e,t){var i=[],n=!1,o=!1;function a(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<i.length;e+=2)try{r(i[e],s(i[e+1]),l)}catch(e){t.error(e)}n=!1}function l(){o||(o=!0,e(function(){o=!1,a()}))}return l.sync=a,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=i.indexOf(e);0<=n&&(i.splice(n,2),r(e,[],l)),null!=t&&(i.push(e,t),r(e,s(t),l))},redraw:l}}},{"../render/vnode":44}],26:[function(e,t,n){(function(k){"use strict";var C=e("../render/vnode"),a=e("../render/hyperscript"),T=e("../promise/promise"),o=e("../pathname/build"),S=e("../pathname/parse"),L=e("../pathname/compileTemplate"),M=e("../pathname/assign"),A={};t.exports=function(f,h){var s;function p(e,t,n){if(e=o(e,t),null!=s){s();var r=n?n.state:null,i=n?n.title:null;n&&n.replace?f.history.replaceState(r,i,x.prefix+e):f.history.pushState(r,i,x.prefix+e)}else f.location.href=x.prefix+e}var m,g,v,y,b=A,w=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,c=0,u=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:L(e)}}),i="function"==typeof k?k:setTimeout,d=T.resolve(),o=!1;if((s=null)!=t){var a=S(t);if(!u.some(function(e){return e.check(a)}))throw new ReferenceError("Default route doesn't match any known routes")}function l(){o=!1;var e=f.location.hash;"#"!==x.prefix[0]&&(e=f.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=f.location.pathname+e)[0]&&(e="/"+e));var a=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length),l=S(a);function s(){if(a===t)throw new Error("Could not resolve default route "+t);p(t,null,{replace:!0})}M(l.params,f.history.state),function t(n){for(;n<u.length;n++)if(u[n].check(l)){var r=u[n].component,e=u[n].route,i=r,o=y=function(e){if(o===y){if(e===w)return t(n+1);m=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,g=l.params,v=a,y=null,b=r.render?r:null,2===c?h.redraw():(c=2,h.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},o(i)):r.onmatch?d.then(function(){return r.onmatch(l.params,a,e)}).then(o,s):o("div"))}s()}(0)}return s=function(){o||(o=!0,i(l))},"function"==typeof f.history.pushState?(r=function(){f.removeEventListener("popstate",s,!1)},f.addEventListener("popstate",s,!1)):"#"===x.prefix[0]&&(s=null,r=function(){f.removeEventListener("hashchange",l,!1)},f.addEventListener("hashchange",l,!1)),h.mount(e,{onbeforeupdate:function(){return!(!(c=c?2:1)||A===b)},oncreate:l,onremove:r,view:function(){if(c&&A!==b){var e=[C(m,g.key,g)];return b&&(e=b.render(e[0])),e}}})}return x.set=function(e,t,n){null!=y&&((n=n||{}).replace=!0),y=null,p(e,t,n)},x.get=function(){return v},x.prefix="#!",x.Link={view:function(e){var n,r,i=e.attrs.options,t={};M(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null;var o=a(e.attrs.selector||"a",t,e.children);return(o.attrs.disabled=Boolean(o.attrs.disabled))?(o.attrs.href=null,o.attrs["aria-disabled"]="true",o.attrs.onclick=null):(n=o.attrs.onclick,r=o.attrs.href,o.attrs.href=x.prefix+r,o.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null==n||"object"!=typeof n||"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,i))}),o}},x.param=function(e){return g&&null!=e?g[e]:g},x}}).call(this,e("timers").setImmediate)},{"../pathname/assign":30,"../pathname/build":31,"../pathname/compileTemplate":32,"../pathname/parse":33,"../promise/promise":35,"../render/hyperscript":40,"../render/vnode":44,timers:49}],27:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":39,"./render/hyperscript":40,"./render/trust":43}],28:[function(e,t,n){"use strict";function r(){return i.apply(this,arguments)}var i=e("./hyperscript"),o=e("./request"),a=e("./mount-redraw");r.m=i,r.trust=i.trust,r.fragment=i.fragment,r.mount=a.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=a.redraw,r.request=o.request,r.jsonp=o.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":27,"./mount-redraw":29,"./pathname/build":31,"./pathname/parse":33,"./promise/polyfill":34,"./querystring/build":36,"./querystring/parse":37,"./render":38,"./render/vnode":44,"./request":45,"./route":47}],29:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":25,"./render":38}],30:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],31:[function(e,t,n){"use strict";var m=e("../querystring/build"),g=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),i=n<0?e.length:n,o=t<0?i:t,a=e.slice(0,o),l={};g(l,r);var s=a.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete l[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))}),c=s.indexOf("?"),u=s.indexOf("#"),d=u<0?s.length:u,f=c<0?d:c,h=s.slice(0,f);0<=t&&(h+=e.slice(t,i)),0<=c&&(h+=(t<0?"?":"&")+s.slice(c,d));var p=m(l);return p&&(h+=(t<0&&c<0?"?":"&")+p),0<=n&&(h+=e.slice(n)),0<=u&&(h+=(n<0?"":"&")+s.slice(u)),h}},{"../querystring/build":36,"./assign":30}],32:[function(e,t,n){"use strict";var l=e("./parse");t.exports=function(e){var r=l(e),i=Object.keys(r.params),o=[],a=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(o.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<i.length;t++)if(r.params[i[t]]!==e.params[i[t]])return!1;if(!o.length)return a.test(e.path);var n=a.exec(e.path);if(null==n)return!1;for(t=0;t<o.length;t++)e.params[o[t].k]=o[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":33}],33:[function(e,t,n){"use strict";var a=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),r=n<0?e.length:n,i=t<0?r:t,o=e.slice(0,i).replace(/\/{2,}/g,"/");return o?("/"!==o[0]&&(o="/"+o),1<o.length&&"/"===o[o.length-1]&&(o=o.slice(0,-1))):o="/",{path:o,params:t<0?{}:a(e.slice(t+1,r))}}},{"../querystring/parse":37}],34:[function(e,t,n){(function(n){"use strict";var f=function(e){if(!(this instanceof f))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),c=o._instance={resolvers:a,rejectors:l},u="function"==typeof n?n: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))u(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,c.state=i,c.retry=function(){t(n)}});else{if(n===o)throw new TypeError("Promise can't be resolved w/ itself");d(e.bind(n))}}catch(e){s(e)}}}function d(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)}}d(e)};f.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 f(function(e,t){i=e,o=t});return n(e,a.resolvers,i,!0),n(t,a.rejectors,o,!1),r},f.prototype.catch=function(e){return this.then(null,e)},f.prototype.finally=function(t){return this.then(function(e){return f.resolve(t()).then(function(){return e})},function(e){return f.resolve(t()).then(function(){return f.reject(e)})})},f.resolve=function(t){return t instanceof f?t:new f(function(e){e(t)})},f.reject=function(n){return new f(function(e,t){t(n)})},f.all=function(l){return new f(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)})},f.race=function(r){return new f(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=f}).call(this,e("timers").setImmediate)},{timers:49}],35:[function(n,r,e){(function(e){"use strict";var t=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=t:window.Promise.prototype.finally||(window.Promise.prototype.finally=t.prototype.finally),r.exports=window.Promise):void 0!==e?(void 0===e.Promise?e.Promise=t:e.Promise.prototype.finally||(e.Promise.prototype.finally=t.prototype.finally),r.exports=e.Promise):r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":34}],36:[function(e,t,n){"use strict";t.exports=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):""))}}},{}],37:[function(e,t,n){"use strict";t.exports=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(/\]\[?|\[/),c=r;-1<a.indexOf("[")&&s.pop();for(var u=0;u<s.length;u++){var d=s[u],f=s[u+1],h=""==f||!isNaN(parseInt(f,10));if(""===d)null==n[a=s.slice(0,u).join()]&&(n[a]=Array.isArray(c)?c.length:0),d=n[a]++;else if("__proto__"===d)break;if(u===s.length-1)c[d]=l;else{var p=Object.getOwnPropertyDescriptor(c,d);null!=p&&(p=p.value),null==p&&(c[d]=p=h?[]:{}),c=p}}}return r}},{}],38:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":42}],39:[function(e,t,n){"use strict";var r=e("../render/vnode"),i=e("./hyperscriptVnode");t.exports=function(){var e=i.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":44,"./hyperscriptVnode":41}],40:[function(e,t,n){"use strict";var s=e("../render/vnode"),r=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,u={},d={}.hasOwnProperty;function f(e){for(var t in e)if(d.call(e,t))return!1;return!0}t.exports=function(e){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.");var t=r.apply(1,arguments);return"string"==typeof e&&(t.children=s.normalizeChildren(t.children),"["!==e)?function(e,t){var n=t.attrs,r=s.normalizeChildren(t.children),i=d.call(n,"class"),o=i?n.class:n.className;if(t.tag=e.tag,t.attrs=null,t.children=void 0,!f(e.attrs)&&!f(n)){var a={};for(var l in n)d.call(n,l)&&(a[l]=n[l]);n=a}for(var l in e.attrs)d.call(e.attrs,l)&&"className"!==l&&!d.call(n,l)&&(n[l]=e.attrs[l]);for(var l in null==o&&null==e.attrs.className||(n.className=null!=o?null!=e.attrs.className?String(e.attrs.className)+" "+String(o):o:null!=e.attrs.className?e.attrs.className:null),i&&(n.class=null),n)if(d.call(n,l)&&"key"!==l){t.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?t.text=r[0].children:t.children=r,t}(u[e]||function(e){for(var t,n="div",r=[],i={};t=c.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),t):(t.tag=e,t)}},{"../render/vnode":44,"./hyperscriptVnode":41}],41:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":44}],42:[function(e,t,n){"use strict";var I=e("../render/vnode");t.exports=function(e){var s,u=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function d(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function c(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function f(e){var t=e.state;try{return this.apply(t,arguments)}finally{c(e,t)}}function h(){try{return u.activeElement}catch(e){return null}}function A(e,t,n,r,i,o,a){for(var l=n;l<r;l++){var s=t[l];null!=s&&O(e,s,i,a,o)}}function O(e,t,n,r,i){var o=t.tag;if("string"==typeof o)switch(t.state={},null!=t.attrs&&L(t.attrs,t,n),o){case"#":!function(e,t,n){t.dom=u.createTextNode(t.children),g(e,t.dom,n)}(e,t,i);break;case"<":l(e,t,r,i);break;case"[":!function(e,t,n,r,i){var o=u.createDocumentFragment();if(null!=t.children){var a=t.children;A(o,a,0,a.length,n,null,r)}t.dom=o.firstChild,t.domSize=o.childNodes.length,g(e,o,i)}(e,t,n,r,i);break;default:!function(e,t,n,r,i){var o=t.tag,a=t.attrs,l=a&&a.is,s=(r=d(t)||r)?l?u.createElementNS(r,o,{is:l}):u.createElementNS(r,o):l?u.createElement(o,{is:l}):u.createElement(o);t.dom=s,null!=a&&function(e,t,n){for(var r in t)x(e,r,null,t[r],n)}(t,a,r);if(g(e,s,i),!v(t)&&(null!=t.text&&(""!==t.text?s.textContent=t.text:t.children=[I("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children)){var c=t.children;A(s,c,0,c.length,n,null,r),"select"===t.tag&&null!=a&&function(e,t){if("value"in t)if(null===t.value)-1!==e.dom.selectedIndex&&(e.dom.value=null);else{var n=""+t.value;e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)}"selectedIndex"in t&&x(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,a)}}(e,t,n,r,i)}else!function(e,t,n,r,i){(function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}L(e.state,e,t),null!=e.attrs&&L(e.attrs,e,t);if(e.instance=I.normalize(f.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(t,n),null!=t.instance?(O(e,t.instance,n,r,i),t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0):t.domSize=0}(e,t,n,r,i)}var p={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function l(e,t,n,r){var i=t.children.match(/^\s*?<(\w+)/im)||[],o=u.createElement(p[i[1]]||"div");"http://www.w3.org/2000/svg"===n?(o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",o=o.firstChild):o.innerHTML=t.children,t.dom=o.firstChild,t.domSize=o.childNodes.length,t.instance=[];for(var a,l=u.createDocumentFragment();a=o.firstChild;)t.instance.push(a),l.appendChild(a);g(e,l,r)}function m(e,t,n,r,i,o){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)A(e,n,0,n.length,r,i,o);else if(null==n||0===n.length)P(e,t,0,t.length);else{var a=null!=t[0]&&null!=t[0].key,l=null!=n[0]&&null!=n[0].key,s=0,c=0;if(!a)for(;c<t.length&&null==t[c];)c++;if(!l)for(;s<n.length&&null==n[s];)s++;if(null===l&&null==a)return;if(a!=l)P(e,t,c,t.length),A(e,n,s,n.length,r,i,o);else if(l){for(var u,d,f,h,p,m=t.length-1,g=n.length-1;c<=m&&s<=g&&(f=t[m],h=n[g],f.key===h.key);)f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),m--,g--;for(;c<=m&&s<=g&&(u=t[c],d=n[s],u.key===d.key);)c++,s++,u!==d&&N(e,u,d,r,z(t,c,i),o);for(;c<=m&&s<=g&&s!==g&&u.key===h.key&&f.key===d.key;)D(e,f,p=z(t,c,i)),f!==d&&N(e,f,d,r,p,o),++s<=--g&&D(e,u,i),u!==h&&N(e,u,h,r,i,o),null!=h.dom&&(i=h.dom),c++,f=t[--m],h=n[g],u=t[c],d=n[s];for(;c<=m&&s<=g&&f.key===h.key;)f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),g--,f=t[--m],h=n[g];if(g<s)P(e,t,c,m+1);else if(m<c)A(e,n,s,g+1,r,i,o);else{var v,y,b=i,w=g-s+1,x=new Array(w),k=0,C=0,T=2147483647,S=0;for(C=0;C<w;C++)x[C]=-1;for(C=g;s<=C;C--){null==v&&(v=_(t,c,m+1));var L=v[(h=n[C]).key];null!=L&&(T=L<T?L:-1,f=t[x[C-s]=L],t[L]=null,f!==h&&N(e,f,h,r,i,o),null!=h.dom&&(i=h.dom),S++)}if(i=b,S!==m-c+1&&P(e,t,c,m+1),0===S)A(e,n,s,g+1,r,i,o);else if(-1===T)for(k=(y=function(e){var t=[0],n=0,r=0,i=0,o=E.length=e.length;for(i=0;i<o;i++)E[i]=e[i];for(i=0;i<o;++i)if(-1!==e[i]){var a=t[t.length-1];if(e[a]<e[i])E[i]=a,t.push(i);else{for(n=0,r=t.length-1;n<r;){var l=(n>>>1)+(r>>>1)+(n&r&1);e[t[l]]<e[i]?n=1+l:r=l}e[i]<e[t[n]]&&(0<n&&(E[i]=t[n-1]),t[n]=i)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=E[r];return E.length=0,t}(x)).length-1,C=g;s<=C;C--)d=n[C],-1===x[C-s]?O(e,d,r,o,i):y[k]===C-s?k--:D(e,d,i),null!=d.dom&&(i=n[C].dom);else for(C=g;s<=C;C--)d=n[C],-1===x[C-s]&&O(e,d,r,o,i),null!=d.dom&&(i=n[C].dom)}}else{var M=t.length<n.length?t.length:n.length;for(s=s<c?s:c;s<M;s++)(u=t[s])===(d=n[s])||null==u&&null==d||(null==u?O(e,d,r,o,z(t,s+1,i)):null==d?F(e,u):N(e,u,d,r,z(t,s+1,i),o));t.length>M&&P(e,t,s,t.length),n.length>M&&A(e,n,s,n.length,r,i,o)}}}function N(e,t,n,r,i,o){var a=t.tag;if(a===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=f.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=f.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof a)switch(null!=n.attrs&&M(n.attrs,n,r),a){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":!function(e,t,n,r,i){t.children!==n.children?(y(e,t),l(e,n,r,i)):(n.dom=t.dom,n.domSize=t.domSize,n.instance=t.instance)}(e,t,n,o,i);break;case"[":!function(e,t,n,r,i,o){m(e,t.children,n.children,r,i,o);var a=0,l=n.children;if((n.dom=null)!=l){for(var s=0;s<l.length;s++){var c=l[s];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),a+=c.domSize||1)}1!==a&&(n.domSize=a)}}(e,t,n,r,i,o);break;default:!function(e,t,n,r){var i=t.dom=e.dom;r=d(t)||r,"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)x(e,i,t&&t[i],n[i],r);var o;if(null!=t)for(var i in t)null==(o=t[i])||null!=n&&null!=n[i]||k(e,i,o,r)})(t,e.attrs,t.attrs,r),v(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=[I("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[I("#",void 0,void 0,t.text,void 0,void 0)]),m(i,e.children,t.children,n,null,r)))}(t,n,r,o)}else!function(e,t,n,r,i,o){if(n.instance=I.normalize(f.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");M(n.state,n,r),null!=n.attrs&&M(n.attrs,n,r);null!=n.instance?(null==t.instance?O(e,n.instance,r,o,i):N(e,t.instance,n.instance,r,i,o),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(F(e,t.instance),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,i,o)}else F(e,t),O(e,n,r,o,i)}function _(e,t,n){for(var r=Object.create(null);t<n;t++){var i=e[t];if(null!=i){var o=i.key;null!=o&&(r[o]=t)}}return r}var E=[];function z(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function D(e,t,n){var r=u.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var i=0;i<r.instance.length;i++)n.appendChild(r.instance[i]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(var i=0;i<r.children.length;i++){var o=r.children[i];null!=o&&e(t,n,o)}break}}(e,r,t),g(e,r,n)}function g(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function v(e){if(null==e.attrs||null==e.attrs.contenteditable&&null==e.attrs.contentEditable)return!1;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");return!0}function P(e,t,n,r){for(var i=n;i<r;i++){var o=t[i];null!=o&&F(e,o)}}function F(e,t){var n,r,i,o=0,a=t.state;"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(i=f.call(t.state.onbeforeremove,t))&&"function"==typeof i.then&&(o=1,n=i);t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(i=f.call(t.attrs.onbeforeremove,t))&&"function"==typeof i.then&&(o|=2,r=i);if(c(t,a),o){if(null!=n){var l=function(){1&o&&((o&=2)||s())};n.then(l,l)}if(null!=r){l=function(){2&o&&((o&=1)||s())};r.then(l,l)}}else w(t),b(e,t);function s(){c(t,a),w(t),b(e,t)}}function y(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function b(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)y(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&b(e,r)}}break}}function w(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&f.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&f.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&w(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&w(r)}}}function x(e,t,n,r,i){if("key"!==t&&"is"!==t&&null!=r&&!o(t)&&(n!==r||function(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===h()||"option"===e.tag&&e.dom.parentNode===u.activeElement}(e,t)||"object"==typeof r)){if("o"===t[0]&&"n"===t[1])return S(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)T(e.dom,n,r);else if(a(e,t,i)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===h())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function k(e,t,n,r){if("key"!==t&&"is"!==t&&null!=n&&!o(t))if("o"!==t[0]||"n"!==t[1]||o(t))if("style"===t)T(e.dom,n,null);else if(!a(e,t,r)||"className"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===h())||"input"===e.tag&&"type"===t){var i=t.indexOf(":");-1!==i&&(t=t.slice(i+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)}else e.dom[t]=null;else S(e,t,void 0)}function o(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function a(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function C(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function T(e,t,n){if(t===n);else if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n){null!=(i=n[r])&&e.style.setProperty(C(r),String(i))}else{for(var r in n){var i;null!=(i=n[r])&&(i=String(i))!==String(t[r])&&e.style.setProperty(C(r),i)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(C(r))}}function i(){this._=s}function S(e,t,n){if(null!=e.events){if(e.events[t]===n)return;null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}else null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new i,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function L(e,t,n){"function"==typeof e.oninit&&f.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(f.bind(e.oncreate,t))}function M(e,t,n){"function"==typeof e.onupdate&&n.push(f.bind(e.onupdate,t))}return(i.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],i=h(),o=e.namespaceURI;null==e.vnodes&&(e.textContent=""),t=I.normalizeChildren(Array.isArray(t)?t:[t]);var a=s;try{s="function"==typeof n?n:void 0,m(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===o?void 0:o)}finally{s=a}e.vnodes=t,null!=i&&h()!==i&&"function"==typeof i.focus&&i.focus();for(var l=0;l<r.length;l++)r[l]()}}},{"../render/vnode":44}],43:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return null==e&&(e=""),r("<",void 0,void 0,e,void 0,void 0)}},{"../render/vnode":44}],44:[function(e,t,n){"use strict";function i(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,events:void 0,instance:void 0}}i.normalize=function(e){return Array.isArray(e)?i("[",void 0,void 0,i.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:i("#",void 0,void 0,String(e),void 0,void 0)},i.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=i.normalize(e[r])}return t},t.exports=i},{}],45:[function(e,t,n){"use strict";var r=e("./promise/promise"),i=e("./mount-redraw");t.exports=e("./request/request")(window,r,i.redraw)},{"./mount-redraw":29,"./promise/promise":35,"./request/request":46}],46:[function(e,t,n){"use strict";var c=e("../pathname/build");t.exports=function(p,n,l){var a=0;function s(e){return new n(e)}function e(a){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){a(c(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var i=0;function o(){0==--i&&"function"==typeof l&&l()}return function t(n){var r=n.then;n.constructor=s;n.then=function(){i++;var e=r.apply(n,arguments);return e.then(o,function(e){if(o(),0===i)throw e}),t(e)};return n}(e)}}function m(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return!0;return!1}return s.prototype=n.prototype,s.__proto__=n,{request:e(function(o,a,l,s){var e,t=null!=a.method?a.method.toUpperCase():"GET",n=a.body,r=!(null!=a.serialize&&a.serialize!==JSON.serialize||n instanceof p.FormData),c=a.responseType||("function"==typeof a.extract?"":"json"),i=new p.XMLHttpRequest,u=!1,d=i,f=i.abort;for(var h in i.abort=function(){u=!0,f.call(this)},i.open(t,o,!1!==a.async,"string"==typeof a.user?a.user:void 0,"string"==typeof a.password?a.password:void 0),r&&null!=n&&!m(a,/^content-type$/i)&&i.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof a.deserialize||m(a,/^accept$/i)||i.setRequestHeader("Accept","application/json, text/*"),a.withCredentials&&(i.withCredentials=a.withCredentials),a.timeout&&(i.timeout=a.timeout),i.responseType=c,a.headers)!{}.hasOwnProperty.call(a.headers,h)||i.setRequestHeader(h,a.headers[h]);i.onreadystatechange=function(e){if(!u&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(o),r=e.target.response;if("json"===c?e.target.responseType||"function"==typeof a.extract||(r=JSON.parse(e.target.responseText)):c&&"text"!==c||null==r&&(r=e.target.responseText),"function"==typeof a.extract?(r=a.extract(e.target,a),n=!0):"function"==typeof a.deserialize&&(r=a.deserialize(r)),n)l(r);else{try{t=e.target.responseText}catch(e){t=r}var i=new Error(t);i.code=e.target.status,i.response=r,s(i)}}catch(e){s(e)}},"function"==typeof a.config&&(i=a.config(i,a,o)||i)!==d&&(e=i.abort,i.abort=function(){u=!0,e.call(this)}),null==n?i.send():"function"==typeof a.serialize?i.send(a.serialize(n)):n instanceof p.FormData?i.send(n):i.send(JSON.stringify(n))}),jsonp:e(function(e,t,n,r){var i=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+a++,o=p.document.createElement("script");p[i]=function(e){delete p[i],o.parentNode.removeChild(o),n(e)},o.onerror=function(){delete p[i],o.parentNode.removeChild(o),r(new Error("JSONP request failed"))},o.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(i),p.document.documentElement.appendChild(o)})}}},{"../pathname/build":31}],47:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":26,"./mount-redraw":29}],48:[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){ret
|