MailChimp for WordPress - Version 4.1.5

Version Description

Download this release

Release Info

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

Code changes from version 4.1.4 to 4.1.5

CHANGELOG.md CHANGED
@@ -1,6 +1,25 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  #### 4.1.4 - June 15, 2017
5
 
6
  **Fixes**
1
  Changelog
2
  =========
3
 
4
+ #### 4.1.5 - June 27, 2017
5
+
6
+ **Fixes**
7
+
8
+ - Failsafe against outputting sign-up checkbox twice in registration forms.
9
+ - Properly close HTML anchor element in French translation files.
10
+ - Fix BuddyPress sign-ups when using WordPress Multisite.
11
+
12
+ **Improvements**
13
+
14
+ - Fire action hook `mc4wp_form_updated_subscriber` whenever a form was used to update a subscriber in MailChimp.
15
+ - Increase browser timeout for AJAX request when fetching MailChimp lists.
16
+
17
+ **Additions**
18
+
19
+ - Added campaign & template methods to API client class.
20
+
21
+
22
+
23
  #### 4.1.4 - June 15, 2017
24
 
25
  **Fixes**
assets/js/admin.js CHANGED
@@ -145,7 +145,8 @@ ListFetcher.prototype.fetch = function (e) {
145
  this.done = false;
146
 
147
  $.post(ajaxurl, {
148
- action: "mc4wp_renew_mailchimp_lists"
 
149
  }).done(function (data) {
150
  this.success = true;
151
 
145
  this.done = false;
146
 
147
  $.post(ajaxurl, {
148
+ action: "mc4wp_renew_mailchimp_lists",
149
+ timeout: 180000
150
  }).done(function (data) {
151
  this.success = true;
152
 
assets/js/admin.min.js CHANGED
@@ -1,3 +1,3 @@
1
- !function(){var e=void 0,t=void 0;!function t(n,r,i){function o(l,s){if(!r[l]){if(!n[l]){var u="function"==typeof e&&e;if(!s&&u)return u(l,!0);if(a)return a(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[l]={exports:{}};n[l][0].call(f.exports,function(e){var t=n[l][1][e];return o(t||e)},f,f.exports,t,n,r,i)}return r[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,n){"use strict";var r=window.m=e("mithril"),i=e("wolfy87-eventemitter"),o=document.getElementById("mc4wp-admin"),a=new i,l=e("./admin/tabs.js")(o),s=e("./admin/helpers.js"),u=e("./admin/settings.js")(o,s,a),c=e("./admin/list-fetcher.js"),f=document.getElementById("mc4wp-list-fetcher");f&&r.mount(f,new c),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=r,window.mc4wp.helpers=s,window.mc4wp.events=a,window.mc4wp.settings=u,window.mc4wp.tabs=l},{"./admin/helpers.js":2,"./admin/list-fetcher.js":3,"./admin/settings.js":4,"./admin/tabs.js":5,mithril:7,"wolfy87-eventemitter":8}],2:[function(e,t,n){"use strict";var r={};r.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},r.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},r.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){r.bindEventToElement(e,t,n)})},r.debounce=function(e,t,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||e.apply(i,o)},l=n&&!r;clearTimeout(r),r=setTimeout(a,t),l&&e.apply(i,o)}},function(){var e=document.querySelectorAll("[data-showif]");Array.prototype.forEach.call(e,function(e){function t(){if("radio"!==this.getAttribute("type")||this.checked){var t="checkbox"===this.getAttribute("type")?this.checked:this.value,r=t==n.value;a?(e.style.display=r?"":"none",e.style.visibility=r?"":"hidden"):e.style.opacity=r?"":"0.4",Array.prototype.forEach.call(o,function(e){r?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}var n=JSON.parse(e.getAttribute("data-showif")),i=document.querySelectorAll('[name="'+n.element+'"]'),o=e.querySelectorAll("input,select,textarea:not([readonly])"),a=void 0===n.hide||n.hide;Array.prototype.forEach.call(i,function(e){t.call(e)}),r.bindEventToElements(i,"change",t)})}(),t.exports=r},{}],3:[function(e,t,n){"use strict";function r(){this.working=!1,this.done=!1,o.mailchimp.api_connected&&0===o.mailchimp.lists.length&&this.fetch()}var i=window.jQuery,o=mc4wp_vars,a=o.i18n;r.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,i.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists"}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},r.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?a.fetching_mailchimp_lists:a.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" &nbsp; "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" &nbsp; "),m("em.help",a.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",a.fetching_mailchimp_lists_done):m("em.help.red",a.fetching_mailchimp_lists_error)]:""])])},t.exports=r},{}],4:[function(e,t,n){"use strict";var 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},i=function(e,t,n){function i(e,t){return c.filter(function(n){return n[e]===t})}function o(){return c}function a(){return c=[],Array.prototype.forEach.call(s,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===r(u[e.value])&&c.push(u[e.value])}),n.trigger("selectedLists.change",[c]),c}function l(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){i("id",e.getAttribute("data-list-id")).length>0?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}var s=(e.querySelector("form"),e.querySelectorAll(".mc4wp-list-input")),u=mc4wp_vars.mailchimp.lists,c=[];return n.on("selectedLists.change",l),t.bindEventToElements(s,"change",a),a(),{getSelectedLists:o}};t.exports=i},{}],5:[function(e,t,n){"use strict";var r=e("./url.js"),i=function(e){function t(e){for(var t=0;t<f.length;t++)if(f[t].id===e)return f[t]}function n(e,n){if("string"==typeof e&&(e=t(e)),!e)return!1;void 0==n&&(n=!0),s.removeClass("tab-active").css("display","none"),u.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var o=r.setParameter(window.location.href,"tab",e.id);return history.pushState&&n&&history.pushState(e.id,"",o),i(e),c.value=o,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function i(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function o(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var i=this.className.match(/nav-tab-(\w+)?/);i&&(t=i[1])}if(!t){var o=r.parse(this.href);if(!o.tab)return;t=o.tab}return!n(t)||(e.preventDefault(),e.returnValue=!1,!1)}var a=window.jQuery,l=a(e),s=l.find(".tab"),u=l.find(".nav-tab"),c=e.querySelector('input[name="_wp_http_referer"]'),f=[];return a.each(s,function(t,r){var i=r.id.substring(4),o=a(r).find("h2").first().text();f.push({id:i,title:o,element:r,nav:e.querySelectorAll(".nav-tab-"+i),open:function(){return n(i)}})}),u.click(o),a(document.body).on("click",".tab-link",o),function(){if(history.pushState){var e=s.filter(":visible").get(0);if(e){var n=t(e.id.substring(4));n&&(history.replaceState&&null===history.state&&history.replaceState(n.id,""),i(n))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||n(e.state,!1)}),{open:n,get:t}};t.exports=i},{"./url.js":6}],6:[function(e,t,n){"use strict";var r={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var i=r.parse(e);return i[t]=n,r.build(i)}};t.exports=r},{}],7:[function(e,t,n){(function(e){!function(){"use strict";function n(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function r(e){for(var t,n="div",r=[],i={};t=l.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 u=t[6];u&&(u=u.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(u):i[t[4]]=u||!0}}return r.length>0&&(i.className=r.join(" ")),s[e]={tag:n,attrs:i}}function i(e,t,r){var i,o,a=!1,l=t.className||t.class;for(var s in e.attrs)u.call(e.attrs,s)&&(t[s]=e.attrs[s]);void 0!==l&&(void 0!==t.class&&(t.class=void 0,t.className=l),null!=e.attrs.className&&(t.className=e.attrs.className+" "+l));for(var s in t)if(u.call(t,s)&&"key"!==s){a=!0;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?o=r[0].children:i=r,n(e.tag,t.key,a?t:void 0,i,o)}function o(e){var t,o=arguments[1],a=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var l=s[e]||r(e);if(null==o?o={}:("object"!=typeof o||null!=o.tag||Array.isArray(o))&&(o={},a=1),arguments.length===a+1)t=arguments[a],Array.isArray(t)||(t=[t]);else for(t=[];a<arguments.length;)t.push(arguments[a++]);var u=n.normalizeChildren(t);return"string"==typeof e?i(l,o,u):n(e,o.key,o,u)}function a(e){var t=0,n=null,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var i=Date.now();0===t||i-t>=16?(t=i,e()):null===n&&(n=r(function(){n=null,e(),t=Date.now()},16-(i-t)))}}n.normalize=function(e){return Array.isArray(e)?n("[",void 0,void 0,n.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?n("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},n.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=n.normalize(e[t]);return e};var l=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},u={}.hasOwnProperty;o.trust=function(e){return null==e&&(e=""),n("<",void 0,void 0,e,void 0,void 0)},o.fragment=function(e,t){return n("[",e.key,e,n.normalizeChildren(t),void 0,void 0)};var c=o,f=function(e){function t(e,t){return function a(c){var f;try{if(!t||null==c||"object"!=typeof c&&"function"!=typeof c||"function"!=typeof(f=c.then))u(function(){t||0!==e.length||console.error("Possible unhandled promise rejection:",c);for(var n=0;n<e.length;n++)e[n](c);i.length=0,o.length=0,s.state=t,s.retry=function(){a(c)}});else{if(c===r)throw new TypeError("Promise can't be resolved w/ itself");n(f.bind(c))}}catch(e){l(e)}}}function n(e){function t(e){return function(t){n++>0||e(t)}}var n=0,r=t(l);try{e(t(a),r)}catch(e){r(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 r=this,i=[],o=[],a=t(i,!0),l=t(o,!1),s=r._instance={resolvers:i,rejectors:o},u="function"==typeof setImmediate?setImmediate:setTimeout;n(e)};if(f.prototype.then=function(e,t){function n(e,t,n,o){t.push(function(t){if("function"!=typeof e)n(t);else try{r(e(t))}catch(e){i&&i(e)}}),"function"==typeof a.retry&&o===a.state&&a.retry()}var r,i,o=this,a=o._instance,l=new f(function(e,t){r=e,i=t});return n(e,a.resolvers,r,!0),n(t,a.rejectors,i,!1),l},f.prototype.catch=function(e){return this.then(null,e)},f.resolve=function(e){return e instanceof f?e:new f(function(t){t(e)})},f.reject=function(e){return new f(function(t,n){n(e)})},f.all=function(e){return new f(function(t,n){var r=e.length,i=0,o=[];if(0===e.length)t([]);else for(var a=0;a<e.length;a++)!function(a){function l(e){i++,o[a]=e,i===r&&t(o)}null==e[a]||"object"!=typeof e[a]&&"function"!=typeof e[a]||"function"!=typeof e[a].then?l(e[a]):e[a].then(l,n)}(a)})},f.race=function(e){return new f(function(t,n){for(var r=0;r<e.length;r++)e[r].then(t,n)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=f);var f=window.Promise}else if(void 0!==e){void 0===e.Promise&&(e.Promise=f);var f=e.Promise}var d=function(e){function t(e,r){if(Array.isArray(r))for(var i=0;i<r.length;i++)t(e+"["+i+"]",r[i]);else if("[object Object]"===Object.prototype.toString.call(r))for(var i in r)t(e+"["+i+"]",r[i]);else n.push(encodeURIComponent(e)+(null!=r&&""!==r?"="+encodeURIComponent(r):""))}if("[object Object]"!==Object.prototype.toString.call(e))return"";var n=[];for(var r in e)t(r,e[r]);return n.join("&")},h=new RegExp("^file://","i"),v=function(e,t){function n(e){v=e}function r(){function e(){0==--t&&"function"==typeof v&&v()}var t=0;return function n(r){var i=r.then;return r.then=function(){t++;var o=i.apply(r,arguments);return o.then(e,function(n){if(e(),0===t)throw n}),n(o)},r}}function i(e,t){if("string"==typeof e){var n=e;e=t||{},null==e.url&&(e.url=n)}return e}function o(n,o){var a=r();n=i(n,o);var d=new t(function(t,r){null==n.method&&(n.method="GET"),n.method=n.method.toUpperCase();var i="GET"!==n.method&&"TRACE"!==n.method&&("boolean"!=typeof n.useBody||n.useBody);"function"!=typeof n.serialize&&(n.serialize="undefined"!=typeof FormData&&n.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof n.deserialize&&(n.deserialize=u),"function"!=typeof n.extract&&(n.extract=c),n.url=l(n.url,n.data),i?n.data=n.serialize(n.data):n.url=s(n.url,n.data);var o=new e.XMLHttpRequest,a=!1,d=o.abort;o.abort=function(){a=!0,d.call(o)},o.open(n.method,n.url,"boolean"!=typeof n.async||n.async,"string"==typeof n.user?n.user:void 0,"string"==typeof n.password?n.password:void 0),n.serialize===JSON.stringify&&i&&o.setRequestHeader("Content-Type","application/json; charset=utf-8"),n.deserialize===u&&o.setRequestHeader("Accept","application/json, text/*"),n.withCredentials&&(o.withCredentials=n.withCredentials);for(var v in n.headers)({}).hasOwnProperty.call(n.headers,v)&&o.setRequestHeader(v,n.headers[v]);"function"==typeof n.config&&(o=n.config(o,n)||o),o.onreadystatechange=function(){if(!a&&4===o.readyState)try{var e=n.extract!==c?n.extract(o,n):n.deserialize(n.extract(o,n));if(o.status>=200&&o.status<300||304===o.status||h.test(n.url))t(f(n.type,e));else{var i=new Error(o.responseText);for(var l in e)i[l]=e[l];r(i)}}catch(e){r(e)}},i&&null!=n.data?o.send(n.data):o.send()});return!0===n.background?d:a(d)}function a(n,o){var a=r();n=i(n,o);var u=new t(function(t,r){var i=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+p++,o=e.document.createElement("script");e[i]=function(r){o.parentNode.removeChild(o),t(f(n.type,r)),delete e[i]},o.onerror=function(){o.parentNode.removeChild(o),r(new Error("JSONP request failed")),delete e[i]},null==n.data&&(n.data={}),n.url=l(n.url,n.data),n.data[n.callbackKey||"callback"]=i,o.src=s(n.url,n.data),e.document.documentElement.appendChild(o)});return!0===n.background?u:a(u)}function l(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function s(e,t){var n=d(t);if(""!==n){e+=(e.indexOf("?")<0?"?":"&")+n}return e}function u(e){try{return""!==e?JSON.parse(e):null}catch(t){throw new Error(e)}}function c(e){return e.responseText}function f(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}var v,p=0;return{request:o,jsonp:a,setCompletionCallback:n}}(window,f),p=function(e){function t(e){return V=e}function r(e,t,n,r,o,a,l){for(var s=n;s<r;s++){var u=t[s];null!=u&&i(e,u,o,l,a)}}function i(e,t,n,r,i){var u=t.tag;if("string"!=typeof u)return c(e,t,n,r,i);switch(t.state={},null!=t.attrs&&M(t.attrs,t,n),u){case"#":return o(e,t,i);case"<":return a(e,t,i);case"[":return l(e,t,n,r,i);default:return s(e,t,n,r,i)}}function o(e,t,n){return t.dom=H.createTextNode(t.children),E(e,t.dom,n),t.dom}function a(e,t,n){var r=t.children.match(/^\s*?<(\w+)/im)||[],i={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[r[1]]||"div",o=H.createElement(i);o.innerHTML=t.children,t.dom=o.firstChild,t.domSize=o.childNodes.length;for(var a,l=H.createDocumentFragment();a=o.firstChild;)l.appendChild(a);return E(e,l,n),l}function l(e,t,n,i,o){var a=H.createDocumentFragment();if(null!=t.children){var l=t.children;r(a,l,0,l.length,n,null,i)}return t.dom=a.firstChild,t.domSize=a.childNodes.length,E(e,a,o),a}function s(e,t,i,o,a){var l=t.tag;switch(t.tag){case"svg":o="http://www.w3.org/2000/svg";break;case"math":o="http://www.w3.org/1998/Math/MathML"}var s=t.attrs,u=s&&s.is,c=o?u?H.createElementNS(o,l,{is:u}):H.createElementNS(o,l):u?H.createElement(l,{is:u}):H.createElement(l);if(t.dom=c,null!=s&&j(t,s,o),E(e,c,a),null!=t.attrs&&null!=t.attrs.contenteditable)A(t);else if(null!=t.text&&(""!==t.text?c.textContent=t.text:t.children=[n("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var f=t.children;r(c,f,0,f.length,i,null,o),O(t)}return c}function u(e,t){var r;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),r=e.state.view,null!=r.$$reentrantLock$$)return B;r.$$reentrantLock$$=!0}else{if(e.state=void 0,r=e.tag,null!=r.$$reentrantLock$$)return B;r.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&M(e.attrs,e,t),M(e._state,e,t),e.instance=n.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");r.$$reentrantLock$$=null}function c(e,t,n,r,o){if(u(t,n),null!=t.instance){var a=i(e,t.instance,n,r,o);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,E(e,a,o),a}return t.domSize=0,B}function f(e,t,n,o,a,l,s){if(t!==n&&(null!=t||null!=n))if(null==t)r(e,n,0,n.length,a,l,void 0);else if(null==n)k(t,0,t.length,n);else{if(t.length===n.length){for(var u=!1,c=0;c<n.length;c++)if(null!=n[c]&&null!=t[c]){u=null==n[c].key&&null==t[c].key;break}if(u){for(var c=0;c<t.length;c++)t[c]!==n[c]&&(null==t[c]&&null!=n[c]?i(e,n[c],a,s,x(t,c+1,l)):null==n[c]?k(t,c,c+1,n):d(e,t[c],n[c],a,x(t,c+1,l),o,s));return}}if(o=o||g(t,n)){var f=t.pool;t=t.concat(t.pool)}for(var h,v=0,p=0,m=t.length-1,y=n.length-1;m>=v&&y>=p;){var A=t[v],S=n[p];if(A!==S||o)if(null==A)v++;else if(null==S)p++;else if(A.key===S.key){var _=null!=f&&v>=t.length-f.length||null==f&&o;v++,p++,d(e,A,S,a,x(t,v,l),_,s),o&&A.tag===S.tag&&E(e,b(A),l)}else{var A=t[m];if(A!==S||o)if(null==A)m--;else if(null==S)p++;else{if(A.key!==S.key)break;var _=null!=f&&m>=t.length-f.length||null==f&&o;d(e,A,S,a,x(t,m+1,l),_,s),(o||p<y)&&E(e,b(A),x(t,v,l)),m--,p++}else m--,p++}else v++,p++}for(;m>=v&&y>=p;){var A=t[m],S=n[y];if(A!==S||o)if(null==A)m--;else if(null==S)y--;else if(A.key===S.key){var _=null!=f&&m>=t.length-f.length||null==f&&o;d(e,A,S,a,x(t,m+1,l),_,s),o&&A.tag===S.tag&&E(e,b(A),l),null!=A.dom&&(l=A.dom),m--,y--}else{if(h||(h=w(t,m)),null!=S){var L=h[S.key];if(null!=L){var j=t[L],_=null!=f&&L>=t.length-f.length||null==f&&o;d(e,j,S,a,x(t,m+1,l),o,s),E(e,b(j),l),t[L].skip=!0,null!=j.dom&&(l=j.dom)}else{var C=i(e,S,a,void 0,l);l=C}}y--}else m--,y--;if(y<p)break}r(e,n,p,y+1,a,l,s),k(t,v,m+1,n)}}function d(e,t,n,r,o,a,l){var s=t.tag;if(s===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!a&&U(n,t))return;if("string"==typeof s)switch(null!=n.attrs&&(a?(n.state={},M(n.attrs,n,r)):D(n.attrs,n,r)),s){case"#":h(t,n);break;case"<":v(e,t,n,o);break;case"[":p(e,t,n,a,r,o,l);break;default:m(t,n,a,r,l)}else y(e,t,n,r,o,a,l)}else S(t,null),i(e,n,r,l,o)}function h(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children),t.dom=e.dom}function v(e,t,n,r){t.children!==n.children?(b(t),a(e,n,r)):(n.dom=t.dom,n.domSize=t.domSize)}function p(e,t,n,r,i,o,a){f(e,t.children,n.children,r,i,o,a);var l=0,s=n.children;if(n.dom=null,null!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}function m(e,t,r,i,o){var a=t.dom=e.dom;switch(t.tag){case"svg":o="http://www.w3.org/2000/svg";break;case"math":o="http://www.w3.org/1998/Math/MathML"}"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0)),z(t,e.attrs,t.attrs,o),null!=t.attrs&&null!=t.attrs.contenteditable?A(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=[n("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[n("#",void 0,void 0,t.text,void 0,void 0)]),f(a,e.children,t.children,r,i,null,o))}function y(e,t,r,o,a,l,s){if(l)u(r,o);else{if(r.instance=n.normalize(r._state.view.call(r.state,r)),r.instance===r)throw Error("A view cannot return the vnode it received as argument");null!=r.attrs&&D(r.attrs,r,o),D(r._state,r,o)}null!=r.instance?(null==t.instance?i(e,r.instance,o,s,a):d(e,t.instance,r.instance,o,a,l,s),r.dom=r.instance.dom,r.domSize=r.instance.domSize):null!=t.instance?(S(t.instance,null),r.dom=void 0,r.domSize=0):(r.dom=t.dom,r.domSize=t.domSize)}function g(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}function w(e,t){for(var n={},r=0,r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function b(e){var t=e.domSize;if(null!=t||null==e.dom){var n=H.createDocumentFragment();if(t>0){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}return e.dom}function x(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function E(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function A(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function k(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:S(o,r))}}function S(e,t){function n(){if(++i===r&&(L(e),e.dom)){var n=e.domSize||1;if(n>1)for(var o=e.dom;--n;)_(o.nextSibling);_(e.dom),null==t||null!=e.domSize||$(e.attrs)||"string"!=typeof e.tag||(t.pool?t.pool.push(e):t.pool=[e])}}var r=1,i=0;if(e.attrs&&"function"==typeof e.attrs.onbeforeremove){var o=e.attrs.onbeforeremove.call(e.state,e);null!=o&&"function"==typeof o.then&&(r++,o.then(n,n))}if("string"!=typeof e.tag&&"function"==typeof e._state.onbeforeremove){var o=e._state.onbeforeremove.call(e.state,e);null!=o&&"function"==typeof o.then&&(r++,o.then(n,n))}n()}function _(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function L(e){if(e.attrs&&"function"==typeof e.attrs.onremove&&e.attrs.onremove.call(e.state,e),"string"!=typeof e.tag&&"function"==typeof e._state.onremove&&e._state.onremove.call(e.state,e),null!=e.instance)L(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&&L(r)}}}function j(e,t,n){for(var r in t)C(e,r,null,t[r],n)}function C(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||T(e,t)||"object"==typeof r)&&void 0!==r&&!N(t)){var a=t.indexOf(":");if(a>-1&&"xlink"===t.substr(0,a))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(a+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)q(e,t,r);else if("style"===t)I(o,n,r);else if(t in o&&!P(t)&&void 0===i&&!R(e)){if("input"===e.tag&&"value"===t&&e.dom.value==r&&e.dom===H.activeElement)return;if("select"===e.tag&&"value"===t&&e.dom.value==r&&e.dom===H.activeElement)return;if("option"===e.tag&&"value"===t&&e.dom.value==r)return;if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function O(e){var t=e.attrs;"select"===e.tag&&null!=t&&("value"in t&&C(e,"value",null,t.value,void 0),"selectedIndex"in t&&C(e,"selectedIndex",null,t.selectedIndex,void 0))}function z(e,t,n,r){if(null!=n)for(var i in n)C(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||N(i)?"key"!==i&&e.dom.removeAttribute(i):q(e,i,void 0))}function T(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===H.activeElement}function N(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function P(e){return"href"===e||"list"===e||"form"===e||"width"===e||"height"===e}function R(e){return e.attrs.is||e.tag.indexOf("-")>-1}function $(e){return null!=e&&(e.oncreate||e.onupdate||e.onbeforeremove||e.onremove)}function I(e,t,n){if(t===n&&(e.style.cssText="",t=null),null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{"string"==typeof t&&(e.style.cssText="");for(var r in n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}function q(e,t,n){var r=e.dom,i="function"!=typeof V?n:function(e){var t=n.call(r,e);return V.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function M(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function D(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}function U(e,t){var n,r;return null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t)),"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t)),!(void 0===n&&void 0===r||n||r)&&(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,!0)}function F(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],i=H.activeElement;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),f(e,e.vnodes,n.normalizeChildren(t),!1,r,null,void 0),e.vnodes=t;for(var o=0;o<r.length;o++)r[o]();H.activeElement!==i&&i.focus()}var V,H=e.document,B=H.createDocumentFragment();return{render:F,setEventCallback:t}},m=function(e){function t(e,t){n(e),o.push(e,a(t))}function n(e){var t=o.indexOf(e);t>-1&&o.splice(t,2)}function r(){for(var e=1;e<o.length;e+=2)o[e]()}var i=p(e);i.setEventCallback(function(e){!1!==e.redraw&&r()});var o=[];return{subscribe:t,unsubscribe:n,redraw:r,render:i.render}}(window);v.setCompletionCallback(m.redraw);c.mount=function(e){return function(t,r){if(null===r)return e.render(t,[]),void e.unsubscribe(t);if(null==r.view&&"function"!=typeof r)throw new Error("m.mount(element, component) expects a component, not a vnode");var i=function(){e.render(t,n(r))};e.subscribe(t,i),e.redraw()}}(m);var y=f,g=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),a=decodeURIComponent(o[0]),l=2===o.length?decodeURIComponent(o[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var s=a.split(/\]\[?|\[/),u=n;a.indexOf("[")>-1&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),v=c===s.length-1;if(""===f){var a=s.slice(0,c).join();null==r[a]&&(r[a]=0),f=r[a]++}null==u[f]&&(u[f]=v?l:h?[]:{}),u=u[f]}}return n},w=function(e){function t(t){var n=e.location[t].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===t&&"/"!==n[0]&&(n="/"+n),n}function n(e){return function(){null==i&&(i=a(function(){i=null,e()}))}}function r(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=r>-1?r:i>-1?i:e.length;if(r>-1){var a=i>-1?i:e.length,l=g(e.slice(r+1,a));for(var s in l)t[s]=l[s]}if(i>-1){var u=g(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var i,o="function"==typeof e.history.pushState,a="function"==typeof setImmediate?setImmediate:setTimeout,l={prefix:"#!"};return l.getPath=function(){switch(l.prefix.charAt(0)){case"#":return t("hash").slice(l.prefix.length);case"?":return t("search").slice(l.prefix.length)+t("hash");default:return t("pathname").slice(l.prefix.length)+t("search")+t("hash")}},l.setPath=function(t,n,i){var a={},s={};if(t=r(t,a,s),null!=n){for(var u in n)a[u]=n[u];t=t.replace(/:([^\/]+)/g,function(e,t){return delete a[t],n[t]})}var c=d(a);c&&(t+="?"+c);var f=d(s);if(f&&(t+="#"+f),o){var h=i?i.state:null,v=i?i.title:null;e.onpopstate(),i&&i.replace?e.history.replaceState(h,v,l.prefix+t):e.history.pushState(h,v,l.prefix+t)}else e.location.href=l.prefix+t},l.defineRoutes=function(t,i,a){function s(){var n=l.getPath(),o={},s=r(n,o,o),u=e.history.state;if(null!=u)for(var c in u)o[c]=u[c];for(var f in t){var d=new RegExp("^"+f.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(d.test(s))return void s.replace(d,function(){for(var e=f.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2),a=0;a<e.length;a++)o[e[a].replace(/:|\./g,"")]=decodeURIComponent(r[a]);i(t[f],o,n,f)})}a(n,o)}o?e.onpopstate=n(s):"#"===l.prefix.charAt(0)&&(e.onhashchange=s),s()},l};c.route=function(e,t){var r,i,o,a,l,s=w(e),u=function(e){return e},c=function(e,c,f){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var d=function(){null!=r&&t.render(e,r(n(i,o.key,o)))},h=function(e){if(e===c)throw new Error("Could not resolve default route "+c);s.setPath(c,null,{replace:!0})};s.defineRoutes(f,function(e,t,n){var s=l=function(e,c){s===l&&(i=null==c||"function"!=typeof c.view&&"function"!=typeof c?"div":c,o=t,a=n,l=null,r=(e.render||u).bind(e),d())};e.view||"function"==typeof e?s({},e):e.onmatch?y.resolve(e.onmatch(t,n)).then(function(t){s(e,t)},h):s(e,"div")},h),t.subscribe(e,d)};return c.set=function(e,t,n){null!=l&&(n={replace:!0}),l=null,s.setPath(e,t,n)},c.get=function(){return a},c.prefix=function(e){s.prefix=e},c.link=function(e){e.dom.setAttribute("href",s.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(s.prefix)&&(t=t.slice(s.prefix.length)),c.set(t,void 0,void 0)}}},c.param=function(e){return void 0!==o&&void 0!==e?o[e]:o},c}(window,m),c.withAttr=function(e,t,n){return function(r){t.call(n||this,e in r.currentTarget?r.currentTarget[e]:r.currentTarget.getAttribute(e))}};var b=p(window);c.render=b.render,c.redraw=m.redraw,c.request=v.request,c.jsonp=v.jsonp,c.parseQueryString=g,c.buildQueryString=d,c.version="1.1.1",c.vnode=n,void 0!==t?t.exports=c:window.m=c}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,n,r){!function(e){"use strict";function r(){}function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var l=r.prototype,s=e.EventEmitter;l.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},l.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},l.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},l.addListener=function(e,t){if(!a(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===i(r[n],t)&&r[n].push(o?t:{listener:t,once:!1});return this},l.on=o("addListener"),l.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},l.once=o("addOnceListener"),l.defineEvent=function(e){return this.getListeners(e),this},l.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},l.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&-1!==(n=i(o[r],t))&&o[r].splice(n,1);return this},l.off=o("removeListener"),l.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},l.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},l.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},l.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},l.removeAllListeners=o("removeEvent"),l.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e)
2
  ;for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},l.trigger=o("emitEvent"),l.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},l.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},l._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},l._getEvents=function(){return this._events||(this._events={})},r.noConflict=function(){return e.EventEmitter=s,r},"function"==typeof t&&t.amd?t(function(){return r}):"object"==typeof n&&n.exports?n.exports=r:e.EventEmitter=r}(this||{})},{}]},{},[1])}();
3
  //# sourceMappingURL=admin.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function t(n,r,i){function o(l,s){if(!r[l]){if(!n[l]){var u="function"==typeof e&&e;if(!s&&u)return u(l,!0);if(a)return a(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[l]={exports:{}};n[l][0].call(f.exports,function(e){var t=n[l][1][e];return o(t||e)},f,f.exports,t,n,r,i)}return r[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,n){"use strict";var r=window.m=e("mithril"),i=e("wolfy87-eventemitter"),o=document.getElementById("mc4wp-admin"),a=new i,l=e("./admin/tabs.js")(o),s=e("./admin/helpers.js"),u=e("./admin/settings.js")(o,s,a),c=e("./admin/list-fetcher.js"),f=document.getElementById("mc4wp-list-fetcher");f&&r.mount(f,new c),window.mc4wp=window.mc4wp||{},window.mc4wp.deps=window.mc4wp.deps||{},window.mc4wp.deps.mithril=r,window.mc4wp.helpers=s,window.mc4wp.events=a,window.mc4wp.settings=u,window.mc4wp.tabs=l},{"./admin/helpers.js":2,"./admin/list-fetcher.js":3,"./admin/settings.js":4,"./admin/tabs.js":5,mithril:7,"wolfy87-eventemitter":8}],2:[function(e,t,n){"use strict";var r={};r.toggleElement=function(e){for(var t=document.querySelectorAll(e),n=0;n<t.length;n++){var r=t[n].clientHeight<=0;t[n].style.display=r?"":"none"}},r.bindEventToElement=function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent&&e.attachEvent("on"+t,n)},r.bindEventToElements=function(e,t,n){Array.prototype.forEach.call(e,function(e){r.bindEventToElement(e,t,n)})},r.debounce=function(e,t,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||e.apply(i,o)},l=n&&!r;clearTimeout(r),r=setTimeout(a,t),l&&e.apply(i,o)}},function(){var e=document.querySelectorAll("[data-showif]");Array.prototype.forEach.call(e,function(e){function t(){if("radio"!==this.getAttribute("type")||this.checked){var t="checkbox"===this.getAttribute("type")?this.checked:this.value,r=t==n.value;a?(e.style.display=r?"":"none",e.style.visibility=r?"":"hidden"):e.style.opacity=r?"":"0.4",Array.prototype.forEach.call(o,function(e){r?e.removeAttribute("readonly"):e.setAttribute("readonly","readonly")})}}var n=JSON.parse(e.getAttribute("data-showif")),i=document.querySelectorAll('[name="'+n.element+'"]'),o=e.querySelectorAll("input,select,textarea:not([readonly])"),a=void 0===n.hide||n.hide;Array.prototype.forEach.call(i,function(e){t.call(e)}),r.bindEventToElements(i,"change",t)})}(),t.exports=r},{}],3:[function(e,t,n){"use strict";function r(){this.working=!1,this.done=!1,o.mailchimp.api_connected&&0===o.mailchimp.lists.length&&this.fetch()}var i=window.jQuery,o=mc4wp_vars,a=o.i18n;r.prototype.fetch=function(e){e&&e.preventDefault(),this.working=!0,this.done=!1,i.post(ajaxurl,{action:"mc4wp_renew_mailchimp_lists",timeout:18e4}).done(function(e){this.success=!0,e&&window.setTimeout(function(){window.location.reload()},3e3)}.bind(this)).fail(function(e){this.success=!1}.bind(this)).always(function(e){this.working=!1,this.done=!0,m.redraw()}.bind(this))},r.prototype.view=function(){return m("form",{method:"POST",onsubmit:this.fetch.bind(this)},[m("p",[m("input",{type:"submit",value:this.working?a.fetching_mailchimp_lists:a.renew_mailchimp_lists,className:"button",disabled:!!this.working}),m.trust(" &nbsp; "),this.working?[m("span.mc4wp-loader","Loading..."),m.trust(" &nbsp; "),m("em.help",a.fetching_mailchimp_lists_can_take_a_while)]:"",this.done?[this.success?m("em.help.green",a.fetching_mailchimp_lists_done):m("em.help.red",a.fetching_mailchimp_lists_error)]:""])])},t.exports=r},{}],4:[function(e,t,n){"use strict";var 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},i=function(e,t,n){function i(e,t){return c.filter(function(n){return n[e]===t})}function o(){return c}function a(){return c=[],Array.prototype.forEach.call(s,function(e){("boolean"!=typeof e.checked||e.checked)&&"object"===r(u[e.value])&&c.push(u[e.value])}),n.trigger("selectedLists.change",[c]),c}function l(){var e=document.querySelectorAll(".lists--only-selected > *");Array.prototype.forEach.call(e,function(e){i("id",e.getAttribute("data-list-id")).length>0?e.setAttribute("class",e.getAttribute("class").replace("hidden","")):e.setAttribute("class",e.getAttribute("class")+" hidden")})}var s=(e.querySelector("form"),e.querySelectorAll(".mc4wp-list-input")),u=mc4wp_vars.mailchimp.lists,c=[];return n.on("selectedLists.change",l),t.bindEventToElements(s,"change",a),a(),{getSelectedLists:o}};t.exports=i},{}],5:[function(e,t,n){"use strict";var r=e("./url.js"),i=function(e){function t(e){for(var t=0;t<f.length;t++)if(f[t].id===e)return f[t]}function n(e,n){if("string"==typeof e&&(e=t(e)),!e)return!1;void 0==n&&(n=!0),s.removeClass("tab-active").css("display","none"),u.removeClass("nav-tab-active"),Array.prototype.forEach.call(e.nav,function(e){e.className+=" nav-tab-active",e.blur()}),e.element.style.display="block",e.element.className+=" tab-active";var o=r.setParameter(window.location.href,"tab",e.id);return history.pushState&&n&&history.pushState(e.id,"",o),i(e),c.value=o,"function"==typeof tb_remove&&tb_remove(),"fields"===e.id&&window.mc4wp&&window.mc4wp.forms&&window.mc4wp.forms.editor&&mc4wp.forms.editor.refresh(),!0}function i(e){var t=document.title.split("-");document.title=document.title.replace(t[0],e.title+" ")}function o(e){e=e||window.event;var t=this.getAttribute("data-tab");if(!t){var i=this.className.match(/nav-tab-(\w+)?/);i&&(t=i[1])}if(!t){var o=r.parse(this.href);if(!o.tab)return;t=o.tab}return!n(t)||(e.preventDefault(),e.returnValue=!1,!1)}var a=window.jQuery,l=a(e),s=l.find(".tab"),u=l.find(".nav-tab"),c=e.querySelector('input[name="_wp_http_referer"]'),f=[];return a.each(s,function(t,r){var i=r.id.substring(4),o=a(r).find("h2").first().text();f.push({id:i,title:o,element:r,nav:e.querySelectorAll(".nav-tab-"+i),open:function(){return n(i)}})}),u.click(o),a(document.body).on("click",".tab-link",o),function(){if(history.pushState){var e=s.filter(":visible").get(0);if(e){var n=t(e.id.substring(4));n&&(history.replaceState&&null===history.state&&history.replaceState(n.id,""),i(n))}}}(),window.addEventListener&&history.pushState&&window.addEventListener("popstate",function(e){return!e.state||n(e.state,!1)}),{open:n,get:t}};t.exports=i},{"./url.js":6}],6:[function(e,t,n){"use strict";var r={parse:function(e){var t={},n=e.split("&");for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t},build:function(e){var t=[];for(var n in e)t.push(n+"="+encodeURIComponent(e[n]));return t.join("&")},setParameter:function(e,t,n){var i=r.parse(e);return i[t]=n,r.build(i)}};t.exports=r},{}],7:[function(e,t,n){(function(e){!function(){"use strict";function n(e,t,n,r,i,o){return{tag:e,key:t,attrs:n,children:r,text:i,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function r(e){for(var t,n="div",r=[],i={};t=l.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 u=t[6];u&&(u=u.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===t[4]?r.push(u):i[t[4]]=u||!0}}return r.length>0&&(i.className=r.join(" ")),s[e]={tag:n,attrs:i}}function i(e,t,r){var i,o,a=!1,l=t.className||t.class;for(var s in e.attrs)u.call(e.attrs,s)&&(t[s]=e.attrs[s]);void 0!==l&&(void 0!==t.class&&(t.class=void 0,t.className=l),null!=e.attrs.className&&(t.className=e.attrs.className+" "+l));for(var s in t)if(u.call(t,s)&&"key"!==s){a=!0;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?o=r[0].children:i=r,n(e.tag,t.key,a?t:void 0,i,o)}function o(e){var t,o=arguments[1],a=2;if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");if("string"==typeof e)var l=s[e]||r(e);if(null==o?o={}:("object"!=typeof o||null!=o.tag||Array.isArray(o))&&(o={},a=1),arguments.length===a+1)t=arguments[a],Array.isArray(t)||(t=[t]);else for(t=[];a<arguments.length;)t.push(arguments[a++]);var u=n.normalizeChildren(t);return"string"==typeof e?i(l,o,u):n(e,o.key,o,u)}function a(e){var t=0,n=null,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var i=Date.now();0===t||i-t>=16?(t=i,e()):null===n&&(n=r(function(){n=null,e(),t=Date.now()},16-(i-t)))}}n.normalize=function(e){return Array.isArray(e)?n("[",void 0,void 0,n.normalizeChildren(e),void 0,void 0):null!=e&&"object"!=typeof e?n("#",void 0,void 0,!1===e?"":e,void 0,void 0):e},n.normalizeChildren=function(e){for(var t=0;t<e.length;t++)e[t]=n.normalize(e[t]);return e};var l=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},u={}.hasOwnProperty;o.trust=function(e){return null==e&&(e=""),n("<",void 0,void 0,e,void 0,void 0)},o.fragment=function(e,t){return n("[",e.key,e,n.normalizeChildren(t),void 0,void 0)};var c=o,f=function(e){function t(e,t){return function a(c){var f;try{if(!t||null==c||"object"!=typeof c&&"function"!=typeof c||"function"!=typeof(f=c.then))u(function(){t||0!==e.length||console.error("Possible unhandled promise rejection:",c);for(var n=0;n<e.length;n++)e[n](c);i.length=0,o.length=0,s.state=t,s.retry=function(){a(c)}});else{if(c===r)throw new TypeError("Promise can't be resolved w/ itself");n(f.bind(c))}}catch(e){l(e)}}}function n(e){function t(e){return function(t){n++>0||e(t)}}var n=0,r=t(l);try{e(t(a),r)}catch(e){r(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 r=this,i=[],o=[],a=t(i,!0),l=t(o,!1),s=r._instance={resolvers:i,rejectors:o},u="function"==typeof setImmediate?setImmediate:setTimeout;n(e)};if(f.prototype.then=function(e,t){function n(e,t,n,o){t.push(function(t){if("function"!=typeof e)n(t);else try{r(e(t))}catch(e){i&&i(e)}}),"function"==typeof a.retry&&o===a.state&&a.retry()}var r,i,o=this,a=o._instance,l=new f(function(e,t){r=e,i=t});return n(e,a.resolvers,r,!0),n(t,a.rejectors,i,!1),l},f.prototype.catch=function(e){return this.then(null,e)},f.resolve=function(e){return e instanceof f?e:new f(function(t){t(e)})},f.reject=function(e){return new f(function(t,n){n(e)})},f.all=function(e){return new f(function(t,n){var r=e.length,i=0,o=[];if(0===e.length)t([]);else for(var a=0;a<e.length;a++)!function(a){function l(e){i++,o[a]=e,i===r&&t(o)}null==e[a]||"object"!=typeof e[a]&&"function"!=typeof e[a]||"function"!=typeof e[a].then?l(e[a]):e[a].then(l,n)}(a)})},f.race=function(e){return new f(function(t,n){for(var r=0;r<e.length;r++)e[r].then(t,n)})},"undefined"!=typeof window){void 0===window.Promise&&(window.Promise=f);var f=window.Promise}else if(void 0!==e){void 0===e.Promise&&(e.Promise=f);var f=e.Promise}var d=function(e){function t(e,r){if(Array.isArray(r))for(var i=0;i<r.length;i++)t(e+"["+i+"]",r[i]);else if("[object Object]"===Object.prototype.toString.call(r))for(var i in r)t(e+"["+i+"]",r[i]);else n.push(encodeURIComponent(e)+(null!=r&&""!==r?"="+encodeURIComponent(r):""))}if("[object Object]"!==Object.prototype.toString.call(e))return"";var n=[];for(var r in e)t(r,e[r]);return n.join("&")},h=new RegExp("^file://","i"),v=function(e,t){function n(e){v=e}function r(){function e(){0==--t&&"function"==typeof v&&v()}var t=0;return function n(r){var i=r.then;return r.then=function(){t++;var o=i.apply(r,arguments);return o.then(e,function(n){if(e(),0===t)throw n}),n(o)},r}}function i(e,t){if("string"==typeof e){var n=e;e=t||{},null==e.url&&(e.url=n)}return e}function o(n,o){var a=r();n=i(n,o);var d=new t(function(t,r){null==n.method&&(n.method="GET"),n.method=n.method.toUpperCase();var i="GET"!==n.method&&"TRACE"!==n.method&&("boolean"!=typeof n.useBody||n.useBody);"function"!=typeof n.serialize&&(n.serialize="undefined"!=typeof FormData&&n.data instanceof FormData?function(e){return e}:JSON.stringify),"function"!=typeof n.deserialize&&(n.deserialize=u),"function"!=typeof n.extract&&(n.extract=c),n.url=l(n.url,n.data),i?n.data=n.serialize(n.data):n.url=s(n.url,n.data);var o=new e.XMLHttpRequest,a=!1,d=o.abort;o.abort=function(){a=!0,d.call(o)},o.open(n.method,n.url,"boolean"!=typeof n.async||n.async,"string"==typeof n.user?n.user:void 0,"string"==typeof n.password?n.password:void 0),n.serialize===JSON.stringify&&i&&o.setRequestHeader("Content-Type","application/json; charset=utf-8"),n.deserialize===u&&o.setRequestHeader("Accept","application/json, text/*"),n.withCredentials&&(o.withCredentials=n.withCredentials);for(var v in n.headers)({}).hasOwnProperty.call(n.headers,v)&&o.setRequestHeader(v,n.headers[v]);"function"==typeof n.config&&(o=n.config(o,n)||o),o.onreadystatechange=function(){if(!a&&4===o.readyState)try{var e=n.extract!==c?n.extract(o,n):n.deserialize(n.extract(o,n));if(o.status>=200&&o.status<300||304===o.status||h.test(n.url))t(f(n.type,e));else{var i=new Error(o.responseText);for(var l in e)i[l]=e[l];r(i)}}catch(e){r(e)}},i&&null!=n.data?o.send(n.data):o.send()});return!0===n.background?d:a(d)}function a(n,o){var a=r();n=i(n,o);var u=new t(function(t,r){var i=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+p++,o=e.document.createElement("script");e[i]=function(r){o.parentNode.removeChild(o),t(f(n.type,r)),delete e[i]},o.onerror=function(){o.parentNode.removeChild(o),r(new Error("JSONP request failed")),delete e[i]},null==n.data&&(n.data={}),n.url=l(n.url,n.data),n.data[n.callbackKey||"callback"]=i,o.src=s(n.url,n.data),e.document.documentElement.appendChild(o)});return!0===n.background?u:a(u)}function l(e,t){if(null==t)return e;for(var n=e.match(/:[^\/]+/gi)||[],r=0;r<n.length;r++){var i=n[r].slice(1);null!=t[i]&&(e=e.replace(n[r],t[i]))}return e}function s(e,t){var n=d(t);if(""!==n){e+=(e.indexOf("?")<0?"?":"&")+n}return e}function u(e){try{return""!==e?JSON.parse(e):null}catch(t){throw new Error(e)}}function c(e){return e.responseText}function f(e,t){if("function"==typeof e){if(!Array.isArray(t))return new e(t);for(var n=0;n<t.length;n++)t[n]=new e(t[n])}return t}var v,p=0;return{request:o,jsonp:a,setCompletionCallback:n}}(window,f),p=function(e){function t(e){return V=e}function r(e,t,n,r,o,a,l){for(var s=n;s<r;s++){var u=t[s];null!=u&&i(e,u,o,l,a)}}function i(e,t,n,r,i){var u=t.tag;if("string"!=typeof u)return c(e,t,n,r,i);switch(t.state={},null!=t.attrs&&M(t.attrs,t,n),u){case"#":return o(e,t,i);case"<":return a(e,t,i);case"[":return l(e,t,n,r,i);default:return s(e,t,n,r,i)}}function o(e,t,n){return t.dom=H.createTextNode(t.children),E(e,t.dom,n),t.dom}function a(e,t,n){var r=t.children.match(/^\s*?<(\w+)/im)||[],i={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[r[1]]||"div",o=H.createElement(i);o.innerHTML=t.children,t.dom=o.firstChild,t.domSize=o.childNodes.length;for(var a,l=H.createDocumentFragment();a=o.firstChild;)l.appendChild(a);return E(e,l,n),l}function l(e,t,n,i,o){var a=H.createDocumentFragment();if(null!=t.children){var l=t.children;r(a,l,0,l.length,n,null,i)}return t.dom=a.firstChild,t.domSize=a.childNodes.length,E(e,a,o),a}function s(e,t,i,o,a){var l=t.tag;switch(t.tag){case"svg":o="http://www.w3.org/2000/svg";break;case"math":o="http://www.w3.org/1998/Math/MathML"}var s=t.attrs,u=s&&s.is,c=o?u?H.createElementNS(o,l,{is:u}):H.createElementNS(o,l):u?H.createElement(l,{is:u}):H.createElement(l);if(t.dom=c,null!=s&&j(t,s,o),E(e,c,a),null!=t.attrs&&null!=t.attrs.contenteditable)A(t);else if(null!=t.text&&(""!==t.text?c.textContent=t.text:t.children=[n("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children){var f=t.children;r(c,f,0,f.length,i,null,o),O(t)}return c}function u(e,t){var r;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),r=e.state.view,null!=r.$$reentrantLock$$)return B;r.$$reentrantLock$$=!0}else{if(e.state=void 0,r=e.tag,null!=r.$$reentrantLock$$)return B;r.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(e._state=e.state,null!=e.attrs&&M(e.attrs,e,t),M(e._state,e,t),e.instance=n.normalize(e._state.view.call(e.state,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");r.$$reentrantLock$$=null}function c(e,t,n,r,o){if(u(t,n),null!=t.instance){var a=i(e,t.instance,n,r,o);return t.dom=t.instance.dom,t.domSize=null!=t.dom?t.instance.domSize:0,E(e,a,o),a}return t.domSize=0,B}function f(e,t,n,o,a,l,s){if(t!==n&&(null!=t||null!=n))if(null==t)r(e,n,0,n.length,a,l,void 0);else if(null==n)k(t,0,t.length,n);else{if(t.length===n.length){for(var u=!1,c=0;c<n.length;c++)if(null!=n[c]&&null!=t[c]){u=null==n[c].key&&null==t[c].key;break}if(u){for(var c=0;c<t.length;c++)t[c]!==n[c]&&(null==t[c]&&null!=n[c]?i(e,n[c],a,s,x(t,c+1,l)):null==n[c]?k(t,c,c+1,n):d(e,t[c],n[c],a,x(t,c+1,l),o,s));return}}if(o=o||g(t,n)){var f=t.pool;t=t.concat(t.pool)}for(var h,v=0,p=0,m=t.length-1,y=n.length-1;m>=v&&y>=p;){var A=t[v],S=n[p];if(A!==S||o)if(null==A)v++;else if(null==S)p++;else if(A.key===S.key){var _=null!=f&&v>=t.length-f.length||null==f&&o;v++,p++,d(e,A,S,a,x(t,v,l),_,s),o&&A.tag===S.tag&&E(e,b(A),l)}else{var A=t[m];if(A!==S||o)if(null==A)m--;else if(null==S)p++;else{if(A.key!==S.key)break;var _=null!=f&&m>=t.length-f.length||null==f&&o;d(e,A,S,a,x(t,m+1,l),_,s),(o||p<y)&&E(e,b(A),x(t,v,l)),m--,p++}else m--,p++}else v++,p++}for(;m>=v&&y>=p;){var A=t[m],S=n[y];if(A!==S||o)if(null==A)m--;else if(null==S)y--;else if(A.key===S.key){var _=null!=f&&m>=t.length-f.length||null==f&&o;d(e,A,S,a,x(t,m+1,l),_,s),o&&A.tag===S.tag&&E(e,b(A),l),null!=A.dom&&(l=A.dom),m--,y--}else{if(h||(h=w(t,m)),null!=S){var L=h[S.key];if(null!=L){var j=t[L],_=null!=f&&L>=t.length-f.length||null==f&&o;d(e,j,S,a,x(t,m+1,l),o,s),E(e,b(j),l),t[L].skip=!0,null!=j.dom&&(l=j.dom)}else{var C=i(e,S,a,void 0,l);l=C}}y--}else m--,y--;if(y<p)break}r(e,n,p,y+1,a,l,s),k(t,v,m+1,n)}}function d(e,t,n,r,o,a,l){var s=t.tag;if(s===n.tag){if(n.state=t.state,n._state=t._state,n.events=t.events,!a&&U(n,t))return;if("string"==typeof s)switch(null!=n.attrs&&(a?(n.state={},M(n.attrs,n,r)):D(n.attrs,n,r)),s){case"#":h(t,n);break;case"<":v(e,t,n,o);break;case"[":p(e,t,n,a,r,o,l);break;default:m(t,n,a,r,l)}else y(e,t,n,r,o,a,l)}else S(t,null),i(e,n,r,l,o)}function h(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children),t.dom=e.dom}function v(e,t,n,r){t.children!==n.children?(b(t),a(e,n,r)):(n.dom=t.dom,n.domSize=t.domSize)}function p(e,t,n,r,i,o,a){f(e,t.children,n.children,r,i,o,a);var l=0,s=n.children;if(n.dom=null,null!=s){for(var u=0;u<s.length;u++){var c=s[u];null!=c&&null!=c.dom&&(null==n.dom&&(n.dom=c.dom),l+=c.domSize||1)}1!==l&&(n.domSize=l)}}function m(e,t,r,i,o){var a=t.dom=e.dom;switch(t.tag){case"svg":o="http://www.w3.org/2000/svg";break;case"math":o="http://www.w3.org/1998/Math/MathML"}"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0)),z(t,e.attrs,t.attrs,o),null!=t.attrs&&null!=t.attrs.contenteditable?A(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=[n("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[n("#",void 0,void 0,t.text,void 0,void 0)]),f(a,e.children,t.children,r,i,null,o))}function y(e,t,r,o,a,l,s){if(l)u(r,o);else{if(r.instance=n.normalize(r._state.view.call(r.state,r)),r.instance===r)throw Error("A view cannot return the vnode it received as argument");null!=r.attrs&&D(r.attrs,r,o),D(r._state,r,o)}null!=r.instance?(null==t.instance?i(e,r.instance,o,s,a):d(e,t.instance,r.instance,o,a,l,s),r.dom=r.instance.dom,r.domSize=r.instance.domSize):null!=t.instance?(S(t.instance,null),r.dom=void 0,r.domSize=0):(r.dom=t.dom,r.domSize=t.domSize)}function g(e,t){if(null!=e.pool&&Math.abs(e.pool.length-t.length)<=Math.abs(e.length-t.length)){var n=e[0]&&e[0].children&&e[0].children.length||0,r=e.pool[0]&&e.pool[0].children&&e.pool[0].children.length||0,i=t[0]&&t[0].children&&t[0].children.length||0;if(Math.abs(r-i)<=Math.abs(n-i))return!0}return!1}function w(e,t){for(var n={},r=0,r=0;r<t;r++){var i=e[r];if(null!=i){var o=i.key;null!=o&&(n[o]=r)}}return n}function b(e){var t=e.domSize;if(null!=t||null==e.dom){var n=H.createDocumentFragment();if(t>0){for(var r=e.dom;--t;)n.appendChild(r.nextSibling);n.insertBefore(r,n.firstChild)}return n}return e.dom}function x(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function E(e,t,n){n&&n.parentNode?e.insertBefore(t,n):e.appendChild(t)}function A(e){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted")}function k(e,t,n,r){for(var i=t;i<n;i++){var o=e[i];null!=o&&(o.skip?o.skip=!1:S(o,r))}}function S(e,t){function n(){if(++i===r&&(L(e),e.dom)){var n=e.domSize||1;if(n>1)for(var o=e.dom;--n;)_(o.nextSibling);_(e.dom),null==t||null!=e.domSize||$(e.attrs)||"string"!=typeof e.tag||(t.pool?t.pool.push(e):t.pool=[e])}}var r=1,i=0;if(e.attrs&&"function"==typeof e.attrs.onbeforeremove){var o=e.attrs.onbeforeremove.call(e.state,e);null!=o&&"function"==typeof o.then&&(r++,o.then(n,n))}if("string"!=typeof e.tag&&"function"==typeof e._state.onbeforeremove){var o=e._state.onbeforeremove.call(e.state,e);null!=o&&"function"==typeof o.then&&(r++,o.then(n,n))}n()}function _(e){var t=e.parentNode;null!=t&&t.removeChild(e)}function L(e){if(e.attrs&&"function"==typeof e.attrs.onremove&&e.attrs.onremove.call(e.state,e),"string"!=typeof e.tag&&"function"==typeof e._state.onremove&&e._state.onremove.call(e.state,e),null!=e.instance)L(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&&L(r)}}}function j(e,t,n){for(var r in t)C(e,r,null,t[r],n)}function C(e,t,n,r,i){var o=e.dom;if("key"!==t&&"is"!==t&&(n!==r||T(e,t)||"object"==typeof r)&&void 0!==r&&!N(t)){var a=t.indexOf(":");if(a>-1&&"xlink"===t.substr(0,a))o.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(a+1),r);else if("o"===t[0]&&"n"===t[1]&&"function"==typeof r)q(e,t,r);else if("style"===t)I(o,n,r);else if(t in o&&!P(t)&&void 0===i&&!R(e)){if("input"===e.tag&&"value"===t&&e.dom.value==r&&e.dom===H.activeElement)return;if("select"===e.tag&&"value"===t&&e.dom.value==r&&e.dom===H.activeElement)return;if("option"===e.tag&&"value"===t&&e.dom.value==r)return;if("input"===e.tag&&"type"===t)return void o.setAttribute(t,r);o[t]=r}else"boolean"==typeof r?r?o.setAttribute(t,""):o.removeAttribute(t):o.setAttribute("className"===t?"class":t,r)}}function O(e){var t=e.attrs;"select"===e.tag&&null!=t&&("value"in t&&C(e,"value",null,t.value,void 0),"selectedIndex"in t&&C(e,"selectedIndex",null,t.selectedIndex,void 0))}function z(e,t,n,r){if(null!=n)for(var i in n)C(e,i,t&&t[i],n[i],r);if(null!=t)for(var i in t)null!=n&&i in n||("className"===i&&(i="class"),"o"!==i[0]||"n"!==i[1]||N(i)?"key"!==i&&e.dom.removeAttribute(i):q(e,i,void 0))}function T(e,t){return"value"===t||"checked"===t||"selectedIndex"===t||"selected"===t&&e.dom===H.activeElement}function N(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function P(e){return"href"===e||"list"===e||"form"===e||"width"===e||"height"===e}function R(e){return e.attrs.is||e.tag.indexOf("-")>-1}function $(e){return null!=e&&(e.oncreate||e.onupdate||e.onbeforeremove||e.onremove)}function I(e,t,n){if(t===n&&(e.style.cssText="",t=null),null==n)e.style.cssText="";else if("string"==typeof n)e.style.cssText=n;else{"string"==typeof t&&(e.style.cssText="");for(var r in n)e.style[r]=n[r];if(null!=t&&"string"!=typeof t)for(var r in t)r in n||(e.style[r]="")}}function q(e,t,n){var r=e.dom,i="function"!=typeof V?n:function(e){var t=n.call(r,e);return V.call(r,e),t};if(t in r)r[t]="function"==typeof n?i:null;else{var o=t.slice(2);if(void 0===e.events&&(e.events={}),e.events[t]===i)return;null!=e.events[t]&&r.removeEventListener(o,e.events[t],!1),"function"==typeof n&&(e.events[t]=i,r.addEventListener(o,e.events[t],!1))}}function M(e,t,n){"function"==typeof e.oninit&&e.oninit.call(t.state,t),"function"==typeof e.oncreate&&n.push(e.oncreate.bind(t.state,t))}function D(e,t,n){"function"==typeof e.onupdate&&n.push(e.onupdate.bind(t.state,t))}function U(e,t){var n,r;return null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate&&(n=e.attrs.onbeforeupdate.call(e.state,e,t)),"string"!=typeof e.tag&&"function"==typeof e._state.onbeforeupdate&&(r=e._state.onbeforeupdate.call(e.state,e,t)),!(void 0===n&&void 0===r||n||r)&&(e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,!0)}function F(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],i=H.activeElement;null==e.vnodes&&(e.textContent=""),Array.isArray(t)||(t=[t]),f(e,e.vnodes,n.normalizeChildren(t),!1,r,null,void 0),e.vnodes=t;for(var o=0;o<r.length;o++)r[o]();H.activeElement!==i&&i.focus()}var V,H=e.document,B=H.createDocumentFragment();return{render:F,setEventCallback:t}},m=function(e){function t(e,t){n(e),o.push(e,a(t))}function n(e){var t=o.indexOf(e);t>-1&&o.splice(t,2)}function r(){for(var e=1;e<o.length;e+=2)o[e]()}var i=p(e);i.setEventCallback(function(e){!1!==e.redraw&&r()});var o=[];return{subscribe:t,unsubscribe:n,redraw:r,render:i.render}}(window);v.setCompletionCallback(m.redraw);c.mount=function(e){return function(t,r){if(null===r)return e.render(t,[]),void e.unsubscribe(t);if(null==r.view&&"function"!=typeof r)throw new Error("m.mount(element, component) expects a component, not a vnode");var i=function(){e.render(t,n(r))};e.subscribe(t,i),e.redraw()}}(m);var y=f,g=function(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t=e.split("&"),n={},r={},i=0;i<t.length;i++){var o=t[i].split("="),a=decodeURIComponent(o[0]),l=2===o.length?decodeURIComponent(o[1]):"";"true"===l?l=!0:"false"===l&&(l=!1);var s=a.split(/\]\[?|\[/),u=n;a.indexOf("[")>-1&&s.pop();for(var c=0;c<s.length;c++){var f=s[c],d=s[c+1],h=""==d||!isNaN(parseInt(d,10)),v=c===s.length-1;if(""===f){var a=s.slice(0,c).join();null==r[a]&&(r[a]=0),f=r[a]++}null==u[f]&&(u[f]=v?l:h?[]:{}),u=u[f]}}return n},w=function(e){function t(t){var n=e.location[t].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);return"pathname"===t&&"/"!==n[0]&&(n="/"+n),n}function n(e){return function(){null==i&&(i=a(function(){i=null,e()}))}}function r(e,t,n){var r=e.indexOf("?"),i=e.indexOf("#"),o=r>-1?r:i>-1?i:e.length;if(r>-1){var a=i>-1?i:e.length,l=g(e.slice(r+1,a));for(var s in l)t[s]=l[s]}if(i>-1){var u=g(e.slice(i+1));for(var s in u)n[s]=u[s]}return e.slice(0,o)}var i,o="function"==typeof e.history.pushState,a="function"==typeof setImmediate?setImmediate:setTimeout,l={prefix:"#!"};return l.getPath=function(){switch(l.prefix.charAt(0)){case"#":return t("hash").slice(l.prefix.length);case"?":return t("search").slice(l.prefix.length)+t("hash");default:return t("pathname").slice(l.prefix.length)+t("search")+t("hash")}},l.setPath=function(t,n,i){var a={},s={};if(t=r(t,a,s),null!=n){for(var u in n)a[u]=n[u];t=t.replace(/:([^\/]+)/g,function(e,t){return delete a[t],n[t]})}var c=d(a);c&&(t+="?"+c);var f=d(s);if(f&&(t+="#"+f),o){var h=i?i.state:null,v=i?i.title:null;e.onpopstate(),i&&i.replace?e.history.replaceState(h,v,l.prefix+t):e.history.pushState(h,v,l.prefix+t)}else e.location.href=l.prefix+t},l.defineRoutes=function(t,i,a){function s(){var n=l.getPath(),o={},s=r(n,o,o),u=e.history.state;if(null!=u)for(var c in u)o[c]=u[c];for(var f in t){var d=new RegExp("^"+f.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(d.test(s))return void s.replace(d,function(){for(var e=f.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2),a=0;a<e.length;a++)o[e[a].replace(/:|\./g,"")]=decodeURIComponent(r[a]);i(t[f],o,n,f)})}a(n,o)}o?e.onpopstate=n(s):"#"===l.prefix.charAt(0)&&(e.onhashchange=s),s()},l};c.route=function(e,t){var r,i,o,a,l,s=w(e),u=function(e){return e},c=function(e,c,f){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var d=function(){null!=r&&t.render(e,r(n(i,o.key,o)))},h=function(e){if(e===c)throw new Error("Could not resolve default route "+c);s.setPath(c,null,{replace:!0})};s.defineRoutes(f,function(e,t,n){var s=l=function(e,c){s===l&&(i=null==c||"function"!=typeof c.view&&"function"!=typeof c?"div":c,o=t,a=n,l=null,r=(e.render||u).bind(e),d())};e.view||"function"==typeof e?s({},e):e.onmatch?y.resolve(e.onmatch(t,n)).then(function(t){s(e,t)},h):s(e,"div")},h),t.subscribe(e,d)};return c.set=function(e,t,n){null!=l&&(n={replace:!0}),l=null,s.setPath(e,t,n)},c.get=function(){return a},c.prefix=function(e){s.prefix=e},c.link=function(e){e.dom.setAttribute("href",s.prefix+e.attrs.href),e.dom.onclick=function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault(),e.redraw=!1;var t=this.getAttribute("href");0===t.indexOf(s.prefix)&&(t=t.slice(s.prefix.length)),c.set(t,void 0,void 0)}}},c.param=function(e){return void 0!==o&&void 0!==e?o[e]:o},c}(window,m),c.withAttr=function(e,t,n){return function(r){t.call(n||this,e in r.currentTarget?r.currentTarget[e]:r.currentTarget.getAttribute(e))}};var b=p(window);c.render=b.render,c.redraw=m.redraw,c.request=v.request,c.jsonp=v.jsonp,c.parseQueryString=g,c.buildQueryString=d,c.version="1.1.1",c.vnode=n,void 0!==t?t.exports=c:window.m=c}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,n,r){!function(e){"use strict";function r(){}function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var l=r.prototype,s=e.EventEmitter;l.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},l.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},l.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},l.addListener=function(e,t){if(!a(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===i(r[n],t)&&r[n].push(o?t:{listener:t,once:!1});return this},l.on=o("addListener"),l.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},l.once=o("addOnceListener"),l.defineEvent=function(e){return this.getListeners(e),this},l.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},l.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&-1!==(n=i(o[r],t))&&o[r].splice(n,1);return this},l.off=o("removeListener"),l.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},l.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},l.manipulateListeners=function(e,t,n){var r,i,o=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)o.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?o.call(this,r,i):a.call(this,r,i));return this},l.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},l.removeAllListeners=o("removeEvent"),l.emitEvent=function(e,t){var n,r,i,o,a=this.getListenersAsObject(e)
2
  ;for(o in a)if(a.hasOwnProperty(o))for(n=a[o].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},l.trigger=o("emitEvent"),l.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},l.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},l._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},l._getEvents=function(){return this._events||(this._events={})},r.noConflict=function(){return e.EventEmitter=s,r},"function"==typeof t&&t.amd?t(function(){return r}):"object"==typeof n&&n.exports?n.exports=r:e.EventEmitter=r}(this||{})},{}]},{},[1])}();
3
  //# sourceMappingURL=admin.min.js.map
assets/js/admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","m","window","EventEmitter","context","document","getElementById","events","tabs","helpers","settings","ListFetcher","mount","mc4wp","deps","mithril","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","wolfy87-eventemitter","2","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","addEventListener","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","later","apply","callNow","clearTimeout","setTimeout","showIfElements","getAttribute","checked","value","conditionMet","config","hide","visibility","opacity","inputs","inputElement","removeAttribute","setAttribute","JSON","parse","parentElements","parentElement","3","working","done","mailchimp","api_connected","lists","fetch","$","jQuery","mc4wp_vars","i18n","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","className","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","4","_typeof","Symbol","iterator","obj","constructor","Settings","getSelectedListsWhere","searchKey","searchValue","selectedLists","filter","el","getSelectedLists","updateSelectedLists","listInputs","input","push","trigger","toggleVisibleLists","rows","replace","querySelector","on","5","URL","Tabs","get","id","_open","tab","updateState","$tabs","removeClass","css","$tabNavs","nav","blur","url","setParameter","href","history","pushState","title","refererField","tb_remove","forms","editor","refresh","split","switchTab","tabId","match","urlParams","returnValue","$context","find","each","substring","first","text","open","click","body","activeTab","replaceState","state","./url.js","6","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","7","global","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","compileSelector","classes","selectorParser","exec","attrValue","selectorCache","execSelector","childList","hasAttrs","class","hasOwn","isArray","hyperscript","start","cached","normalized","normalizeChildren","throttle","callback","last","pending","requestAnimationFrame","now","Date","normalize","node","html","fragment","attrs1","PromisePolyfill","executor","list","shouldAbsorb","execute","then","callAsync","console","error","resolvers","rejectors","retry","self","TypeError","executeOnce","rejectCurrent","run","fn","runs","onerror","resolveCurrent","_instance","setImmediate","onFulfilled","onRejection","handle","next","resolveNext","rejectNext","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","object","destructure","key0","Object","toString","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","setCompletionCallback","oncompletion","finalizer","complete","finalize","promise0","then0","extra","request","toUpperCase","useBody","serialize","FormData","stringify","deserialize","extract","interpolate","assemble","xhr","XMLHttpRequest","aborted","_abort","abort","async","user","password","setRequestHeader","withCredentials","headers","onreadystatechange","readyState","response","status","test","cast","responseText","send","background","jsonp","callbackName","Math","round","random","callbackCount","script","createElement","parentNode","removeChild","callbackKey","src","documentElement","appendChild","tokens","slice","querystring","indexOf","type0","coreRenderer","setEventCallback","onevent","createNodes","parent","vnodes","end","hooks","nextSibling","ns","vnode","createNode","createComponent","initLifecycle","createText","createHTML","createFragment","$doc","createTextNode","insertNode","match1","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","firstChild","childNodes","child","createDocumentFragment","attrs2","is","createElementNS","setAttrs","contenteditable","setContentEditable","textContent","setLateAttrs","initComponent","sentinel","create","$$reentrantLock$$","$emptyFragment","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","isRecyclable","pool","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","shouldNotUpdate","updateLifecycle","updateText","updateHTML","updateFragment","updateElement","updateComponent","removeNode","nodeValue","updateAttrs","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","key2","count0","insertBefore","content","continuation","called","expected","onremove","removeNodeFromDOM","hasIntegrationMethods","onbeforeremove","result","setAttr","isFormAttribute","isLifecycleMethod","nsLastIndex","substr","setAttributeNS","updateEvent","updateStyle","isAttribute","isCustomElement","activeElement","selectedIndex","attr","source","oncreate","onupdate","cssText","eventName","removeEventListener","oninit","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","render","active","focus","redrawService","subscribe","key1","unsubscribe","callbacks","index","splice","renderService","redrawService0","root","component","run0","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","normalize1","fragment0","debounceAsync","callback0","asyncId","callAsync0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","supportsPushState","router","prefix","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","onhashchange","route","render1","attrs3","currentPath","lastUpdate","routeService","identity","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","8","indexOfListener","listeners","listener","alias","name","isValidListener","proto","originalGlobalValue","getListeners","evt","_getEvents","flattenListeners","flatListeners","getListenersAsObject","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","removeAllListeners","emitEvent","listenersMap","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,OAAUC,GAAeC,MAASD,IAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,GAAIF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGQ,QAAkD,IAAI,GAA1CL,GAAkB,kBAATX,IAAqBA,EAAgBQ,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,GAAI,OAAOD,KAAKY,GAAG,SAASnB,EAAQoB,EAAOJ,GACvhB,YAIA,IAAIK,GAAIC,OAAOD,EAAIrB,EAAQ,WACvBuB,EAAevB,EAAQ,wBAGvBwB,EAAUC,SAASC,eAAe,eAClCC,EAAS,GAAIJ,GACbK,EAAO5B,EAAQ,mBAAmBwB,GAClCK,EAAU7B,EAAQ,sBAClB8B,EAAW9B,EAAQ,uBAAuBwB,EAASK,EAASF,GAG5DI,EAAc/B,EAAQ,2BACtBgC,EAAQP,SAASC,eAAe,qBAChCM,IACAX,EAAEW,MAAMA,EAAO,GAAID,IAIvBT,OAAOW,MAAQX,OAAOW,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,OAAO7hB,OAQXqgB,EAAMyB,mBAAqB5B,EAAM,eAcjCG,EAAM0B,UAAY,SAAmBvB,EAAKvgB,GACtC,GACI+f,GACAC,EACAvjB,EACAgM,EAJAsZ,EAAehiB,KAAK4gB,qBAAqBJ,EAO7C,KAAK9X,IAAOsZ,GACR,GAAIA,EAAa9Z,eAAeQ,GAG5B,IAFAsX,EAAYgC,EAAatZ,GAAKiJ,MAAM;uDAE/BjV,EAAI,EAAGA,EAAIsjB,EAAU/iB,OAAQP,IAG9BujB,EAAWD,EAAUtjB,IAEC,IAAlBujB,EAASc,MACT/gB,KAAKohB,eAAeZ,EAAKP,EAASA,UAG3BA,EAASA,SAAS7f,MAAMJ,KAAMC,SAExBD,KAAKiiB,uBAClBjiB,KAAKohB,eAAeZ,EAAKP,EAASA,SAMlD,OAAOjgB,OAMXqgB,EAAMvb,QAAUob,EAAM,aAUtBG,EAAM6B,KAAO,SAAc1B,GACvB,GAAIvgB,GAAOT,MAAMC,UAAUkS,MAAM3U,KAAKkD,UAAW,EACjD,OAAOF,MAAK+hB,UAAUvB,EAAKvgB,IAW/BogB,EAAM8B,mBAAqB,SAA4BxhB,GAEnD,MADAX,MAAKoiB,iBAAmBzhB,EACjBX,MAWXqgB,EAAM4B,oBAAsB,WACxB,OAAIjiB,KAAKkI,eAAe,qBACblI,KAAKoiB,kBAapB/B,EAAMI,WAAa,WACf,MAAOzgB,MAAK6hB,UAAY7hB,KAAK6hB,aAQjCvkB,EAAa+kB,WAAa,WAEtB,MADAtlB,GAAQO,aAAegjB,EAChBhjB,GAIW,kBAAXrB,IAAyBA,EAAOqmB,IACvCrmB,EAAO,WACH,MAAOqB,KAGY,gBAAXH,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUO,EAGjBP,EAAQO,aAAeA,GAE7B0C,oBAES","file":"admin.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\n// dependencies\n\nvar m = window.m = require('mithril');\nvar EventEmitter = require('wolfy87-eventemitter');\n\n// vars\nvar context = document.getElementById('mc4wp-admin');\nvar events = new EventEmitter();\nvar tabs = require('./admin/tabs.js')(context);\nvar helpers = require('./admin/helpers.js');\nvar settings = require('./admin/settings.js')(context, helpers, events);\n\n// list fetcher\nvar ListFetcher = require('./admin/list-fetcher.js');\nvar mount = document.getElementById('mc4wp-list-fetcher');\nif (mount) {\n m.mount(mount, new ListFetcher());\n}\n\n// expose some things\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/helpers.js\":2,\"./admin/list-fetcher.js\":3,\"./admin/settings.js\":4,\"./admin/tabs.js\":5,\"mithril\":7,\"wolfy87-eventemitter\":8}],2:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n\tvar elements = document.querySelectorAll(selector);\n\tfor (var i = 0; i < elements.length; i++) {\n\t\tvar show = elements[i].clientHeight <= 0;\n\t\telements[i].style.display = show ? '' : 'none';\n\t}\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n\tif (element.addEventListener) {\n\t\telement.addEventListener(event, handler);\n\t} else if (element.attachEvent) {\n\t\telement.attachEvent('on' + event, handler);\n\t}\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n\tArray.prototype.forEach.call(elements, function (element) {\n\t\thelpers.bindEventToElement(element, event, handler);\n\t});\n};\n\n// polling\nhelpers.debounce = function (func, wait, immediate) {\n\tvar timeout;\n\treturn function () {\n\t\tvar context = this,\n\t\t args = arguments;\n\t\tvar later = function later() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n};\n\n/**\n * Showif.js\n */\n(function () {\n\tvar showIfElements = document.querySelectorAll('[data-showif]');\n\n\t// dependent elements\n\tArray.prototype.forEach.call(showIfElements, function (element) {\n\t\tvar config = JSON.parse(element.getAttribute('data-showif'));\n\t\tvar parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n\t\tvar inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n\t\tvar hide = config.hide === undefined || config.hide;\n\n\t\tfunction toggleElement() {\n\n\t\t\t// do nothing with unchecked radio inputs\n\t\t\tif (this.getAttribute('type') === \"radio\" && !this.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n\t\t\tvar conditionMet = value == config.value;\n\n\t\t\tif (hide) {\n\t\t\t\telement.style.display = conditionMet ? '' : 'none';\n\t\t\t\telement.style.visibility = conditionMet ? '' : 'hidden';\n\t\t\t} else {\n\t\t\t\telement.style.opacity = conditionMet ? '' : '0.4';\n\t\t\t}\n\n\t\t\t// disable input fields to stop sending their values to server\n\t\t\tArray.prototype.forEach.call(inputs, function (inputElement) {\n\t\t\t\tconditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n\t\t\t});\n\t\t}\n\n\t\t// find checked element and call toggleElement function\n\t\tArray.prototype.forEach.call(parentElements, function (parentElement) {\n\t\t\ttoggleElement.call(parentElement);\n\t\t});\n\n\t\t// bind on all changes\n\t\thelpers.bindEventToElements(parentElements, 'change', toggleElement);\n\t});\n})();\n\nmodule.exports = helpers;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false;\n\n // start fetching right away when no lists but api key given\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n\n this.working = true;\n this.done = false;\n\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\"\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' &nbsp; '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' &nbsp; '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar Settings = function Settings(context, helpers, events) {\n\t'use strict';\n\n\t// vars\n\n\tvar form = context.querySelector('form');\n\tvar listInputs = context.querySelectorAll('.mc4wp-list-input');\n\tvar lists = mc4wp_vars.mailchimp.lists;\n\tvar selectedLists = [];\n\n\t// functions\n\tfunction getSelectedListsWhere(searchKey, searchValue) {\n\t\treturn selectedLists.filter(function (el) {\n\t\t\treturn el[searchKey] === searchValue;\n\t\t});\n\t}\n\n\tfunction getSelectedLists() {\n\t\treturn selectedLists;\n\t}\n\n\tfunction updateSelectedLists() {\n\t\tselectedLists = [];\n\n\t\tArray.prototype.forEach.call(listInputs, function (input) {\n\t\t\t// skip unchecked checkboxes\n\t\t\tif (typeof input.checked === \"boolean\" && !input.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_typeof(lists[input.value]) === \"object\") {\n\t\t\t\tselectedLists.push(lists[input.value]);\n\t\t\t}\n\t\t});\n\n\t\tevents.trigger('selectedLists.change', [selectedLists]);\n\t\treturn selectedLists;\n\t}\n\n\tfunction toggleVisibleLists() {\n\t\tvar rows = document.querySelectorAll('.lists--only-selected > *');\n\t\tArray.prototype.forEach.call(rows, function (el) {\n\n\t\t\tvar listId = el.getAttribute('data-list-id');\n\t\t\tvar isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n\t\t\tif (isSelected) {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n\t\t\t} else {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class') + \" hidden\");\n\t\t\t}\n\t\t});\n\t}\n\n\tevents.on('selectedLists.change', toggleVisibleLists);\n\thelpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n\n\tupdateSelectedLists();\n\n\treturn {\n\t\tgetSelectedLists: getSelectedLists\n\t};\n};\n\nmodule.exports = Settings;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js');\n\n// Tabs\nvar Tabs = function Tabs(context) {\n\n\t// TODO: last piece of jQuery... can we get rid of it?\n\tvar $ = window.jQuery;\n\n\tvar $context = $(context);\n\tvar $tabs = $context.find('.tab');\n\tvar $tabNavs = $context.find('.nav-tab');\n\tvar refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n\tvar tabs = [];\n\n\t$.each($tabs, function (i, t) {\n\t\tvar id = t.id.substring(4);\n\t\tvar title = $(t).find('h2').first().text();\n\n\t\ttabs.push({\n\t\t\tid: id,\n\t\t\ttitle: title,\n\t\t\telement: t,\n\t\t\tnav: context.querySelectorAll('.nav-tab-' + id),\n\t\t\topen: function open() {\n\t\t\t\treturn _open(id);\n\t\t\t}\n\t\t});\n\t});\n\n\tfunction get(id) {\n\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tif (tabs[i].id === id) {\n\t\t\t\treturn tabs[i];\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction _open(tab, updateState) {\n\n\t\t// make sure we have a tab object\n\t\tif (typeof tab === \"string\") {\n\t\t\ttab = get(tab);\n\t\t}\n\n\t\tif (!tab) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// should we update state?\n\t\tif (updateState == undefined) {\n\t\t\tupdateState = true;\n\t\t}\n\n\t\t// hide all tabs & remove active class\n\t\t$tabs.removeClass('tab-active').css('display', 'none');\n\t\t$tabNavs.removeClass('nav-tab-active');\n\n\t\t// add `nav-tab-active` to this tab\n\t\tArray.prototype.forEach.call(tab.nav, function (nav) {\n\t\t\tnav.className += \" nav-tab-active\";\n\t\t\tnav.blur();\n\t\t});\n\n\t\t// show target tab\n\t\ttab.element.style.display = 'block';\n\t\ttab.element.className += \" tab-active\";\n\n\t\t// create new URL\n\t\tvar url = URL.setParameter(window.location.href, \"tab\", tab.id);\n\n\t\t// update hash\n\t\tif (history.pushState && updateState) {\n\t\t\thistory.pushState(tab.id, '', url);\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\n\t\t// update referer field\n\t\trefererField.value = url;\n\n\t\t// if thickbox is open, close it.\n\t\tif (typeof tb_remove === \"function\") {\n\t\t\ttb_remove();\n\t\t}\n\n\t\t// refresh editor after switching tabs\n\t\t// TODO: decouple this! law of demeter etc.\n\t\tif (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n\t\t\tmc4wp.forms.editor.refresh();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction title(tab) {\n\t\tvar title = document.title.split('-');\n\t\tdocument.title = document.title.replace(title[0], tab.title + \" \");\n\t}\n\n\tfunction switchTab(e) {\n\t\te = e || window.event;\n\n\t\t// get from data attribute\n\t\tvar tabId = this.getAttribute('data-tab');\n\n\t\t// get from classname\n\t\tif (!tabId) {\n\t\t\tvar match = this.className.match(/nav-tab-(\\w+)?/);\n\t\t\tif (match) {\n\t\t\t\ttabId = match[1];\n\t\t\t}\n\t\t}\n\n\t\t// get from href\n\t\tif (!tabId) {\n\t\t\tvar urlParams = URL.parse(this.href);\n\t\t\tif (!urlParams.tab) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttabId = urlParams.tab;\n\t\t}\n\n\t\tvar opened = _open(tabId);\n\n\t\tif (opened) {\n\t\t\te.preventDefault();\n\t\t\te.returnValue = false;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction init() {\n\n\t\t// check for current tab\n\t\tif (!history.pushState) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar activeTab = $tabs.filter(':visible').get(0);\n\t\tif (!activeTab) {\n\t\t\treturn;\n\t\t}\n\t\tvar tab = get(activeTab.id.substring(4));\n\t\tif (!tab) return;\n\n\t\t// check if tab is in html5 history\n\t\tif (history.replaceState && history.state === null) {\n\t\t\thistory.replaceState(tab.id, '');\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\t}\n\n\t$tabNavs.click(switchTab);\n\t$(document.body).on('click', '.tab-link', switchTab);\n\tinit();\n\n\tif (window.addEventListener && history.pushState) {\n\t\twindow.addEventListener('popstate', function (e) {\n\t\t\tif (!e.state) return true;\n\t\t\tvar tabId = e.state;\n\t\t\treturn _open(tabId, false);\n\t\t});\n\t}\n\n\treturn {\n\t\topen: _open,\n\t\tget: get\n\t};\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":6}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n\tparse: function parse(url) {\n\t\tvar query = {};\n\t\tvar a = url.split('&');\n\t\tfor (var i in a) {\n\t\t\tif (!a.hasOwnProperty(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar b = a[i].split('=');\n\t\t\tquery[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n\t\t}\n\n\t\treturn query;\n\t},\n\tbuild: function build(data) {\n\t\tvar ret = [];\n\t\tfor (var d in data) {\n\t\t\tret.push(d + \"=\" + encodeURIComponent(data[d]));\n\t\t}return ret.join(\"&\");\n\t},\n\tsetParameter: function setParameter(url, key, value) {\n\t\tvar data = URL.parse(url);\n\t\tdata[key] = value;\n\t\treturn URL.build(data);\n\t}\n};\n\nmodule.exports = URL;\n\n},{}],7:[function(require,module,exports){\n(function (global){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction 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 || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tswitch (vnode.tag) {\n\t\t\tcase \"svg\": ns = \"http://www.w3.org/2000/svg\"; break\n\t\t\tcase \"math\": ns = \"http://www.w3.org/1998/Math/MathML\"; break\n\t\t}\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, undefined)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, undefined, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tswitch (vnode.tag) {\n\t\t\tcase \"svg\": ns = \"http://www.w3.org/2000/svg\"; break\n\t\t\tcase \"math\": ns = \"http://www.w3.org/1998/Math/MathML\"; break\n\t\t}\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\telse {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\tif (vnode.tag === \"input\" && key2 === \"value\" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return\n\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\tif (vnode.tag === \"select\" && key2 === \"value\" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return\n\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\tif (vnode.tag === \"option\" && key2 === \"value\" && vnode.dom.value == value) return\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, undefined)\n\t\tdom.vnodes = vnodes\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t\tif ($doc.activeElement !== active) active.focus()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw !== false) redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) options = {replace: true}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.1\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],8:[function(require,module,exports){\n/*!\n * EventEmitter v5.1.0 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n })();"]}
1
+ {"version":3,"sources":["admin.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","m","window","EventEmitter","context","document","getElementById","events","tabs","helpers","settings","ListFetcher","mount","mc4wp","deps","mithril","./admin/helpers.js","./admin/list-fetcher.js","./admin/settings.js","./admin/tabs.js","wolfy87-eventemitter","2","toggleElement","selector","elements","querySelectorAll","show","clientHeight","style","display","bindEventToElement","element","event","handler","addEventListener","attachEvent","bindEventToElements","Array","prototype","forEach","debounce","func","wait","immediate","timeout","this","args","arguments","later","apply","callNow","clearTimeout","setTimeout","showIfElements","getAttribute","checked","value","conditionMet","config","hide","visibility","opacity","inputs","inputElement","removeAttribute","setAttribute","JSON","parse","parentElements","parentElement","3","working","done","mailchimp","api_connected","lists","fetch","$","jQuery","mc4wp_vars","i18n","preventDefault","post","ajaxurl","action","data","success","location","reload","bind","fail","always","redraw","view","method","onsubmit","type","fetching_mailchimp_lists","renew_mailchimp_lists","className","disabled","trust","fetching_mailchimp_lists_can_take_a_while","fetching_mailchimp_lists_done","fetching_mailchimp_lists_error","4","_typeof","Symbol","iterator","obj","constructor","Settings","getSelectedListsWhere","searchKey","searchValue","selectedLists","filter","el","getSelectedLists","updateSelectedLists","listInputs","input","push","trigger","toggleVisibleLists","rows","replace","querySelector","on","5","URL","Tabs","get","id","_open","tab","updateState","$tabs","removeClass","css","$tabNavs","nav","blur","url","setParameter","href","history","pushState","title","refererField","tb_remove","forms","editor","refresh","split","switchTab","tabId","match","urlParams","returnValue","$context","find","each","substring","first","text","open","click","body","activeTab","replaceState","state","./url.js","6","query","hasOwnProperty","b","decodeURIComponent","build","ret","d","encodeURIComponent","join","key","7","global","Vnode","tag","attrs0","children","dom","attrs","domSize","_state","instance","skip","compileSelector","classes","selectorParser","exec","attrValue","selectorCache","execSelector","childList","hasAttrs","class","hasOwn","isArray","hyperscript","start","cached","normalized","normalizeChildren","throttle","callback","last","pending","requestAnimationFrame","now","Date","normalize","node","html","fragment","attrs1","PromisePolyfill","executor","list","shouldAbsorb","execute","then","callAsync","console","error","resolvers","rejectors","retry","self","TypeError","executeOnce","rejectCurrent","run","fn","runs","onerror","resolveCurrent","_instance","setImmediate","onFulfilled","onRejection","handle","next","resolveNext","rejectNext","promise","resolve","reject","catch","all","total","count","values","consume","race","Promise","buildQueryString","object","destructure","key0","Object","toString","FILE_PROTOCOL_REGEX","RegExp","requestService","$window","setCompletionCallback","oncompletion","finalizer","complete","finalize","promise0","then0","extra","request","toUpperCase","useBody","serialize","FormData","stringify","deserialize","extract","interpolate","assemble","xhr","XMLHttpRequest","aborted","_abort","abort","async","user","password","setRequestHeader","withCredentials","headers","onreadystatechange","readyState","response","status","test","cast","responseText","send","background","jsonp","callbackName","Math","round","random","callbackCount","script","createElement","parentNode","removeChild","callbackKey","src","documentElement","appendChild","tokens","slice","querystring","indexOf","type0","coreRenderer","setEventCallback","onevent","createNodes","parent","vnodes","end","hooks","nextSibling","ns","vnode","createNode","createComponent","initLifecycle","createText","createHTML","createFragment","$doc","createTextNode","insertNode","match1","parent1","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","firstChild","childNodes","child","createDocumentFragment","attrs2","is","createElementNS","setAttrs","contenteditable","setContentEditable","textContent","setLateAttrs","initComponent","sentinel","create","$$reentrantLock$$","$emptyFragment","updateNodes","old","recycling","removeNodes","isUnkeyed","getNextSibling","updateNode","isRecyclable","pool","concat","map","oldStart","oldEnd","v","shouldRecycle","toFragment","getKeyMap","oldIndex","movable","oldTag","shouldNotUpdate","updateLifecycle","updateText","updateHTML","updateFragment","updateElement","updateComponent","removeNode","nodeValue","updateAttrs","abs","oldChildrenLength","poolChildrenLength","vnodesChildrenLength","key2","count0","insertBefore","content","continuation","called","expected","onremove","removeNodeFromDOM","hasIntegrationMethods","onbeforeremove","result","setAttr","isFormAttribute","isLifecycleMethod","nsLastIndex","substr","setAttributeNS","updateEvent","updateStyle","isAttribute","isCustomElement","activeElement","selectedIndex","attr","source","oncreate","onupdate","cssText","eventName","removeEventListener","oninit","forceVnodeUpdate","forceComponentUpdate","onbeforeupdate","render","active","focus","redrawService","subscribe","key1","unsubscribe","callbacks","index","splice","renderService","redrawService0","root","component","run0","parseQueryString","string","charAt","entries","data0","counters","entry","key5","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","isValue","coreRouter","normalize1","fragment0","debounceAsync","callback0","asyncId","callAsync0","parsePath","path","queryData","hashData","queryIndex","hashIndex","pathEnd","queryEnd","queryParams","key4","hashParams","supportsPushState","router","prefix","getPath","setPath","options","match2","token","hash","onpopstate","defineRoutes","routes","resolveRoute","params","pathname","k","route0","matcher","keys","onhashchange","route","render1","attrs3","currentPath","lastUpdate","routeService","identity","defaultRoute","run1","bail","payload","update","routeResolver","comp","onmatch","resolved","set","prefix0","link","vnode1","onclick","ctrlKey","metaKey","shiftKey","which","param","key3","withAttr","attrName","callback1","currentTarget","_28","version","8","indexOfListener","listeners","listener","alias","name","isValidListener","proto","originalGlobalValue","getListeners","evt","_getEvents","flattenListeners","flatListeners","getListenersAsObject","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","_events","removeAllListeners","emitEvent","listenersMap","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,OAAUC,GAAeC,MAASD,IAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAI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MlD,OAAOjgB,OAMXqgB,EAAMvb,QAAUob,EAAM,aAUtBG,EAAM6B,KAAO,SAAc1B,GACvB,GAAIvgB,GAAOT,MAAMC,UAAUkS,MAAM3U,KAAKkD,UAAW,EACjD,OAAOF,MAAK+hB,UAAUvB,EAAKvgB,IAW/BogB,EAAM8B,mBAAqB,SAA4BxhB,GAEnD,MADAX,MAAKoiB,iBAAmBzhB,EACjBX,MAWXqgB,EAAM4B,oBAAsB,WACxB,OAAIjiB,KAAKkI,eAAe,qBACblI,KAAKoiB,kBAapB/B,EAAMI,WAAa,WACf,MAAOzgB,MAAK6hB,UAAY7hB,KAAK6hB,aAQjCvkB,EAAa+kB,WAAa,WAEtB,MADAtlB,GAAQO,aAAegjB,EAChBhjB,GAIW,kBAAXrB,IAAyBA,EAAOqmB,IACvCrmB,EAAO,WACH,MAAOqB,KAGY,gBAAXH,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUO,EAGjBP,EAAQO,aAAeA,GAE7B0C,oBAES","file":"admin.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\n// dependencies\n\nvar m = window.m = require('mithril');\nvar EventEmitter = require('wolfy87-eventemitter');\n\n// vars\nvar context = document.getElementById('mc4wp-admin');\nvar events = new EventEmitter();\nvar tabs = require('./admin/tabs.js')(context);\nvar helpers = require('./admin/helpers.js');\nvar settings = require('./admin/settings.js')(context, helpers, events);\n\n// list fetcher\nvar ListFetcher = require('./admin/list-fetcher.js');\nvar mount = document.getElementById('mc4wp-list-fetcher');\nif (mount) {\n m.mount(mount, new ListFetcher());\n}\n\n// expose some things\nwindow.mc4wp = window.mc4wp || {};\nwindow.mc4wp.deps = window.mc4wp.deps || {};\nwindow.mc4wp.deps.mithril = m;\nwindow.mc4wp.helpers = helpers;\nwindow.mc4wp.events = events;\nwindow.mc4wp.settings = settings;\nwindow.mc4wp.tabs = tabs;\n\n},{\"./admin/helpers.js\":2,\"./admin/list-fetcher.js\":3,\"./admin/settings.js\":4,\"./admin/tabs.js\":5,\"mithril\":7,\"wolfy87-eventemitter\":8}],2:[function(require,module,exports){\n'use strict';\n\nvar helpers = {};\n\nhelpers.toggleElement = function (selector) {\n\tvar elements = document.querySelectorAll(selector);\n\tfor (var i = 0; i < elements.length; i++) {\n\t\tvar show = elements[i].clientHeight <= 0;\n\t\telements[i].style.display = show ? '' : 'none';\n\t}\n};\n\nhelpers.bindEventToElement = function (element, event, handler) {\n\tif (element.addEventListener) {\n\t\telement.addEventListener(event, handler);\n\t} else if (element.attachEvent) {\n\t\telement.attachEvent('on' + event, handler);\n\t}\n};\n\nhelpers.bindEventToElements = function (elements, event, handler) {\n\tArray.prototype.forEach.call(elements, function (element) {\n\t\thelpers.bindEventToElement(element, event, handler);\n\t});\n};\n\n// polling\nhelpers.debounce = function (func, wait, immediate) {\n\tvar timeout;\n\treturn function () {\n\t\tvar context = this,\n\t\t args = arguments;\n\t\tvar later = function later() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n};\n\n/**\n * Showif.js\n */\n(function () {\n\tvar showIfElements = document.querySelectorAll('[data-showif]');\n\n\t// dependent elements\n\tArray.prototype.forEach.call(showIfElements, function (element) {\n\t\tvar config = JSON.parse(element.getAttribute('data-showif'));\n\t\tvar parentElements = document.querySelectorAll('[name=\"' + config.element + '\"]');\n\t\tvar inputs = element.querySelectorAll('input,select,textarea:not([readonly])');\n\t\tvar hide = config.hide === undefined || config.hide;\n\n\t\tfunction toggleElement() {\n\n\t\t\t// do nothing with unchecked radio inputs\n\t\t\tif (this.getAttribute('type') === \"radio\" && !this.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar value = this.getAttribute(\"type\") === \"checkbox\" ? this.checked : this.value;\n\t\t\tvar conditionMet = value == config.value;\n\n\t\t\tif (hide) {\n\t\t\t\telement.style.display = conditionMet ? '' : 'none';\n\t\t\t\telement.style.visibility = conditionMet ? '' : 'hidden';\n\t\t\t} else {\n\t\t\t\telement.style.opacity = conditionMet ? '' : '0.4';\n\t\t\t}\n\n\t\t\t// disable input fields to stop sending their values to server\n\t\t\tArray.prototype.forEach.call(inputs, function (inputElement) {\n\t\t\t\tconditionMet ? inputElement.removeAttribute('readonly') : inputElement.setAttribute('readonly', 'readonly');\n\t\t\t});\n\t\t}\n\n\t\t// find checked element and call toggleElement function\n\t\tArray.prototype.forEach.call(parentElements, function (parentElement) {\n\t\t\ttoggleElement.call(parentElement);\n\t\t});\n\n\t\t// bind on all changes\n\t\thelpers.bindEventToElements(parentElements, 'change', toggleElement);\n\t});\n})();\n\nmodule.exports = helpers;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar config = mc4wp_vars;\nvar i18n = config.i18n;\n\nfunction ListFetcher() {\n this.working = false;\n this.done = false;\n\n // start fetching right away when no lists but api key given\n if (config.mailchimp.api_connected && config.mailchimp.lists.length === 0) {\n this.fetch();\n }\n}\n\nListFetcher.prototype.fetch = function (e) {\n e && e.preventDefault();\n\n this.working = true;\n this.done = false;\n\n $.post(ajaxurl, {\n action: \"mc4wp_renew_mailchimp_lists\",\n timeout: 180000\n }).done(function (data) {\n this.success = true;\n\n if (data) {\n window.setTimeout(function () {\n window.location.reload();\n }, 3000);\n }\n }.bind(this)).fail(function (data) {\n this.success = false;\n }.bind(this)).always(function (data) {\n this.working = false;\n this.done = true;\n\n m.redraw();\n }.bind(this));\n};\n\nListFetcher.prototype.view = function () {\n return m('form', {\n method: \"POST\",\n onsubmit: this.fetch.bind(this)\n }, [m('p', [m('input', {\n type: \"submit\",\n value: this.working ? i18n.fetching_mailchimp_lists : i18n.renew_mailchimp_lists,\n className: \"button\",\n disabled: !!this.working\n }), m.trust(' &nbsp; '), this.working ? [m('span.mc4wp-loader', \"Loading...\"), m.trust(' &nbsp; '), m('em.help', i18n.fetching_mailchimp_lists_can_take_a_while)] : '', this.done ? [this.success ? m('em.help.green', i18n.fetching_mailchimp_lists_done) : m('em.help.red', i18n.fetching_mailchimp_lists_error)] : ''])]);\n};\n\nmodule.exports = ListFetcher;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar Settings = function Settings(context, helpers, events) {\n\t'use strict';\n\n\t// vars\n\n\tvar form = context.querySelector('form');\n\tvar listInputs = context.querySelectorAll('.mc4wp-list-input');\n\tvar lists = mc4wp_vars.mailchimp.lists;\n\tvar selectedLists = [];\n\n\t// functions\n\tfunction getSelectedListsWhere(searchKey, searchValue) {\n\t\treturn selectedLists.filter(function (el) {\n\t\t\treturn el[searchKey] === searchValue;\n\t\t});\n\t}\n\n\tfunction getSelectedLists() {\n\t\treturn selectedLists;\n\t}\n\n\tfunction updateSelectedLists() {\n\t\tselectedLists = [];\n\n\t\tArray.prototype.forEach.call(listInputs, function (input) {\n\t\t\t// skip unchecked checkboxes\n\t\t\tif (typeof input.checked === \"boolean\" && !input.checked) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_typeof(lists[input.value]) === \"object\") {\n\t\t\t\tselectedLists.push(lists[input.value]);\n\t\t\t}\n\t\t});\n\n\t\tevents.trigger('selectedLists.change', [selectedLists]);\n\t\treturn selectedLists;\n\t}\n\n\tfunction toggleVisibleLists() {\n\t\tvar rows = document.querySelectorAll('.lists--only-selected > *');\n\t\tArray.prototype.forEach.call(rows, function (el) {\n\n\t\t\tvar listId = el.getAttribute('data-list-id');\n\t\t\tvar isSelected = getSelectedListsWhere('id', listId).length > 0;\n\n\t\t\tif (isSelected) {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class').replace('hidden', ''));\n\t\t\t} else {\n\t\t\t\tel.setAttribute('class', el.getAttribute('class') + \" hidden\");\n\t\t\t}\n\t\t});\n\t}\n\n\tevents.on('selectedLists.change', toggleVisibleLists);\n\thelpers.bindEventToElements(listInputs, 'change', updateSelectedLists);\n\n\tupdateSelectedLists();\n\n\treturn {\n\t\tgetSelectedLists: getSelectedLists\n\t};\n};\n\nmodule.exports = Settings;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nvar URL = require('./url.js');\n\n// Tabs\nvar Tabs = function Tabs(context) {\n\n\t// TODO: last piece of jQuery... can we get rid of it?\n\tvar $ = window.jQuery;\n\n\tvar $context = $(context);\n\tvar $tabs = $context.find('.tab');\n\tvar $tabNavs = $context.find('.nav-tab');\n\tvar refererField = context.querySelector('input[name=\"_wp_http_referer\"]');\n\tvar tabs = [];\n\n\t$.each($tabs, function (i, t) {\n\t\tvar id = t.id.substring(4);\n\t\tvar title = $(t).find('h2').first().text();\n\n\t\ttabs.push({\n\t\t\tid: id,\n\t\t\ttitle: title,\n\t\t\telement: t,\n\t\t\tnav: context.querySelectorAll('.nav-tab-' + id),\n\t\t\topen: function open() {\n\t\t\t\treturn _open(id);\n\t\t\t}\n\t\t});\n\t});\n\n\tfunction get(id) {\n\n\t\tfor (var i = 0; i < tabs.length; i++) {\n\t\t\tif (tabs[i].id === id) {\n\t\t\t\treturn tabs[i];\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction _open(tab, updateState) {\n\n\t\t// make sure we have a tab object\n\t\tif (typeof tab === \"string\") {\n\t\t\ttab = get(tab);\n\t\t}\n\n\t\tif (!tab) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// should we update state?\n\t\tif (updateState == undefined) {\n\t\t\tupdateState = true;\n\t\t}\n\n\t\t// hide all tabs & remove active class\n\t\t$tabs.removeClass('tab-active').css('display', 'none');\n\t\t$tabNavs.removeClass('nav-tab-active');\n\n\t\t// add `nav-tab-active` to this tab\n\t\tArray.prototype.forEach.call(tab.nav, function (nav) {\n\t\t\tnav.className += \" nav-tab-active\";\n\t\t\tnav.blur();\n\t\t});\n\n\t\t// show target tab\n\t\ttab.element.style.display = 'block';\n\t\ttab.element.className += \" tab-active\";\n\n\t\t// create new URL\n\t\tvar url = URL.setParameter(window.location.href, \"tab\", tab.id);\n\n\t\t// update hash\n\t\tif (history.pushState && updateState) {\n\t\t\thistory.pushState(tab.id, '', url);\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\n\t\t// update referer field\n\t\trefererField.value = url;\n\n\t\t// if thickbox is open, close it.\n\t\tif (typeof tb_remove === \"function\") {\n\t\t\ttb_remove();\n\t\t}\n\n\t\t// refresh editor after switching tabs\n\t\t// TODO: decouple this! law of demeter etc.\n\t\tif (tab.id === 'fields' && window.mc4wp && window.mc4wp.forms && window.mc4wp.forms.editor) {\n\t\t\tmc4wp.forms.editor.refresh();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction title(tab) {\n\t\tvar title = document.title.split('-');\n\t\tdocument.title = document.title.replace(title[0], tab.title + \" \");\n\t}\n\n\tfunction switchTab(e) {\n\t\te = e || window.event;\n\n\t\t// get from data attribute\n\t\tvar tabId = this.getAttribute('data-tab');\n\n\t\t// get from classname\n\t\tif (!tabId) {\n\t\t\tvar match = this.className.match(/nav-tab-(\\w+)?/);\n\t\t\tif (match) {\n\t\t\t\ttabId = match[1];\n\t\t\t}\n\t\t}\n\n\t\t// get from href\n\t\tif (!tabId) {\n\t\t\tvar urlParams = URL.parse(this.href);\n\t\t\tif (!urlParams.tab) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttabId = urlParams.tab;\n\t\t}\n\n\t\tvar opened = _open(tabId);\n\n\t\tif (opened) {\n\t\t\te.preventDefault();\n\t\t\te.returnValue = false;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction init() {\n\n\t\t// check for current tab\n\t\tif (!history.pushState) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar activeTab = $tabs.filter(':visible').get(0);\n\t\tif (!activeTab) {\n\t\t\treturn;\n\t\t}\n\t\tvar tab = get(activeTab.id.substring(4));\n\t\tif (!tab) return;\n\n\t\t// check if tab is in html5 history\n\t\tif (history.replaceState && history.state === null) {\n\t\t\thistory.replaceState(tab.id, '');\n\t\t}\n\n\t\t// update document title\n\t\ttitle(tab);\n\t}\n\n\t$tabNavs.click(switchTab);\n\t$(document.body).on('click', '.tab-link', switchTab);\n\tinit();\n\n\tif (window.addEventListener && history.pushState) {\n\t\twindow.addEventListener('popstate', function (e) {\n\t\t\tif (!e.state) return true;\n\t\t\tvar tabId = e.state;\n\t\t\treturn _open(tabId, false);\n\t\t});\n\t}\n\n\treturn {\n\t\topen: _open,\n\t\tget: get\n\t};\n};\n\nmodule.exports = Tabs;\n\n},{\"./url.js\":6}],6:[function(require,module,exports){\n'use strict';\n\nvar URL = {\n\tparse: function parse(url) {\n\t\tvar query = {};\n\t\tvar a = url.split('&');\n\t\tfor (var i in a) {\n\t\t\tif (!a.hasOwnProperty(i)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar b = a[i].split('=');\n\t\t\tquery[decodeURIComponent(b[0])] = decodeURIComponent(b[1]);\n\t\t}\n\n\t\treturn query;\n\t},\n\tbuild: function build(data) {\n\t\tvar ret = [];\n\t\tfor (var d in data) {\n\t\t\tret.push(d + \"=\" + encodeURIComponent(data[d]));\n\t\t}return ret.join(\"&\");\n\t},\n\tsetParameter: function setParameter(url, key, value) {\n\t\tvar data = URL.parse(url);\n\t\tdata[key] = value;\n\t\treturn URL.build(data);\n\t}\n};\n\nmodule.exports = URL;\n\n},{}],7:[function(require,module,exports){\n(function (global){\n;(function() {\n\"use strict\"\nfunction Vnode(tag, key, attrs0, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node != null && typeof node !== \"object\") return Vnode(\"#\", undefined, undefined, node === false ? \"\" : node, undefined, undefined)\n\treturn node\n}\nVnode.normalizeChildren = function normalizeChildren(children) {\n\tfor (var i = 0; i < children.length; i++) {\n\t\tchildren[i] = Vnode.normalize(children[i])\n\t}\n\treturn children\n}\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\nvar hasOwn = {}.hasOwnProperty\nfunction 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 || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\nfunction execSelector(state, attrs, children) {\n\tvar hasAttrs = false, childList, text\n\tvar className = attrs.className || attrs.class\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key)) {\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className !== undefined) {\n\t\tif (attrs.class !== undefined) {\n\t\t\tattrs.class = undefined\n\t\t\tattrs.className = className\n\t\t}\n\t\tif (state.attrs.className != null) {\n\t\t\tattrs.className = state.attrs.className + \" \" + className\n\t\t}\n\t}\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\thasAttrs = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n\t\ttext = children[0].children\n\t} else {\n\t\tchildList = children\n\t}\n\treturn Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)\n}\nfunction hyperscript(selector) {\n\t// Because sloppy mode sucks\n\tvar attrs = arguments[1], start = 2, children\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\tif (typeof selector === \"string\") {\n\t\tvar cached = selectorCache[selector] || compileSelector(selector)\n\t}\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = 1\n\t}\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\tvar normalized = Vnode.normalizeChildren(children)\n\tif (typeof selector === \"string\") {\n\t\treturn execSelector(cached, attrs, normalized)\n\t} else {\n\t\treturn Vnode(selector, attrs.key, attrs, normalized)\n\t}\n}\nhyperscript.trust = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\nhyperscript.fragment = function(attrs1, children) {\n\treturn Vnode(\"[\", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)\n}\nvar m = hyperscript\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\")\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") window.Promise = PromisePolyfill\n\tvar PromisePolyfill = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") global.Promise = PromisePolyfill\n\tvar PromisePolyfill = global.Promise\n} else {\n}\nvar buildQueryString = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\tvar args = []\n\tfor (var key0 in object) {\n\t\tdestructure(key0, object[key0])\n\t}\n\treturn args.join(\"&\")\n\tfunction destructure(key0, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key0 + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key0) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\nvar FILE_PROTOCOL_REGEX = new RegExp(\"^file://\", \"i\")\nvar _8 = function($window, Promise) {\n\tvar callbackCount = 0\n\tvar oncompletion\n\tfunction setCompletionCallback(callback) {oncompletion = callback}\n\tfunction finalizer() {\n\t\tvar count = 0\n\t\tfunction complete() {if (--count === 0 && typeof oncompletion === \"function\") oncompletion()}\n\t\treturn function finalize(promise0) {\n\t\t\tvar then0 = promise0.then\n\t\t\tpromise0.then = function() {\n\t\t\t\tcount++\n\t\t\t\tvar next = then0.apply(promise0, arguments)\n\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\tcomplete()\n\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t})\n\t\t\t\treturn finalize(next)\n\t\t\t}\n\t\t\treturn promise0\n\t\t}\n\t}\n\tfunction normalize(args, extra) {\n\t\tif (typeof args === \"string\") {\n\t\t\tvar url = args\n\t\t\targs = extra || {}\n\t\t\tif (args.url == null) args.url = url\n\t\t}\n\t\treturn args\n\t}\n\tfunction request(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tif (args.method == null) args.method = \"GET\"\n\t\t\targs.method = args.method.toUpperCase()\n\t\t\tvar useBody = (args.method === \"GET\" || args.method === \"TRACE\") ? false : (typeof args.useBody === \"boolean\" ? args.useBody : true)\n\t\t\tif (typeof args.serialize !== \"function\") args.serialize = typeof FormData !== \"undefined\" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify\n\t\t\tif (typeof args.deserialize !== \"function\") args.deserialize = deserialize\n\t\t\tif (typeof args.extract !== \"function\") args.extract = extract\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\tif (useBody) args.data = args.serialize(args.data)\n\t\t\telse args.url = assemble(args.url, args.data)\n\t\t\tvar xhr = new $window.XMLHttpRequest(),\n\t\t\t\taborted = false,\n\t\t\t\t_abort = xhr.abort\n\t\t\txhr.abort = function abort() {\n\t\t\t\taborted = true\n\t\t\t\t_abort.call(xhr)\n\t\t\t}\n\t\t\txhr.open(args.method, args.url, typeof args.async === \"boolean\" ? args.async : true, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\t\t\tif (args.serialize === JSON.stringify && useBody) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (args.deserialize === deserialize) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tfor (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {\n\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t}\n\t\t\tif (typeof args.config === \"function\") xhr = args.config(xhr, args) || xhr\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif(aborted) return\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))\n\t\t\t\t\t\tif ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {\n\t\t\t\t\t\t\tresolve(cast(args.type, response))\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar error = new Error(xhr.responseText)\n\t\t\t\t\t\t\tfor (var key in response) error[key] = response[key]\n\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (useBody && (args.data != null)) xhr.send(args.data)\n\t\t\telse xhr.send()\n\t\t})\n\t\treturn args.background === true ? promise0 : finalize(promise0)\n\t}\n\tfunction jsonp(args, extra) {\n\t\tvar finalize = finalizer()\n\t\targs = normalize(args, extra)\n\t\tvar promise0 = new Promise(function(resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(cast(args.type, data))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t\tdelete $window[callbackName]\n\t\t\t}\n\t\t\tif (args.data == null) args.data = {}\n\t\t\targs.url = interpolate(args.url, args.data)\n\t\t\targs.data[args.callbackKey || \"callback\"] = callbackName\n\t\t\tscript.src = assemble(args.url, args.data)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t})\n\t\treturn args.background === true? promise0 : finalize(promise0)\n\t}\n\tfunction interpolate(url, data) {\n\t\tif (data == null) return url\n\t\tvar tokens = url.match(/:[^\\/]+/gi) || []\n\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\tvar key = tokens[i].slice(1)\n\t\t\tif (data[key] != null) {\n\t\t\t\turl = url.replace(tokens[i], data[key])\n\t\t\t}\n\t\t}\n\t\treturn url\n\t}\n\tfunction assemble(url, data) {\n\t\tvar querystring = buildQueryString(data)\n\t\tif (querystring !== \"\") {\n\t\t\tvar prefix = url.indexOf(\"?\") < 0 ? \"?\" : \"&\"\n\t\t\turl += prefix + querystring\n\t\t}\n\t\treturn url\n\t}\n\tfunction deserialize(data) {\n\t\ttry {return data !== \"\" ? JSON.parse(data) : null}\n\t\tcatch (e) {throw new Error(data)}\n\t}\n\tfunction extract(xhr) {return xhr.responseText}\n\tfunction cast(type0, data) {\n\t\tif (typeof type0 === \"function\") {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\tdata[i] = new type0(data[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return new type0(data)\n\t\t}\n\t\treturn data\n\t}\n\treturn {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}\n}\nvar requestService = _8(window, PromisePolyfill)\nvar coreRenderer = function($window) {\n\tvar $doc = $window.document\n\tvar $emptyFragment = $doc.createDocumentFragment()\n\tvar onevent\n\tfunction setEventCallback(callback) {return onevent = callback}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": return createText(parent, vnode, nextSibling)\n\t\t\t\tcase \"<\": return createHTML(parent, vnode, nextSibling)\n\t\t\t\tcase \"[\": return createFragment(parent, vnode, hooks, ns, nextSibling)\n\t\t\t\tdefault: return createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse return createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t\treturn vnode.dom\n\t}\n\tfunction createHTML(parent, vnode, nextSibling) {\n\t\tvar match1 = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\tvar parent1 = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}[match1[1]] || \"div\"\n\t\tvar temp = $doc.createElement(parent1)\n\t\ttemp.innerHTML = vnode.children\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t\treturn fragment\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tswitch (vnode.tag) {\n\t\t\tcase \"svg\": ns = \"http://www.w3.org/2000/svg\"; break\n\t\t\tcase \"math\": ns = \"http://www.w3.org/1998/Math/MathML\"; break\n\t\t}\n\t\tvar attrs2 = vnode.attrs\n\t\tvar is = attrs2 && attrs2.is\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\t\tif (attrs2 != null) {\n\t\t\tsetAttrs(vnode, attrs2, ns)\n\t\t}\n\t\tinsertNode(parent, element, nextSibling)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse {\n\t\t\tif (vnode.text != null) {\n\t\t\t\tif (vnode.text !== \"\") element.textContent = vnode.text\n\t\t\t\telse vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\t}\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tsetLateAttrs(vnode)\n\t\t\t}\n\t\t}\n\t\treturn element\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return $emptyFragment\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tvnode._state = vnode.state\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tinitLifecycle(vnode._state, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tvar element = createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t\tinsertNode(parent, element, nextSibling)\n\t\t\treturn element\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t\treturn $emptyFragment\n\t\t}\n\t}\n\t//update\n\tfunction updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, undefined)\n\t\telse if (vnodes == null) removeNodes(old, 0, old.length, vnodes)\n\t\telse {\n\t\t\tif (old.length === vnodes.length) {\n\t\t\t\tvar isUnkeyed = false\n\t\t\t\tfor (var i = 0; i < vnodes.length; i++) {\n\t\t\t\t\tif (vnodes[i] != null && old[i] != null) {\n\t\t\t\t\t\tisUnkeyed = vnodes[i].key == null && old[i].key == null\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isUnkeyed) {\n\t\t\t\t\tfor (var i = 0; i < old.length; i++) {\n\t\t\t\t\t\tif (old[i] === vnodes[i]) continue\n\t\t\t\t\t\telse if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))\n\t\t\t\t\t\telse if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)\n\t\t\t\t\t\telse updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\trecycling = recycling || isRecyclable(old, vnodes)\n\t\t\tif (recycling) {\n\t\t\t\tvar pool = old.pool\n\t\t\t\told = old.concat(old.pool)\n\t\t\t}\n\t\t\tvar oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldStart], v = vnodes[start]\n\t\t\t\tif (o === v && !recycling) oldStart++, start++\n\t\t\t\telse if (o == null) oldStart++\n\t\t\t\telse if (v == null) start++\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = old[oldEnd]\n\t\t\t\t\tif (o === v && !recycling) oldEnd--, start++\n\t\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\t\telse if (v == null) start++\n\t\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\t\tif (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))\n\t\t\t\t\t\toldEnd--, start++\n\t\t\t\t\t}\n\t\t\t\t\telse break\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\tvar o = old[oldEnd], v = vnodes[end]\n\t\t\t\tif (o === v && !recycling) oldEnd--, end--\n\t\t\t\telse if (o == null) oldEnd--\n\t\t\t\telse if (v == null) end--\n\t\t\t\telse if (o.key === v.key) {\n\t\t\t\t\tvar shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\tupdateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)\n\t\t\t\t\tif (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)\n\t\t\t\t\tif (o.dom != null) nextSibling = o.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!map) map = getKeyMap(old, oldEnd)\n\t\t\t\t\tif (v != null) {\n\t\t\t\t\t\tvar oldIndex = map[v.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tvar movable = old[oldIndex]\n\t\t\t\t\t\t\tvar shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)\n\t\t\t\t\t\t\tupdateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)\n\t\t\t\t\t\t\tinsertNode(parent, toFragment(movable), nextSibling)\n\t\t\t\t\t\t\told[oldIndex].skip = true\n\t\t\t\t\t\t\tif (movable.dom != null) nextSibling = movable.dom\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar dom = createNode(parent, v, hooks, undefined, nextSibling)\n\t\t\t\t\t\t\tnextSibling = dom\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tend--\n\t\t\t\t}\n\t\t\t\tif (end < start) break\n\t\t\t}\n\t\t\tcreateNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\tremoveNodes(old, oldStart, oldEnd + 1, vnodes)\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode._state = old._state\n\t\t\tvnode.events = old.events\n\t\t\tif (!recycling && shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tif (recycling) {\n\t\t\t\t\t\tvnode.state = {}\n\t\t\t\t\t\tinitLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t\t}\n\t\t\t\t\telse updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, recycling, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(old, null)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\ttoFragment(old)\n\t\t\tcreateHTML(parent, vnode, nextSibling)\n\t\t}\n\t\telse vnode.dom = old.dom, vnode.domSize = old.domSize\n\t}\n\tfunction updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, recycling, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tswitch (vnode.tag) {\n\t\t\tcase \"svg\": ns = \"http://www.w3.org/2000/svg\"; break\n\t\t\tcase \"math\": ns = \"http://www.w3.org/1998/Math/MathML\"; break\n\t\t}\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t\tif (vnode.text != null) {\n\t\t\t\tvnode.attrs.value = vnode.text //FIXME handle0 multiple children\n\t\t\t\tvnode.text = undefined\n\t\t\t}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (vnode.attrs != null && vnode.attrs.contenteditable != null) {\n\t\t\tsetContentEditable(vnode)\n\t\t}\n\t\telse if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n\t\t\tif (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text\n\t\t}\n\t\telse {\n\t\t\tif (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)]\n\t\t\tif (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)]\n\t\t\tupdateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {\n\t\tif (recycling) {\n\t\t\tinitComponent(vnode, hooks)\n\t\t} else {\n\t\t\tvnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))\n\t\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tupdateLifecycle(vnode._state, vnode, hooks)\n\t\t}\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(old.instance, null)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction isRecyclable(old, vnodes) {\n\t\tif (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {\n\t\t\tvar oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0\n\t\t\tvar poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0\n\t\t\tvar vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0\n\t\t\tif (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\tfunction getKeyMap(vnodes, end) {\n\t\tvar map = {}, i = 0\n\t\tfor (var i = 0; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key2 = vnode.key\n\t\t\t\tif (key2 != null) map[key2] = i\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\tfunction toFragment(vnode) {\n\t\tvar count0 = vnode.domSize\n\t\tif (count0 != null || vnode.dom == null) {\n\t\t\tvar fragment = $doc.createDocumentFragment()\n\t\t\tif (count0 > 0) {\n\t\t\t\tvar dom = vnode.dom\n\t\t\t\twhile (--count0) fragment.appendChild(dom.nextSibling)\n\t\t\t\tfragment.insertBefore(dom, fragment.firstChild)\n\t\t\t}\n\t\t\treturn fragment\n\t\t}\n\t\telse return vnode.dom\n\t}\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\tfunction setContentEditable(vnode) {\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\")\n\t}\n\t//remove\n\tfunction removeNodes(vnodes, start, end, context) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tif (vnode.skip) vnode.skip = false\n\t\t\t\telse removeNode(vnode, context)\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNode(vnode, context) {\n\t\tvar expected = 1, called = 0\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeremove === \"function\") {\n\t\t\tvar result = vnode._state.onbeforeremove.call(vnode.state, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\texpected++\n\t\t\t\tresult.then(continuation, continuation)\n\t\t\t}\n\t\t}\n\t\tcontinuation()\n\t\tfunction continuation() {\n\t\t\tif (++called === expected) {\n\t\t\t\tonremove(vnode)\n\t\t\t\tif (vnode.dom) {\n\t\t\t\t\tvar count0 = vnode.domSize || 1\n\t\t\t\t\tif (count0 > 1) {\n\t\t\t\t\t\tvar dom = vnode.dom\n\t\t\t\t\t\twhile (--count0) {\n\t\t\t\t\t\t\tremoveNodeFromDOM(dom.nextSibling)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tremoveNodeFromDOM(vnode.dom)\n\t\t\t\t\tif (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === \"string\") { //TODO test custom elements\n\t\t\t\t\t\tif (!context.pool) context.pool = [vnode]\n\t\t\t\t\t\telse context.pool.push(vnode)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeNodeFromDOM(node) {\n\t\tvar parent = node.parentNode\n\t\tif (parent != null) parent.removeChild(node)\n\t}\n\tfunction onremove(vnode) {\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") vnode.attrs.onremove.call(vnode.state, vnode)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onremove === \"function\") vnode._state.onremove.call(vnode.state, vnode)\n\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\telse {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//attrs2\n\tfunction setAttrs(vnode, attrs2, ns) {\n\t\tfor (var key2 in attrs2) {\n\t\t\tsetAttr(vnode, key2, null, attrs2[key2], ns)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key2, old, value, ns) {\n\t\tvar element = vnode.dom\n\t\tif (key2 === \"key\" || key2 === \"is\" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== \"object\" || typeof value === \"undefined\" || isLifecycleMethod(key2)) return\n\t\tvar nsLastIndex = key2.indexOf(\":\")\n\t\tif (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === \"xlink\") {\n\t\t\telement.setAttributeNS(\"http://www.w3.org/1999/xlink\", key2.slice(nsLastIndex + 1), value)\n\t\t}\n\t\telse if (key2[0] === \"o\" && key2[1] === \"n\" && typeof value === \"function\") updateEvent(vnode, key2, value)\n\t\telse if (key2 === \"style\") updateStyle(element, old, value)\n\t\telse if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {\n\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\tif (vnode.tag === \"input\" && key2 === \"value\" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return\n\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\tif (vnode.tag === \"select\" && key2 === \"value\" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return\n\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\tif (vnode.tag === \"option\" && key2 === \"value\" && vnode.dom.value == value) return\n\t\t\t// If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.\n\t\t\tif (vnode.tag === \"input\" && key2 === \"type\") {\n\t\t\t\telement.setAttribute(key2, value)\n\t\t\t\treturn\n\t\t\t}\n\t\t\telement[key2] = value\n\t\t}\n\t\telse {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) element.setAttribute(key2, \"\")\n\t\t\t\telse element.removeAttribute(key2)\n\t\t\t}\n\t\t\telse element.setAttribute(key2 === \"className\" ? \"class\" : key2, value)\n\t\t}\n\t}\n\tfunction setLateAttrs(vnode) {\n\t\tvar attrs2 = vnode.attrs\n\t\tif (vnode.tag === \"select\" && attrs2 != null) {\n\t\t\tif (\"value\" in attrs2) setAttr(vnode, \"value\", null, attrs2.value, undefined)\n\t\t\tif (\"selectedIndex\" in attrs2) setAttr(vnode, \"selectedIndex\", null, attrs2.selectedIndex, undefined)\n\t\t}\n\t}\n\tfunction updateAttrs(vnode, old, attrs2, ns) {\n\t\tif (attrs2 != null) {\n\t\t\tfor (var key2 in attrs2) {\n\t\t\t\tsetAttr(vnode, key2, old && old[key2], attrs2[key2], ns)\n\t\t\t}\n\t\t}\n\t\tif (old != null) {\n\t\t\tfor (var key2 in old) {\n\t\t\t\tif (attrs2 == null || !(key2 in attrs2)) {\n\t\t\t\t\tif (key2 === \"className\") key2 = \"class\"\n\t\t\t\t\tif (key2[0] === \"o\" && key2[1] === \"n\" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)\n\t\t\t\t\telse if (key2 !== \"key\") vnode.dom.removeAttribute(key2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction isAttribute(attr) {\n\t\treturn attr === \"href\" || attr === \"list\" || attr === \"form\" || attr === \"width\" || attr === \"height\"// || attr === \"type\"\n\t}\n\tfunction isCustomElement(vnode){\n\t\treturn vnode.attrs.is || vnode.tag.indexOf(\"-\") > -1\n\t}\n\tfunction hasIntegrationMethods(source) {\n\t\treturn source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)\n\t}\n\t//style\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) element.style.cssText = \"\", old = null\n\t\tif (style == null) element.style.cssText = \"\"\n\t\telse if (typeof style === \"string\") element.style.cssText = style\n\t\telse {\n\t\t\tif (typeof old === \"string\") element.style.cssText = \"\"\n\t\t\tfor (var key2 in style) {\n\t\t\t\telement.style[key2] = style[key2]\n\t\t\t}\n\t\t\tif (old != null && typeof old !== \"string\") {\n\t\t\t\tfor (var key2 in old) {\n\t\t\t\t\tif (!(key2 in style)) element.style[key2] = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//event\n\tfunction updateEvent(vnode, key2, value) {\n\t\tvar element = vnode.dom\n\t\tvar callback = typeof onevent !== \"function\" ? value : function(e) {\n\t\t\tvar result = value.call(element, e)\n\t\t\tonevent.call(element, e)\n\t\t\treturn result\n\t\t}\n\t\tif (key2 in element) element[key2] = typeof value === \"function\" ? callback : null\n\t\telse {\n\t\t\tvar eventName = key2.slice(2)\n\t\t\tif (vnode.events === undefined) vnode.events = {}\n\t\t\tif (vnode.events[key2] === callback) return\n\t\t\tif (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\tvnode.events[key2] = callback\n\t\t\t\telement.addEventListener(eventName, vnode.events[key2], false)\n\t\t\t}\n\t\t}\n\t}\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") source.oninit.call(vnode.state, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(source.oncreate.bind(vnode.state, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(source.onupdate.bind(vnode.state, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tvar forceVnodeUpdate, forceComponentUpdate\n\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode._state.onbeforeupdate === \"function\") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)\n\t\tif (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\tfunction render(dom, vnodes) {\n\t\tif (!dom) throw new Error(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\")\n\t\tvar hooks = []\n\t\tvar active = $doc.activeElement\n\t\t// First time0 rendering into a node clears it out\n\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\tif (!Array.isArray(vnodes)) vnodes = [vnodes]\n\t\tupdateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, undefined)\n\t\tdom.vnodes = vnodes\n\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t\tif ($doc.activeElement !== active) active.focus()\n\t}\n\treturn {render: render, setEventCallback: setEventCallback}\n}\nfunction throttle(callback) {\n\t//60fps translates to 16.6ms, round it down since setTimeout requires int\n\tvar time = 16\n\tvar last = 0, pending = null\n\tvar timeout = typeof requestAnimationFrame === \"function\" ? requestAnimationFrame : setTimeout\n\treturn function() {\n\t\tvar now = Date.now()\n\t\tif (last === 0 || now - last >= time) {\n\t\t\tlast = now\n\t\t\tcallback()\n\t\t}\n\t\telse if (pending === null) {\n\t\t\tpending = timeout(function() {\n\t\t\t\tpending = null\n\t\t\t\tcallback()\n\t\t\t\tlast = Date.now()\n\t\t\t}, time - (now - last))\n\t\t}\n\t}\n}\nvar _11 = function($window) {\n\tvar renderService = coreRenderer($window)\n\trenderService.setEventCallback(function(e) {\n\t\tif (e.redraw !== false) redraw()\n\t})\n\tvar callbacks = []\n\tfunction subscribe(key1, callback) {\n\t\tunsubscribe(key1)\n\t\tcallbacks.push(key1, throttle(callback))\n\t}\n\tfunction unsubscribe(key1) {\n\t\tvar index = callbacks.indexOf(key1)\n\t\tif (index > -1) callbacks.splice(index, 2)\n\t}\n\tfunction redraw() {\n\t\tfor (var i = 1; i < callbacks.length; i += 2) {\n\t\t\tcallbacks[i]()\n\t\t}\n\t}\n\treturn {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}\n}\nvar redrawService = _11(window)\nrequestService.setCompletionCallback(redrawService.redraw)\nvar _16 = function(redrawService0) {\n\treturn function(root, component) {\n\t\tif (component === null) {\n\t\t\tredrawService0.render(root, [])\n\t\t\tredrawService0.unsubscribe(root)\n\t\t\treturn\n\t\t}\n\t\t\n\t\tif (component.view == null && typeof component !== \"function\") throw new Error(\"m.mount(element, component) expects a component, not a vnode\")\n\t\t\n\t\tvar run0 = function() {\n\t\t\tredrawService0.render(root, Vnode(component))\n\t\t}\n\t\tredrawService0.subscribe(root, run0)\n\t\tredrawService0.redraw()\n\t}\n}\nm.mount = _16(redrawService)\nvar Promise = PromisePolyfill\nvar parseQueryString = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\tvar entries = string.split(\"&\"), data0 = {}, counters = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key5 = decodeURIComponent(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\"\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\t\tvar levels = key5.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data0\n\t\tif (key5.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tvar isValue = j === levels.length - 1\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key5 = levels.slice(0, j).join()\n\t\t\t\tif (counters[key5] == null) counters[key5] = 0\n\t\t\t\tlevel = counters[key5]++\n\t\t\t}\n\t\t\tif (cursor[level] == null) {\n\t\t\t\tcursor[level] = isValue ? value : isNumber ? [] : {}\n\t\t\t}\n\t\t\tcursor = cursor[level]\n\t\t}\n\t}\n\treturn data0\n}\nvar coreRouter = function($window) {\n\tvar supportsPushState = typeof $window.history.pushState === \"function\"\n\tvar callAsync0 = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction normalize1(fragment0) {\n\t\tvar data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)\n\t\tif (fragment0 === \"pathname\" && data[0] !== \"/\") data = \"/\" + data\n\t\treturn data\n\t}\n\tvar asyncId\n\tfunction debounceAsync(callback0) {\n\t\treturn function() {\n\t\t\tif (asyncId != null) return\n\t\t\tasyncId = callAsync0(function() {\n\t\t\t\tasyncId = null\n\t\t\t\tcallback0()\n\t\t\t})\n\t\t}\n\t}\n\tfunction parsePath(path, queryData, hashData) {\n\t\tvar queryIndex = path.indexOf(\"?\")\n\t\tvar hashIndex = path.indexOf(\"#\")\n\t\tvar pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length\n\t\tif (queryIndex > -1) {\n\t\t\tvar queryEnd = hashIndex > -1 ? hashIndex : path.length\n\t\t\tvar queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))\n\t\t\tfor (var key4 in queryParams) queryData[key4] = queryParams[key4]\n\t\t}\n\t\tif (hashIndex > -1) {\n\t\t\tvar hashParams = parseQueryString(path.slice(hashIndex + 1))\n\t\t\tfor (var key4 in hashParams) hashData[key4] = hashParams[key4]\n\t\t}\n\t\treturn path.slice(0, pathEnd)\n\t}\n\tvar router = {prefix: \"#!\"}\n\trouter.getPath = function() {\n\t\tvar type2 = router.prefix.charAt(0)\n\t\tswitch (type2) {\n\t\t\tcase \"#\": return normalize1(\"hash\").slice(router.prefix.length)\n\t\t\tcase \"?\": return normalize1(\"search\").slice(router.prefix.length) + normalize1(\"hash\")\n\t\t\tdefault: return normalize1(\"pathname\").slice(router.prefix.length) + normalize1(\"search\") + normalize1(\"hash\")\n\t\t}\n\t}\n\trouter.setPath = function(path, data, options) {\n\t\tvar queryData = {}, hashData = {}\n\t\tpath = parsePath(path, queryData, hashData)\n\t\tif (data != null) {\n\t\t\tfor (var key4 in data) queryData[key4] = data[key4]\n\t\t\tpath = path.replace(/:([^\\/]+)/g, function(match2, token) {\n\t\t\t\tdelete queryData[token]\n\t\t\t\treturn data[token]\n\t\t\t})\n\t\t}\n\t\tvar query = buildQueryString(queryData)\n\t\tif (query) path += \"?\" + query\n\t\tvar hash = buildQueryString(hashData)\n\t\tif (hash) path += \"#\" + hash\n\t\tif (supportsPushState) {\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\t$window.onpopstate()\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)\n\t\t\telse $window.history.pushState(state, title, router.prefix + path)\n\t\t}\n\t\telse $window.location.href = router.prefix + path\n\t}\n\trouter.defineRoutes = function(routes, resolve, reject) {\n\t\tfunction resolveRoute() {\n\t\t\tvar path = router.getPath()\n\t\t\tvar params = {}\n\t\t\tvar pathname = parsePath(path, params, params)\n\t\t\tvar state = $window.history.state\n\t\t\tif (state != null) {\n\t\t\t\tfor (var k in state) params[k] = state[k]\n\t\t\t}\n\t\t\tfor (var route0 in routes) {\n\t\t\t\tvar matcher = new RegExp(\"^\" + route0.replace(/:[^\\/]+?\\.{3}/g, \"(.*?)\").replace(/:[^\\/]+/g, \"([^\\\\/]+)\") + \"\\/?$\")\n\t\t\t\tif (matcher.test(pathname)) {\n\t\t\t\t\tpathname.replace(matcher, function() {\n\t\t\t\t\t\tvar keys = route0.match(/:[^\\/]+/g) || []\n\t\t\t\t\t\tvar values = [].slice.call(arguments, 1, -2)\n\t\t\t\t\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\t\t\t\t\tparams[keys[i].replace(/:|\\./g, \"\")] = decodeURIComponent(values[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(routes[route0], params, path, route0)\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(path, params)\n\t\t}\n\t\tif (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)\n\t\telse if (router.prefix.charAt(0) === \"#\") $window.onhashchange = resolveRoute\n\t\tresolveRoute()\n\t}\n\treturn router\n}\nvar _20 = function($window, redrawService0) {\n\tvar routeService = coreRouter($window)\n\tvar identity = function(v) {return v}\n\tvar render1, component, attrs3, currentPath, lastUpdate\n\tvar route = function(root, defaultRoute, routes) {\n\t\tif (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\")\n\t\tvar run1 = function() {\n\t\t\tif (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))\n\t\t}\n\t\tvar bail = function(path) {\n\t\t\tif (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})\n\t\t\telse throw new Error(\"Could not resolve default route \" + defaultRoute)\n\t\t}\n\t\trouteService.defineRoutes(routes, function(payload, params, path) {\n\t\t\tvar update = lastUpdate = function(routeResolver, comp) {\n\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\tattrs3 = params, currentPath = path, lastUpdate = null\n\t\t\t\trender1 = (routeResolver.render || identity).bind(routeResolver)\n\t\t\t\trun1()\n\t\t\t}\n\t\t\tif (payload.view || typeof payload === \"function\") update({}, payload)\n\t\t\telse {\n\t\t\t\tif (payload.onmatch) {\n\t\t\t\t\tPromise.resolve(payload.onmatch(params, path)).then(function(resolved) {\n\t\t\t\t\t\tupdate(payload, resolved)\n\t\t\t\t\t}, bail)\n\t\t\t\t}\n\t\t\t\telse update(payload, \"div\")\n\t\t\t}\n\t\t}, bail)\n\t\tredrawService0.subscribe(root, run1)\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) options = {replace: true}\n\t\tlastUpdate = null\n\t\trouteService.setPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = function(prefix0) {routeService.prefix = prefix0}\n\troute.link = function(vnode1) {\n\t\tvnode1.dom.setAttribute(\"href\", routeService.prefix + vnode1.attrs.href)\n\t\tvnode1.dom.onclick = function(e) {\n\t\t\tif (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return\n\t\t\te.preventDefault()\n\t\t\te.redraw = false\n\t\t\tvar href = this.getAttribute(\"href\")\n\t\t\tif (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)\n\t\t\troute.set(href, undefined, undefined)\n\t\t}\n\t}\n\troute.param = function(key3) {\n\t\tif(typeof attrs3 !== \"undefined\" && typeof key3 !== \"undefined\") return attrs3[key3]\n\t\treturn attrs3\n\t}\n\treturn route\n}\nm.route = _20(window, redrawService)\nm.withAttr = function(attrName, callback1, context) {\n\treturn function(e) {\n\t\tcallback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))\n\t}\n}\nvar _28 = coreRenderer(window)\nm.render = _28.render\nm.redraw = redrawService.redraw\nm.request = requestService.request\nm.jsonp = requestService.jsonp\nm.parseQueryString = parseQueryString\nm.buildQueryString = buildQueryString\nm.version = \"1.1.1\"\nm.vnode = Vnode\nif (typeof module !== \"undefined\") module[\"exports\"] = m\nelse window.m = m\n}());\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],8:[function(require,module,exports){\n/*!\n * EventEmitter v5.1.0 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n })();"]}
assets/js/forms-admin.js CHANGED
@@ -1689,10 +1689,10 @@ window.mc4wp.forms.fields = fields;
1689
  }
1690
  };
1691
 
1692
- CodeMirror.findEnclosingTag = function(cm, pos, range) {
1693
  var iter = new Iter(cm, pos.line, pos.ch, range);
1694
  for (;;) {
1695
- var open = findMatchingOpen(iter);
1696
  if (!open) break;
1697
  var forward = new Iter(cm, pos.line, pos.ch, range);
1698
  var close = findMatchingClose(forward, open.tag);
@@ -2844,7 +2844,7 @@ function endOfLine(visually, cm, lineObj, lineNo, dir) {
2844
  ch = dir < 0 ? lineObj.text.length - 1 : 0;
2845
  var targetTop = measureCharPrepared(cm, prep, ch).top;
2846
  ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);
2847
- if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1, true); }
2848
  } else { ch = dir < 0 ? part.to : part.from; }
2849
  return new Pos(lineNo, ch, sticky)
2850
  }
@@ -3205,12 +3205,13 @@ function startState(mode, a1, a2) {
3205
  // Fed to the mode parsers, provides helper functions to make
3206
  // parsers more succinct.
3207
 
3208
- var StringStream = function(string, tabSize) {
3209
  this.pos = this.start = 0;
3210
  this.string = string;
3211
  this.tabSize = tabSize || 8;
3212
  this.lastColumnPos = this.lastColumnValue = 0;
3213
  this.lineStart = 0;
 
3214
  };
3215
 
3216
  StringStream.prototype.eol = function () {return this.pos >= this.string.length};
@@ -3277,23 +3278,65 @@ StringStream.prototype.hideFirstChars = function (n, inner) {
3277
  try { return inner() }
3278
  finally { this.lineStart -= n; }
3279
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3280
 
3281
  // Compute a style array (an array starting with a mode generation
3282
  // -- for invalidation -- followed by pairs of end positions and
3283
  // style strings), which is used to highlight the tokens on the
3284
  // line.
3285
- function highlightLine(cm, line, state, forceToEnd) {
3286
  // A styles array always starts with a number identifying the
3287
  // mode/overlays that it is based on (for easy invalidation).
3288
  var st = [cm.state.modeGen], lineClasses = {};
3289
  // Compute the base array of styles
3290
- runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },
3291
- lineClasses, forceToEnd);
 
3292
 
3293
  // Run overlays, adjust style array.
3294
  var loop = function ( o ) {
3295
  var overlay = cm.state.overlays[o], i = 1, at = 0;
3296
- runMode(cm, line.text, overlay.mode, true, function (end, style) {
 
3297
  var start = i;
3298
  // Ensure there's a token end at the current position, and that i points at it
3299
  while (at < end) {
@@ -3317,49 +3360,54 @@ function highlightLine(cm, line, state, forceToEnd) {
3317
  };
3318
 
3319
  for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
 
3320
 
3321
  return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
3322
  }
3323
 
3324
  function getLineStyles(cm, line, updateFrontier) {
3325
  if (!line.styles || line.styles[0] != cm.state.modeGen) {
3326
- var state = getStateBefore(cm, lineNo(line));
3327
- var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);
3328
- line.stateAfter = state;
 
 
3329
  line.styles = result.styles;
3330
  if (result.classes) { line.styleClasses = result.classes; }
3331
  else if (line.styleClasses) { line.styleClasses = null; }
3332
- if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++; }
 
3333
  }
3334
  return line.styles
3335
  }
3336
 
3337
- function getStateBefore(cm, n, precise) {
3338
  var doc = cm.doc, display = cm.display;
3339
- if (!doc.mode.startState) { return true }
3340
- var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
3341
- if (!state) { state = startState(doc.mode); }
3342
- else { state = copyState(doc.mode, state); }
3343
- doc.iter(pos, n, function (line) {
3344
- processLine(cm, line.text, state);
3345
- var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo;
3346
- line.stateAfter = save ? copyState(doc.mode, state) : null;
3347
- ++pos;
 
3348
  });
3349
- if (precise) { doc.frontier = pos; }
3350
- return state
3351
  }
3352
 
3353
  // Lightweight form of highlight -- proceed over this line and
3354
  // update state, but don't save a style array. Used for lines that
3355
  // aren't currently visible.
3356
- function processLine(cm, text, state, startAt) {
3357
  var mode = cm.doc.mode;
3358
- var stream = new StringStream(text, cm.options.tabSize);
3359
  stream.start = stream.pos = startAt || 0;
3360
- if (text == "") { callBlankLine(mode, state); }
3361
  while (!stream.eol()) {
3362
- readToken(mode, stream, state);
3363
  stream.start = stream.pos;
3364
  }
3365
  }
@@ -3380,26 +3428,26 @@ function readToken(mode, stream, state, inner) {
3380
  throw new Error("Mode " + mode.name + " failed to advance stream.")
3381
  }
3382
 
 
 
 
 
 
 
 
3383
  // Utility for getTokenAt and getLineTokens
3384
  function takeToken(cm, pos, precise, asArray) {
3385
- var getObj = function (copy) { return ({
3386
- start: stream.start, end: stream.pos,
3387
- string: stream.current(),
3388
- type: style || null,
3389
- state: copy ? copyState(doc.mode, state) : state
3390
- }); };
3391
-
3392
  var doc = cm.doc, mode = doc.mode, style;
3393
  pos = clipPos(doc, pos);
3394
- var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);
3395
- var stream = new StringStream(line.text, cm.options.tabSize), tokens;
3396
  if (asArray) { tokens = []; }
3397
  while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
3398
  stream.start = stream.pos;
3399
- style = readToken(mode, stream, state);
3400
- if (asArray) { tokens.push(getObj(true)); }
3401
  }
3402
- return asArray ? tokens : getObj()
3403
  }
3404
 
3405
  function extractLineClasses(type, output) {
@@ -3417,21 +3465,21 @@ function extractLineClasses(type, output) {
3417
  }
3418
 
3419
  // Run the given mode's parser over a line, calling f for each token.
3420
- function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
3421
  var flattenSpans = mode.flattenSpans;
3422
  if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }
3423
  var curStart = 0, curStyle = null;
3424
- var stream = new StringStream(text, cm.options.tabSize), style;
3425
  var inner = cm.options.addModeClass && [null];
3426
- if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses); }
3427
  while (!stream.eol()) {
3428
  if (stream.pos > cm.options.maxHighlightLength) {
3429
  flattenSpans = false;
3430
- if (forceToEnd) { processLine(cm, text, state, stream.pos); }
3431
  stream.pos = text.length;
3432
  style = null;
3433
  } else {
3434
- style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);
3435
  }
3436
  if (inner) {
3437
  var mName = inner[0].name;
@@ -3466,8 +3514,9 @@ function findStartLine(cm, n, precise) {
3466
  var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
3467
  for (var search = n; search > lim; --search) {
3468
  if (search <= doc.first) { return doc.first }
3469
- var line = getLine(doc, search - 1);
3470
- if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }
 
3471
  var indented = countColumn(line.text, null, cm.options.tabSize);
3472
  if (minline == null || minindent > indented) {
3473
  minline = search - 1;
@@ -3477,6 +3526,23 @@ function findStartLine(cm, n, precise) {
3477
  return minline
3478
  }
3479
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3480
  // LINE DATA STRUCTURE
3481
 
3482
  // Line objects. These hold state related to a line, including
@@ -4353,8 +4419,17 @@ function clearCaches(cm) {
4353
  cm.display.lineNumChars = null;
4354
  }
4355
 
4356
- function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }
4357
- function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }
 
 
 
 
 
 
 
 
 
4358
 
4359
  // Converts a {top, bottom, left, right} box from line-local
4360
  // coordinates into another coordinate system. Context may be one of
@@ -4520,20 +4595,30 @@ function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {
4520
  var assign;
4521
  ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign));
4522
  }
4523
- pos = new Pos(lineNo$$1, begin);
4524
  var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left;
4525
  var dir = beginLeft < x ? 1 : -1;
4526
  var prevDiff, diff = beginLeft - x, prevPos;
4527
- do {
 
4528
  prevDiff = diff;
4529
  prevPos = pos;
4530
- pos = moveVisually(cm, lineObj, pos, dir);
4531
- if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) {
4532
- pos = prevPos;
4533
- break
 
 
 
 
4534
  }
4535
  diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x;
4536
- } while ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))
 
 
 
 
 
4537
  if (Math.abs(diff) > Math.abs(prevDiff)) {
4538
  if ((diff < 0) == (prevDiff < 0)) { throw new Error("Broke out of infinite loop in coordsCharInner") }
4539
  pos = prevPos;
@@ -4849,49 +4934,6 @@ function onBlur(cm, e) {
4849
  setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);
4850
  }
4851
 
4852
- // Re-align line numbers and gutter marks to compensate for
4853
- // horizontal scrolling.
4854
- function alignHorizontally(cm) {
4855
- var display = cm.display, view = display.view;
4856
- if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
4857
- var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
4858
- var gutterW = display.gutters.offsetWidth, left = comp + "px";
4859
- for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
4860
- if (cm.options.fixedGutter) {
4861
- if (view[i].gutter)
4862
- { view[i].gutter.style.left = left; }
4863
- if (view[i].gutterBackground)
4864
- { view[i].gutterBackground.style.left = left; }
4865
- }
4866
- var align = view[i].alignable;
4867
- if (align) { for (var j = 0; j < align.length; j++)
4868
- { align[j].style.left = left; } }
4869
- } }
4870
- if (cm.options.fixedGutter)
4871
- { display.gutters.style.left = (comp + gutterW) + "px"; }
4872
- }
4873
-
4874
- // Used to ensure that the line number gutter is still the right
4875
- // size for the current document size. Returns true when an update
4876
- // is needed.
4877
- function maybeUpdateLineNumberWidth(cm) {
4878
- if (!cm.options.lineNumbers) { return false }
4879
- var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
4880
- if (last.length != display.lineNumChars) {
4881
- var test = display.measure.appendChild(elt("div", [elt("div", last)],
4882
- "CodeMirror-linenumber CodeMirror-gutter-elt"));
4883
- var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
4884
- display.lineGutter.style.width = "";
4885
- display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
4886
- display.lineNumWidth = display.lineNumInnerWidth + padding;
4887
- display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
4888
- display.lineGutter.style.width = display.lineNumWidth + "px";
4889
- updateGutterSpace(cm);
4890
- return true
4891
- }
4892
- return false
4893
- }
4894
-
4895
  // Read the actual heights of the rendered lines, and update their
4896
  // stored heights to match.
4897
  function updateHeightsInViewport(cm) {
@@ -4950,139 +4992,218 @@ function visibleLines(display, doc, viewport) {
4950
  return {from: from, to: Math.max(to, from + 1)}
4951
  }
4952
 
4953
- // Sync the scrollable area and scrollbars, ensure the viewport
4954
- // covers the visible area.
4955
- function setScrollTop(cm, val) {
4956
- if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
4957
- cm.doc.scrollTop = val;
4958
- if (!gecko) { updateDisplaySimple(cm, {top: val}); }
4959
- if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }
4960
- cm.display.scrollbars.setScrollTop(val);
4961
- if (gecko) { updateDisplaySimple(cm); }
4962
- startWorker(cm, 100);
 
 
 
 
 
 
 
 
 
 
4963
  }
4964
- // Sync scroller and scrollbar, ensure the gutter elements are
4965
- // aligned.
4966
- function setScrollLeft(cm, val, isScroller) {
4967
- if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }
4968
- val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
4969
- cm.doc.scrollLeft = val;
4970
- alignHorizontally(cm);
4971
- if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }
4972
- cm.display.scrollbars.setScrollLeft(val);
 
 
 
 
 
 
 
 
 
 
 
4973
  }
4974
 
4975
- // Since the delta values reported on mouse wheel events are
4976
- // unstandardized between browsers and even browser versions, and
4977
- // generally horribly unpredictable, this code starts by measuring
4978
- // the scroll effect that the first few mouse wheel events have,
4979
- // and, from that, detects the way it can convert deltas to pixel
4980
- // offsets afterwards.
4981
- //
4982
- // The reason we want to know the amount a wheel event will scroll
4983
- // is that it gives us a chance to update the display before the
4984
- // actual scrolling happens, reducing flickering.
4985
 
4986
- var wheelSamples = 0;
4987
- var wheelPixelsPerUnit = null;
4988
- // Fill in a browser-detected starting value on browsers where we
4989
- // know one. These don't have to be accurate -- the result of them
4990
- // being wrong would just be a slight flicker on the first wheel
4991
- // scroll (if it is large enough).
4992
- if (ie) { wheelPixelsPerUnit = -.53; }
4993
- else if (gecko) { wheelPixelsPerUnit = 15; }
4994
- else if (chrome) { wheelPixelsPerUnit = -.7; }
4995
- else if (safari) { wheelPixelsPerUnit = -1/3; }
4996
 
4997
- function wheelEventDelta(e) {
4998
- var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
4999
- if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }
5000
- if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }
5001
- else if (dy == null) { dy = e.wheelDelta; }
5002
- return {x: dx, y: dy}
5003
- }
5004
- function wheelEventPixels(e) {
5005
- var delta = wheelEventDelta(e);
5006
- delta.x *= wheelPixelsPerUnit;
5007
- delta.y *= wheelPixelsPerUnit;
5008
- return delta
5009
  }
5010
 
5011
- function onScrollWheel(cm, e) {
5012
- var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
5013
-
5014
- var display = cm.display, scroll = display.scroller;
5015
- // Quit if there's nothing to scroll here
5016
- var canScrollX = scroll.scrollWidth > scroll.clientWidth;
5017
- var canScrollY = scroll.scrollHeight > scroll.clientHeight;
5018
- if (!(dx && canScrollX || dy && canScrollY)) { return }
5019
-
5020
- // Webkit browsers on OS X abort momentum scrolls when the target
5021
- // of the scroll event is removed from the scrollable element.
5022
- // This hack (see related code in patchDisplay) makes sure the
5023
- // element is kept around.
5024
- if (dy && mac && webkit) {
5025
- outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
5026
- for (var i = 0; i < view.length; i++) {
5027
- if (view[i].node == cur) {
5028
- cm.display.currentWheelTarget = cur;
5029
- break outer
5030
- }
5031
- }
5032
  }
 
 
 
 
 
5033
  }
 
 
5034
 
5035
- // On some browsers, horizontal scrolling will cause redraws to
5036
- // happen before the gutter has been realigned, causing it to
5037
- // wriggle around in a most unseemly way. When we have an
5038
- // estimated pixels/delta value, we just handle horizontal
5039
- // scrolling entirely here. It'll be slightly off from native, but
5040
- // better than glitching out.
5041
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
5042
- if (dy && canScrollY)
5043
- { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); }
5044
- setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
5045
- // Only prevent default scrolling if vertical scrolling is
5046
- // actually possible. Otherwise, it causes vertical scroll
5047
- // jitter on OSX trackpads when deltaX is small and deltaY
5048
- // is large (issue #3579)
5049
- if (!dy || (dy && canScrollY))
5050
- { e_preventDefault(e); }
5051
- display.wheelStartX = null; // Abort measurement, if in progress
5052
- return
 
 
 
 
 
 
5053
  }
5054
 
5055
- // 'Project' the visible viewport to cover the area that is being
5056
- // scrolled into view (if we know enough to estimate it).
5057
- if (dy && wheelPixelsPerUnit != null) {
5058
- var pixels = dy * wheelPixelsPerUnit;
5059
- var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
5060
- if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
5061
- else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
5062
- updateDisplaySimple(cm, {top: top, bottom: bot});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5063
  }
 
 
5064
 
5065
- if (wheelSamples < 20) {
5066
- if (display.wheelStartX == null) {
5067
- display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
5068
- display.wheelDX = dx; display.wheelDY = dy;
5069
- setTimeout(function () {
5070
- if (display.wheelStartX == null) { return }
5071
- var movedX = scroll.scrollLeft - display.wheelStartX;
5072
- var movedY = scroll.scrollTop - display.wheelStartY;
5073
- var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
5074
- (movedX && display.wheelDX && movedX / display.wheelDX);
5075
- display.wheelStartX = display.wheelStartY = null;
5076
- if (!sample) { return }
5077
- wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
5078
- ++wheelSamples;
5079
- }, 200);
5080
- } else {
5081
- display.wheelDX += dx; display.wheelDY += dy;
5082
- }
 
 
 
5083
  }
5084
  }
5085
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5086
  // SCROLLBARS
5087
 
5088
  // Prepare DOM reads needed to update the scrollbars. Done in one
@@ -5160,12 +5281,12 @@ NativeScrollbars.prototype.update = function (measure) {
5160
 
5161
  NativeScrollbars.prototype.setScrollLeft = function (pos) {
5162
  if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }
5163
- if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz); }
5164
  };
5165
 
5166
  NativeScrollbars.prototype.setScrollTop = function (pos) {
5167
  if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }
5168
- if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert); }
5169
  };
5170
 
5171
  NativeScrollbars.prototype.zeroWidthHack = function () {
@@ -5176,17 +5297,18 @@ NativeScrollbars.prototype.zeroWidthHack = function () {
5176
  this.disableVert = new Delayed;
5177
  };
5178
 
5179
- NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {
5180
  bar.style.pointerEvents = "auto";
5181
  function maybeDisable() {
5182
  // To find out whether the scrollbar is still visible, we
5183
  // check whether the element under the pixel in the bottom
5184
- // left corner of the scrollbar box is the scrollbar box
5185
  // itself (when the bar is still visible) or its filler child
5186
  // (when the bar is hidden). If it is still visible, we keep
5187
  // it enabled, if it's hidden, we disable pointer events.
5188
  var box = bar.getBoundingClientRect();
5189
- var elt$$1 = document.elementFromPoint(box.left + 1, box.bottom - 1);
 
5190
  if (elt$$1 != bar) { bar.style.pointerEvents = "none"; }
5191
  else { delay.set(1000, maybeDisable); }
5192
  }
@@ -5240,155 +5362,28 @@ function updateScrollbarsInner(cm, measure) {
5240
  } else { d.gutterFiller.style.display = ""; }
5241
  }
5242
 
5243
- var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
5244
-
5245
- function initScrollbars(cm) {
5246
- if (cm.display.scrollbars) {
5247
- cm.display.scrollbars.clear();
5248
- if (cm.display.scrollbars.addClass)
5249
- { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
5250
- }
5251
-
5252
- cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
5253
- cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
5254
- // Prevent clicks in the scrollbars from killing focus
5255
- on(node, "mousedown", function () {
5256
- if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }
5257
- });
5258
- node.setAttribute("cm-not-content", "true");
5259
- }, function (pos, axis) {
5260
- if (axis == "horizontal") { setScrollLeft(cm, pos); }
5261
- else { setScrollTop(cm, pos); }
5262
- }, cm);
5263
- if (cm.display.scrollbars.addClass)
5264
- { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
5265
- }
5266
-
5267
- // SCROLLING THINGS INTO VIEW
5268
-
5269
- // If an editor sits on the top or bottom of the window, partially
5270
- // scrolled out of view, this ensures that the cursor is visible.
5271
- function maybeScrollWindow(cm, rect) {
5272
- if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
5273
-
5274
- var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
5275
- if (rect.top + box.top < 0) { doScroll = true; }
5276
- else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }
5277
- if (doScroll != null && !phantom) {
5278
- var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
5279
- cm.display.lineSpace.appendChild(scrollNode);
5280
- scrollNode.scrollIntoView(doScroll);
5281
- cm.display.lineSpace.removeChild(scrollNode);
5282
- }
5283
- }
5284
-
5285
- // Scroll a given position into view (immediately), verifying that
5286
- // it actually became visible (as line heights are accurately
5287
- // measured, the position of something may 'drift' during drawing).
5288
- function scrollPosIntoView(cm, pos, end, margin) {
5289
- if (margin == null) { margin = 0; }
5290
- var rect;
5291
- for (var limit = 0; limit < 5; limit++) {
5292
- var changed = false;
5293
- var coords = cursorCoords(cm, pos);
5294
- var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
5295
- rect = {left: Math.min(coords.left, endCoords.left),
5296
- top: Math.min(coords.top, endCoords.top) - margin,
5297
- right: Math.max(coords.left, endCoords.left),
5298
- bottom: Math.max(coords.bottom, endCoords.bottom) + margin};
5299
- var scrollPos = calculateScrollPos(cm, rect);
5300
- var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
5301
- if (scrollPos.scrollTop != null) {
5302
- setScrollTop(cm, scrollPos.scrollTop);
5303
- if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }
5304
- }
5305
- if (scrollPos.scrollLeft != null) {
5306
- setScrollLeft(cm, scrollPos.scrollLeft);
5307
- if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }
5308
- }
5309
- if (!changed) { break }
5310
- }
5311
- return rect
5312
- }
5313
-
5314
- // Scroll a given set of coordinates into view (immediately).
5315
- function scrollIntoView(cm, rect) {
5316
- var scrollPos = calculateScrollPos(cm, rect);
5317
- if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop); }
5318
- if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }
5319
- }
5320
-
5321
- // Calculate a new scroll position needed to scroll the given
5322
- // rectangle into view. Returns an object with scrollTop and
5323
- // scrollLeft properties. When these are undefined, the
5324
- // vertical/horizontal position does not need to be adjusted.
5325
- function calculateScrollPos(cm, rect) {
5326
- var display = cm.display, snapMargin = textHeight(cm.display);
5327
- if (rect.top < 0) { rect.top = 0; }
5328
- var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
5329
- var screen = displayHeight(cm), result = {};
5330
- if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }
5331
- var docBottom = cm.doc.height + paddingVert(display);
5332
- var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;
5333
- if (rect.top < screentop) {
5334
- result.scrollTop = atTop ? 0 : rect.top;
5335
- } else if (rect.bottom > screentop + screen) {
5336
- var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);
5337
- if (newTop != screentop) { result.scrollTop = newTop; }
5338
- }
5339
-
5340
- var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
5341
- var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
5342
- var tooWide = rect.right - rect.left > screenw;
5343
- if (tooWide) { rect.right = rect.left + screenw; }
5344
- if (rect.left < 10)
5345
- { result.scrollLeft = 0; }
5346
- else if (rect.left < screenleft)
5347
- { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }
5348
- else if (rect.right > screenw + screenleft - 3)
5349
- { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
5350
- return result
5351
- }
5352
-
5353
- // Store a relative adjustment to the scroll position in the current
5354
- // operation (to be applied when the operation finishes).
5355
- function addToScrollPos(cm, left, top) {
5356
- if (left != null || top != null) { resolveScrollToPos(cm); }
5357
- if (left != null)
5358
- { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; }
5359
- if (top != null)
5360
- { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; }
5361
- }
5362
-
5363
- // Make sure that at the end of the operation the current cursor is
5364
- // shown.
5365
- function ensureCursorVisible(cm) {
5366
- resolveScrollToPos(cm);
5367
- var cur = cm.getCursor(), from = cur, to = cur;
5368
- if (!cm.options.lineWrapping) {
5369
- from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
5370
- to = Pos(cur.line, cur.ch + 1);
5371
- }
5372
- cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin};
5373
- }
5374
-
5375
- // When an operation has its scrollToPos property set, and another
5376
- // scroll action is applied before the end of the operation, this
5377
- // 'simulates' scrolling that position into view in a cheap way, so
5378
- // that the effect of intermediate scroll commands is not ignored.
5379
- function resolveScrollToPos(cm) {
5380
- var range$$1 = cm.curOp.scrollToPos;
5381
- if (range$$1) {
5382
- cm.curOp.scrollToPos = null;
5383
- var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);
5384
- var sPos = calculateScrollPos(cm, {
5385
- left: Math.min(from.left, to.left),
5386
- top: Math.min(from.top, to.top) - range$$1.margin,
5387
- right: Math.max(from.right, to.right),
5388
- bottom: Math.max(from.bottom, to.bottom) + range$$1.margin
5389
- });
5390
- cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);
5391
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5392
  }
5393
 
5394
  // Operations are used to wrap a series of changes to the editor
@@ -5519,17 +5514,9 @@ function endOperation_finish(op) {
5519
  { display.wheelStartX = display.wheelStartY = null; }
5520
 
5521
  // Propagate the scroll position to the actual DOM scroller
5522
- if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {
5523
- doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));
5524
- display.scrollbars.setScrollTop(doc.scrollTop);
5525
- display.scroller.scrollTop = doc.scrollTop;
5526
- }
5527
- if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
5528
- doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));
5529
- display.scrollbars.setScrollLeft(doc.scrollLeft);
5530
- display.scroller.scrollLeft = doc.scrollLeft;
5531
- alignHorizontally(cm);
5532
- }
5533
  // If we need to scroll a specific position into view, do so.
5534
  if (op.scrollToPos) {
5535
  var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
@@ -5742,22 +5729,23 @@ function countDirtyView(cm) {
5742
  // HIGHLIGHT WORKER
5743
 
5744
  function startWorker(cm, time) {
5745
- if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
5746
  { cm.state.highlight.set(time, bind(highlightWorker, cm)); }
5747
  }
5748
 
5749
  function highlightWorker(cm) {
5750
  var doc = cm.doc;
5751
- if (doc.frontier < doc.first) { doc.frontier = doc.first; }
5752
- if (doc.frontier >= cm.display.viewTo) { return }
5753
  var end = +new Date + cm.options.workTime;
5754
- var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
5755
  var changedLines = [];
5756
 
5757
- doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
5758
- if (doc.frontier >= cm.display.viewFrom) { // Visible
5759
- var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength;
5760
- var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true);
 
 
5761
  line.styles = highlighted.styles;
5762
  var oldCls = line.styleClasses, newCls = highlighted.classes;
5763
  if (newCls) { line.styleClasses = newCls; }
@@ -5765,19 +5753,22 @@ function highlightWorker(cm) {
5765
  var ischange = !oldStyles || oldStyles.length != line.styles.length ||
5766
  oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
5767
  for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }
5768
- if (ischange) { changedLines.push(doc.frontier); }
5769
- line.stateAfter = tooLong ? state : copyState(doc.mode, state);
 
5770
  } else {
5771
  if (line.text.length <= cm.options.maxHighlightLength)
5772
- { processLine(cm, line.text, state); }
5773
- line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
 
5774
  }
5775
- ++doc.frontier;
5776
  if (+new Date > end) {
5777
  startWorker(cm, cm.options.workDelay);
5778
  return true
5779
  }
5780
  });
 
 
5781
  if (changedLines.length) { runInOp(cm, function () {
5782
  for (var i = 0; i < changedLines.length; i++)
5783
  { regLineChange(cm, changedLines[i], "text"); }
@@ -5823,6 +5814,36 @@ function maybeClipScrollbars(cm) {
5823
  }
5824
  }
5825
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5826
  // Does the actual updating of the line display. Bails out
5827
  // (returning false) when there is nothing to be done and forced is
5828
  // false.
@@ -5872,14 +5893,14 @@ function updateDisplayIfNeeded(cm, update) {
5872
 
5873
  // For big changes, we hide the enclosing element during the
5874
  // update, since that speeds up the operations on most browsers.
5875
- var focused = activeElt();
5876
  if (toUpdate > 4) { display.lineDiv.style.display = "none"; }
5877
  patchDisplay(cm, display.updateLineNumbers, update.dims);
5878
  if (toUpdate > 4) { display.lineDiv.style.display = ""; }
5879
  display.renderedView = display.view;
5880
  // There might have been a widget with a focused element that got
5881
  // hidden or updated, if so re-focus it.
5882
- if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus(); }
5883
 
5884
  // Prevent selection and cursors from interfering with the scroll
5885
  // width and height.
@@ -5918,6 +5939,7 @@ function postUpdateDisplay(cm, update) {
5918
  updateSelection(cm);
5919
  updateScrollbars(cm, barMeasure);
5920
  setDocumentHeight(cm, barMeasure);
 
5921
  }
5922
 
5923
  update.signal(cm, "update", cm);
@@ -6027,6 +6049,117 @@ function setGuttersForLineNumbers(options) {
6027
  }
6028
  }
6029
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6030
  // Selection objects are immutable. A new one is created every time
6031
  // the selection changes. A selection is one or more non-overlapping
6032
  // (and non-touching) ranges, sorted, and an integer that indicates
@@ -6180,7 +6313,7 @@ function resetModeState(cm) {
6180
  if (line.stateAfter) { line.stateAfter = null; }
6181
  if (line.styles) { line.styles = null; }
6182
  });
6183
- cm.doc.frontier = cm.doc.first;
6184
  startWorker(cm, 100);
6185
  cm.state.modeGen++;
6186
  if (cm.curOp) { regChange(cm); }
@@ -6514,8 +6647,8 @@ function copyHistoryArray(events, newGroup, instantiateSel) {
6514
  // include a given position (and optionally a second position).
6515
  // Otherwise, simply returns the range between the given positions.
6516
  // Used for cursor motion and such.
6517
- function extendRange(doc, range, head, other) {
6518
- if (doc.cm && doc.cm.display.shift || doc.extend) {
6519
  var anchor = range.anchor;
6520
  if (other) {
6521
  var posBefore = cmp(head, anchor) < 0;
@@ -6533,16 +6666,18 @@ function extendRange(doc, range, head, other) {
6533
  }
6534
 
6535
  // Extend the primary selection range, discard the rest.
6536
- function extendSelection(doc, head, other, options) {
6537
- setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options);
 
6538
  }
6539
 
6540
  // Extend all selections (pos is an array of selections with length
6541
  // equal the number of selections)
6542
  function extendSelections(doc, heads, options) {
6543
  var out = [];
 
6544
  for (var i = 0; i < doc.sel.ranges.length; i++)
6545
- { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); }
6546
  var newSel = normalizeSelection(out, doc.sel.primIndex);
6547
  setSelection(doc, newSel, options);
6548
  }
@@ -6623,7 +6758,7 @@ function setSelectionInner(doc, sel) {
6623
  // Verify that the selection does not partially select any atomic
6624
  // marked ranges.
6625
  function reCheckSelection(doc) {
6626
- setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);
6627
  }
6628
 
6629
  // Return a selection that does not partially select any atomic
@@ -6926,8 +7061,7 @@ function makeChangeSingleDocInEditor(cm, change, spans) {
6926
  if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }
6927
  }
6928
 
6929
- // Adjust frontier, schedule worker
6930
- doc.frontier = Math.min(doc.frontier, from.line);
6931
  startWorker(cm, 400);
6932
 
6933
  var lendiff = change.text.length - (to.line - from.line) - 1;
@@ -7037,7 +7171,7 @@ function changeLine(doc, handle, changeType, op) {
7037
  //
7038
  // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
7039
 
7040
- var LeafChunk = function(lines) {
7041
  var this$1 = this;
7042
 
7043
  this.lines = lines;
@@ -7048,47 +7182,49 @@ var LeafChunk = function(lines) {
7048
  height += lines[i].height;
7049
  }
7050
  this.height = height;
7051
- };
7052
 
7053
- LeafChunk.prototype.chunkSize = function () { return this.lines.length };
 
7054
 
7055
- // Remove the n lines at offset 'at'.
7056
- LeafChunk.prototype.removeInner = function (at, n) {
7057
  var this$1 = this;
7058
 
7059
- for (var i = at, e = at + n; i < e; ++i) {
7060
- var line = this$1.lines[i];
7061
- this$1.height -= line.height;
7062
- cleanUpLine(line);
7063
- signalLater(line, "delete");
7064
- }
7065
- this.lines.splice(at, n);
7066
- };
7067
 
7068
- // Helper used to collapse a small branch into a single leaf.
7069
- LeafChunk.prototype.collapse = function (lines) {
7070
- lines.push.apply(lines, this.lines);
7071
- };
7072
 
7073
- // Insert the given array of lines at offset 'at', count them as
7074
- // having the given height.
7075
- LeafChunk.prototype.insertInner = function (at, lines, height) {
7076
  var this$1 = this;
7077
 
7078
- this.height += height;
7079
- this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
7080
- for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }
7081
- };
7082
 
7083
- // Used to iterate over a part of the tree.
7084
- LeafChunk.prototype.iterN = function (at, n, op) {
7085
  var this$1 = this;
7086
 
7087
- for (var e = at + n; at < e; ++at)
7088
- { if (op(this$1.lines[at])) { return true } }
 
7089
  };
7090
 
7091
- var BranchChunk = function(children) {
7092
  var this$1 = this;
7093
 
7094
  this.children = children;
@@ -7101,104 +7237,106 @@ var BranchChunk = function(children) {
7101
  this.size = size;
7102
  this.height = height;
7103
  this.parent = null;
7104
- };
7105
 
7106
- BranchChunk.prototype.chunkSize = function () { return this.size };
 
7107
 
7108
- BranchChunk.prototype.removeInner = function (at, n) {
7109
  var this$1 = this;
7110
 
7111
- this.size -= n;
7112
- for (var i = 0; i < this.children.length; ++i) {
7113
- var child = this$1.children[i], sz = child.chunkSize();
7114
- if (at < sz) {
7115
- var rm = Math.min(n, sz - at), oldHeight = child.height;
7116
- child.removeInner(at, rm);
7117
- this$1.height -= oldHeight - child.height;
7118
- if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }
7119
- if ((n -= rm) == 0) { break }
7120
- at = 0;
7121
- } else { at -= sz; }
7122
- }
7123
- // If the result is smaller than 25 lines, ensure that it is a
7124
- // single leaf node.
7125
- if (this.size - n < 25 &&
7126
- (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
7127
- var lines = [];
7128
- this.collapse(lines);
7129
- this.children = [new LeafChunk(lines)];
7130
- this.children[0].parent = this;
7131
- }
7132
- };
7133
 
7134
- BranchChunk.prototype.collapse = function (lines) {
7135
  var this$1 = this;
7136
 
7137
- for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }
7138
- };
7139
 
7140
- BranchChunk.prototype.insertInner = function (at, lines, height) {
7141
  var this$1 = this;
7142
 
7143
- this.size += lines.length;
7144
- this.height += height;
7145
- for (var i = 0; i < this.children.length; ++i) {
7146
- var child = this$1.children[i], sz = child.chunkSize();
7147
- if (at <= sz) {
7148
- child.insertInner(at, lines, height);
7149
- if (child.lines && child.lines.length > 50) {
7150
- // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
7151
- // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
7152
- var remaining = child.lines.length % 25 + 25;
7153
- for (var pos = remaining; pos < child.lines.length;) {
7154
- var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
7155
- child.height -= leaf.height;
7156
- this$1.children.splice(++i, 0, leaf);
7157
- leaf.parent = this$1;
 
 
 
7158
  }
7159
- child.lines = child.lines.slice(0, remaining);
7160
- this$1.maybeSpill();
7161
  }
7162
- break
7163
  }
7164
- at -= sz;
7165
- }
7166
- };
7167
 
7168
- // When a node has grown, check whether it should be split.
7169
- BranchChunk.prototype.maybeSpill = function () {
7170
- if (this.children.length <= 10) { return }
7171
- var me = this;
7172
- do {
7173
- var spilled = me.children.splice(me.children.length - 5, 5);
7174
- var sibling = new BranchChunk(spilled);
7175
- if (!me.parent) { // Become the parent node
7176
- var copy = new BranchChunk(me.children);
7177
- copy.parent = me;
7178
- me.children = [copy, sibling];
7179
- me = copy;
7180
- } else {
7181
- me.size -= sibling.size;
7182
- me.height -= sibling.height;
7183
- var myIndex = indexOf(me.parent.children, me);
7184
- me.parent.children.splice(myIndex + 1, 0, sibling);
7185
- }
7186
- sibling.parent = me.parent;
7187
- } while (me.children.length > 10)
7188
- me.parent.maybeSpill();
7189
- };
7190
 
7191
- BranchChunk.prototype.iterN = function (at, n, op) {
7192
  var this$1 = this;
7193
 
7194
- for (var i = 0; i < this.children.length; ++i) {
7195
- var child = this$1.children[i], sz = child.chunkSize();
7196
- if (at < sz) {
7197
- var used = Math.min(n, sz - at);
7198
- if (child.iterN(at, used, op)) { return true }
7199
- if ((n -= used) == 0) { break }
7200
- at = 0;
7201
- } else { at -= sz; }
 
7202
  }
7203
  };
7204
 
@@ -7251,7 +7389,7 @@ eventMixin(LineWidget);
7251
 
7252
  function adjustScrollWhenAboveVisible(cm, line, diff) {
7253
  if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
7254
- { addToScrollPos(cm, null, diff); }
7255
  }
7256
 
7257
  function addLineWidget(doc, handle, node, options) {
@@ -7266,7 +7404,7 @@ function addLineWidget(doc, handle, node, options) {
7266
  if (cm && !lineIsHidden(doc, line)) {
7267
  var aboveVisible = heightAtLine(line) < doc.scrollTop;
7268
  updateLineHeight(line, line.height + widgetHeight(widget));
7269
- if (aboveVisible) { addToScrollPos(cm, null, widget.height); }
7270
  cm.curOp.forceUpdate = true;
7271
  }
7272
  return true
@@ -7568,7 +7706,7 @@ var Doc = function(text, mode, firstLine, lineSep, direction) {
7568
  this.scrollTop = this.scrollLeft = 0;
7569
  this.cantEdit = false;
7570
  this.cleanGeneration = 1;
7571
- this.frontier = firstLine;
7572
  var start = Pos(firstLine, 0);
7573
  this.sel = simpleSelection(start);
7574
  this.history = new History(null);
@@ -7614,7 +7752,8 @@ Doc.prototype = createObj(BranchChunk.prototype, {
7614
  var top = Pos(this.first, 0), last = this.first + this.size - 1;
7615
  makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
7616
  text: this.splitLines(code), origin: "setValue", full: true}, true);
7617
- setSelection(this, simpleSelection(top));
 
7618
  }),
7619
  replaceRange: function(code, from, to, origin) {
7620
  from = clipPos(this, from);
@@ -8090,8 +8229,8 @@ function clearDragCursor(cm) {
8090
  // garbage collected.
8091
 
8092
  function forEachCodeMirror(f) {
8093
- if (!document.body.getElementsByClassName) { return }
8094
- var byClass = document.body.getElementsByClassName("CodeMirror");
8095
  for (var i = 0; i < byClass.length; i++) {
8096
  var cm = byClass[i].CodeMirror;
8097
  if (cm) { f(cm); }
@@ -8265,11 +8404,8 @@ function isModifierKey(value) {
8265
  return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
8266
  }
8267
 
8268
- // Look up the name of a key as indicated by an event object.
8269
- function keyName(event, noShift) {
8270
- if (presto && event.keyCode == 34 && event["char"]) { return false }
8271
- var base = keyNames[event.keyCode], name = base;
8272
- if (name == null || event.altGraphKey) { return false }
8273
  if (event.altKey && base != "Alt") { name = "Alt-" + name; }
8274
  if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; }
8275
  if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; }
@@ -8277,6 +8413,14 @@ function keyName(event, noShift) {
8277
  return name
8278
  }
8279
 
 
 
 
 
 
 
 
 
8280
  function getKeyMap(val) {
8281
  return typeof val == "string" ? keyMap[val] : val
8282
  }
@@ -8503,6 +8647,9 @@ function lookupKeyForEditor(cm, name, handle) {
8503
  || lookupKey(name, cm.options.keyMap, handle, cm)
8504
  }
8505
 
 
 
 
8506
  var stopSeq = new Delayed;
8507
  function dispatchKey(cm, name, e, handle) {
8508
  var seq = cm.state.keySeq;
@@ -8614,6 +8761,37 @@ function onKeyPress(e) {
8614
  cm.display.input.onKeyPress(e);
8615
  }
8616
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8617
  // A mouse down can be a single click, double click, triple click,
8618
  // start of selection drag, start of text drag, new cursor
8619
  // (ctrl-click), rectangle drag (alt-drag), or xwin
@@ -8635,72 +8813,91 @@ function onMouseDown(e) {
8635
  return
8636
  }
8637
  if (clickInGutter(cm, e)) { return }
8638
- var start = posFromMouse(cm, e);
8639
  window.focus();
8640
 
8641
- switch (e_button(e)) {
8642
- case 1:
8643
- // #3261: make sure, that we're not starting a second selection
8644
- if (cm.state.selectingText)
8645
- { cm.state.selectingText(e); }
8646
- else if (start)
8647
- { leftButtonDown(cm, e, start); }
8648
- else if (e_target(e) == display.scroller)
8649
- { e_preventDefault(e); }
8650
- break
8651
- case 2:
8652
- if (webkit) { cm.state.lastMiddleDown = +new Date; }
8653
- if (start) { extendSelection(cm.doc, start); }
8654
  setTimeout(function () { return display.input.focus(); }, 20);
8655
- e_preventDefault(e);
8656
- break
8657
- case 3:
8658
  if (captureRightClick) { onContextMenu(cm, e); }
8659
  else { delayBlurEvent(cm); }
8660
- break
8661
  }
8662
  }
8663
 
8664
- var lastClick;
8665
- var lastDoubleClick;
8666
- function leftButtonDown(cm, e, start) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8667
  if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
8668
  else { cm.curOp.focus = activeElt(); }
8669
 
8670
- var now = +new Date, type;
8671
- if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
8672
- type = "triple";
8673
- } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
8674
- type = "double";
8675
- lastDoubleClick = {time: now, pos: start};
8676
- } else {
8677
- type = "single";
8678
- lastClick = {time: now, pos: start};
8679
- }
8680
 
8681
- var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
8682
  if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
8683
- type == "single" && (contained = sel.contains(start)) > -1 &&
8684
- (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
8685
- (cmp(contained.to(), start) > 0 || start.xRel < 0))
8686
- { leftButtonStartDrag(cm, e, start, modifier); }
8687
  else
8688
- { leftButtonSelect(cm, e, start, type, modifier); }
8689
  }
8690
 
8691
  // Start a text drag. When it ends, see if any dragging actually
8692
  // happen, and treat as a click if it didn't.
8693
- function leftButtonStartDrag(cm, e, start, modifier) {
8694
- var display = cm.display, startTime = +new Date;
8695
- var dragEnd = operation(cm, function (e2) {
8696
  if (webkit) { display.scroller.draggable = false; }
8697
  cm.state.draggingText = false;
8698
  off(document, "mouseup", dragEnd);
 
 
8699
  off(display.scroller, "drop", dragEnd);
8700
- if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
8701
- e_preventDefault(e2);
8702
- if (!modifier && +new Date - 200 < startTime)
8703
- { extendSelection(cm.doc, start); }
8704
  // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
8705
  if (webkit || ie && ie_version == 9)
8706
  { setTimeout(function () {document.body.focus(); display.input.focus();}, 20); }
@@ -8708,23 +8905,40 @@ function leftButtonStartDrag(cm, e, start, modifier) {
8708
  { display.input.focus(); }
8709
  }
8710
  });
 
 
 
 
8711
  // Let the drag handler handle this.
8712
  if (webkit) { display.scroller.draggable = true; }
8713
  cm.state.draggingText = dragEnd;
8714
- dragEnd.copy = mac ? e.altKey : e.ctrlKey;
8715
  // IE's approach to draggable
8716
  if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
8717
  on(document, "mouseup", dragEnd);
 
 
8718
  on(display.scroller, "drop", dragEnd);
 
 
 
 
 
 
 
 
 
 
 
8719
  }
8720
 
8721
  // Normal selection, as opposed to text dragging.
8722
- function leftButtonSelect(cm, e, start, type, addNew) {
8723
  var display = cm.display, doc = cm.doc;
8724
- e_preventDefault(e);
8725
 
8726
  var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
8727
- if (addNew && !e.shiftKey) {
8728
  ourIndex = doc.sel.contains(start);
8729
  if (ourIndex > -1)
8730
  { ourRange = ranges[ourIndex]; }
@@ -8735,28 +8949,19 @@ function leftButtonSelect(cm, e, start, type, addNew) {
8735
  ourIndex = doc.sel.primIndex;
8736
  }
8737
 
8738
- if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
8739
- type = "rect";
8740
- if (!addNew) { ourRange = new Range(start, start); }
8741
- start = posFromMouse(cm, e, true, true);
8742
  ourIndex = -1;
8743
- } else if (type == "double") {
8744
- var word = cm.findWordAt(start);
8745
- if (cm.display.shift || doc.extend)
8746
- { ourRange = extendRange(doc, ourRange, word.anchor, word.head); }
8747
- else
8748
- { ourRange = word; }
8749
- } else if (type == "triple") {
8750
- var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));
8751
- if (cm.display.shift || doc.extend)
8752
- { ourRange = extendRange(doc, ourRange, line.anchor, line.head); }
8753
- else
8754
- { ourRange = line; }
8755
  } else {
8756
- ourRange = extendRange(doc, ourRange, start);
 
 
 
 
8757
  }
8758
 
8759
- if (!addNew) {
8760
  ourIndex = 0;
8761
  setSelection(doc, new Selection([ourRange], 0), sel_mouse);
8762
  startSel = doc.sel;
@@ -8764,7 +8969,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
8764
  ourIndex = ranges.length;
8765
  setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
8766
  {scroll: false, origin: "*mouse"});
8767
- } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
8768
  setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
8769
  {scroll: false, origin: "*mouse"});
8770
  startSel = doc.sel;
@@ -8777,7 +8982,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
8777
  if (cmp(lastPos, pos) == 0) { return }
8778
  lastPos = pos;
8779
 
8780
- if (type == "rect") {
8781
  var ranges = [], tabSize = cm.options.tabSize;
8782
  var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
8783
  var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
@@ -8796,20 +9001,14 @@ function leftButtonSelect(cm, e, start, type, addNew) {
8796
  cm.scrollIntoView(pos);
8797
  } else {
8798
  var oldRange = ourRange;
8799
- var anchor = oldRange.anchor, head = pos;
8800
- if (type != "single") {
8801
- var range$$1;
8802
- if (type == "double")
8803
- { range$$1 = cm.findWordAt(pos); }
8804
- else
8805
- { range$$1 = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); }
8806
- if (cmp(range$$1.anchor, anchor) > 0) {
8807
- head = range$$1.head;
8808
- anchor = minPos(oldRange.from(), range$$1.anchor);
8809
- } else {
8810
- head = range$$1.anchor;
8811
- anchor = maxPos(oldRange.to(), range$$1.head);
8812
- }
8813
  }
8814
  var ranges$1 = startSel.ranges.slice(0);
8815
  ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head);
@@ -8826,7 +9025,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
8826
 
8827
  function extend(e) {
8828
  var curCount = ++counter;
8829
- var cur = posFromMouse(cm, e, true, type == "rect");
8830
  if (!cur) { return }
8831
  if (cmp(cur, lastPos) != 0) {
8832
  cm.curOp.focus = activeElt();
@@ -8992,6 +9191,7 @@ function defineOptions(CodeMirror) {
8992
  if (next.attach) { next.attach(cm, prev || null); }
8993
  });
8994
  option("extraKeys", null);
 
8995
 
8996
  option("lineWrapping", false, wrappingChanged, true);
8997
  option("gutters", [], function (cm) {
@@ -9019,14 +9219,12 @@ function defineOptions(CodeMirror) {
9019
 
9020
  option("resetSelectionOnContextMenu", true);
9021
  option("lineWiseCopyCut", true);
 
9022
 
9023
  option("readOnly", false, function (cm, val) {
9024
  if (val == "nocursor") {
9025
  onBlur(cm);
9026
  cm.display.input.blur();
9027
- cm.display.disabled = true;
9028
- } else {
9029
- cm.display.disabled = false;
9030
  }
9031
  cm.display.input.readOnlyChanged(val);
9032
  });
@@ -9247,7 +9445,7 @@ function registerEventHandlers(cm) {
9247
  // area, ensure viewport is updated when scrolling.
9248
  on(d.scroller, "scroll", function () {
9249
  if (d.scroller.clientHeight) {
9250
- setScrollTop(cm, d.scroller.scrollTop);
9251
  setScrollLeft(cm, d.scroller.scrollLeft, true);
9252
  signal(cm, "scroll", cm);
9253
  }
@@ -9291,7 +9489,7 @@ function indentLine(cm, n, how, aggressive) {
9291
  // Fall back to "prev" when the mode doesn't have an indentation
9292
  // method.
9293
  if (!doc.mode.indent) { how = "prev"; }
9294
- else { state = getStateBefore(cm, n); }
9295
  }
9296
 
9297
  var tabSize = cm.options.tabSize;
@@ -9367,7 +9565,7 @@ function applyTextInput(cm, inserted, deleted, sel, origin) {
9367
  for (var i = 0; i < lastCopied.text.length; i++)
9368
  { multiPaste.push(doc.splitLines(lastCopied.text[i])); }
9369
  }
9370
- } else if (textLines.length == sel.ranges.length) {
9371
  multiPaste = map(textLines, function (l) { return [l]; });
9372
  }
9373
  }
@@ -9627,7 +9825,7 @@ var addEditorMethods = function(CodeMirror) {
9627
  getStateAfter: function(line, precise) {
9628
  var doc = this.doc;
9629
  line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
9630
- return getStateBefore(this, line + 1, precise)
9631
  },
9632
 
9633
  cursorCoords: function(start, mode) {
@@ -9708,6 +9906,7 @@ var addEditorMethods = function(CodeMirror) {
9708
  triggerOnKeyDown: methodOp(onKeyDown),
9709
  triggerOnKeyPress: methodOp(onKeyPress),
9710
  triggerOnKeyUp: onKeyUp,
 
9711
 
9712
  execCommand: function(cmd) {
9713
  if (commands.hasOwnProperty(cmd))
@@ -9780,7 +9979,7 @@ var addEditorMethods = function(CodeMirror) {
9780
  goals.push(headPos.left);
9781
  var pos = findPosV(this$1, headPos, dir, unit);
9782
  if (unit == "page" && range$$1 == doc.sel.primary())
9783
- { addToScrollPos(this$1, null, charCoords(this$1, pos, "div").top - headPos.top); }
9784
  return pos
9785
  }, sel_move);
9786
  if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
@@ -9817,11 +10016,7 @@ var addEditorMethods = function(CodeMirror) {
9817
  hasFocus: function() { return this.display.input.getField() == activeElt() },
9818
  isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
9819
 
9820
- scrollTo: methodOp(function(x, y) {
9821
- if (x != null || y != null) { resolveScrollToPos(this); }
9822
- if (x != null) { this.curOp.scrollLeft = x; }
9823
- if (y != null) { this.curOp.scrollTop = y; }
9824
- }),
9825
  getScrollInfo: function() {
9826
  var scroller = this.display.scroller;
9827
  return {left: scroller.scrollLeft, top: scroller.scrollTop,
@@ -9843,16 +10038,9 @@ var addEditorMethods = function(CodeMirror) {
9843
  range$$1.margin = margin || 0;
9844
 
9845
  if (range$$1.from.line != null) {
9846
- resolveScrollToPos(this);
9847
- this.curOp.scrollToPos = range$$1;
9848
  } else {
9849
- var sPos = calculateScrollPos(this, {
9850
- left: Math.min(range$$1.from.left, range$$1.to.left),
9851
- top: Math.min(range$$1.from.top, range$$1.to.top) - range$$1.margin,
9852
- right: Math.max(range$$1.from.right, range$$1.to.right),
9853
- bottom: Math.max(range$$1.from.bottom, range$$1.to.bottom) + range$$1.margin
9854
- });
9855
- this.scrollTo(sPos.scrollLeft, sPos.scrollTop);
9856
  }
9857
  }),
9858
 
@@ -9880,7 +10068,7 @@ var addEditorMethods = function(CodeMirror) {
9880
  regChange(this);
9881
  this.curOp.forceUpdate = true;
9882
  clearCaches(this);
9883
- this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop);
9884
  updateGutterSpace(this);
9885
  if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
9886
  { estimateLineHeights(this); }
@@ -9893,7 +10081,7 @@ var addEditorMethods = function(CodeMirror) {
9893
  attachDoc(this, doc);
9894
  clearCaches(this);
9895
  this.display.input.reset();
9896
- this.scrollTo(doc.scrollLeft, doc.scrollTop);
9897
  this.curOp.forceScroll = true;
9898
  signalLater(this, "swapDoc", this, old);
9899
  return old
@@ -10104,36 +10292,41 @@ ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
10104
  };
10105
 
10106
  ContentEditableInput.prototype.showPrimarySelection = function () {
10107
- var sel = window.getSelection(), prim = this.cm.doc.sel.primary();
10108
- var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset);
10109
- var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset);
10110
- if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
10111
- cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
10112
- cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
10113
- { return }
10114
 
10115
- var start = posToDOM(this.cm, prim.from());
10116
- var end = posToDOM(this.cm, prim.to());
10117
- if (!start && !end) {
10118
  sel.removeAllRanges();
10119
  return
10120
  }
10121
 
10122
- var view = this.cm.display.view;
10123
- var old = sel.rangeCount && sel.getRangeAt(0);
10124
- if (!start) {
10125
- start = {node: view[0].measure.map[2], offset: 0};
10126
- } else if (!end) { // FIXME dangerously hacky
 
 
 
 
 
 
 
10127
  var measure = view[view.length - 1].measure;
10128
  var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;
10129
  end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};
10130
  }
10131
 
10132
- var rng;
 
 
 
 
 
10133
  try { rng = range(start.node, start.offset, end.offset, end.node); }
10134
  catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
10135
  if (rng) {
10136
- if (!gecko && this.cm.state.focused) {
10137
  sel.collapse(start.node, start.offset);
10138
  if (!rng.collapsed) {
10139
  sel.removeAllRanges();
@@ -10643,7 +10836,7 @@ TextareaInput.prototype.showSelection = function (drawn) {
10643
  // Reset the input to correspond to the selection (or to be empty,
10644
  // when not typing and nothing is selected)
10645
  TextareaInput.prototype.reset = function (typing) {
10646
- if (this.contextMenuPending) { return }
10647
  var minimal, selected, cm = this.cm, doc = cm.doc;
10648
  if (cm.somethingSelected()) {
10649
  this.prevInput = "";
@@ -10853,6 +11046,7 @@ TextareaInput.prototype.onContextMenu = function (e) {
10853
 
10854
  TextareaInput.prototype.readOnlyChanged = function (val) {
10855
  if (!val) { this.reset(); }
 
10856
  };
10857
 
10858
  TextareaInput.prototype.setUneditable = function () {};
@@ -11008,7 +11202,7 @@ CodeMirror$1.fromTextArea = fromTextArea;
11008
 
11009
  addLegacyProps(CodeMirror$1);
11010
 
11011
- CodeMirror$1.version = "5.25.0";
11012
 
11013
  return CodeMirror$1;
11014
 
@@ -11418,7 +11612,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11418
  ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
11419
  // Dedent relative to current context.
11420
  indent = Math.max(0, cx.indent - indentUnit);
11421
- cx = cx.prev;
11422
  }
11423
  }
11424
  return indent;
@@ -11489,7 +11682,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11489
  "border-top-left-radius", "border-top-right-radius", "border-top-style",
11490
  "border-top-width", "border-width", "bottom", "box-decoration-break",
11491
  "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
11492
- "caption-side", "clear", "clip", "color", "color-profile", "column-count",
11493
  "column-fill", "column-gap", "column-rule", "column-rule-color",
11494
  "column-rule-style", "column-rule-width", "column-span", "column-width",
11495
  "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
@@ -11510,7 +11703,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11510
  "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
11511
  "grid-template-rows", "hanging-punctuation", "height", "hyphens",
11512
  "icon", "image-orientation", "image-rendering", "image-resolution",
11513
- "inline-box-align", "justify-content", "left", "letter-spacing",
11514
  "line-break", "line-height", "line-stacking", "line-stacking-ruby",
11515
  "line-stacking-shift", "line-stacking-strategy", "list-style",
11516
  "list-style-image", "list-style-position", "list-style-type", "margin",
@@ -11525,7 +11718,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11525
  "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
11526
  "page", "page-break-after", "page-break-before", "page-break-inside",
11527
  "page-policy", "pause", "pause-after", "pause-before", "perspective",
11528
- "perspective-origin", "pitch", "pitch-range", "play-during", "position",
11529
  "presentation-level", "punctuation-trim", "quotes", "region-break-after",
11530
  "region-break-before", "region-break-inside", "region-fragment",
11531
  "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
@@ -11676,13 +11869,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11676
  "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
11677
  "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
11678
  "searchfield-cancel-button", "searchfield-decoration",
11679
- "searchfield-results-button", "searchfield-results-decoration",
11680
  "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
11681
  "simp-chinese-formal", "simp-chinese-informal", "single",
11682
  "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
11683
  "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
11684
  "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
11685
- "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
11686
  "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
11687
  "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
11688
  "table-caption", "table-cell", "table-column", "table-column-group",
@@ -11765,8 +11958,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11765
  }
11766
  },
11767
  ":": function(stream) {
11768
- if (stream.match(/\s*\{/))
11769
- return [null, "{"];
11770
  return false;
11771
  },
11772
  "$": function(stream) {
@@ -11983,11 +12176,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
11983
  return state.token(stream, state);
11984
  },
11985
 
11986
- indent: function (state, textAfter) {
11987
  if (!state.localMode || /^\s*<\//.test(textAfter))
11988
  return htmlMode.indent(state.htmlState, textAfter);
11989
  else if (state.localMode.indent)
11990
- return state.localMode.indent(state.localState, textAfter);
11991
  else
11992
  return CodeMirror.Pass;
11993
  },
@@ -12045,12 +12238,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12045
  "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
12046
  "this": kw("this"), "class": kw("class"), "super": kw("atom"),
12047
  "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
12048
- "await": C, "async": kw("async")
12049
  };
12050
 
12051
  // Extend the 'normal' keywords with the TypeScript language extensions
12052
  if (isTS) {
12053
- var type = {type: "variable", style: "variable-3"};
12054
  var tsKeywords = {
12055
  // object-like things
12056
  "interface": kw("class"),
@@ -12058,7 +12251,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12058
  "namespace": C,
12059
  "module": kw("module"),
12060
  "enum": kw("module"),
12061
- "type": kw("type"),
12062
 
12063
  // scope modifiers
12064
  "public": kw("modifier"),
@@ -12066,9 +12258,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12066
  "protected": kw("modifier"),
12067
  "abstract": kw("modifier"),
12068
 
12069
- // operators
12070
- "as": operator,
12071
-
12072
  // types
12073
  "string": type, "number": type, "boolean": type, "any": type
12074
  };
@@ -12081,7 +12270,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12081
  return jsKeywords;
12082
  }();
12083
 
12084
- var isOperatorChar = /[+\-*&%=<>!?|~^]/;
12085
  var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
12086
 
12087
  function readRegexp(stream) {
@@ -12155,9 +12344,16 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12155
  return ret("operator", "operator", stream.current());
12156
  } else if (wordRE.test(ch)) {
12157
  stream.eatWhile(wordRE);
12158
- var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
12159
- return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
12160
- ret("variable", "variable", word);
 
 
 
 
 
 
 
12161
  }
12162
  }
12163
 
@@ -12365,8 +12561,15 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12365
  }
12366
  if (type == "function") return cont(functiondef);
12367
  if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
12368
- if (type == "variable") return cont(pushlex("stat"), maybelabel);
12369
- if (type == "switch") return cont(pushlex("form"), parenExpr, pushlex("}", "switch"), expect("{"),
 
 
 
 
 
 
 
12370
  block, poplex, poplex);
12371
  if (type == "case") return cont(expression, expect(":"));
12372
  if (type == "default") return cont(expect(":"));
@@ -12375,9 +12578,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12375
  if (type == "class") return cont(pushlex("form"), className, poplex);
12376
  if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
12377
  if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
12378
- if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
12379
- if (type == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
12380
  if (type == "async") return cont(statement)
 
12381
  return pass(pushlex("stat"), expression, expect(";"), poplex);
12382
  }
12383
  function expression(type) {
@@ -12437,6 +12640,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12437
  if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
12438
  if (type == ".") return cont(property, me);
12439
  if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
 
12440
  }
12441
  function quasi(type, value) {
12442
  if (type != "quasi") return pass();
@@ -12495,7 +12699,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12495
  } else if (type == "[") {
12496
  return cont(expression, expect("]"), afterprop);
12497
  } else if (type == "spread") {
12498
- return cont(expression);
12499
  } else if (type == ":") {
12500
  return pass(afterprop)
12501
  }
@@ -12543,9 +12747,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12543
  }
12544
  }
12545
  function typeexpr(type) {
12546
- if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
12547
  if (type == "string" || type == "number" || type == "atom") return cont(afterType);
12548
- if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex)
12549
  if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
12550
  }
12551
  function maybeReturnType(type) {
@@ -12559,6 +12763,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12559
  return cont(typeprop)
12560
  } else if (type == ":") {
12561
  return cont(typeexpr)
 
 
12562
  }
12563
  }
12564
  function typearg(type) {
@@ -12569,6 +12775,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12569
  if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
12570
  if (value == "|" || type == ".") return cont(typeexpr)
12571
  if (type == "[") return cont(expect("]"), afterType)
 
12572
  }
12573
  function vardef() {
12574
  return pass(pattern, maybetype, maybeAssign, vardefCont);
@@ -12624,6 +12831,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12624
  if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
12625
  if (type == "variable") {register(value); return cont(functiondef);}
12626
  if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
 
12627
  }
12628
  function funarg(type) {
12629
  if (type == "spread") return cont(funarg);
@@ -12662,6 +12870,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
12662
  }
12663
  if (type == ";") return cont(classBody);
12664
  if (type == "}") return cont();
 
12665
  }
12666
  function classfield(type, value) {
12667
  if (value == "?") return cont(classfield)
1689
  }
1690
  };
1691
 
1692
+ CodeMirror.findEnclosingTag = function(cm, pos, range, tag) {
1693
  var iter = new Iter(cm, pos.line, pos.ch, range);
1694
  for (;;) {
1695
+ var open = findMatchingOpen(iter, tag);
1696
  if (!open) break;
1697
  var forward = new Iter(cm, pos.line, pos.ch, range);
1698
  var close = findMatchingClose(forward, open.tag);
2844
  ch = dir < 0 ? lineObj.text.length - 1 : 0;
2845
  var targetTop = measureCharPrepared(cm, prep, ch).top;
2846
  ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);
2847
+ if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); }
2848
  } else { ch = dir < 0 ? part.to : part.from; }
2849
  return new Pos(lineNo, ch, sticky)
2850
  }
3205
  // Fed to the mode parsers, provides helper functions to make
3206
  // parsers more succinct.
3207
 
3208
+ var StringStream = function(string, tabSize, lineOracle) {
3209
  this.pos = this.start = 0;
3210
  this.string = string;
3211
  this.tabSize = tabSize || 8;
3212
  this.lastColumnPos = this.lastColumnValue = 0;
3213
  this.lineStart = 0;
3214
+ this.lineOracle = lineOracle;
3215
  };
3216
 
3217
  StringStream.prototype.eol = function () {return this.pos >= this.string.length};
3278
  try { return inner() }
3279
  finally { this.lineStart -= n; }
3280
  };
3281
+ StringStream.prototype.lookAhead = function (n) {
3282
+ var oracle = this.lineOracle;
3283
+ return oracle && oracle.lookAhead(n)
3284
+ };
3285
+
3286
+ var SavedContext = function(state, lookAhead) {
3287
+ this.state = state;
3288
+ this.lookAhead = lookAhead;
3289
+ };
3290
+
3291
+ var Context = function(doc, state, line, lookAhead) {
3292
+ this.state = state;
3293
+ this.doc = doc;
3294
+ this.line = line;
3295
+ this.maxLookAhead = lookAhead || 0;
3296
+ };
3297
+
3298
+ Context.prototype.lookAhead = function (n) {
3299
+ var line = this.doc.getLine(this.line + n);
3300
+ if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }
3301
+ return line
3302
+ };
3303
+
3304
+ Context.prototype.nextLine = function () {
3305
+ this.line++;
3306
+ if (this.maxLookAhead > 0) { this.maxLookAhead--; }
3307
+ };
3308
+
3309
+ Context.fromSaved = function (doc, saved, line) {
3310
+ if (saved instanceof SavedContext)
3311
+ { return new Context(doc, copyState(doc.mode, saved.saved), line, saved.lookAhead) }
3312
+ else
3313
+ { return new Context(doc, copyState(doc.mode, saved), line) }
3314
+ };
3315
+
3316
+ Context.prototype.save = function (copy) {
3317
+ var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;
3318
+ return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
3319
+ };
3320
+
3321
 
3322
  // Compute a style array (an array starting with a mode generation
3323
  // -- for invalidation -- followed by pairs of end positions and
3324
  // style strings), which is used to highlight the tokens on the
3325
  // line.
3326
+ function highlightLine(cm, line, context, forceToEnd) {
3327
  // A styles array always starts with a number identifying the
3328
  // mode/overlays that it is based on (for easy invalidation).
3329
  var st = [cm.state.modeGen], lineClasses = {};
3330
  // Compute the base array of styles
3331
+ runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
3332
+ lineClasses, forceToEnd);
3333
+ var state = context.state;
3334
 
3335
  // Run overlays, adjust style array.
3336
  var loop = function ( o ) {
3337
  var overlay = cm.state.overlays[o], i = 1, at = 0;
3338
+ context.state = true;
3339
+ runMode(cm, line.text, overlay.mode, context, function (end, style) {
3340
  var start = i;
3341
  // Ensure there's a token end at the current position, and that i points at it
3342
  while (at < end) {
3360
  };
3361
 
3362
  for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
3363
+ context.state = state;
3364
 
3365
  return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
3366
  }
3367
 
3368
  function getLineStyles(cm, line, updateFrontier) {
3369
  if (!line.styles || line.styles[0] != cm.state.modeGen) {
3370
+ var context = getContextBefore(cm, lineNo(line));
3371
+ var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);
3372
+ var result = highlightLine(cm, line, context);
3373
+ if (resetState) { context.state = resetState; }
3374
+ line.stateAfter = context.save(!resetState);
3375
  line.styles = result.styles;
3376
  if (result.classes) { line.styleClasses = result.classes; }
3377
  else if (line.styleClasses) { line.styleClasses = null; }
3378
+ if (updateFrontier === cm.doc.highlightFrontier)
3379
+ { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }
3380
  }
3381
  return line.styles
3382
  }
3383
 
3384
+ function getContextBefore(cm, n, precise) {
3385
  var doc = cm.doc, display = cm.display;
3386
+ if (!doc.mode.startState) { return new Context(doc, true, n) }
3387
+ var start = findStartLine(cm, n, precise);
3388
+ var saved = start > doc.first && getLine(doc, start - 1).stateAfter;
3389
+ var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);
3390
+
3391
+ doc.iter(start, n, function (line) {
3392
+ processLine(cm, line.text, context);
3393
+ var pos = context.line;
3394
+ line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;
3395
+ context.nextLine();
3396
  });
3397
+ if (precise) { doc.modeFrontier = context.line; }
3398
+ return context
3399
  }
3400
 
3401
  // Lightweight form of highlight -- proceed over this line and
3402
  // update state, but don't save a style array. Used for lines that
3403
  // aren't currently visible.
3404
+ function processLine(cm, text, context, startAt) {
3405
  var mode = cm.doc.mode;
3406
+ var stream = new StringStream(text, cm.options.tabSize, context);
3407
  stream.start = stream.pos = startAt || 0;
3408
+ if (text == "") { callBlankLine(mode, context.state); }
3409
  while (!stream.eol()) {
3410
+ readToken(mode, stream, context.state);
3411
  stream.start = stream.pos;
3412
  }
3413
  }
3428
  throw new Error("Mode " + mode.name + " failed to advance stream.")
3429
  }
3430
 
3431
+ var Token = function(stream, type, state) {
3432
+ this.start = stream.start; this.end = stream.pos;
3433
+ this.string = stream.current();
3434
+ this.type = type || null;
3435
+ this.state = state;
3436
+ };
3437
+
3438
  // Utility for getTokenAt and getLineTokens
3439
  function takeToken(cm, pos, precise, asArray) {
 
 
 
 
 
 
 
3440
  var doc = cm.doc, mode = doc.mode, style;
3441
  pos = clipPos(doc, pos);
3442
+ var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);
3443
+ var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;
3444
  if (asArray) { tokens = []; }
3445
  while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
3446
  stream.start = stream.pos;
3447
+ style = readToken(mode, stream, context.state);
3448
+ if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }
3449
  }
3450
+ return asArray ? tokens : new Token(stream, style, context.state)
3451
  }
3452
 
3453
  function extractLineClasses(type, output) {
3465
  }
3466
 
3467
  // Run the given mode's parser over a line, calling f for each token.
3468
+ function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
3469
  var flattenSpans = mode.flattenSpans;
3470
  if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }
3471
  var curStart = 0, curStyle = null;
3472
+ var stream = new StringStream(text, cm.options.tabSize, context), style;
3473
  var inner = cm.options.addModeClass && [null];
3474
+ if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }
3475
  while (!stream.eol()) {
3476
  if (stream.pos > cm.options.maxHighlightLength) {
3477
  flattenSpans = false;
3478
+ if (forceToEnd) { processLine(cm, text, context, stream.pos); }
3479
  stream.pos = text.length;
3480
  style = null;
3481
  } else {
3482
+ style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);
3483
  }
3484
  if (inner) {
3485
  var mName = inner[0].name;
3514
  var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
3515
  for (var search = n; search > lim; --search) {
3516
  if (search <= doc.first) { return doc.first }
3517
+ var line = getLine(doc, search - 1), after = line.stateAfter;
3518
+ if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
3519
+ { return search }
3520
  var indented = countColumn(line.text, null, cm.options.tabSize);
3521
  if (minline == null || minindent > indented) {
3522
  minline = search - 1;
3526
  return minline
3527
  }
3528
 
3529
+ function retreatFrontier(doc, n) {
3530
+ doc.modeFrontier = Math.min(doc.modeFrontier, n);
3531
+ if (doc.highlightFrontier < n - 10) { return }
3532
+ var start = doc.first;
3533
+ for (var line = n - 1; line > start; line--) {
3534
+ var saved = getLine(doc, line).stateAfter;
3535
+ // change is on 3
3536
+ // state on line 1 looked ahead 2 -- so saw 3
3537
+ // test 1 + 2 < 3 should cover this
3538
+ if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
3539
+ start = line + 1;
3540
+ break
3541
+ }
3542
+ }
3543
+ doc.highlightFrontier = Math.min(doc.highlightFrontier, start);
3544
+ }
3545
+
3546
  // LINE DATA STRUCTURE
3547
 
3548
  // Line objects. These hold state related to a line, including
4419
  cm.display.lineNumChars = null;
4420
  }
4421
 
4422
+ function pageScrollX() {
4423
+ // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
4424
+ // which causes page_Offset and bounding client rects to use
4425
+ // different reference viewports and invalidate our calculations.
4426
+ if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
4427
+ return window.pageXOffset || (document.documentElement || document.body).scrollLeft
4428
+ }
4429
+ function pageScrollY() {
4430
+ if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
4431
+ return window.pageYOffset || (document.documentElement || document.body).scrollTop
4432
+ }
4433
 
4434
  // Converts a {top, bottom, left, right} box from line-local
4435
  // coordinates into another coordinate system. Context may be one of
4595
  var assign;
4596
  ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign));
4597
  }
4598
+ pos = new Pos(lineNo$$1, Math.floor(begin + (end - begin) / 2));
4599
  var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left;
4600
  var dir = beginLeft < x ? 1 : -1;
4601
  var prevDiff, diff = beginLeft - x, prevPos;
4602
+ var steps = Math.ceil((end - begin) / 4);
4603
+ outer: do {
4604
  prevDiff = diff;
4605
  prevPos = pos;
4606
+ var i = 0;
4607
+ for (; i < steps; ++i) {
4608
+ var prevPos$1 = pos;
4609
+ pos = moveVisually(cm, lineObj, pos, dir);
4610
+ if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) {
4611
+ pos = prevPos$1;
4612
+ break outer
4613
+ }
4614
  }
4615
  diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x;
4616
+ if (steps > 1) {
4617
+ var diff_change_per_step = Math.abs(diff - prevDiff) / steps;
4618
+ steps = Math.min(steps, Math.ceil(Math.abs(diff) / diff_change_per_step));
4619
+ dir = diff < 0 ? 1 : -1;
4620
+ }
4621
+ } while (diff != 0 && (steps > 1 || ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))))
4622
  if (Math.abs(diff) > Math.abs(prevDiff)) {
4623
  if ((diff < 0) == (prevDiff < 0)) { throw new Error("Broke out of infinite loop in coordsCharInner") }
4624
  pos = prevPos;
4934
  setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);
4935
  }
4936
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4937
  // Read the actual heights of the rendered lines, and update their
4938
  // stored heights to match.
4939
  function updateHeightsInViewport(cm) {
4992
  return {from: from, to: Math.max(to, from + 1)}
4993
  }
4994
 
4995
+ // Re-align line numbers and gutter marks to compensate for
4996
+ // horizontal scrolling.
4997
+ function alignHorizontally(cm) {
4998
+ var display = cm.display, view = display.view;
4999
+ if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
5000
+ var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
5001
+ var gutterW = display.gutters.offsetWidth, left = comp + "px";
5002
+ for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
5003
+ if (cm.options.fixedGutter) {
5004
+ if (view[i].gutter)
5005
+ { view[i].gutter.style.left = left; }
5006
+ if (view[i].gutterBackground)
5007
+ { view[i].gutterBackground.style.left = left; }
5008
+ }
5009
+ var align = view[i].alignable;
5010
+ if (align) { for (var j = 0; j < align.length; j++)
5011
+ { align[j].style.left = left; } }
5012
+ } }
5013
+ if (cm.options.fixedGutter)
5014
+ { display.gutters.style.left = (comp + gutterW) + "px"; }
5015
  }
5016
+
5017
+ // Used to ensure that the line number gutter is still the right
5018
+ // size for the current document size. Returns true when an update
5019
+ // is needed.
5020
+ function maybeUpdateLineNumberWidth(cm) {
5021
+ if (!cm.options.lineNumbers) { return false }
5022
+ var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
5023
+ if (last.length != display.lineNumChars) {
5024
+ var test = display.measure.appendChild(elt("div", [elt("div", last)],
5025
+ "CodeMirror-linenumber CodeMirror-gutter-elt"));
5026
+ var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
5027
+ display.lineGutter.style.width = "";
5028
+ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
5029
+ display.lineNumWidth = display.lineNumInnerWidth + padding;
5030
+ display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
5031
+ display.lineGutter.style.width = display.lineNumWidth + "px";
5032
+ updateGutterSpace(cm);
5033
+ return true
5034
+ }
5035
+ return false
5036
  }
5037
 
5038
+ // SCROLLING THINGS INTO VIEW
 
 
 
 
 
 
 
 
 
5039
 
5040
+ // If an editor sits on the top or bottom of the window, partially
5041
+ // scrolled out of view, this ensures that the cursor is visible.
5042
+ function maybeScrollWindow(cm, rect) {
5043
+ if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
 
 
 
 
 
 
5044
 
5045
+ var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
5046
+ if (rect.top + box.top < 0) { doScroll = true; }
5047
+ else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }
5048
+ if (doScroll != null && !phantom) {
5049
+ var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
5050
+ cm.display.lineSpace.appendChild(scrollNode);
5051
+ scrollNode.scrollIntoView(doScroll);
5052
+ cm.display.lineSpace.removeChild(scrollNode);
5053
+ }
 
 
 
5054
  }
5055
 
5056
+ // Scroll a given position into view (immediately), verifying that
5057
+ // it actually became visible (as line heights are accurately
5058
+ // measured, the position of something may 'drift' during drawing).
5059
+ function scrollPosIntoView(cm, pos, end, margin) {
5060
+ if (margin == null) { margin = 0; }
5061
+ var rect;
5062
+ for (var limit = 0; limit < 5; limit++) {
5063
+ var changed = false;
5064
+ var coords = cursorCoords(cm, pos);
5065
+ var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
5066
+ rect = {left: Math.min(coords.left, endCoords.left),
5067
+ top: Math.min(coords.top, endCoords.top) - margin,
5068
+ right: Math.max(coords.left, endCoords.left),
5069
+ bottom: Math.max(coords.bottom, endCoords.bottom) + margin};
5070
+ var scrollPos = calculateScrollPos(cm, rect);
5071
+ var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
5072
+ if (scrollPos.scrollTop != null) {
5073
+ updateScrollTop(cm, scrollPos.scrollTop);
5074
+ if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }
 
 
5075
  }
5076
+ if (scrollPos.scrollLeft != null) {
5077
+ setScrollLeft(cm, scrollPos.scrollLeft);
5078
+ if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }
5079
+ }
5080
+ if (!changed) { break }
5081
  }
5082
+ return rect
5083
+ }
5084
 
5085
+ // Scroll a given set of coordinates into view (immediately).
5086
+ function scrollIntoView(cm, rect) {
5087
+ var scrollPos = calculateScrollPos(cm, rect);
5088
+ if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }
5089
+ if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }
5090
+ }
5091
+
5092
+ // Calculate a new scroll position needed to scroll the given
5093
+ // rectangle into view. Returns an object with scrollTop and
5094
+ // scrollLeft properties. When these are undefined, the
5095
+ // vertical/horizontal position does not need to be adjusted.
5096
+ function calculateScrollPos(cm, rect) {
5097
+ var display = cm.display, snapMargin = textHeight(cm.display);
5098
+ if (rect.top < 0) { rect.top = 0; }
5099
+ var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
5100
+ var screen = displayHeight(cm), result = {};
5101
+ if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }
5102
+ var docBottom = cm.doc.height + paddingVert(display);
5103
+ var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;
5104
+ if (rect.top < screentop) {
5105
+ result.scrollTop = atTop ? 0 : rect.top;
5106
+ } else if (rect.bottom > screentop + screen) {
5107
+ var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);
5108
+ if (newTop != screentop) { result.scrollTop = newTop; }
5109
  }
5110
 
5111
+ var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
5112
+ var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
5113
+ var tooWide = rect.right - rect.left > screenw;
5114
+ if (tooWide) { rect.right = rect.left + screenw; }
5115
+ if (rect.left < 10)
5116
+ { result.scrollLeft = 0; }
5117
+ else if (rect.left < screenleft)
5118
+ { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }
5119
+ else if (rect.right > screenw + screenleft - 3)
5120
+ { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
5121
+ return result
5122
+ }
5123
+
5124
+ // Store a relative adjustment to the scroll position in the current
5125
+ // operation (to be applied when the operation finishes).
5126
+ function addToScrollTop(cm, top) {
5127
+ if (top == null) { return }
5128
+ resolveScrollToPos(cm);
5129
+ cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
5130
+ }
5131
+
5132
+ // Make sure that at the end of the operation the current cursor is
5133
+ // shown.
5134
+ function ensureCursorVisible(cm) {
5135
+ resolveScrollToPos(cm);
5136
+ var cur = cm.getCursor(), from = cur, to = cur;
5137
+ if (!cm.options.lineWrapping) {
5138
+ from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
5139
+ to = Pos(cur.line, cur.ch + 1);
5140
  }
5141
+ cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin};
5142
+ }
5143
 
5144
+ function scrollToCoords(cm, x, y) {
5145
+ if (x != null || y != null) { resolveScrollToPos(cm); }
5146
+ if (x != null) { cm.curOp.scrollLeft = x; }
5147
+ if (y != null) { cm.curOp.scrollTop = y; }
5148
+ }
5149
+
5150
+ function scrollToRange(cm, range$$1) {
5151
+ resolveScrollToPos(cm);
5152
+ cm.curOp.scrollToPos = range$$1;
5153
+ }
5154
+
5155
+ // When an operation has its scrollToPos property set, and another
5156
+ // scroll action is applied before the end of the operation, this
5157
+ // 'simulates' scrolling that position into view in a cheap way, so
5158
+ // that the effect of intermediate scroll commands is not ignored.
5159
+ function resolveScrollToPos(cm) {
5160
+ var range$$1 = cm.curOp.scrollToPos;
5161
+ if (range$$1) {
5162
+ cm.curOp.scrollToPos = null;
5163
+ var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);
5164
+ scrollToCoordsRange(cm, from, to, range$$1.margin);
5165
  }
5166
  }
5167
 
5168
+ function scrollToCoordsRange(cm, from, to, margin) {
5169
+ var sPos = calculateScrollPos(cm, {
5170
+ left: Math.min(from.left, to.left),
5171
+ top: Math.min(from.top, to.top) - margin,
5172
+ right: Math.max(from.right, to.right),
5173
+ bottom: Math.max(from.bottom, to.bottom) + margin
5174
+ });
5175
+ scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);
5176
+ }
5177
+
5178
+ // Sync the scrollable area and scrollbars, ensure the viewport
5179
+ // covers the visible area.
5180
+ function updateScrollTop(cm, val) {
5181
+ if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
5182
+ if (!gecko) { updateDisplaySimple(cm, {top: val}); }
5183
+ setScrollTop(cm, val, true);
5184
+ if (gecko) { updateDisplaySimple(cm); }
5185
+ startWorker(cm, 100);
5186
+ }
5187
+
5188
+ function setScrollTop(cm, val, forceScroll) {
5189
+ val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);
5190
+ if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
5191
+ cm.doc.scrollTop = val;
5192
+ cm.display.scrollbars.setScrollTop(val);
5193
+ if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }
5194
+ }
5195
+
5196
+ // Sync scroller and scrollbar, ensure the gutter elements are
5197
+ // aligned.
5198
+ function setScrollLeft(cm, val, isScroller, forceScroll) {
5199
+ val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
5200
+ if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
5201
+ cm.doc.scrollLeft = val;
5202
+ alignHorizontally(cm);
5203
+ if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }
5204
+ cm.display.scrollbars.setScrollLeft(val);
5205
+ }
5206
+
5207
  // SCROLLBARS
5208
 
5209
  // Prepare DOM reads needed to update the scrollbars. Done in one
5281
 
5282
  NativeScrollbars.prototype.setScrollLeft = function (pos) {
5283
  if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }
5284
+ if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); }
5285
  };
5286
 
5287
  NativeScrollbars.prototype.setScrollTop = function (pos) {
5288
  if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }
5289
+ if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); }
5290
  };
5291
 
5292
  NativeScrollbars.prototype.zeroWidthHack = function () {
5297
  this.disableVert = new Delayed;
5298
  };
5299
 
5300
+ NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
5301
  bar.style.pointerEvents = "auto";
5302
  function maybeDisable() {
5303
  // To find out whether the scrollbar is still visible, we
5304
  // check whether the element under the pixel in the bottom
5305
+ // right corner of the scrollbar box is the scrollbar box
5306
  // itself (when the bar is still visible) or its filler child
5307
  // (when the bar is hidden). If it is still visible, we keep
5308
  // it enabled, if it's hidden, we disable pointer events.
5309
  var box = bar.getBoundingClientRect();
5310
+ var elt$$1 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
5311
+ : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);
5312
  if (elt$$1 != bar) { bar.style.pointerEvents = "none"; }
5313
  else { delay.set(1000, maybeDisable); }
5314
  }
5362
  } else { d.gutterFiller.style.display = ""; }
5363
  }
5364
 
5365
+ var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
5366
+
5367
+ function initScrollbars(cm) {
5368
+ if (cm.display.scrollbars) {
5369
+ cm.display.scrollbars.clear();
5370
+ if (cm.display.scrollbars.addClass)
5371
+ { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5372
  }
5373
+
5374
+ cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
5375
+ cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
5376
+ // Prevent clicks in the scrollbars from killing focus
5377
+ on(node, "mousedown", function () {
5378
+ if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }
5379
+ });
5380
+ node.setAttribute("cm-not-content", "true");
5381
+ }, function (pos, axis) {
5382
+ if (axis == "horizontal") { setScrollLeft(cm, pos); }
5383
+ else { updateScrollTop(cm, pos); }
5384
+ }, cm);
5385
+ if (cm.display.scrollbars.addClass)
5386
+ { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
5387
  }
5388
 
5389
  // Operations are used to wrap a series of changes to the editor
5514
  { display.wheelStartX = display.wheelStartY = null; }
5515
 
5516
  // Propagate the scroll position to the actual DOM scroller
5517
+ if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }
5518
+
5519
+ if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }
 
 
 
 
 
 
 
 
5520
  // If we need to scroll a specific position into view, do so.
5521
  if (op.scrollToPos) {
5522
  var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
5729
  // HIGHLIGHT WORKER
5730
 
5731
  function startWorker(cm, time) {
5732
+ if (cm.doc.highlightFrontier < cm.display.viewTo)
5733
  { cm.state.highlight.set(time, bind(highlightWorker, cm)); }
5734
  }
5735
 
5736
  function highlightWorker(cm) {
5737
  var doc = cm.doc;
5738
+ if (doc.highlightFrontier >= cm.display.viewTo) { return }
 
5739
  var end = +new Date + cm.options.workTime;
5740
+ var context = getContextBefore(cm, doc.highlightFrontier);
5741
  var changedLines = [];
5742
 
5743
+ doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
5744
+ if (context.line >= cm.display.viewFrom) { // Visible
5745
+ var oldStyles = line.styles;
5746
+ var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;
5747
+ var highlighted = highlightLine(cm, line, context, true);
5748
+ if (resetState) { context.state = resetState; }
5749
  line.styles = highlighted.styles;
5750
  var oldCls = line.styleClasses, newCls = highlighted.classes;
5751
  if (newCls) { line.styleClasses = newCls; }
5753
  var ischange = !oldStyles || oldStyles.length != line.styles.length ||
5754
  oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
5755
  for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }
5756
+ if (ischange) { changedLines.push(context.line); }
5757
+ line.stateAfter = context.save();
5758
+ context.nextLine();
5759
  } else {
5760
  if (line.text.length <= cm.options.maxHighlightLength)
5761
+ { processLine(cm, line.text, context); }
5762
+ line.stateAfter = context.line % 5 == 0 ? context.save() : null;
5763
+ context.nextLine();
5764
  }
 
5765
  if (+new Date > end) {
5766
  startWorker(cm, cm.options.workDelay);
5767
  return true
5768
  }
5769
  });
5770
+ doc.highlightFrontier = context.line;
5771
+ doc.modeFrontier = Math.max(doc.modeFrontier, context.line);
5772
  if (changedLines.length) { runInOp(cm, function () {
5773
  for (var i = 0; i < changedLines.length; i++)
5774
  { regLineChange(cm, changedLines[i], "text"); }
5814
  }
5815
  }
5816
 
5817
+ function selectionSnapshot(cm) {
5818
+ if (cm.hasFocus()) { return null }
5819
+ var active = activeElt();
5820
+ if (!active || !contains(cm.display.lineDiv, active)) { return null }
5821
+ var result = {activeElt: active};
5822
+ if (window.getSelection) {
5823
+ var sel = window.getSelection();
5824
+ if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
5825
+ result.anchorNode = sel.anchorNode;
5826
+ result.anchorOffset = sel.anchorOffset;
5827
+ result.focusNode = sel.focusNode;
5828
+ result.focusOffset = sel.focusOffset;
5829
+ }
5830
+ }
5831
+ return result
5832
+ }
5833
+
5834
+ function restoreSelection(snapshot) {
5835
+ if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
5836
+ snapshot.activeElt.focus();
5837
+ if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
5838
+ var sel = window.getSelection(), range$$1 = document.createRange();
5839
+ range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
5840
+ range$$1.collapse(false);
5841
+ sel.removeAllRanges();
5842
+ sel.addRange(range$$1);
5843
+ sel.extend(snapshot.focusNode, snapshot.focusOffset);
5844
+ }
5845
+ }
5846
+
5847
  // Does the actual updating of the line display. Bails out
5848
  // (returning false) when there is nothing to be done and forced is
5849
  // false.
5893
 
5894
  // For big changes, we hide the enclosing element during the
5895
  // update, since that speeds up the operations on most browsers.
5896
+ var selSnapshot = selectionSnapshot(cm);
5897
  if (toUpdate > 4) { display.lineDiv.style.display = "none"; }
5898
  patchDisplay(cm, display.updateLineNumbers, update.dims);
5899
  if (toUpdate > 4) { display.lineDiv.style.display = ""; }
5900
  display.renderedView = display.view;
5901
  // There might have been a widget with a focused element that got
5902
  // hidden or updated, if so re-focus it.
5903
+ restoreSelection(selSnapshot);
5904
 
5905
  // Prevent selection and cursors from interfering with the scroll
5906
  // width and height.
5939
  updateSelection(cm);
5940
  updateScrollbars(cm, barMeasure);
5941
  setDocumentHeight(cm, barMeasure);
5942
+ update.force = false;
5943
  }
5944
 
5945
  update.signal(cm, "update", cm);
6049
  }
6050
  }
6051
 
6052
+ // Since the delta values reported on mouse wheel events are
6053
+ // unstandardized between browsers and even browser versions, and
6054
+ // generally horribly unpredictable, this code starts by measuring
6055
+ // the scroll effect that the first few mouse wheel events have,
6056
+ // and, from that, detects the way it can convert deltas to pixel
6057
+ // offsets afterwards.
6058
+ //
6059
+ // The reason we want to know the amount a wheel event will scroll
6060
+ // is that it gives us a chance to update the display before the
6061
+ // actual scrolling happens, reducing flickering.
6062
+
6063
+ var wheelSamples = 0;
6064
+ var wheelPixelsPerUnit = null;
6065
+ // Fill in a browser-detected starting value on browsers where we
6066
+ // know one. These don't have to be accurate -- the result of them
6067
+ // being wrong would just be a slight flicker on the first wheel
6068
+ // scroll (if it is large enough).
6069
+ if (ie) { wheelPixelsPerUnit = -.53; }
6070
+ else if (gecko) { wheelPixelsPerUnit = 15; }
6071
+ else if (chrome) { wheelPixelsPerUnit = -.7; }
6072
+ else if (safari) { wheelPixelsPerUnit = -1/3; }
6073
+
6074
+ function wheelEventDelta(e) {
6075
+ var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
6076
+ if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }
6077
+ if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }
6078
+ else if (dy == null) { dy = e.wheelDelta; }
6079
+ return {x: dx, y: dy}
6080
+ }
6081
+ function wheelEventPixels(e) {
6082
+ var delta = wheelEventDelta(e);
6083
+ delta.x *= wheelPixelsPerUnit;
6084
+ delta.y *= wheelPixelsPerUnit;
6085
+ return delta
6086
+ }
6087
+
6088
+ function onScrollWheel(cm, e) {
6089
+ var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
6090
+
6091
+ var display = cm.display, scroll = display.scroller;
6092
+ // Quit if there's nothing to scroll here
6093
+ var canScrollX = scroll.scrollWidth > scroll.clientWidth;
6094
+ var canScrollY = scroll.scrollHeight > scroll.clientHeight;
6095
+ if (!(dx && canScrollX || dy && canScrollY)) { return }
6096
+
6097
+ // Webkit browsers on OS X abort momentum scrolls when the target
6098
+ // of the scroll event is removed from the scrollable element.
6099
+ // This hack (see related code in patchDisplay) makes sure the
6100
+ // element is kept around.
6101
+ if (dy && mac && webkit) {
6102
+ outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
6103
+ for (var i = 0; i < view.length; i++) {
6104
+ if (view[i].node == cur) {
6105
+ cm.display.currentWheelTarget = cur;
6106
+ break outer
6107
+ }
6108
+ }
6109
+ }
6110
+ }
6111
+
6112
+ // On some browsers, horizontal scrolling will cause redraws to
6113
+ // happen before the gutter has been realigned, causing it to
6114
+ // wriggle around in a most unseemly way. When we have an
6115
+ // estimated pixels/delta value, we just handle horizontal
6116
+ // scrolling entirely here. It'll be slightly off from native, but
6117
+ // better than glitching out.
6118
+ if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
6119
+ if (dy && canScrollY)
6120
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
6121
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
6122
+ // Only prevent default scrolling if vertical scrolling is
6123
+ // actually possible. Otherwise, it causes vertical scroll
6124
+ // jitter on OSX trackpads when deltaX is small and deltaY
6125
+ // is large (issue #3579)
6126
+ if (!dy || (dy && canScrollY))
6127
+ { e_preventDefault(e); }
6128
+ display.wheelStartX = null; // Abort measurement, if in progress
6129
+ return
6130
+ }
6131
+
6132
+ // 'Project' the visible viewport to cover the area that is being
6133
+ // scrolled into view (if we know enough to estimate it).
6134
+ if (dy && wheelPixelsPerUnit != null) {
6135
+ var pixels = dy * wheelPixelsPerUnit;
6136
+ var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
6137
+ if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
6138
+ else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
6139
+ updateDisplaySimple(cm, {top: top, bottom: bot});
6140
+ }
6141
+
6142
+ if (wheelSamples < 20) {
6143
+ if (display.wheelStartX == null) {
6144
+ display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
6145
+ display.wheelDX = dx; display.wheelDY = dy;
6146
+ setTimeout(function () {
6147
+ if (display.wheelStartX == null) { return }
6148
+ var movedX = scroll.scrollLeft - display.wheelStartX;
6149
+ var movedY = scroll.scrollTop - display.wheelStartY;
6150
+ var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
6151
+ (movedX && display.wheelDX && movedX / display.wheelDX);
6152
+ display.wheelStartX = display.wheelStartY = null;
6153
+ if (!sample) { return }
6154
+ wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
6155
+ ++wheelSamples;
6156
+ }, 200);
6157
+ } else {
6158
+ display.wheelDX += dx; display.wheelDY += dy;
6159
+ }
6160
+ }
6161
+ }
6162
+
6163
  // Selection objects are immutable. A new one is created every time
6164
  // the selection changes. A selection is one or more non-overlapping
6165
  // (and non-touching) ranges, sorted, and an integer that indicates
6313
  if (line.stateAfter) { line.stateAfter = null; }
6314
  if (line.styles) { line.styles = null; }
6315
  });
6316
+ cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;
6317
  startWorker(cm, 100);
6318
  cm.state.modeGen++;
6319
  if (cm.curOp) { regChange(cm); }
6647
  // include a given position (and optionally a second position).
6648
  // Otherwise, simply returns the range between the given positions.
6649
  // Used for cursor motion and such.
6650
+ function extendRange(range, head, other, extend) {
6651
+ if (extend) {
6652
  var anchor = range.anchor;
6653
  if (other) {
6654
  var posBefore = cmp(head, anchor) < 0;
6666
  }
6667
 
6668
  // Extend the primary selection range, discard the rest.
6669
+ function extendSelection(doc, head, other, options, extend) {
6670
+ if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }
6671
+ setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);
6672
  }
6673
 
6674
  // Extend all selections (pos is an array of selections with length
6675
  // equal the number of selections)
6676
  function extendSelections(doc, heads, options) {
6677
  var out = [];
6678
+ var extend = doc.cm && (doc.cm.display.shift || doc.extend);
6679
  for (var i = 0; i < doc.sel.ranges.length; i++)
6680
+ { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }
6681
  var newSel = normalizeSelection(out, doc.sel.primIndex);
6682
  setSelection(doc, newSel, options);
6683
  }
6758
  // Verify that the selection does not partially select any atomic
6759
  // marked ranges.
6760
  function reCheckSelection(doc) {
6761
+ setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));
6762
  }
6763
 
6764
  // Return a selection that does not partially select any atomic
7061
  if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }
7062
  }
7063
 
7064
+ retreatFrontier(doc, from.line);
 
7065
  startWorker(cm, 400);
7066
 
7067
  var lendiff = change.text.length - (to.line - from.line) - 1;
7171
  //
7172
  // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
7173
 
7174
+ function LeafChunk(lines) {
7175
  var this$1 = this;
7176
 
7177
  this.lines = lines;
7182
  height += lines[i].height;
7183
  }
7184
  this.height = height;
7185
+ }
7186
 
7187
+ LeafChunk.prototype = {
7188
+ chunkSize: function chunkSize() { return this.lines.length },
7189
 
7190
+ // Remove the n lines at offset 'at'.
7191
+ removeInner: function removeInner(at, n) {
7192
  var this$1 = this;
7193
 
7194
+ for (var i = at, e = at + n; i < e; ++i) {
7195
+ var line = this$1.lines[i];
7196
+ this$1.height -= line.height;
7197
+ cleanUpLine(line);
7198
+ signalLater(line, "delete");
7199
+ }
7200
+ this.lines.splice(at, n);
7201
+ },
7202
 
7203
+ // Helper used to collapse a small branch into a single leaf.
7204
+ collapse: function collapse(lines) {
7205
+ lines.push.apply(lines, this.lines);
7206
+ },
7207
 
7208
+ // Insert the given array of lines at offset 'at', count them as
7209
+ // having the given height.
7210
+ insertInner: function insertInner(at, lines, height) {
7211
  var this$1 = this;
7212
 
7213
+ this.height += height;
7214
+ this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
7215
+ for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }
7216
+ },
7217
 
7218
+ // Used to iterate over a part of the tree.
7219
+ iterN: function iterN(at, n, op) {
7220
  var this$1 = this;
7221
 
7222
+ for (var e = at + n; at < e; ++at)
7223
+ { if (op(this$1.lines[at])) { return true } }
7224
+ }
7225
  };
7226
 
7227
+ function BranchChunk(children) {
7228
  var this$1 = this;
7229
 
7230
  this.children = children;
7237
  this.size = size;
7238
  this.height = height;
7239
  this.parent = null;
7240
+ }
7241
 
7242
+ BranchChunk.prototype = {
7243
+ chunkSize: function chunkSize() { return this.size },
7244
 
7245
+ removeInner: function removeInner(at, n) {
7246
  var this$1 = this;
7247
 
7248
+ this.size -= n;
7249
+ for (var i = 0; i < this.children.length; ++i) {
7250
+ var child = this$1.children[i], sz = child.chunkSize();
7251
+ if (at < sz) {
7252
+ var rm = Math.min(n, sz - at), oldHeight = child.height;
7253
+ child.removeInner(at, rm);
7254
+ this$1.height -= oldHeight - child.height;
7255
+ if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }
7256
+ if ((n -= rm) == 0) { break }
7257
+ at = 0;
7258
+ } else { at -= sz; }
7259
+ }
7260
+ // If the result is smaller than 25 lines, ensure that it is a
7261
+ // single leaf node.
7262
+ if (this.size - n < 25 &&
7263
+ (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
7264
+ var lines = [];
7265
+ this.collapse(lines);
7266
+ this.children = [new LeafChunk(lines)];
7267
+ this.children[0].parent = this;
7268
+ }
7269
+ },
7270
 
7271
+ collapse: function collapse(lines) {
7272
  var this$1 = this;
7273
 
7274
+ for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }
7275
+ },
7276
 
7277
+ insertInner: function insertInner(at, lines, height) {
7278
  var this$1 = this;
7279
 
7280
+ this.size += lines.length;
7281
+ this.height += height;
7282
+ for (var i = 0; i < this.children.length; ++i) {
7283
+ var child = this$1.children[i], sz = child.chunkSize();
7284
+ if (at <= sz) {
7285
+ child.insertInner(at, lines, height);
7286
+ if (child.lines && child.lines.length > 50) {
7287
+ // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
7288
+ // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
7289
+ var remaining = child.lines.length % 25 + 25;
7290
+ for (var pos = remaining; pos < child.lines.length;) {
7291
+ var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
7292
+ child.height -= leaf.height;
7293
+ this$1.children.splice(++i, 0, leaf);
7294
+ leaf.parent = this$1;
7295
+ }
7296
+ child.lines = child.lines.slice(0, remaining);
7297
+ this$1.maybeSpill();
7298
  }
7299
+ break
 
7300
  }
7301
+ at -= sz;
7302
  }
7303
+ },
 
 
7304
 
7305
+ // When a node has grown, check whether it should be split.
7306
+ maybeSpill: function maybeSpill() {
7307
+ if (this.children.length <= 10) { return }
7308
+ var me = this;
7309
+ do {
7310
+ var spilled = me.children.splice(me.children.length - 5, 5);
7311
+ var sibling = new BranchChunk(spilled);
7312
+ if (!me.parent) { // Become the parent node
7313
+ var copy = new BranchChunk(me.children);
7314
+ copy.parent = me;
7315
+ me.children = [copy, sibling];
7316
+ me = copy;
7317
+ } else {
7318
+ me.size -= sibling.size;
7319
+ me.height -= sibling.height;
7320
+ var myIndex = indexOf(me.parent.children, me);
7321
+ me.parent.children.splice(myIndex + 1, 0, sibling);
7322
+ }
7323
+ sibling.parent = me.parent;
7324
+ } while (me.children.length > 10)
7325
+ me.parent.maybeSpill();
7326
+ },
7327
 
7328
+ iterN: function iterN(at, n, op) {
7329
  var this$1 = this;
7330
 
7331
+ for (var i = 0; i < this.children.length; ++i) {
7332
+ var child = this$1.children[i], sz = child.chunkSize();
7333
+ if (at < sz) {
7334
+ var used = Math.min(n, sz - at);
7335
+ if (child.iterN(at, used, op)) { return true }
7336
+ if ((n -= used) == 0) { break }
7337
+ at = 0;
7338
+ } else { at -= sz; }
7339
+ }
7340
  }
7341
  };
7342
 
7389
 
7390
  function adjustScrollWhenAboveVisible(cm, line, diff) {
7391
  if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
7392
+ { addToScrollTop(cm, diff); }
7393
  }
7394
 
7395
  function addLineWidget(doc, handle, node, options) {
7404
  if (cm && !lineIsHidden(doc, line)) {
7405
  var aboveVisible = heightAtLine(line) < doc.scrollTop;
7406
  updateLineHeight(line, line.height + widgetHeight(widget));
7407
+ if (aboveVisible) { addToScrollTop(cm, widget.height); }
7408
  cm.curOp.forceUpdate = true;
7409
  }
7410
  return true
7706
  this.scrollTop = this.scrollLeft = 0;
7707
  this.cantEdit = false;
7708
  this.cleanGeneration = 1;
7709
+ this.modeFrontier = this.highlightFrontier = firstLine;
7710
  var start = Pos(firstLine, 0);
7711
  this.sel = simpleSelection(start);
7712
  this.history = new History(null);
7752
  var top = Pos(this.first, 0), last = this.first + this.size - 1;
7753
  makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
7754
  text: this.splitLines(code), origin: "setValue", full: true}, true);
7755
+ if (this.cm) { scrollToCoords(this.cm, 0, 0); }
7756
+ setSelection(this, simpleSelection(top), sel_dontScroll);
7757
  }),
7758
  replaceRange: function(code, from, to, origin) {
7759
  from = clipPos(this, from);
8229
  // garbage collected.
8230
 
8231
  function forEachCodeMirror(f) {
8232
+ if (!document.getElementsByClassName) { return }
8233
+ var byClass = document.getElementsByClassName("CodeMirror");
8234
  for (var i = 0; i < byClass.length; i++) {
8235
  var cm = byClass[i].CodeMirror;
8236
  if (cm) { f(cm); }
8404
  return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
8405
  }
8406
 
8407
+ function addModifierNames(name, event, noShift) {
8408
+ var base = name;
 
 
 
8409
  if (event.altKey && base != "Alt") { name = "Alt-" + name; }
8410
  if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; }
8411
  if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; }
8413
  return name
8414
  }
8415
 
8416
+ // Look up the name of a key as indicated by an event object.
8417
+ function keyName(event, noShift) {
8418
+ if (presto && event.keyCode == 34 && event["char"]) { return false }
8419
+ var name = keyNames[event.keyCode];
8420
+ if (name == null || event.altGraphKey) { return false }
8421
+ return addModifierNames(name, event, noShift)
8422
+ }
8423
+
8424
  function getKeyMap(val) {
8425
  return typeof val == "string" ? keyMap[val] : val
8426
  }
8647
  || lookupKey(name, cm.options.keyMap, handle, cm)
8648
  }
8649
 
8650
+ // Note that, despite the name, this function is also used to check
8651
+ // for bound mouse clicks.
8652
+
8653
  var stopSeq = new Delayed;
8654
  function dispatchKey(cm, name, e, handle) {
8655
  var seq = cm.state.keySeq;
8761
  cm.display.input.onKeyPress(e);
8762
  }
8763
 
8764
+ var DOUBLECLICK_DELAY = 400;
8765
+
8766
+ var PastClick = function(time, pos, button) {
8767
+ this.time = time;
8768
+ this.pos = pos;
8769
+ this.button = button;
8770
+ };
8771
+
8772
+ PastClick.prototype.compare = function (time, pos, button) {
8773
+ return this.time + DOUBLECLICK_DELAY > time &&
8774
+ cmp(pos, this.pos) == 0 && button == this.button
8775
+ };
8776
+
8777
+ var lastClick;
8778
+ var lastDoubleClick;
8779
+ function clickRepeat(pos, button) {
8780
+ var now = +new Date;
8781
+ if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
8782
+ lastClick = lastDoubleClick = null;
8783
+ return "triple"
8784
+ } else if (lastClick && lastClick.compare(now, pos, button)) {
8785
+ lastDoubleClick = new PastClick(now, pos, button);
8786
+ lastClick = null;
8787
+ return "double"
8788
+ } else {
8789
+ lastClick = new PastClick(now, pos, button);
8790
+ lastDoubleClick = null;
8791
+ return "single"
8792
+ }
8793
+ }
8794
+
8795
  // A mouse down can be a single click, double click, triple click,
8796
  // start of selection drag, start of text drag, new cursor
8797
  // (ctrl-click), rectangle drag (alt-drag), or xwin
8813
  return
8814
  }
8815
  if (clickInGutter(cm, e)) { return }
8816
+ var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
8817
  window.focus();
8818
 
8819
+ // #3261: make sure, that we're not starting a second selection
8820
+ if (button == 1 && cm.state.selectingText)
8821
+ { cm.state.selectingText(e); }
8822
+
8823
+ if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
8824
+
8825
+ if (button == 1) {
8826
+ if (pos) { leftButtonDown(cm, pos, repeat, e); }
8827
+ else if (e_target(e) == display.scroller) { e_preventDefault(e); }
8828
+ } else if (button == 2) {
8829
+ if (pos) { extendSelection(cm.doc, pos); }
 
 
8830
  setTimeout(function () { return display.input.focus(); }, 20);
8831
+ } else if (button == 3) {
 
 
8832
  if (captureRightClick) { onContextMenu(cm, e); }
8833
  else { delayBlurEvent(cm); }
 
8834
  }
8835
  }
8836
 
8837
+ function handleMappedButton(cm, button, pos, repeat, event) {
8838
+ var name = "Click";
8839
+ if (repeat == "double") { name = "Double" + name; }
8840
+ else if (repeat == "triple") { name = "Triple" + name; }
8841
+ name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name;
8842
+
8843
+ return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {
8844
+ if (typeof bound == "string") { bound = commands[bound]; }
8845
+ if (!bound) { return false }
8846
+ var done = false;
8847
+ try {
8848
+ if (cm.isReadOnly()) { cm.state.suppressEdits = true; }
8849
+ done = bound(cm, pos) != Pass;
8850
+ } finally {
8851
+ cm.state.suppressEdits = false;
8852
+ }
8853
+ return done
8854
+ })
8855
+ }
8856
+
8857
+ function configureMouse(cm, repeat, event) {
8858
+ var option = cm.getOption("configureMouse");
8859
+ var value = option ? option(cm, repeat, event) : {};
8860
+ if (value.unit == null) {
8861
+ var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;
8862
+ value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line";
8863
+ }
8864
+ if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }
8865
+ if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }
8866
+ if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }
8867
+ return value
8868
+ }
8869
+
8870
+ function leftButtonDown(cm, pos, repeat, event) {
8871
  if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
8872
  else { cm.curOp.focus = activeElt(); }
8873
 
8874
+ var behavior = configureMouse(cm, repeat, event);
 
 
 
 
 
 
 
 
 
8875
 
8876
+ var sel = cm.doc.sel, contained;
8877
  if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
8878
+ repeat == "single" && (contained = sel.contains(pos)) > -1 &&
8879
+ (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&
8880
+ (cmp(contained.to(), pos) > 0 || pos.xRel < 0))
8881
+ { leftButtonStartDrag(cm, event, pos, behavior); }
8882
  else
8883
+ { leftButtonSelect(cm, event, pos, behavior); }
8884
  }
8885
 
8886
  // Start a text drag. When it ends, see if any dragging actually
8887
  // happen, and treat as a click if it didn't.
8888
+ function leftButtonStartDrag(cm, event, pos, behavior) {
8889
+ var display = cm.display, moved = false;
8890
+ var dragEnd = operation(cm, function (e) {
8891
  if (webkit) { display.scroller.draggable = false; }
8892
  cm.state.draggingText = false;
8893
  off(document, "mouseup", dragEnd);
8894
+ off(document, "mousemove", mouseMove);
8895
+ off(display.scroller, "dragstart", dragStart);
8896
  off(display.scroller, "drop", dragEnd);
8897
+ if (!moved) {
8898
+ e_preventDefault(e);
8899
+ if (!behavior.addNew)
8900
+ { extendSelection(cm.doc, pos, null, null, behavior.extend); }
8901
  // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
8902
  if (webkit || ie && ie_version == 9)
8903
  { setTimeout(function () {document.body.focus(); display.input.focus();}, 20); }
8905
  { display.input.focus(); }
8906
  }
8907
  });
8908
+ var mouseMove = function(e2) {
8909
+ moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;
8910
+ };
8911
+ var dragStart = function () { return moved = true; };
8912
  // Let the drag handler handle this.
8913
  if (webkit) { display.scroller.draggable = true; }
8914
  cm.state.draggingText = dragEnd;
8915
+ dragEnd.copy = !behavior.moveOnDrag;
8916
  // IE's approach to draggable
8917
  if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
8918
  on(document, "mouseup", dragEnd);
8919
+ on(document, "mousemove", mouseMove);
8920
+ on(display.scroller, "dragstart", dragStart);
8921
  on(display.scroller, "drop", dragEnd);
8922
+
8923
+ delayBlurEvent(cm);
8924
+ setTimeout(function () { return display.input.focus(); }, 20);
8925
+ }
8926
+
8927
+ function rangeForUnit(cm, pos, unit) {
8928
+ if (unit == "char") { return new Range(pos, pos) }
8929
+ if (unit == "word") { return cm.findWordAt(pos) }
8930
+ if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
8931
+ var result = unit(cm, pos);
8932
+ return new Range(result.from, result.to)
8933
  }
8934
 
8935
  // Normal selection, as opposed to text dragging.
8936
+ function leftButtonSelect(cm, event, start, behavior) {
8937
  var display = cm.display, doc = cm.doc;
8938
+ e_preventDefault(event);
8939
 
8940
  var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
8941
+ if (behavior.addNew && !behavior.extend) {
8942
  ourIndex = doc.sel.contains(start);
8943
  if (ourIndex > -1)
8944
  { ourRange = ranges[ourIndex]; }
8949
  ourIndex = doc.sel.primIndex;
8950
  }
8951
 
8952
+ if (behavior.unit == "rectangle") {
8953
+ if (!behavior.addNew) { ourRange = new Range(start, start); }
8954
+ start = posFromMouse(cm, event, true, true);
 
8955
  ourIndex = -1;
 
 
 
 
 
 
 
 
 
 
 
 
8956
  } else {
8957
+ var range$$1 = rangeForUnit(cm, start, behavior.unit);
8958
+ if (behavior.extend)
8959
+ { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }
8960
+ else
8961
+ { ourRange = range$$1; }
8962
  }
8963
 
8964
+ if (!behavior.addNew) {
8965
  ourIndex = 0;
8966
  setSelection(doc, new Selection([ourRange], 0), sel_mouse);
8967
  startSel = doc.sel;
8969
  ourIndex = ranges.length;
8970
  setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
8971
  {scroll: false, origin: "*mouse"});
8972
+ } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
8973
  setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
8974
  {scroll: false, origin: "*mouse"});
8975
  startSel = doc.sel;
8982
  if (cmp(lastPos, pos) == 0) { return }
8983
  lastPos = pos;
8984
 
8985
+ if (behavior.unit == "rectangle") {
8986
  var ranges = [], tabSize = cm.options.tabSize;
8987
  var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
8988
  var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
9001
  cm.scrollIntoView(pos);
9002
  } else {
9003
  var oldRange = ourRange;
9004
+ var range$$1 = rangeForUnit(cm, pos, behavior.unit);
9005
+ var anchor = oldRange.anchor, head;
9006
+ if (cmp(range$$1.anchor, anchor) > 0) {
9007
+ head = range$$1.head;
9008
+ anchor = minPos(oldRange.from(), range$$1.anchor);
9009
+ } else {
9010
+ head = range$$1.anchor;
9011
+ anchor = maxPos(oldRange.to(), range$$1.head);
 
 
 
 
 
 
9012
  }
9013
  var ranges$1 = startSel.ranges.slice(0);
9014
  ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head);
9025
 
9026
  function extend(e) {
9027
  var curCount = ++counter;
9028
+ var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
9029
  if (!cur) { return }
9030
  if (cmp(cur, lastPos) != 0) {
9031
  cm.curOp.focus = activeElt();
9191
  if (next.attach) { next.attach(cm, prev || null); }
9192
  });
9193
  option("extraKeys", null);
9194
+ option("configureMouse", null);
9195
 
9196
  option("lineWrapping", false, wrappingChanged, true);
9197
  option("gutters", [], function (cm) {
9219
 
9220
  option("resetSelectionOnContextMenu", true);
9221
  option("lineWiseCopyCut", true);
9222
+ option("pasteLinesPerSelection", true);
9223
 
9224
  option("readOnly", false, function (cm, val) {
9225
  if (val == "nocursor") {
9226
  onBlur(cm);
9227
  cm.display.input.blur();
 
 
 
9228
  }
9229
  cm.display.input.readOnlyChanged(val);
9230
  });
9445
  // area, ensure viewport is updated when scrolling.
9446
  on(d.scroller, "scroll", function () {
9447
  if (d.scroller.clientHeight) {
9448
+ updateScrollTop(cm, d.scroller.scrollTop);
9449
  setScrollLeft(cm, d.scroller.scrollLeft, true);
9450
  signal(cm, "scroll", cm);
9451
  }
9489
  // Fall back to "prev" when the mode doesn't have an indentation
9490
  // method.
9491
  if (!doc.mode.indent) { how = "prev"; }
9492
+ else { state = getContextBefore(cm, n).state; }
9493
  }
9494
 
9495
  var tabSize = cm.options.tabSize;
9565
  for (var i = 0; i < lastCopied.text.length; i++)
9566
  { multiPaste.push(doc.splitLines(lastCopied.text[i])); }
9567
  }
9568
+ } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {
9569
  multiPaste = map(textLines, function (l) { return [l]; });
9570
  }
9571
  }
9825
  getStateAfter: function(line, precise) {
9826
  var doc = this.doc;
9827
  line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
9828
+ return getContextBefore(this, line + 1, precise).state
9829
  },
9830
 
9831
  cursorCoords: function(start, mode) {
9906
  triggerOnKeyDown: methodOp(onKeyDown),
9907
  triggerOnKeyPress: methodOp(onKeyPress),
9908
  triggerOnKeyUp: onKeyUp,
9909
+ triggerOnMouseDown: methodOp(onMouseDown),
9910
 
9911
  execCommand: function(cmd) {
9912
  if (commands.hasOwnProperty(cmd))
9979
  goals.push(headPos.left);
9980
  var pos = findPosV(this$1, headPos, dir, unit);
9981
  if (unit == "page" && range$$1 == doc.sel.primary())
9982
+ { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); }
9983
  return pos
9984
  }, sel_move);
9985
  if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
10016
  hasFocus: function() { return this.display.input.getField() == activeElt() },
10017
  isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
10018
 
10019
+ scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),
 
 
 
 
10020
  getScrollInfo: function() {
10021
  var scroller = this.display.scroller;
10022
  return {left: scroller.scrollLeft, top: scroller.scrollTop,
10038
  range$$1.margin = margin || 0;
10039
 
10040
  if (range$$1.from.line != null) {
10041
+ scrollToRange(this, range$$1);
 
10042
  } else {
10043
+ scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);
 
 
 
 
 
 
10044
  }
10045
  }),
10046
 
10068
  regChange(this);
10069
  this.curOp.forceUpdate = true;
10070
  clearCaches(this);
10071
+ scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);
10072
  updateGutterSpace(this);
10073
  if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
10074
  { estimateLineHeights(this); }
10081
  attachDoc(this, doc);
10082
  clearCaches(this);
10083
  this.display.input.reset();
10084
+ scrollToCoords(this, doc.scrollLeft, doc.scrollTop);
10085
  this.curOp.forceScroll = true;
10086
  signalLater(this, "swapDoc", this, old);
10087
  return old
10292
  };
10293
 
10294
  ContentEditableInput.prototype.showPrimarySelection = function () {
10295
+ var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();
10296
+ var from = prim.from(), to = prim.to();
 
 
 
 
 
10297
 
10298
+ if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
 
 
10299
  sel.removeAllRanges();
10300
  return
10301
  }
10302
 
10303
+ var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
10304
+ var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);
10305
+ if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
10306
+ cmp(minPos(curAnchor, curFocus), from) == 0 &&
10307
+ cmp(maxPos(curAnchor, curFocus), to) == 0)
10308
+ { return }
10309
+
10310
+ var view = cm.display.view;
10311
+ var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
10312
+ {node: view[0].measure.map[2], offset: 0};
10313
+ var end = to.line < cm.display.viewTo && posToDOM(cm, to);
10314
+ if (!end) {
10315
  var measure = view[view.length - 1].measure;
10316
  var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;
10317
  end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};
10318
  }
10319
 
10320
+ if (!start || !end) {
10321
+ sel.removeAllRanges();
10322
+ return
10323
+ }
10324
+
10325
+ var old = sel.rangeCount && sel.getRangeAt(0), rng;
10326
  try { rng = range(start.node, start.offset, end.offset, end.node); }
10327
  catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
10328
  if (rng) {
10329
+ if (!gecko && cm.state.focused) {
10330
  sel.collapse(start.node, start.offset);
10331
  if (!rng.collapsed) {
10332
  sel.removeAllRanges();
10836
  // Reset the input to correspond to the selection (or to be empty,
10837
  // when not typing and nothing is selected)
10838
  TextareaInput.prototype.reset = function (typing) {
10839
+ if (this.contextMenuPending || this.composing) { return }
10840
  var minimal, selected, cm = this.cm, doc = cm.doc;
10841
  if (cm.somethingSelected()) {
10842
  this.prevInput = "";
11046
 
11047
  TextareaInput.prototype.readOnlyChanged = function (val) {
11048
  if (!val) { this.reset(); }
11049
+ this.textarea.disabled = val == "nocursor";
11050
  };
11051
 
11052
  TextareaInput.prototype.setUneditable = function () {};
11202
 
11203
  addLegacyProps(CodeMirror$1);
11204
 
11205
+ CodeMirror$1.version = "5.27.0";
11206
 
11207
  return CodeMirror$1;
11208
 
11612
  ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
11613
  // Dedent relative to current context.
11614
  indent = Math.max(0, cx.indent - indentUnit);
 
11615
  }
11616
  }
11617
  return indent;
11682
  "border-top-left-radius", "border-top-right-radius", "border-top-style",
11683
  "border-top-width", "border-width", "bottom", "box-decoration-break",
11684
  "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
11685
+ "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
11686
  "column-fill", "column-gap", "column-rule", "column-rule-color",
11687
  "column-rule-style", "column-rule-width", "column-span", "column-width",
11688
  "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
11703
  "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
11704
  "grid-template-rows", "hanging-punctuation", "height", "hyphens",
11705
  "icon", "image-orientation", "image-rendering", "image-resolution",
11706
+ "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
11707
  "line-break", "line-height", "line-stacking", "line-stacking-ruby",
11708
  "line-stacking-shift", "line-stacking-strategy", "list-style",
11709
  "list-style-image", "list-style-position", "list-style-type", "margin",
11718
  "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
11719
  "page", "page-break-after", "page-break-before", "page-break-inside",
11720
  "page-policy", "pause", "pause-after", "pause-before", "perspective",
11721
+ "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
11722
  "presentation-level", "punctuation-trim", "quotes", "region-break-after",
11723
  "region-break-before", "region-break-inside", "region-fragment",
11724
  "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
11869
  "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
11870
  "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
11871
  "searchfield-cancel-button", "searchfield-decoration",
11872
+ "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
11873
  "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
11874
  "simp-chinese-formal", "simp-chinese-informal", "single",
11875
  "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
11876
  "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
11877
  "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
11878
+ "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
11879
  "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
11880
  "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
11881
  "table-caption", "table-cell", "table-column", "table-column-group",
11958
  }
11959
  },
11960
  ":": function(stream) {
11961
+ if (stream.match(/\s*\{/, false))
11962
+ return [null, null]
11963
  return false;
11964
  },
11965
  "$": function(stream) {
12176
  return state.token(stream, state);
12177
  },
12178
 
12179
+ indent: function (state, textAfter, line) {
12180
  if (!state.localMode || /^\s*<\//.test(textAfter))
12181
  return htmlMode.indent(state.htmlState, textAfter);
12182
  else if (state.localMode.indent)
12183
+ return state.localMode.indent(state.localState, textAfter, line);
12184
  else
12185
  return CodeMirror.Pass;
12186
  },
12238
  "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
12239
  "this": kw("this"), "class": kw("class"), "super": kw("atom"),
12240
  "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
12241
+ "await": C
12242
  };
12243
 
12244
  // Extend the 'normal' keywords with the TypeScript language extensions
12245
  if (isTS) {
12246
+ var type = {type: "variable", style: "type"};
12247
  var tsKeywords = {
12248
  // object-like things
12249
  "interface": kw("class"),
12251
  "namespace": C,
12252
  "module": kw("module"),
12253
  "enum": kw("module"),
 
12254
 
12255
  // scope modifiers
12256
  "public": kw("modifier"),
12258
  "protected": kw("modifier"),
12259
  "abstract": kw("modifier"),
12260
 
 
 
 
12261
  // types
12262
  "string": type, "number": type, "boolean": type, "any": type
12263
  };
12270
  return jsKeywords;
12271
  }();
12272
 
12273
+ var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
12274
  var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
12275
 
12276
  function readRegexp(stream) {
12344
  return ret("operator", "operator", stream.current());
12345
  } else if (wordRE.test(ch)) {
12346
  stream.eatWhile(wordRE);
12347
+ var word = stream.current()
12348
+ if (state.lastType != ".") {
12349
+ if (keywords.propertyIsEnumerable(word)) {
12350
+ var kw = keywords[word]
12351
+ return ret(kw.type, kw.style, word)
12352
+ }
12353
+ if (word == "async" && stream.match(/^\s*[\(\w]/, false))
12354
+ return ret("async", "keyword", word)
12355
+ }
12356
+ return ret("variable", "variable", word)
12357
  }
12358
  }
12359
 
12561
  }
12562
  if (type == "function") return cont(functiondef);
12563
  if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
12564
+ if (type == "variable") {
12565
+ if (isTS && value == "type") {
12566
+ cx.marked = "keyword"
12567
+ return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
12568
+ } else {
12569
+ return cont(pushlex("stat"), maybelabel);
12570
+ }
12571
+ }
12572
+ if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"),
12573
  block, poplex, poplex);
12574
  if (type == "case") return cont(expression, expect(":"));
12575
  if (type == "default") return cont(expect(":"));
12578
  if (type == "class") return cont(pushlex("form"), className, poplex);
12579
  if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
12580
  if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
12581
+ if (type == "module") return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
 
12582
  if (type == "async") return cont(statement)
12583
+ if (value == "@") return cont(expression, statement)
12584
  return pass(pushlex("stat"), expression, expect(";"), poplex);
12585
  }
12586
  function expression(type) {
12640
  if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
12641
  if (type == ".") return cont(property, me);
12642
  if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
12643
+ if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
12644
  }
12645
  function quasi(type, value) {
12646
  if (type != "quasi") return pass();
12699
  } else if (type == "[") {
12700
  return cont(expression, expect("]"), afterprop);
12701
  } else if (type == "spread") {
12702
+ return cont(expression, afterprop);
12703
  } else if (type == ":") {
12704
  return pass(afterprop)
12705
  }
12747
  }
12748
  }
12749
  function typeexpr(type) {
12750
+ if (type == "variable") {cx.marked = "type"; return cont(afterType);}
12751
  if (type == "string" || type == "number" || type == "atom") return cont(afterType);
12752
+ if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
12753
  if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
12754
  }
12755
  function maybeReturnType(type) {
12763
  return cont(typeprop)
12764
  } else if (type == ":") {
12765
  return cont(typeexpr)
12766
+ } else if (type == "[") {
12767
+ return cont(expression, maybetype, expect("]"), typeprop)
12768
  }
12769
  }
12770
  function typearg(type) {
12775
  if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
12776
  if (value == "|" || type == ".") return cont(typeexpr)
12777
  if (type == "[") return cont(expect("]"), afterType)
12778
+ if (value == "extends") return cont(typeexpr)
12779
  }
12780
  function vardef() {
12781
  return pass(pattern, maybetype, maybeAssign, vardefCont);
12831
  if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
12832
  if (type == "variable") {register(value); return cont(functiondef);}
12833
  if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
12834
+ if (isTS && value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, functiondef)
12835
  }
12836
  function funarg(type) {
12837
  if (type == "spread") return cont(funarg);
12870
  }
12871
  if (type == ";") return cont(classBody);
12872
  if (type == "}") return cont();
12873
+ if (value == "@") return cont(expression, classBody)
12874
  }
12875
  function classfield(type, value) {
12876
  if (value == "?") return cont(classfield)
assets/js/forms-admin.min.js CHANGED
@@ -1,9 +1,9 @@
1
- !function(){var e=void 0,t=void 0;!function t(r,n,i){function o(l,s){if(!n[l]){if(!r[l]){var c="function"==typeof e&&e;if(!s&&c)return c(l,!0);if(a)return a(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[l]={exports:{}};r[l][0].call(d.exports,function(e){var t=r[l][1][e];return o(t||e)},d,d.exports,t,r,n,i)}return n[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,r){"use strict";var n=function(e,t){var r={};return r.showType=function(r){var n=r.type();return n=n.charAt(0).toUpperCase()+n.slice(1),e("div",[e("label",t.fieldType),e("span",n)])},r.label=function(r){return e("div",[e("label",t.fieldLabel),e("input.widefat",{type:"text",value:r.label(),onchange:e.withAttr("value",r.label),placeholder:r.title()})])},r.value=function(r){var n="hidden"===r.type();return e("div",[e("label",[n?t.value:t.initialValue," ",n?"":e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.value(),onchange:e.withAttr("value",r.value)}),n?"":e("p.help",t.valueHelp)])},r.numberMinMax=function(r){return e("div",[e("div.row",[e("div.col.col-3",[e("label",t.min),e("input",{type:"number",onchange:e.withAttr("value",r.min)})]),e("div.col.col-3",[e("label",t.max),e("input",{type:"number",onchange:e.withAttr("value",r.max)})])])])},r.isRequired=function(r){var n={type:"checkbox",checked:r.required(),onchange:e.withAttr("checked",r.required)},i=void 0;return r.forceRequired()&&(n.required=!0,n.disabled=!0,i=e("p.help",t.forceRequired)),e("div",[e("label.cb-wrap",[e("input",n),t.isFieldRequired]),i])},r.placeholder=function(r){return e("div",[e("label",[t.placeholder," ",e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.placeholder(),onchange:e.withAttr("value",r.placeholder),placeholder:""}),e("p.help",t.placeholderHelp)])},r.useParagraphs=function(r){return e("div",[e("label.cb-wrap",[e("input",{type:"checkbox",checked:r.wrap(),onchange:e.withAttr("checked",r.wrap)}),t.wrapInParagraphTags])])},r.choiceType=function(r){var n=[e("option",{value:"select",selected:"select"===r.type()&&"selected"},t.dropdown),e("option",{value:"radio",selected:"radio"===r.type()&&"selected"},t.radioButtons)];return r.acceptsMultipleValues&&n.push(e("option",{value:"checkbox",selected:"checkbox"===r.type()&&"selected"},t.checkboxes)),e("div",[e("label",t.choiceType),e("select",{value:r.type(),onchange:e.withAttr("value",r.type)},n)])},r.choices=function(r){var n=[];return n.push(e("div",[e("label",t.choices),e("div.limit-height",[e("table",[r.choices().map(function(n,i){return e("tr",{"data-id":i},[e("td.cb",e("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:e.withAttr("value",r.selectChoice.bind(r)),checked:n.selected(),value:n.value(),title:t.preselect})),e("td.stretch",e("input.widefat",{type:"text",value:n.label(),placeholder:n.title(),onchange:e.withAttr("value",n.label)})),e("td",e("span",{title:t.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,i)},""))])})])])])),n},r};t.exports=n},{}],2:[function(e,t,r){"use strict";var n=function(t,r){var n={},i=e("./field-forms-rows.js")(t,r);return n.render=function(e){var t=e.type();if("function"==typeof n[t])return n[t](e);switch(t){case"select":case"radio":case"checkbox":return n.choice(e)}return n.text(e)},n.text=function(e){return[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},n.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type()&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(i.isRequired(e)),t},n.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[i.showType(e),i.value(e)]},n.submit=function(e){return e.label(""),e.placeholder(""),[i.value(e),i.useParagraphs(e)]},n.number=function(e){return[n.text(e),i.numberMinMax(e)]},n};t.exports=n},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var n=e("html"),i=function(e){e.dom.checked&&e.dom.setAttribute("checked","true"),e.dom.value&&e.dom.setAttribute("value",e.dom.value),e.dom.selected&&e.dom.setAttribute("selected","true")},o=function(e){function t(t){var i=void 0,o=void 0,a=void 0,l=document.createElement("div");return i=t.label().length>0?e("label",{},t.label()):"",o="function"==typeof r[t.type()]?r[t.type()](t):r.default(t),a=t.wrap()?e("p",[i,o]):[i,o],e.render(l,a),n.prettyPrint(l.innerHTML)+"\n"}var r={};return r.select=function(t){var r={name:t.name(),required:t.required()},n=!1,o=t.choices().map(function(t){return t.selected()&&(n=!0),e("option",{value:t.value()!==t.label()?t.value():void 0,selected:t.selected(),oncreate:i},t.label())}),a=t.placeholder();return a.length>0&&o.unshift(e("option",{disabled:!0,value:"",selected:!n,oncreate:i},a)),e("select",r,o)},r.checkbox=function(t){return t.choices().map(function(r){var n=t.name()+("checkbox"===t.type()?"[]":""),o=t.required()&&"radio"===t.type();return e("label",[e("input",{name:n,type:t.type(),value:r.value(),checked:r.selected(),required:o,oncreate:i})," ",e("span",r.label())])})},r.radio=r.checkbox,r.default=function(t){var r={type:t.type()};return t.name()&&(r.name=t.name()),t.min()&&(r.min=t.min()),t.max()&&(r.max=t.max()),t.value().length>0&&(r.value=t.value()),t.placeholder().length>0&&(r.placeholder=t.placeholder()),r.required=t.required(),r.oncreate=i,e("input",r)},t};t.exports=o},{html:20}],4:[function(e,t,r){"use strict";var n=function(t,r,n,i,o,a){function l(e){d=i.get(e),d&&d.choices().length>0&&d.value(d.choices().map(function(e){return e.label()}).join("|")),t.redraw()}function s(){}function c(){var e=f(d);n.insert(e),l(""),t.redraw()}function u(){var e=i.getCategories(),r=i.getAll(),n=t("div.available-fields.small-margin",[t("h4",a.chooseField),e.map(function(e){var n=r.filter(function(t){return t.category===e});if(n.length)return t("div.tiny-margin",[t("strong",e),n.map(function(e){var r="button";e.forceRequired()&&(r+=" is-required");var n=e.inFormContent();return null!==n&&(r+=" "+(n?"in-form":"not-in-form")),t("button",{className:r,type:"button",onclick:t.withAttr("value",l),value:e.index},e.title())})])})]),o=null;return d&&(o=h(t("div.field-wizard",[t("h3",[d.title(),d.forceRequired()?t("span.red","*"):"",d.name().length?t("code",d.name()):""]),d.help().length?t("p",t.trust(d.help())):"",p.render(d),t("p",[t("button",{class:"button-primary",type:"button",onkeydown:function(e){e=e||window.event,13==e.keyCode&&c()},onclick:c},a.addToForm)])]),l)),[n,o]}var d,f=e("./field-generator.js")(t),h=e("./overlay.js")(t,a),p=e("./field-forms.js")(t,a);return n.on("blur",t.redraw),{view:u,controller:s}};t.exports=n},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){"use strict";var n=function(e,t){function r(){u.forEach(e.deregister)}function n(t,r,n){var i=e.register(t,r);n||u.push(i)}function i(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function o(e){var r=t.listFields,o=i(e.field_type),a={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:o,choices:e.choices,acceptsMultipleValues:!1};return"address"!==a.type?n(r,a,!1):(n(r,{name:a.name+"[addr1]",type:"text",mailchimpType:"address",title:t.streetAddress}),n(r,{name:a.name+"[city]",type:"text",mailchimpType:"address",title:t.city}),n(r,{name:a.name+"[state]",type:"text",mailchimpType:"address",title:t.state}),n(r,{name:a.name+"[zip]",type:"text",mailchimpType:"address",title:t.zip}),n(r,{name:a.name+"[country]",type:"select",mailchimpType:"address",title:t.country,choices:mc4wp_vars.countries})),!0}function a(e){var r=t.interestCategories,o=i(e.field_type);n(r,{title:e.name,name:"INTERESTS["+e.id+"]",type:o,choices:e.interests,acceptsMultipleValues:"checkbox"===o},!1)}function l(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e.public&&!t.public?-1:!e.public&&t.public?1:0}),e.merge_fields.forEach(o),e.interest_categories.forEach(a)}function s(e){r(),e.forEach(l)}function c(e){var r,i=t.formFields;n(i,{name:"",value:t.subscribe,type:"submit",title:t.submitButton},!0),r={};for(var o in e)r[e[o].id]=e[o].name;n(i,{name:"_mc4wp_lists",type:"checkbox",title:t.listChoice,choices:r,help:t.listChoiceDescription,acceptsMultipleValues:!0},!0),r={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},n(i,{name:"_mc4wp_action",type:"radio",title:t.formAction,choices:r,value:"subscribe",help:t.formActionDescription},!0)}var u=[];return{registerCustomFields:c,registerListFields:l,registerListsFields:s}};t.exports=n},{}],6:[function(e,t,r){"use strict";var n=e("mithril/stream");t.exports=function(e,t){function r(e){return"function"==typeof e.map?e.map(function(e){return new p({label:e})}):Object.keys(e).map(function(t){var r=e[t];return new p({label:r,value:t})})}function i(n,i){var o,a=c("name",i.name).shift();return a?void(!a.forceRequired()&&i.forceRequired&&a.forceRequired(!0)):(i.choices&&(i.choices=r(i.choices),i.value&&(i.choices=i.choices.map(function(e){return e.value()===i.value&&e.selected(!0),e}))),f.indexOf(n)<0&&f.push(n),o=new h(i),o.category=n,d.push(o),u&&window.clearTimeout(u),u=window.setTimeout(e.redraw,200),t.trigger("fields.change"),o)}function o(t){var r=d.indexOf(t);r>-1&&(delete d[r],e.redraw())}function a(e){return d[e]}function l(){return d=d.map(function(e,t){return e.index=t,e})}function s(){return f}function c(e,t){return d.filter(function(r){return r[e]()===t})}var u,d=[],f=[],h=function(e){this.name=n(e.name),this.title=n(e.title||e.name),this.type=n(e.type),this.mailchimpType=n(e.mailchimpType||""),this.label=n(e.title||""),this.value=n(e.value||""),this.placeholder=n(e.placeholder||""),this.required=n(e.required||!1),this.forceRequired=n(e.forceRequired||!1),this.wrap=n(e.wrap||!0),this.min=n(e.min||null),this.max=n(e.max||null),this.help=n(e.help||""),this.choices=n(e.choices||[]),this.inFormContent=n(null),this.acceptsMultipleValues=e.acceptsMultipleValues,this.selectChoice=function(e){var t=this;this.choices(this.choices().map(function(r){return r.value()===e?r.selected(!0):"checkbox"!==t.type()&&r.selected(!1),r}))}},p=function(e){this.label=n(e.label),this.title=n(e.title||e.label),this.selected=n(e.selected||!1),this.value=n(e.value||e.label)};return{get:a,getAll:l,getCategories:s,deregister:o,register:i,getAllWhere:c}}},{"mithril/stream":21}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold"),e("codemirror/addon/edit/matchtags"),e("codemirror/addon/edit/closetag.js");var i=function(e){function t(){return o&&(i.innerHTML=a.getValue().toLowerCase(),o=!1),i}var r,i=document.createElement("form"),o=!1,a={};return i.innerHTML=e.value.toLowerCase(),n&&(r=n.fromTextArea(e,{selectionPointer:!0,matchTags:{bothTags:!0},mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0}),window.dispatchEvent&&r.on("change",function(){if("function"==typeof Event){var t=new Event("change",{bubbles:!0});e.dispatchEvent(t)}})),window.addEventListener("load",function(){n.signal(r,"change")}),e.addEventListener("change",function(){o=!0}),a.getValue=function(){return r?r.getValue():e.value},a.query=function(e){return t().querySelectorAll(e.toLowerCase())},a.containsField=function(e){return null!==t().elements.namedItem(e.toLowerCase())},a.insert=function(t){r?(r.replaceSelection(t),r.focus()):e.value+=t},a.on=function(t,n){return r?(t="input"===t?"changes":t,r.on(t,n)):e.addEventListener(t,n)},a.refresh=function(){r&&r.refresh()},a};t.exports=i},{codemirror:15,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchtags":13,"codemirror/addon/fold/xml-fold":14,"codemirror/mode/css/css":16,"codemirror/mode/htmlmixed/htmlmixed":17,"codemirror/mode/javascript/javascript":18,"codemirror/mode/xml/xml":19}],8:[function(e,t,r){"use strict";var n=function(e,t,r,n,i,o){function a(){n.getAll().forEach(function(e){if(!(e.name().length<=0)){var r=e.name();"checkbox"===e.type()&&(r+="[]");var n=t.containsField(r);if(e.inFormContent(n),"address"===e.mailchimpType()){e.originalRequiredValue=void 0===e.originalRequiredValue?e.forceRequired():e.originalRequiredValue;var i=e.name().replace(/\[(\w+)\]/g,"");t.query('[name^="'+i+'"]').length>0?(void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired()),e.forceRequired(!0)):e.forceRequired(e.originalRequiredValue)}}}),l(),e.redraw()}function l(){var e=n.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase().replace(/\[(\w+)\]/g,".$1")}),r=t.query("[required]");Array.prototype.forEach.call(r,function(t){var r=t.name.toUpperCase();"_"!==r[0]&&(r=r.replace(/\[(\w+)\]/g,".$1"),-1===e.indexOf(r)&&e.push(r))}),s.value=e.join(",")}var s=document.getElementById("required-fields");t.on("change",o.debounce(a,500)),i.on("fields.change",o.debounce(a,500))};t.exports=n},{}],9:[function(e,t,r){"use strict";function n(e,t){l[e]=t,o()}function i(e){delete l[e],o()}function o(){var e="";for(var t in l)e+='<div class="notice notice-warning inline"><p>'+l[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){r=document.createElement("div"),r.className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}function a(e,t){var r=function(){e.getValue().toLowerCase().indexOf('name="groupings')>-1?n("deprecated_groupings","Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly."):i("deprecated_groupings")},o=function(){var r=t.getAllWhere("forceRequired",!0),o=r.filter(function(t){return!e.containsField(t.name().toUpperCase())}),a="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";a+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+o.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",o.length>0?n("required_fields_missing",a):i("required_fields_missing")};r(),e.on("focus",r),e.on("blur",r),o(),e.on("blur",o),e.on("focus",o)}var l={};t.exports={init:a}},{}],10:[function(e,t,r){"use strict";var n=function(e,t){function r(){document.removeEventListener("keydown",n),window.removeEventListener("resize",i),l()}function n(e){e=e||window.event,27==e.keyCode&&r(),13==e.keyCode&&e.preventDefault()}function i(){if(a){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-a.clientWidth-40)/2,n=(t-a.clientHeight-40)/2;a.style.left=(r>0?r:0)+"px",a.style.top=(n>0?n:0)+"px"}}function o(e){a=e.dom,i()}var a=void 0,l=void 0;return function(a,s){return l=s,document.addEventListener("keydown",n),window.addEventListener("resize",i),[e("div.overlay-wrap",e("div.overlay",{oncreate:o},[e("span",{class:"close dashicons dashicons-no",title:t.close,onclick:r}),a])),e("div.overlay-background",{title:t.close,onclick:r})]}};t.exports=n},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=document.getElementById("mc4wp-form-content"),m=window.formEditor=new u(p),g=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),v=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),g);var y=new f(h,n);o.on("selectedLists.change",y.registerListsFields),y.registerListsFields(a.getSelectedLists()),y.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),v.init(m,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=m,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r=t.listSelections(),n=[],s=0;s<r.length;s++){if(!r[s].empty())return e.Pass;var c=r[s].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),f=d.state;if("xml"!=d.mode.name||!f.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==d.mode.configuration,m="object"==typeof h&&h.dontCloseTags||p&&a,g="object"==typeof h&&h.indentTags||p&&l,v=f.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==f.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,f,!0))return e.Pass;var b=g&&i(g,y)>-1;n[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=r.length-1;s>=0;s--){var w=n[s];t.replaceRange(w.text,r[s].head,r[s].anchor,"+insert");var x=t.listSelections().slice(0);x[s]={head:w.newPos,anchor:w.newPos},t.setSelections(x),w.indent&&(t.indentLine(w.newPos.line,null,!0),t.indentLine(w.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),i=[],a=r?"/":"</",l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var s=n[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),d=u.state;if(r&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;var f;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)f=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;f=a+"style"}else{if(!d.context||!d.context.tagName||o(t,d.context.tagName,s,d))return e.Pass;f=a+d.context.tagName}">"!=t.getLine(s.line).charAt(c.end)&&(f+=">"),i[l]=f}t.replaceSelections(i),n=t.listSelections();for(var l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&t.indentLine(n[l].head.line)}function n(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function o(t,r,n,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),l=e.scanForClosingTag(t,n,null,a);if(!l||l.tag!=r)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==r;s=s.prev)++c;n=l.to;for(var u=1;u<c;u++){var d=e.scanForClosingTag(t,n,null,a);if(!d||d.tag!=r)return!1;n=d.to}return!0}e.defineOption("autoCloseTags",!1,function(r,i,o){if(o!=e.Init&&o&&r.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return r(e)}})},{"../../lib/codemirror":15,"../fold/xml-fold":14}],13:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),i=r.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=e.findMatchingTag(r,n,i);if(o){if(r.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?r.state.tagOther=r.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",r),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",r),i.on("viewportChange",n),r(i))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}})},{"../../lib/codemirror":15,"../fold/xml-fold":14}],14:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function r(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function n(e,t){var r=e.cm.getTokenTypeAt(f(e.line,t));return r&&/\btag\b/.test(r)}function i(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(n(e,t+1)){p.lastIndex=t,e.ch=t;var r=p.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function s(e){for(;;){p.lastIndex=e.ch;var t=p.exec(e.text);if(!t){if(i(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(n=a(e)))return;if("selfClose"!=n)if(i[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==i[2]){r.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:f(o,l),to:f(e.line,e.ch)}}else r.push(i[2])}}function d(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;s>=0;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:f(e.line,e.ch),to:f(i,o)}}}else l(e)}}var f=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=new RegExp("<(/?)(["+h+"]["+h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var i,o=s(n);if(!o||n.line!=t.line||!(i=a(n)))return;if(!o[1]&&"selfClose"!=i){var l=f(n.line,n.ch),c=u(n,o[2]);return c&&{from:l,to:c.from}}}}),e.findMatchingTag=function(e,n,i){var o=new r(e,n.line,n.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&f(o.line,o.ch),h=s&&l(o);if(s&&h&&!(t(o,n)>0)){var p={from:f(o.line,o.ch),to:c,tag:h[2]};return"selfClose"==s?{open:p,close:null,at:"open"}:h[1]?{open:d(o,h[2]),close:p,at:"close"}:(o=new r(e,c.line,c.ch,i),{open:p,close:u(o,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var i=new r(e,t.line,t.ch,n);;){var o=d(i);if(!o)break;var a=new r(e,t.line,t.ch,n),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,n,i){return u(new r(e,t.line,t.ch,i?{from:0,to:i}:null),n)}})},{"../../lib/codemirror":15}],15:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.CodeMirror=i()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,r,i){var o=n(e,t,r,i);return o.setAttribute("role","presentation"),o}function o(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 a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function l(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function s(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function d(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function f(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function h(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;La.length<=e;)La.push(m(La)+" ");return La[e]}function m(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function v(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function y(){}function b(e,t){var r;return Object.create?r=Object.create(e):(y.prototype=e,r=new y),t&&u(t,r),r}function w(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ma.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function k(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&Aa.test(e)}function S(e,t,r){for(;(r<0?t>0:t<e.length)&&C(e.charAt(t));)t+=r;return t}function T(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function L(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[a],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+xa+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),Zo&&Jo<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Qo||Go&&sa||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}function M(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function A(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function _(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function O(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function N(e){if(null==e.parent)return null;for(var t=e.parent,r=f(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function W(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function E(e,t){return t>=e.first&&t<e.first+e.size}function z(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function D(e,t,r){if(void 0===r&&(r=null),!(this instanceof D))return new D(e,t,r);this.line=e,this.ch=t,this.sticky=r}function P(e,t){return e.line-t.line||e.ch-t.ch}function H(e,t){return e.sticky==t.sticky&&0==P(e,t)}function I(e){return D(e.line,e.ch)}function F(e,t){return P(e,t)<0?t:e}function R(e,t){return P(e,t)<0?e:t}function j(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function B(e,t){if(t.line<e.first)return D(e.first,0);var r=e.first+e.size-1;return t.line>r?D(r,M(e,r).text.length):q(t,M(e,t.line).text.length)}function q(e,t){var r=e.ch;return null==r||r>t?D(e.line,t):r<0?D(e.line,0):e}function K(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=B(e,t[n]);return r}function U(){_a=!0}function V(){Oa=!0}function G(e,t,r){this.marker=e,this.from=t,this.to=r}function $(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Y(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function X(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new G(a,o.from,s?null:o.to))}}return n}function J(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new G(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Q(e,t){if(t.full)return null;var r=E(e,t.from.line)&&M(e,t.from.line).markedSpans,n=E(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==P(t.from,t.to),l=Z(r,i,a),s=J(n,o,a),c=1==t.text.length,u=m(t.text).length+(c?i:0)
2
- ;if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=$(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 g=s[p];if(null!=g.to&&(g.to+=u),null==g.from){var v=$(l,g.marker);v||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=ee(l)),s&&s!=l&&(s=ee(s));var y=[l];if(!c){var b,w=t.text.length-2;if(w>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(b||(b=[])).push(new G(l[x].marker,null,null));for(var k=0;k<w;++k)y.push(b);y.push(s)}return y}function ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function te(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=f(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(P(c.to,l.from)<0||P(c.from,l.to)>0)){var u=[s,1],d=P(c.from,l.from),h=P(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function ae(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=P(n.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=P(n.to,i.to)||oe(e)-oe(t);return a||t.id-e.id}function le(e,t){var r,n=Oa&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||ae(r,i.marker)<0)&&(r=i.marker);return r}function se(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,r,n,i){var o=M(e,t),a=Oa&&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=P(c.from,r)||ie(s.marker)-ie(i),d=P(c.to,n)||oe(s.marker)-oe(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?P(c.to,r)>=0:P(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?P(c.from,n)<=0:P(c.from,n)<0)))return!0}}}function de(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function fe(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function he(e){for(var t,r;t=ce(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=M(e,t),n=de(r);return r==n?t:N(n)}function me(e,t){if(t>e.lastLine())return t;var r,n=M(e,t);if(!ge(e,n))return t;for(;r=ce(n);)n=r.find(1,!0).line;return N(n)+1}function ge(e,t){var r=Oa&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ve(e,t,n))return!0}}function ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ve(e,n.line,$(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ve(e,t,i))return!0}function ye(e){e=de(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function be(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=se(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ce(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function we(e){var t=e.display,r=e.doc;t.maxLine=M(r,r.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=be(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function xe(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ke(e,t,r){var n;Na=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Na=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Na=i)}return null!=n?n:Na}function Ce(e,t){var r=e.order;return null==r&&(r=e.order=Wa(e.text,t)),r}function Se(e,t,r){var n=S(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Te(e,t,r){var n=Se(e,t.ch,r);return null==n?null:new D(t.line,n,r<0?"after":"before")}function Le(e,t,r,n,i){if(e){var o=Ce(r,t.doc.direction);if(o){var a,l=i<0?m(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Xt(t,r);a=i<0?r.text.length-1:0;var d=Zt(t,u,a).top;a=T(function(e){return Zt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Se(r,a,1,!0))}else a=i<0?l.to:l.from;return new D(n,a,c)}}return new D(n,i<0?r.text.length:0,i<0?"before":"after")}function Me(e,t,r,n){var i=Ce(t,e.doc.direction);if(!i)return Te(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ke(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Te(t,r,n);var l,s=function(e,r){return Se(t,e instanceof D?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||Xt(e,t),mr(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var h=d?"before":"after";return new D(r.line,f,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new D(r.line,s(e,1),"before"):new D(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},m=p(o+n,n,u);if(m)return m;var g=n>0?u.end:s(u.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,c(g)))?null:m}function Ae(e,t){return e._handlers&&e._handlers[t]||Ea}function _e(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=f(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Oe(e,t){var r=Ae(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ne(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,r||t.type,e,t),He(t)||t.codemirrorIgnore}function We(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==f(r,t[n])&&r.push(t[n])}function Ee(e,t){return Ae(e,t).length>0}function ze(e){e.prototype.on=function(e,t){za(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function De(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function He(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ie(e){De(e),Pe(e)}function Fe(e){return e.target||e.srcElement}function Re(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ca&&e.ctrlKey&&1==t&&(t=3),t}function je(e){if(null==ba){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ba=t.offsetWidth<=1&&t.offsetHeight>2&&!(Zo&&Jo<8))}var i=ba?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Be(e){if(null!=wa)return wa;var n=r(e,document.createTextNode("AخA")),i=ha(n,0,1).getBoundingClientRect(),o=ha(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(wa=o.right-i.right<3)}function qe(e){if(null!=Fa)return Fa;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=ha(t,0,1).getBoundingClientRect();return Fa=Math.abs(i.left-o.left)>1}function Ke(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ra[e]=t}function Ue(e,t){ja[e]=t}function Ve(e){if("string"==typeof e&&ja.hasOwnProperty(e))e=ja[e];else if(e&&"string"==typeof e.name&&ja.hasOwnProperty(e.name)){var t=ja[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),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 r=Ra[t.name];if(!r)return Ge(e,"text/plain");var n=r(e,t);if(Ba.hasOwnProperty(t.name)){var i=Ba[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function $e(e,t){u(t,Ba.hasOwnProperty(e)?Ba[e]:Ba[e]={})}function Ye(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ze(e,t,r){return!e.startState||e.startState(t,r)}function Je(e,t,r,n){var i=[e.state.modeGen],o={};at(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=0;a<e.state.overlays.length;++a)!function(r){var n=e.state.overlays[r],a=1,l=0;at(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)}(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=et(e,N(t)),i=Je(e,t,t.text.length>e.options.maxHighlightLength?Ye(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=lt(e,t,r),a=o>n.first&&M(n,o-1).stateAfter;return a=a?Ye(n.mode,a):Ze(n.mode),n.iter(o,t,function(r){tt(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?Ye(n.mode,a):null,++o}),r&&(n.frontier=o),a}function tt(e,t,r,n){var i=e.doc.mode,o=new qa(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&rt(i,r);!o.eol();)nt(i,o,r),o.start=o.pos}function rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function nt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?Ye(a.mode,u):u}},a=e.doc,l=a.mode;t=B(a,t);var s,c=M(a,t.line),u=et(e,t.line,r),d=new qa(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=nt(l,d,u),n&&s.push(o(!0));return n?s:o()}function ot(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function at(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new qa(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&ot(rt(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&tt(e,t,n,d.pos),d.pos=t.length,s=null):s=ot(nt(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}function lt(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=M(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=d(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),re(e),ne(e,r);var i=n?n(e):1;i!=e.height&&O(e,i)}function ct(e){e.parent=null,re(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Ga:Va;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dt(e,t){var r=i("span",null,null,Qo?"padding-right: .1px":null),n={pre:i("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Zo||Qo)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,l=void 0;n.pos=0,n.addToken=ht,Be(e.display.measure)&&(l=Ce(a,e.doc.direction))&&(n.addToken=mt(n.addToken,l)),n.map=[];vt(a,n,Qe(e,a,t!=e.display.externalMeasured&&N(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=s(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=s(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Qo){var c=n.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=s(n.pre.className,n.textClass||"")),n}function ft(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?pt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));Zo&&Jo<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),Zo&&Jo<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),Zo&&Jo<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function mt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function gt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==p&&k.widgetNode?y.push(k):x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||ae(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==p)for(var S=0;S<y.length;++S)gt(t,0,y[S]);if(f&&(f.from||0)==p){if(gt(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var T=Math.min(h,v);;){if(g){var L=p+g.length;if(!f){var M=L>T?g.slice(0,T-p):g;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",d,l)}if(L>=T){g=g.slice(T-p),p=T;break}p=L,u=""}g=i.slice(o,o=r[m++]),a=ut(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),ut(r[A+1],t.cm.options))}function yt(e,t,r){this.line=t,this.rest=he(t),this.size=this.rest?N(m(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function bt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new yt(e.doc,M(e.doc,o),o);n=o+a.size,i.push(a)}return i}function wt(e){$a?$a.ops.push(e):e.ownsGroup=$a={ops:[e],delayedCallbacks:[]}}function xt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function kt(e,t){var r=e.ownsGroup;if(r)try{xt(r)}finally{$a=null,t(r)}}function Ct(e,t){var r=Ae(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);$a?n=$a.delayedCallbacks:Ya?n=Ya:(n=Ya=[],setTimeout(St,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function St(){var e=Ya;Ya=null;for(var t=0;t<e.length;++t)e[t]()}function Tt(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?_t(e,t):"gutter"==o?Nt(e,t,r,n):"class"==o?Ot(e,t):"widget"==o&&Wt(e,t,n)}t.changes=null}function Lt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Zo&&Jo<8&&(e.node.style.zIndex=2)),e.node}function Mt(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=Lt(t);t.background=i.insertBefore(n("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function At(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):dt(e,t)}function _t(e,t){var r=t.text.className,n=At(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ot(e,t)):r&&(t.text.className=r)}function Ot(e,t){Mt(e,t),t.line.wrapClass?Lt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Nt(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Lt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Lt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",z(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Wt(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);zt(e,t,r)}function Et(e,t,r,n){var i=At(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ot(e,t),Nt(e,t,r,n),zt(e,t,n),t.node}function zt(e,t,r){if(Dt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Dt(e,t.rest[n],t,r,!1)}function Dt(e,t,r,i,o){if(t.widgets)for(var a=Lt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Pt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),Ct(c,"redraw")}}function Pt(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ht(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function It(e,t){for(var r=Fe(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ft(e){return e.lineSpace.offsetTop}function Rt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function jt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Bt(e){return xa-e.display.nativeBarWidth}function qt(e){return e.display.scroller.clientWidth-Bt(e)-e.display.barWidth}function Kt(e){return e.display.scroller.clientHeight-Bt(e)-e.display.barHeight}function Ut(e,t,r){var n=e.options.lineWrapping,i=n&&qt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Vt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(N(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Gt(e,t){t=de(t);var n=N(t),i=e.display.externalMeasured=new yt(e.doc,t,n);i.lineN=n;var o=i.built=dt(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function $t(e,t,r,n){return Zt(e,Xt(e,t),r,n)}function Yt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Xt(e,t){var r=N(t),n=Yt(e,r);n&&!n.text?n=null:n&&n.changes&&(Tt(e,n,r,br(e)),e.curOp.forceUpdate=!0),n||(n=Gt(e,t));var i=Vt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Zt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=er(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Jt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Qt(e,t){var r=Xa;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function er(e,t,r,n){var i,o=Jt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&C(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&C(t.line.text.charAt(o.coverStart+s));)++s;if(i=Zo&&Jo<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Qt(ha(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}Zo&&Jo<11&&(i=tr(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(Zo&&Jo<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+yr(e.display),top:f.top,bottom:f.bottom}:Xa}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};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p),w}function tr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!qe(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function rr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function nr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)rr(e.display.view[r])}function ir(e){nr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function or(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ar(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Ht(t.widgets[o]);r.top+=a,r.bottom+=a}if("line"==n)return r;n||(n="local");var l=ye(t);if("local"==n?l+=Ft(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ar());var c=s.left+("window"==n?0:or());r.left+=c,r.right+=c}return r.top+=l,r.bottom+=l,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=or(),i-=ar();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function cr(e,t,r,n,i){return n||(n=M(e.doc,t.line)),lr(e,n,$t(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function a(t,a){var l=Zt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,lr(e,n,l,r)}function l(e,t,r){var n=s[t],i=n.level%2!=0;return a(r?e-1:e,i!=r)}n=n||M(e.doc,t.line),i||(i=Xt(e,n));var s=Ce(n,e.doc.direction),c=t.ch,u=t.sticky;if(c>=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=ke(s,c,u),f=Na,h=l(c,d,"before"==u);return null!=f&&(h.other=l(c,f,"before"!=u)),h}function dr(e,t){var r=0;t=B(e.doc,t),e.options.lineWrapping||(r=yr(e.display)*t.ch);var n=M(e.doc,t.line),i=ye(n)+Ft(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function fr(e,t,r,n,i){var o=D(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function hr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return fr(n.first,0,null,!0,-1);var i=W(n,r),o=n.first+n.size-1;if(i>o)return fr(n.first+n.size-1,M(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=M(n,i);;){var l=gr(e,a,i,t,r),s=ce(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=N(a=c.to.line)}}function pr(e,t,r,n){var i=function(n){return lr(e,t,Zt(e,r,n),"line")},o=t.text.length,a=T(function(e){return i(e-1).bottom<=n},o,0);return o=T(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function mr(e,t,r,n){return pr(e,t,r,lr(e,t,Zt(e,r,n),"line").top)}function gr(e,t,r,n,i){i-=ye(t);var o,a=0,l=t.text.length,s=Xt(e,t);if(Ce(t,e.doc.direction)){if(e.options.lineWrapping){var c;c=pr(e,t,s,i),a=c.begin,l=c.end}o=new D(r,a);var u,d,f=ur(e,o,"line",t,s).left,h=f<n?1:-1,p=f-n;do{if(u=p,d=o,null==(o=Me(e,t,o,h))||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=d;break}p=ur(e,o,"line",t,s).left-n}while(h<0!=p<0&&Math.abs(p)<=Math.abs(u));if(Math.abs(p)>Math.abs(u)){if(p<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=d}}else{var m=T(function(r){var o=lr(e,t,Zt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},a,l);m=S(t.text,m,1),o=new D(r,m,m==l?"before":"after")}var g=ur(e,o,"line",t,s);return(i<g.top||g.bottom<i)&&(o.outside=!0),o.xRel=n<g.left?-1:n>g.right?1:0,o}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ua){Ua=n("pre");for(var i=0;i<49;++i)Ua.appendChild(document.createTextNode("x")),Ua.appendChild(n("br"));Ua.appendChild(document.createTextNode("x"))}r(e.measure,Ua);var o=Ua.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function yr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function br(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:wr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function wr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/yr(e.display)-3);return function(i){if(ge(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function kr(e){var t=e.doc,r=xr(e);t.iter(function(e){var t=r(e);t!=e.height&&O(e,t)})}function Cr(e,t,r,n){var i=e.display;if(!r&&"true"==Fe(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=hr(e,o,a);if(n&&1==c.xRel&&(s=M(e.doc,c.line).text).length==c.ch){
3
- var u=d(s,s.length,e.options.tabSize)-s.length;c=D(c.line,Math.max(0,Math.round((o-jt(e.display).left)/yr(e.display))-u))}return c}function Sr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function Tr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Lr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(!1!==t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Mr(e,l.head,i),s||Ar(e,l,o)}}return n}function Mr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Ar(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return cr(e,D(t,r),"div",c,n)}var a,s,c=M(l,t),f=c.text.length;return xe(Ce(c,l.direction),r||0,null==n?f:n,function(e,t,l){var c,h,p,m=o(e,"left");if(e==t)c=m,h=p=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}h=m.left,p=c.right}null==r&&0==e&&(h=u),c.top-m.top>3&&(i(h,m.top,null,m.bottom),h=u,m.bottom<c.top&&i(h,m.bottom,null,c.top)),null==n&&t==f&&(p=d),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),h<u+1&&(h=u),i(h,c.top,p-h,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=jt(e.display),u=c.left,d=Math.max(a.sizerWidth,qt(e)-a.sizer.offsetLeft)-c.right,f=t.from(),h=t.to();if(f.line==h.line)o(f.line,f.ch,h.ch);else{var p=M(l,f.line),m=M(l,h.line),g=de(p)==de(m),v=o(f.line,f.ch,g?p.text.length+1:null).end,y=o(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function _r(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Or(e){e.state.focused||(e.display.input.focus(),Wr(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))},100)}function Wr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Oe(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Qo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),_r(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,t),e.state.focused=!1,ga(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function zr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=wr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Dr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=z(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Mn(e),!0}return!1}function Pr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(Zo&&Jo<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=vr(t)),(s>.001||s<-.001)&&(O(i.line,o),Hr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Hr(i.rest[c])}}}function Hr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Ir(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ft(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=W(t,n),a=W(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=W(t,ye(M(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=W(t,ye(M(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Fr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Go||Tn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Go&&Tn(e),wn(e,100))}function Rr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,zr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Br(e){var t=jr(e);return t.x*=Ja,t.y*=Ja,t}function qr(e,t){var r=jr(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&ca&&Qo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!Go&&!ra&&null!=Ja)return i&&s&&Fr(e,Math.max(0,Math.min(a.scrollTop+i*Ja,a.scrollHeight-a.clientHeight))),Rr(e,Math.max(0,Math.min(a.scrollLeft+n*Ja,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&De(t),void(o.wheelStartX=null);if(i&&null!=Ja){var f=i*Ja,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),Tn(e,{top:h,bottom:p})}Za<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ja=(Ja*Za+r)/(Za+1),++Za)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Kr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Rt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Bt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Ur(e,t){t||(t=Kr(e));var r=e.display.barWidth,n=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Pr(e),Vr(e,Kr(e)),r=e.display.barWidth,n=e.display.barHeight}function Vr(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function Gr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ga(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new tl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),za(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Rr(e,t):Fr(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function $r(e,t){if(!Ne(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!oa){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ft(e.display))+"px;\n height: "+(t.bottom-t.top+Bt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function Yr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,l=ur(e,t),s=r&&r!=t?ur(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var c=Zr(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Fr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Rr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function Xr(e,t){var r=Zr(e,t);null!=r.scrollTop&&Fr(e,r.scrollTop),null!=r.scrollLeft&&Rr(e,r.scrollLeft)}function Zr(e,t){var r=e.display,n=vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Kt(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Rt(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=qt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Jr(e,t,r){null==t&&null==r||en(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qr(e){en(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?D(t.line,t.ch-1):t,n=D(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function en(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=dr(e,t.from),n=dr(e,t.to),i=Zr(e,{left:Math.min(r.left,n.left),top:Math.min(r.top,n.top)-t.margin,right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)+t.margin});e.scrollTo(i.scrollLeft,i.scrollTop)}}function tn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++rl},wt(e.curOp)}function rn(e){kt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;nn(e)})}function nn(e){for(var t=e.ops,r=0;r<t.length;r++)on(t[r]);for(var n=0;n<t.length;n++)an(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var a=0;a<t.length;a++)cn(t[a])}function on(e){var t=e.cm,r=t.display;kn(t),e.updateMaxLine&&we(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new nl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function an(e){e.updatedDisplay=e.mustUpdate&&Cn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Pr(t),e.barMeasure=Kr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Bt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==a()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&An(t,e.barMeasure),e.selectionChanged&&_r(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Or(e.cm)}function cn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Sn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,zr(t)),e.scrollToPos){$r(t,Yr(t,B(n,e.scrollToPos.from),B(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||Oe(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Oe(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();tn(e);try{return t()}finally{rn(e)}}function dn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tn(e);try{return t.apply(e,arguments)}finally{rn(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);tn(this);try{return e.apply(this,arguments)}finally{rn(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tn(t);try{return e.apply(this,arguments)}finally{rn(t)}}}function pn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Oa&&pe(e.doc,t)<i.viewTo&&gn(e);else if(r<=i.viewFrom)Oa&&me(e.doc,r+n)>i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var a=vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):gn(e)}else{var l=vn(e,t,t,-1),s=vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(bt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):gn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function mn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Sr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==f(a,r)&&a.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Sr(e,t),a=e.display.view;if(!Oa||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function yn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=bt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Sr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function bn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function wn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,c(xn,e))}function xn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ye(t.mode,et(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Je(e,o,l?Ye(t.mode,n):n,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(t.frontier),o.stateAfter=l?n:Ye(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&tt(e,o.text,n),o.stateAfter=t.frontier%5==0?Ye(t.mode,n):null;if(++t.frontier,+new Date>r)return wn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)mn(e,i[t],"text")})}}function kn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Bt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Bt(e)+"px",t.scrollbarsClipped=!0)}function Cn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return gn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==bn(e))return!1;Dr(e)&&(gn(e),r.dims=br(e));var o=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<l&&l-n.viewFrom<20&&(l=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),Oa&&(l=pe(e.doc,l),s=me(e.doc,s));var c=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;yn(e,l,s),n.viewOffset=ye(M(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=bn(e);if(!c&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=a();return u>4&&(n.lineDiv.style.display="none"),Ln(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,d&&a()!=d&&d.offsetHeight&&d.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,c&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function Sn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=qt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Rt(e.display)-Kt(e),r.top)}),t.visible=Ir(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Cn(e,t);n=!1){Pr(e);var i=Kr(e);Tr(e),Ur(e,i),An(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Tn(e,t){var r=new nl(e,t);if(Cn(e,r)){Pr(e),Sn(e,r);var n=Kr(e);Tr(e),Ur(e,n),An(e,n),r.finish()}}function Ln(e,r,n){function i(t){var r=t.nextSibling;return Qo&&ca&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,d=0;d<c.length;d++){var h=c[d];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=i(s);var p=a&&null!=r&&r<=u&&h.lineNumber;h.changes&&(f(h.changes,"gutter")>-1&&(p=!1),Tt(e,h,u,n)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(z(e.options,u)))),s=h.node.nextSibling}else{var m=Et(e,h,u,n);l.insertBefore(m,s)}u+=h.size}for(;s;)s=i(s)}function Mn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function An(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Bt(e)+"px"}function _n(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",Mn(e)}function On(e){var t=f(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Nn(e,t){var r=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=f(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(P(o.to(),i.from())>=0){var a=R(o.from(),i.from()),l=F(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new ol(s?l:a,s?a:l))}}return new il(e,t)}function Wn(e,t){return new il([new ol(e,t||e)],0)}function En(e){return e.text?D(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function zn(e,t){if(P(e,t.from)<0)return e;if(P(e,t.to)<=0)return En(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=En(t).ch-t.to.ch),D(r,n)}function Dn(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ol(zn(i.anchor,t),zn(i.head,t)))}return Nn(r,e.sel.primIndex)}function Pn(e,t,r){return e.line==t.line?D(r.line,e.ch-t.ch+r.ch):D(r.line+(e.line-t.line),e.ch)}function Hn(e,t,r){for(var n=[],i=D(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Pn(l.from,i,o),c=Pn(En(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=P(u.head,u.anchor)<0;n[a]=new ol(d?c:s,d?s:c)}else n[a]=new ol(s,s)}return new il(n,e.sel.primIndex)}function In(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Fn(e)}function Fn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,wn(e,100),e.state.modeGen++,e.curOp&&pn(e)}function Rn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==m(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function jn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),Ct(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Ka(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=M(e,l.line),d=M(e,s.line),f=m(c),h=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Rn(e,t)){var g=a(0,c.length-1);o(d,d.text,h),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var v=a(1,c.length-1);v.push(new Ka(f+u.text.slice(s.ch),h,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),h);var y=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,y)}Ct(e,"change",e,t)}function Bn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function qn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,kr(e),In(e),Kn(e),e.options.lineWrapping||we(e),e.options.mode=t.modeOption,pn(e)}function Kn(e){("rtl"==e.doc.direction?l:ga)(e.display.lineDiv,"CodeMirror-rtl")}function Un(e){un(e,function(){Kn(e),pn(e)})}function Vn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Gn(e,t){var r={from:I(t.from),to:En(t),text:A(e,t.from,t.to)};return ei(e,r,t.from.line,t.to.line+1),Bn(e,function(e){return ei(e,r,t.from.line,t.to.line+1)},!0),r}function $n(e){for(;e.length;){if(!m(e).ranges)break;e.pop()}}function Yn(e,t){return t?($n(e.done),m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function Xn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Yn(i,i.lastOp==n)))a=m(o.changes),0==P(t.from,t.to)&&0==P(t.from,a.to)?a.to=En(t):o.changes.push(Gn(e,t));else{var s=m(i.done);for(s&&s.ranges||Qn(e.sel,i.done),o={changes:[Gn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Oe(e,"historyAdded")}function Zn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Jn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Zn(e,o,m(i.done),t))?i.done[i.done.length-1]=t:Qn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&$n(i.undone)}function Qn(e,t){var r=m(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ei(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ti(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ri(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ti(r[i]));return n}function ni(e,t){var r=ri(e,t),n=Q(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function ii(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?il.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&f(t,Number(u[1]))>-1&&(m(l)[d]=c[d],delete c[d])}}}return n}function oi(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=P(r,i)<0;o!=P(n,i)<0?(i=r,r=n):o!=P(r,n)<0&&(r=n)}return new ol(i,r)}return new ol(n||r,r)}function ai(e,t,r,n){fi(e,new il([oi(e,e.sel.primary(),t,r)],0),n)}function li(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=oi(e,e.sel.ranges[i],t[i],null);fi(e,Nn(n,e.sel.primIndex),r)}function si(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,fi(e,Nn(i,e.sel.primIndex),n)}function ci(e,t,r,n){fi(e,Wn(t,r),n)}function ui(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new ol(B(e,t[n].anchor),B(e,t[n].head))},origin:r&&r.origin};return Oe(e,"beforeSelectionChange",e,n),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Nn(n.ranges,n.ranges.length-1):t}function di(e,t,r){var n=e.history.done,i=m(n);i&&i.ranges?(n[n.length-1]=t,hi(e,t,r)):fi(e,t,r)}function fi(e,t,r){hi(e,t,r),Jn(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function hi(e,t,r){(Ee(e,"beforeSelectionChange")||e.cm&&Ee(e.cm,"beforeSelectionChange"))&&(t=ui(e,t,r)),pi(e,gi(e,t,r&&r.bias||(P(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||Qr(e.cm)}function pi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,We(e.cm)),Ct(e,"cursorActivity",e))}function mi(e){pi(e,gi(e,e.sel,null,!1),Ca)}function gi(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=yi(e,a.anchor,l&&l.anchor,r,n),c=yi(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ol(s,c))}return i?Nn(i,t.primIndex):t}function vi(e,t,r,n,i){var o=M(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Oe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=bi(e,c,-n,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=P(c,r))&&(n<0?u<0:u>0))return vi(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=bi(e,d,n,d.line==t.line?o:null)),d?vi(e,d,t,n,i):null}}return t}function yi(e,t,r,n,i){var o=n||1,a=vi(e,t,r,o,i)||!i&&vi(e,t,r,o,!0)||vi(e,t,r,-o,i)||!i&&vi(e,t,r,-o,!0);return a||(e.cantEdit=!0,D(e.first,0))}function bi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?B(e,D(t.line-1)):null:r>0&&t.ch==(n||M(e,t.line)).text.length?t.line<e.first+e.size-1?D(t.line+1,0):null:new D(t.line,t.ch+r)}function wi(e){e.setSelection(D(e.firstLine(),0),D(e.lastLine()),Ca)}function xi(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=B(e,t)),r&&(n.to=B(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Oe(e,"beforeChange",e,n),e.cm&&Oe(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ki(e,t,r){if(e.cm){if(!e.cm.curOp)return dn(e.cm,ki)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"))||(t=xi(e,t,!0))){var n=_a&&!r&&te(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ci(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Ci(e,t)}}function Ci(e,t){if(1!=t.text.length||""!=t.text[0]||0!=P(t.from,t.to)){var r=Dn(e,t);Xn(e,t,r,e.cm?e.cm.curOp.id:NaN),Li(e,t,r,Q(e,t));var n=[];Bn(e,function(e,r){r||-1!=f(n,e.history)||(Ni(e.history,t),n.push(e.history)),Li(e,t,null,Q(e,t))})}}function Si(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){
4
- for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(Qn(n,l),r&&!n.equals(e.sel))return void fi(e,n,{clearRedo:!1});o=n}var c=[];Qn(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"),d=n.changes.length-1;d>=0;--d){var h=function(r){var i=n.changes[r];if(i.origin=t,u&&!xi(e,i,!1))return a.length=0,{};c.push(Gn(e,i));var o=r?Dn(e,i):m(a);Li(e,i,o,ni(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:En(i)});var l=[];Bn(e,function(e,t){t||-1!=f(l,e.history)||(Ni(e.history,i),l.push(e.history)),Li(e,i,null,ni(e,i))})}(d);if(h)return h.v}}}}function Ti(e,t){if(0!=t&&(e.first+=t,e.sel=new il(g(e.sel.ranges,function(e){return new ol(D(e.anchor.line+t,e.anchor.ch),D(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)mn(e.cm,n,"gutter")}}function Li(e,t,r,n){if(e.cm&&!e.cm.curOp)return dn(e.cm,Li)(e,t,r,n);if(t.to.line<e.first)return void Ti(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ti(e,i),t={from:D(e.first,0),to:D(t.to.line+i,t.to.ch),text:[m(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:D(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=A(e,t.from,t.to),r||(r=Dn(e,t)),e.cm?Mi(e.cm,t,n):jn(e,t,n),hi(e,r,Ca)}}function Mi(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=N(de(M(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&We(e),jn(n,t,r,xr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),wn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pn(e):o.line!=a.line||1!=t.text.length||Rn(e.doc,t)?pn(e,o.line,a.line+1,c):mn(e,o.line,"text");var u=Ee(e,"changes"),d=Ee(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ct(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ai(e,t,r,n,i){if(n||(n=r),P(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),ki(e,{from:r,to:n,text:t,origin:i})}function _i(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Oi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)_i(o.ranges[l].anchor,t,r,n),_i(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=D(c.from.line+n,c.from.ch),c.to=D(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Ni(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Oi(e.done,r,n,i),Oi(e.undone,r,n,i)}function Wi(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=M(e,j(e,t)):i=N(t),null==i?null:(n(o,i)&&e.cm&&mn(e.cm,i,r),o)}function Ei(e,t,r){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Jr(e,null,r)}function zi(e,t,r,n){var i=new sl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Wi(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var n=ye(t)<e.scrollTop;O(t,t.height+Ht(i)),n&&Jr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),Ct(o,"lineWidgetAdded",o,i,"number"==typeof t?t:N(t)),i}function Di(e,t,r,n,o){if(n&&n.shared)return Pi(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return dn(e.cm,Di)(e,t,r,n,o);var a=new ul(e,o),l=P(t,r);if(n&&u(n,a,!1),l>0||0==l&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ue(e,t.line,t,r,a)||t.line!=r.line&&ue(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");V()}a.addToHistory&&Xn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,c=t.line,d=e.cm;if(e.iter(c,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&de(e)==d.display.maxLine&&(s=!0),a.collapsed&&c!=t.line&&O(e,0),X(e,new G(a,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),a.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&O(t,0)}),a.clearOnEnter&&za(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(U(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++cl,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)pn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)mn(d,f,"text");a.atomic&&mi(d.doc),Ct(d,"markerAdded",d,a)}return a}function Pi(e,t,r,n,i){n=u(n),n.shared=!1;var o=[Di(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Bn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Di(e,B(e,t),B(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=m(o)}),new dl(o,a)}function Hi(e){return e.findMarks(D(e.first,0),e.clipPos(D(e.lastLine())),function(e){return e.parent})}function Ii(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(P(o,a)){var l=Di(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function Fi(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];Bn(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==f(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}(t)}function Ri(e){var t=this;if(qi(t),!Ne(t,e)&&!It(t.display,e)){De(e),Zo&&(pl=+new Date);var r=Cr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=0;l<i;++l)!function(e,n){if(!t.options.allowDropFileTypes||-1!=f(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=dn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=B(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};ki(t.doc,s),di(t.doc,Wn(r,En(s)))}}),l.readAsText(e)}}(n[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var s=e.dataTransfer.getData("Text");if(s){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),hi(t.doc,Wn(r,r)),c)for(var u=0;u<c.length;++u)Ai(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function ji(e,t){if(Zo&&(!e.state.draggingText||+new Date-pl<100))return void Ie(t);if(!Ne(e,t)&&!It(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!na)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ra&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ra&&r.parentNode.removeChild(r)}}function Bi(e,t){var i=Cr(e,t);if(i){var o=document.createDocumentFragment();Mr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function qi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ki(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Ui(){ml||(Vi(),ml=!0)}function Vi(){var e;za(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ki(Gi)},100))}),za(window,"blur",function(){return Ki(Er)})}function Gi(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function $i(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Yi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=g(r.split(" "),$i),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Xi(e,t,r,n){t=Qi(t);var i=t.call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Xi(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Xi(e,t.fallthrough[o],r,n);if(a)return a}}}function Zi(e){var t="string"==typeof e?e:gl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ji(e,t){if(ra&&34==e.keyCode&&e.char)return!1;var r=gl[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(pa?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(pa?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function Qi(e){return"string"==typeof e?wl[e]:e}function eo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&P(o.from,m(n).to)<=0;){var a=n.pop();if(P(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ai(e.doc,"",n[t].from,n[t].to,"+delete");Qr(e)})}function to(e,t){var r=M(e.doc,t),n=de(r);return n!=r&&(t=N(n)),Le(!0,e,n,t,1)}function ro(e,t){var r=M(e.doc,t),n=fe(r);return n!=r&&(t=N(n)),Le(!0,e,r,t,-1)}function no(e,t){var r=to(e,t.line),n=M(e.doc,r.line),i=Ce(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return D(r.line,a?0:o,r.sticky)}return r}function io(e,t,r){if("string"==typeof t&&!(t=Cl[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ka}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function oo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Xi(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Xi(t,e.options.extraKeys,r,e)||Xi(t,e.options.keyMap,r,e)}function ao(e,t,r,n){var i=e.state.keySeq;if(i){if(Zi(t))return"handled";Sl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=oo(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ct(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(De(r),_r(e)),i&&!o&&/\'$/.test(t)?(De(r),!0):!!o}function lo(e,t){var r=Ji(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ao(e,"Shift-"+r,t,function(t){return io(e,t,!0)})||ao(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return io(e,t)}):ao(e,r,t,function(t){return io(e,t)}))}function so(e,t,r){return ao(e,"'"+r+"'",t,function(t){return io(e,t,!0)})}function co(e){var t=this;if(t.curOp.focus=a(),!Ne(t,e)){Zo&&Jo<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=lo(t,e);ra&&(Tl=n?r:null,!n&&88==r&&!Ia&&(ca?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||uo(t)}}function uo(e){function t(e){18!=e.keyCode&&e.altKey||(ga(r,"CodeMirror-crosshair"),_e(document,"keyup",t),_e(document,"mouseover",t))}var r=e.display.lineDiv;l(r,"CodeMirror-crosshair"),za(document,"keyup",t),za(document,"mouseover",t)}function fo(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ne(this,e)}function ho(e){var t=this;if(!(It(t.display,e)||Ne(t,e)||e.ctrlKey&&!e.altKey||ca&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ra&&r==Tl)return Tl=null,void De(e);if(!ra||e.which&&!(e.which<10)||!lo(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(so(t,e,i)||t.display.input.onKeyPress(e))}}}function po(e){var t=this,r=t.display;if(!(Ne(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,It(r,e))return void(Qo||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!bo(t,e)){var n=Cr(t,e);switch(window.focus(),Re(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?mo(t,e,n):Fe(e)==r.scroller&&De(e);break;case 2:Qo&&(t.state.lastMiddleDown=+new Date),n&&ai(t.doc,n),setTimeout(function(){return r.input.focus()},20),De(e);break;case 3:ma?wo(t,e):Nr(t)}}}}function mo(e,t,r){Zo?setTimeout(c(Or,e),0):e.curOp.focus=a();var n,i=+new Date;kl&&kl.time>i-400&&0==P(kl.pos,r)?n="triple":xl&&xl.time>i-400&&0==P(xl.pos,r)?(n="double",kl={time:i,pos:r}):(n="single",xl={time:i,pos:r});var o,l=e.doc.sel,s=ca?t.metaKey:t.ctrlKey;e.options.dragDrop&&Da&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(P((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(P(o.to(),r)>0||r.xRel<0)?go(e,t,r,s):vo(e,t,r,n,s)}function go(e,t,r,n){var i=e.display,o=+new Date,a=dn(e,function(l){Qo&&(i.scroller.draggable=!1),e.state.draggingText=!1,_e(document,"mouseup",a),_e(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(De(l),!n&&+new Date-200<o&&ai(e.doc,r),Qo||Zo&&9==Jo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});Qo&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=ca?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),za(document,"mouseup",a),za(i.scroller,"drop",a)}function vo(e,t,r,n,i){function o(t){if(0!=P(b,t))if(b=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=d(M(u,r.line).text,r.ch,o),l=d(M(u,t.line).text,t.ch,o),s=Math.min(a,l),c=Math.max(a,l),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var y=M(u,g).text,w=h(y,s,o);s==c?i.push(new ol(D(g,w),D(g,w))):y.length>w&&i.push(new ol(D(g,w),D(g,h(y,c,o))))}i.length||i.push(new ol(r,r)),fi(u,Nn(m.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=f,k=x.anchor,C=t;if("single"!=n){var S;S="double"==n?e.findWordAt(t):new ol(D(t.line,0),B(u,D(t.line+1,0))),P(S.anchor,k)>0?(C=S.head,k=R(x.from(),S.anchor)):(C=S.anchor,k=F(x.to(),S.head))}var T=m.ranges.slice(0);T[p]=new ol(B(u,k),C),fi(u,Nn(T,p),Sa)}}function l(t){var r=++x,i=Cr(e,t,!0,"rect"==n);if(i)if(0!=P(i,b)){e.curOp.focus=a(),o(i);var s=Ir(c,u);(i.line>=s.to||i.line<s.from)&&setTimeout(dn(e,function(){x==r&&l(t)}),150)}else{var d=t.clientY<w.top?-20:t.clientY>w.bottom?20:0;d&&setTimeout(dn(e,function(){x==r&&(c.scroller.scrollTop+=d,l(t))}),50)}}function s(t){e.state.selectingText=!1,x=1/0,De(t),c.input.focus(),_e(document,"mousemove",k),_e(document,"mouseup",C),u.history.lastSelOrigin=null}var c=e.display,u=e.doc;De(t);var f,p,m=u.sel,g=m.ranges;if(i&&!t.shiftKey?(p=u.sel.contains(r),f=p>-1?g[p]:new ol(r,r)):(f=u.sel.primary(),p=u.sel.primIndex),ua?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(f=new ol(r,r)),r=Cr(e,t,!0,!0),p=-1;else if("double"==n){var v=e.findWordAt(r);f=e.display.shift||u.extend?oi(u,f,v.anchor,v.head):v}else if("triple"==n){var y=new ol(D(r.line,0),B(u,D(r.line+1,0)));f=e.display.shift||u.extend?oi(u,f,y.anchor,y.head):y}else f=oi(u,f,r);i?-1==p?(p=g.length,fi(u,Nn(g.concat([f]),p),{scroll:!1,origin:"*mouse"})):g.length>1&&g[p].empty()&&"single"==n&&!t.shiftKey?(fi(u,Nn(g.slice(0,p).concat(g.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):si(u,p,f,Sa):(p=0,fi(u,new il([f],0),Sa),m=u.sel);var b=r,w=c.wrapper.getBoundingClientRect(),x=0,k=dn(e,function(e){Re(e)?l(e):s(e)}),C=dn(e,s);e.state.selectingText=C,za(document,"mousemove",k),za(document,"mouseup",C)}function yo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&De(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ee(e,r))return He(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){return Oe(e,r,e,W(e.doc,o),e.options.gutters[s],t),He(t)}}}function bo(e,t){return yo(e,t,"gutterClick",!0)}function wo(e,t){It(e.display,t)||xo(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xo(e,t){return!!Ee(e,"gutterContextMenu")&&yo(e,t,"gutterContextMenu",!1)}function ko(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ir(e)}function Co(e){_n(e),pn(e),zr(e)}function So(e,t,r){if(!t!=!(r&&r!=Ll)){var n=e.display.dragFunctions,i=t?za:_e;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function To(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ga(e.display.wrapper,"CodeMirror-wrap"),we(e)),kr(e),pn(e),ir(e),setTimeout(function(){return Ur(e)},100)}function Lo(e,t){var r=this;if(!(this instanceof Lo))return new Lo(e,t);this.options=t=t?u(t):{},u(Ml,t,!1),On(t);var n=t.value;"string"==typeof n&&(n=new hl(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new Lo.inputStyles[t.inputStyle](this),o=this.display=new L(e,n,i);o.wrapper.CodeMirror=this,_n(this),ko(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ya,keySeq:null,specialChars:null},t.autofocus&&!sa&&o.input.focus(),Zo&&Jo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Mo(this),Ui(),tn(this),this.curOp.forceUpdate=!0,qn(this,n),t.autofocus&&!sa||this.hasFocus()?setTimeout(c(Wr,this),20):Er(this);for(var a in Al)Al.hasOwnProperty(a)&&Al[a](r,t[a],Ll);Dr(this),t.finishInit&&t.finishInit(this);for(var l=0;l<_l.length;++l)_l[l](r);rn(this),Qo&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Mo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;za(i.scroller,"mousedown",dn(e,po)),Zo&&Jo<11?za(i.scroller,"dblclick",dn(e,function(t){if(!Ne(e,t)){var r=Cr(e,t);if(r&&!bo(e,t)&&!It(e.display,t)){De(t);var n=e.findWordAt(r);ai(e.doc,n.anchor,n.head)}}})):za(i.scroller,"dblclick",function(t){return Ne(e,t)||De(t)}),ma||za(i.scroller,"contextmenu",function(t){return wo(e,t)});var o,a={end:0};za(i.scroller,"touchstart",function(t){if(!Ne(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),za(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),za(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!It(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new ol(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new ol(D(l.line,0),B(e.doc,D(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),De(r)}t()}),za(i.scroller,"touchcancel",t),za(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Fr(e,i.scroller.scrollTop),Rr(e,i.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),za(i.scroller,"mousewheel",function(t){return qr(e,t)}),za(i.scroller,"DOMMouseScroll",function(t){return qr(e,t)}),za(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ne(e,t)||Ie(t)},over:function(t){Ne(e,t)||(Bi(e,t),Ie(t))},start:function(t){return ji(e,t)},drop:dn(e,Ri),leave:function(t){Ne(e,t)||qi(e)}};var l=i.input.getField();za(l,"keyup",function(t){return fo.call(e,t)}),za(l,"keydown",dn(e,co)),za(l,"keypress",dn(e,ho)),za(l,"focus",function(t){return Wr(e,t)}),za(l,"blur",function(t){return Er(e,t)})}function Ao(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t):r="prev");var a=e.options.tabSize,l=M(o,t),s=d(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==ka||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?d(M(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,f+="\t";if(h<c&&(f+=p(c-h)),f!=u)return Ai(o,f,D(t,0),D(t,u.length),"+input"),l.stateAfter=null,!0;for(var g=0;g<o.sel.ranges.length;g++){var v=o.sel.ranges[g];if(v.head.line==t&&v.head.ch<u.length){var y=D(t,u.length);si(o,g,new ol(y,y));break}}}function _o(e){Ol=e}function Oo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Pa(t),s=null;if(a&&n.ranges.length>1)if(Ol&&Ol.text.join("\n")==t){if(n.ranges.length%Ol.text.length==0){s=[];for(var c=0;c<Ol.text.length;c++)s.push(o.splitLines(Ol.text[c]))}}else l.length==n.ranges.length&&(s=g(l,function(e){return[e]}));for(var u,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],h=f.from(),p=f.to();f.empty()&&(r&&r>0?h=D(h.line,h.ch-r):e.state.overwrite&&!a?p=D(p.line,Math.min(M(o,p.line).text.length,p.ch+m(l).length)):Ol&&Ol.lineWise&&Ol.text.join("\n")==t&&(h=p=D(h.line,0))),u=e.curOp.updateInput;var v={from:h,to:p,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};ki(e.doc,v),Ct(e,"inputRead",e,v)}t&&!a&&Wo(e,t),Qr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function No(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Oo(t,r,0,null,"paste")}),!0}function Wo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Ao(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ao(e,i.head.line,"smart"));a&&Ct(e,"electricInput",e,i.head.line)}}}function Eo(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:D(i,0),head:D(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function zo(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Do(){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 Qo?e.style.width="1000px":e.setAttribute("wrap","off"),aa&&(e.style.border="1px solid black"),zo(e),t}function Po(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new D(n,t.ch,t.sticky),c=M(e,n))}function a(n){var a;if(null==(a=i?Me(e.cm,c,t,r):Te(c,t,r))){if(n||!o())return!1;t=Le(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=M(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||a(!h);h=!1){var p=c.text.charAt(t.ch)||"\n",m=x(p,f)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||h||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!h))break}var g=yi(e,t,l,s,!0);return H(l,g)&&(g.hitSide=!0),g}function Ho(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=hr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Io(e,t){var r=Yt(e,t.line);if(!r||r.hidden)return null;var n=M(e.doc,t.line),i=Vt(r,n,t.line),o=Ce(n,e.doc.direction),a="left";if(o){a=ke(o,t.ch)%2?"right":"left"}var l=Jt(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Fo(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ro(e,t){return t&&(e.bad=!0),e}function jo(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(){u&&(c+=d,u=!1)}function l(e){e&&(a(),c+=e)}function s(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void l(r||t.textContent.replace(/\u200b/g,""));var c,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(D(n,0),D(i+1,0),o(+f));return void(h.length&&(c=h[0].find())&&l(A(e.doc,c.from,c.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&a();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);p&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue)}for(var c="",u=!1,d=e.doc.lineSeparator();s(t),t!=r;)t=t.nextSibling;return c}function Bo(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ro(e.clipPos(D(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return qo(o,t,r)}}function qo(e,t,r){function n(t,r,n){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=N(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),D(s,c)}}}var i=e.text.firstChild,a=!1;if(!t||!o(i,t))return Ro(D(N(e.line),0),!0);if(t==i&&(a=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?m(e.rest):e.line;return Ro(D(N(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,d=u.maps,f=n(s,c,r);if(f)return Ro(f,a);for(var h=c.nextSibling,p=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return Ro(D(f.line,f.ch-p),a);p+=h.textContent.length}for(var g=c.previousSibling,v=r;g;g=g.previousSibling){if(f=n(g,g.firstChild,-1))return Ro(D(f.line,f.ch+v),a);v+=g.textContent.length}}function Ko(e,t){function r(){e.value=s.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=a();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(za(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Lo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}var Uo=navigator.userAgent,Vo=navigator.platform,Go=/gecko\/\d/i.test(Uo),$o=/MSIE \d/.test(Uo),Yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Uo),Xo=/Edge\/(\d+)/.exec(Uo),Zo=$o||Yo||Xo,Jo=Zo&&($o?document.documentMode||6:+(Xo||Yo)[1]),Qo=!Xo&&/WebKit\//.test(Uo),ea=Qo&&/Qt\/\d+\.\d+/.test(Uo),ta=!Xo&&/Chrome\//.test(Uo),ra=/Opera\//.test(Uo),na=/Apple Computer/.test(navigator.vendor),ia=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Uo),oa=/PhantomJS/.test(Uo),aa=!Xo&&/AppleWebKit/.test(Uo)&&/Mobile\/\w+/.test(Uo),la=/Android/.test(Uo),sa=aa||la||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Uo),ca=aa||/Mac/.test(Vo),ua=/\bCrOS\b/.test(Uo),da=/win/i.test(Vo),fa=ra&&Uo.match(/Version\/(\d*\.\d*)/);fa&&(fa=Number(fa[1])),fa&&fa>=15&&(ra=!1,Qo=!0);var ha,pa=ca&&(ea||ra&&(null==fa||fa<12.11)),ma=Go||Zo&&Jo>=9,ga=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};ha=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var va=function(e){e.select()};aa?va=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Zo&&(va=function(e){try{e.select()}catch(e){}});var ya=function(){this.id=null};ya.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ba,wa,xa=30,ka={toString:function(){return"CodeMirror.Pass"}},Ca={scroll:!1},Sa={origin:"*mouse"},Ta={origin:"+move"
5
- },La=[""],Ma=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Aa=/[\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]/,_a=!1,Oa=!1,Na=null,Wa=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(r,n){var c="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var u=r.length,d=[],f=0;f<u;++f)d.push(e(r.charCodeAt(f)));for(var h=0,p=c;h<u;++h){var g=d[h];"m"==g?d[h]=p:p=g}for(var v=0,y=c;v<u;++v){var b=d[v];"1"==b&&"r"==y?d[v]="n":a.test(b)&&(y=b,"r"==b&&(d[v]="R"))}for(var w=1,x=d[0];w<u-1;++w){var k=d[w];"+"==k&&"1"==x&&"1"==d[w+1]?d[w]="1":","!=k||x!=d[w+1]||"1"!=x&&"n"!=x||(d[w]=x),x=k}for(var C=0;C<u;++C){var S=d[C];if(","==S)d[C]="N";else if("%"==S){var T=void 0;for(T=C+1;T<u&&"%"==d[T];++T);for(var L=C&&"!"==d[C-1]||T<u&&"1"==d[T]?"1":"N",M=C;M<T;++M)d[M]=L;C=T-1}}for(var A=0,_=c;A<u;++A){var O=d[A];"L"==_&&"1"==O?d[A]="L":a.test(O)&&(_=O)}for(var N=0;N<u;++N)if(o.test(d[N])){var W=void 0;for(W=N+1;W<u&&o.test(d[W]);++W);for(var E="L"==(N?d[N-1]:c),z="L"==(W<u?d[W]:c),D=E==z?E?"L":"R":c,P=N;P<W;++P)d[P]=D;N=W-1}for(var H,I=[],F=0;F<u;)if(l.test(d[F])){var R=F;for(++F;F<u&&l.test(d[F]);++F);I.push(new t(0,R,F))}else{var j=F,B=I.length;for(++F;F<u&&"L"!=d[F];++F);for(var q=j;q<F;)if(s.test(d[q])){j<q&&I.splice(B,0,new t(1,j,q));var K=q;for(++q;q<F&&s.test(d[q]);++q);I.splice(B,0,new t(2,K,q)),j=q}else++q;j<F&&I.splice(B,0,new t(1,j,F))}return 1==I[0].level&&(H=r.match(/^\s+/))&&(I[0].from=H[0].length,I.unshift(new t(0,0,H[0].length))),1==m(I).level&&(H=r.match(/\s+$/))&&(m(I).to-=H[0].length,I.push(new t(0,u-H[0].length,u))),"rtl"==n?I.reverse():I}}(),Ea=[],za=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Ea).concat(r)}},Da=function(){if(Zo&&Jo<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Pa=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ha=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)},Ia=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Fa=null,Ra={},ja={},Ba={},qa=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};qa.prototype.eol=function(){return this.pos>=this.string.length},qa.prototype.sol=function(){return this.pos==this.lineStart},qa.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qa.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qa.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},qa.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qa.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},qa.prototype.skipToEnd=function(){this.pos=this.string.length},qa.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qa.prototype.backUp=function(e){this.pos-=e},qa.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},qa.prototype.indentation=function(){return d(this.string,null,this.tabSize)-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},qa.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},qa.prototype.current=function(){return this.string.slice(this.start,this.pos)},qa.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Ka=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};Ka.prototype.lineNo=function(){return N(this)},ze(Ka);var Ua,Va={},Ga={},$a=null,Ya=null,Xa={left:0,right:0,top:0,bottom:0},Za=0,Ja=null;Zo?Ja=-.53:Go?Ja=15:ta?Ja=-.7:na&&(Ja=-1/3);var Qa=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),za(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),za(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Zo&&Jo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Qa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Qa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Qa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Qa.prototype.zeroWidthHack=function(){var e=ca&&!ia?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ya,this.disableVert=new ya},Qa.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect();document.elementFromPoint(n.left+1,n.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Qa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var el=function(){};el.prototype.update=function(){return{bottom:0,right:0}},el.prototype.setScrollLeft=function(){},el.prototype.setScrollTop=function(){},el.prototype.clear=function(){};var tl={native:Qa,null:el},rl=0,nl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ir(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=qt(e),this.force=r,this.dims=br(e),this.events=[]};nl.prototype.signal=function(e,t){Ee(e,t)&&this.events.push(arguments)},nl.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Oe.apply(null,e.events[t])};var il=function(e,t){this.ranges=e,this.primIndex=t};il.prototype.primary=function(){return this.ranges[this.primIndex]},il.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!H(n.anchor,i.anchor)||!H(n.head,i.head))return!1}return!0},il.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new ol(I(e.ranges[r].anchor),I(e.ranges[r].head));return new il(t,this.primIndex)},il.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},il.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(P(t,i.from())>=0&&P(e,i.to())<=0)return n}return-1};var ol=function(e,t){this.anchor=e,this.head=t};ol.prototype.from=function(){return R(this.anchor,this.head)},ol.prototype.to=function(){return F(this.anchor,this.head)},ol.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var al=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r};al.prototype.chunkSize=function(){return this.lines.length},al.prototype.removeInner=function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ct(o),Ct(o,"delete")}this.lines.splice(e,t)},al.prototype.collapse=function(e){e.push.apply(e,this.lines)},al.prototype.insertInner=function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},al.prototype.iterN=function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0};var ll=function(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null};ll.prototype.chunkSize=function(){return this.size},ll.prototype.removeInner=function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof al))){var s=[];this.collapse(s),this.children=[new al(s)],this.children[0].parent=this}},ll.prototype.collapse=function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},ll.prototype.insertInner=function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new al(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},ll.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ll(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=f(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new ll(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},ll.prototype.iterN=function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}};var sl=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};sl.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=N(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=Ht(this);O(n,Math.max(0,n.height-a)),t&&(un(t,function(){Ei(t,n,-a),mn(t,i,"widget")}),Ct(t,"lineWidgetCleared",t,this,i))}},sl.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Ht(this)-t;i&&(O(n,n.height+i),r&&un(r,function(){r.curOp.forceUpdate=!0,Ei(r,n,i),Ct(r,"lineWidgetChanged",r,e,N(n))}))},ze(sl);var cl=0,ul=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++cl};ul.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&tn(t),Ee(this,"clear")){var n=this.find();n&&Ct(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=$(l.markedSpans,e);t&&!e.collapsed?mn(t,N(l),"text"):t&&(null!=s.to&&(o=N(l)),null!=s.from&&(i=N(l))),l.markedSpans=Y(l.markedSpans,s),null==s.from&&e.collapsed&&!ge(e.doc,l)&&t&&O(l,vr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=de(e.lines[c]),d=be(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&pn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&mi(t.doc)),t&&Ct(t,"markerCleared",t,this,i,o),r&&rn(t),this.parent&&this.parent.clear()}},ul.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=$(a.markedSpans,r);if(null!=l.from&&(n=D(t?a:N(a),l.from),-1==e))return n;if(null!=l.to&&(i=D(t?a:N(a),l.to),1==e))return i}return n&&{from:n,to:i}},ul.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&un(n,function(){var i=t.line,o=N(t.line),a=Yt(n,o);if(a&&(rr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ge(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Ht(r)-l;s&&O(i,i.height+s)}Ct(n,"markerChanged",n,e)})},ul.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=f(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ul.prototype.detachLine=function(e){if(this.lines.splice(f(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ze(ul);var dl=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};dl.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Ct(this,"clear")}},dl.prototype.find=function(e,t){return this.primary.find(e,t)},ze(dl);var fl=0,hl=function(e,t,r,n,i){if(!(this instanceof hl))return new hl(e,t,r,n,i);null==r&&(r=0),ll.call(this,[new al([new Ka("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var o=D(r,0);this.sel=Wn(o),this.history=new Vn(null),this.id=++fl,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),jn(this,{from:o,to:o,text:e}),fi(this,Wn(o),Ca)};hl.prototype=b(ll.prototype,{constructor:hl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=_(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=D(this.first,0),r=this.first+this.size-1;ki(this,{from:t,to:D(r,M(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),fi(this,Wn(t))}),replaceRange:function(e,t,r,n){t=B(this,t),r=r?B(this,r):t,Ai(this,e,t,r,n)},getRange:function(e,t,r){var n=A(this,B(this,e),B(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(E(this,e))return M(this,e)},getLineNumber:function(e){return N(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=M(this,e)),de(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return B(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:hn(function(e,t,r){ci(this,B(this,"number"==typeof e?D(e,t||0):e),null,r)}),setSelection:hn(function(e,t,r){ci(this,B(this,e),B(this,t||e),r)}),extendSelection:hn(function(e,t,r){ai(this,B(this,e),t&&B(this,t),r)}),extendSelections:hn(function(e,t){li(this,K(this,e),t)}),extendSelectionsBy:hn(function(e,t){li(this,K(this,g(this.sel.ranges,e)),t)}),setSelections:hn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new ol(B(n,e[o].anchor),B(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),fi(this,Nn(i,t),r)}}),addSelection:hn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ol(B(this,e),B(this,t||e))),fi(this,Nn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=A(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=A(t,n[i].from(),n[i].to());!1!==e&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:hn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&Hn(this,i,t),c=i.length-1;c>=0;c--)ki(n,i[c]);s?di(this,s):this.cm&&Qr(this.cm)}),undo:hn(function(){Si(this,"undo")}),redo:hn(function(){Si(this,"redo")}),undoSelection:hn(function(){Si(this,"undo",!0)}),redoSelection:hn(function(){Si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Vn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ii(this.history.done),undone:ii(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=ii(e.done.slice(0),null,!0),t.undone=ii(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,r){return Wi(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&k(n)&&(e.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Wi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,k(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!E(this,e))return null;if(t=e,!(e=M(this,e)))return null}else if(null==(t=N(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:hn(function(t,r,n){return Wi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:hn(function(t,r,n){return Wi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:hn(function(e,t,r){return zi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Di(this,B(this,e),B(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=B(this,e),Di(this,e,e,r,"bookmark")},findMarksAt:function(e){e=B(this,e);var t=[],r=M(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=B(this,e),t=B(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),B(this,D(r,t))},indexFromPos:function(e){e=B(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new hl(_(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new hl(_(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ii(n,Hi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Lo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Fi(Hi(t));break}}if(e.history==this.history){var i=[e.id];Bn(e,function(e){return i.push(e.id)},!0),e.history=new Vn(null),e.history.done=ii(this.history.done,i),e.history.undone=ii(this.history.undone,i)}},iterLinkedDocs:function(e){Bn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pa(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:hn(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Un(this.cm))})}),hl.prototype.eachLine=hl.prototype.iter;for(var pl=0,ml=!1,gl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},vl=0;vl<10;vl++)gl[vl+48]=gl[vl+96]=String(vl);for(var yl=65;yl<=90;yl++)gl[yl]=String.fromCharCode(yl);for(var bl=1;bl<=12;bl++)gl[bl+111]=gl[bl+63235]="F"+bl;var wl={};wl.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"},wl.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"},wl.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"},wl.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"]},wl.default=ca?wl.macDefault:wl.pcDefault;var xl,kl,Cl={selectAll:wi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ca)},killLine:function(e){return eo(e,function(t){if(t.empty()){var r=M(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:D(t.head.line+1,0)}:{from:t.head,to:D(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return eo(e,function(t){return{from:D(t.from().line,0),to:B(e.doc,D(t.to().line+1,0))}})},delLineLeft:function(e){return eo(e,function(e){return{from:D(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return eo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(D(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(D(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return to(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return no(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ro(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ta)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ta)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?no(e,t.head):n},Ta)},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")},
6
- insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=d(e.getLine(o.line),o.ch,n);t.push(p(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=M(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new D(i.line,i.ch-1)),i.ch>0)i=new D(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),D(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=M(e.doc,i.line-1).text;a&&(i=new D(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),D(i.line-1,a.length-1),i,"+transpose"))}r.push(new ol(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Qr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Sl=new ya,Tl=null,Ll={toString:function(){return"CodeMirror.Init"}},Ml={},Al={};Lo.defaults=Ml,Lo.optionHandlers=Al;var _l=[];Lo.defineInitHook=function(e){return _l.push(e)};var Ol=null,Nl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ya,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Nl.prototype.init=function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())_o({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Eo(i);_o({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ca),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Ol.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var a=Do(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Ol.text.join("\n");var s=document.activeElement;va(l),setTimeout(function(){i.display.lineSpace.removeChild(a),s.focus(),s==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;zo(o,i.options.spellcheck),za(o,"paste",function(e){Ne(i,e)||No(e,i)||Jo<=11&&setTimeout(dn(i,function(){return r.updateFromDOM()}),20)}),za(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),za(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),za(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),za(o,"touchstart",function(){return n.forceCompositionEnd()}),za(o,"input",function(){r.composing||r.readFromDOMSoon()}),za(o,"copy",t),za(o,"cut",t)},Nl.prototype.prepareSelection=function(){var e=Lr(this.cm,!1);return e.focus=this.cm.state.focused,e},Nl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Nl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Bo(this.cm,e.anchorNode,e.anchorOffset),n=Bo(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=P(R(r,n),t.from())||0!=P(F(r,n),t.to())){var i=Io(this.cm,t.from()),o=Io(this.cm,t.to());if(!i&&!o)return void e.removeAllRanges();var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};var u;try{u=ha(i.node,i.offset,o.offset,o.node)}catch(e){}u&&(!Go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||(e.removeAllRanges(),e.addRange(u))):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):Go&&this.startGracePeriod()),this.rememberSelection()}},Nl.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)},Nl.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},Nl.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Nl.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},Nl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Nl.prototype.blur=function(){this.div.blur()},Nl.prototype.getField=function(){return this.div},Nl.prototype.supportsTouch=function(){return!0},Nl.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Nl.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Nl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(la&&ta&&this.cm.options.gutters.length&&Fo(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Bo(t,e.anchorNode,e.anchorOffset),n=Bo(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){fi(t.doc,Wn(r,n),Ca),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Nl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=D(n.line-1,M(e.doc,n.line-1).length)),i.ch==M(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=D(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(a=N(t.view[0].line),l=t.view[0].node):(a=N(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Sr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=N(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(jo(e,l,c,a,s)),f=A(e.doc,D(a,0),D(s,M(e.doc,s).text.length));d.length>1&&f.length>1;)if(m(d)==m(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,p=0,g=d[0],v=f[0],y=Math.min(g.length,v.length);h<y&&g.charCodeAt(h)==v.charCodeAt(h);)++h;for(var b=m(d),w=m(f),x=Math.min(b.length-(1==d.length?h:0),w.length-(1==f.length?h:0));p<x&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==d.length&&1==f.length&&a==n.line)for(;h&&h>n.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)h--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=D(a,h),C=D(s,f.length?m(f).length-p:0);return d.length>1||d[0]||P(k,C)?(Ai(e.doc,d,k,C,"+input"),!0):void 0},Nl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Nl.prototype.reset=function(){this.forceCompositionEnd()},Nl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Nl.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))},Nl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||un(this.cm,function(){return pn(e.cm)})},Nl.prototype.setUneditable=function(e){e.contentEditable="false"},Nl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||dn(this.cm,Oo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Nl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Nl.prototype.onContextMenu=function(){},Nl.prototype.resetPosition=function(){},Nl.prototype.needsContentAttribute=!0;var Wl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ya,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Wl.prototype.init=function(e){function t(e){if(!Ne(i,e)){if(i.somethingSelected())_o({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Ol.text.join("\n"),va(a));else{if(!i.options.lineWiseCopyCut)return;var t=Eo(i);_o({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ca):(n.prevInput="",a.value=t.text.join("\n"),va(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Do(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),aa&&(a.style.width="0px"),za(a,"input",function(){Zo&&Jo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),za(a,"paste",function(e){Ne(i,e)||No(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),za(a,"cut",t),za(a,"copy",t),za(e.scroller,"paste",function(t){It(e,t)||Ne(i,t)||(i.state.pasteIncoming=!0,n.focus())}),za(e.lineSpace,"selectstart",function(t){It(e,t)||De(t)}),za(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),za(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Wl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Lr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Wl.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wl.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Ia&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&va(this.textarea),Zo&&Jo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",Zo&&Jo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Wl.prototype.getField=function(){return this.textarea},Wl.prototype.supportsTouch=function(){return!1},Wl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!sa||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wl.prototype.blur=function(){this.textarea.blur()},Wl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wl.prototype.receivedFocus=function(){this.slowPoll()},Wl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Wl.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Wl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ha(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(Zo&&Jo>=9&&this.hasSelection===i||ca&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return un(t,function(){Oo(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Wl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wl.prototype.onKeyPress=function(){Zo&&Jo>=9&&(this.hasSelection=null),this.fastPoll()},Wl.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=u,a.style.cssText=c,Zo&&Jo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!Zo||Zo&&Jo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?dn(i,wi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=Cr(i,e),s=o.scroller.scrollTop;if(l&&!ra){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&dn(i,fi)(i.doc,Wn(l),Ca);var c=a.style.cssText,u=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var d=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(Zo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Qo&&(f=window.scrollY),o.input.focus(),Qo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Zo&&Jo>=9&&t(),ma){Ie(e);var h=function(){_e(window,"mouseup",h),setTimeout(r,20)};za(window,"mouseup",h)}else setTimeout(r,50)}},Wl.prototype.readOnlyChanged=function(e){e||this.reset()},Wl.prototype.setUneditable=function(){},Wl.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Ll&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Ll,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,In(e)},!0),t("indentUnit",2,In,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Fn(e),ir(e),pn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(D(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ai(e.doc,t,r[i],D(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ll&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",sa?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!da),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){ko(e),Co(e)},!0),t("keyMap","default",function(e,t,r){var n=Qi(t),i=r!=Ll&&Qi(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,To,!0),t("gutters",[],function(e){On(e.options),Co(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?wr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Ur(e)},!0),t("scrollbarStyle","native",function(e){Gr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){On(e.options),Co(e)},!0),t("firstLineNumber",1,Co,!0),t("lineNumberFormatter",function(e){return e},Co,!0),t("showCursorWhenSelecting",!1,Tr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Er(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,So),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Tr,!0),t("singleCursorHeightPerLine",!0,Tr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Fn,!0),t("addModeClass",!1,Fn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Fn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Lo),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&dn(this,t[e])(this,r,i),Oe(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"](Qi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:fn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,pn(this)}),removeOverlay:fn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void pn(t)}}),indentLine:fn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),E(this.doc,e)&&Ao(this,e,t,r)}),indentSelection:fn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Ao(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Qr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Ao(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&si(t.doc,i,new ol(a,u[i].to()),Ca)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,D(e),t,!0)},getTokenTypeAt:function(e){e=B(this.doc,e);var t,r=Qe(this,M(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&-1==f(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=j(r,null==e?r.first+r.size-1:e),et(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?B(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return cr(this,B(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),hr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,W(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=M(this.doc,e)}else n=e;return lr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,B(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Xr(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:fn(co),triggerOnKeyPress:fn(ho),triggerOnKeyUp:fo,execCommand:function(e){if(Cl.hasOwnProperty(e))return Cl[e].call(null,this)},triggerElectric:fn(function(e){Wo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=B(this.doc,e),l=0;l<t&&(a=Po(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:fn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Po(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Ta)}),deleteH:fn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):eo(this,function(r){var i=Po(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=B(this.doc,e),s=0;s<t;++s){var c=ur(i,l,"div");if(null==a?a=c.left:c.left=a,l=Ho(i,c,o,r),l.hitSide)break}return l},moveV:fn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=ur(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Ho(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Jr(r,null,cr(r,s,"div").top-l.top),s},Ta),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=M(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var a=r.charAt(n),l=x(a,o)?function(e){return x(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!x(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new ol(D(e.line,n),D(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):ga(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==a()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:fn(function(e,t){null==e&&null==t||en(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Bt(this)-this.display.barHeight,width:e.scrollWidth-Bt(this)-this.display.barWidth,clientHeight:Kt(this),clientWidth:qt(this)}},scrollIntoView:fn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:D(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)en(this),this.curOp.scrollToPos=e;else{var r=Zr(this,{left:Math.min(e.from.left,e.to.left),top:Math.min(e.from.top,e.to.top)-e.margin,right:Math.max(e.from.right,e.to.right),bottom:Math.max(e.from.bottom,e.to.bottom)+e.margin});this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:fn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&nr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:fn(function(){var e=this.display.cachedTextHeight;pn(this),this.curOp.forceUpdate=!0,ir(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),Mn(this),(null==e||Math.abs(e-vr(this.display))>.5)&&kr(this),Oe(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,qn(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ze(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Lo);var El="iter insert remove copy getEditor constructor".split(" ");for(var zl in hl.prototype)hl.prototype.hasOwnProperty(zl)&&f(El,zl)<0&&(Lo.prototype[zl]=function(e){return function(){return e.apply(this.doc,arguments)}}(hl.prototype[zl]));return ze(hl),Lo.inputStyles={textarea:Wl,contenteditable:Nl},Lo.defineMode=function(e){Lo.defaults.mode||"null"==e||(Lo.defaults.mode=e),Ke.apply(this,arguments)},Lo.defineMIME=Ue,Lo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Lo.defineMIME("text/plain","null"),Lo.defineExtension=function(e,t){Lo.prototype[e]=t},Lo.defineDocExtension=function(e,t){hl.prototype[e]=t},Lo.fromTextArea=Ko,function(e){e.off=_e,e.on=za,e.wheelEventPixels=Br,e.Doc=hl,e.splitLines=Pa,e.countColumn=d,e.findColumn=h,e.isWordChar=w,e.Pass=ka,e.signal=Oe,e.Line=Ka,e.changeEnd=En,e.scrollbarModel=tl,e.Pos=D,e.cmpPos=P,e.modes=Ra,e.mimeModes=ja,e.resolveMode=Ve,e.getMode=Ge,e.modeExtensions=Ba,e.extendMode=$e,e.copyState=Ye,e.startState=Ze,e.innerMode=Xe,e.commands=Cl,e.keyMap=wl,e.keyName=Ji,e.isModifierKey=Zi,e.lookupKey=Xi,e.normalizeKeyMap=Yi,e.StringStream=qa,e.SharedTextMarker=dl,e.TextMarker=ul,e.LineWidget=sl,e.e_preventDefault=De,e.e_stopPropagation=Pe,e.e_stop=Ie,e.addClass=l,e.contains=o,e.rmClass=ga,e.keyNames=gl}(Lo),Lo.version="5.25.0",Lo})},{}],16:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return p=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(!1!==i)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(!1===n?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return N[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();m=M.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},T=r.counterDescriptors||{},L=r.colorKeywords||{},M=r.valueKeywords||{},A=r.allowNested,_=r.lineComment,O=!0===r.supportsAtComponent,N={};return N.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(O&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return s(r,t,"parens")}return r.context.type},N.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):C.hasOwnProperty(n)?(m="string-2","maybeprop"):A?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?N.top(e,t,r):(m="error","block")},N.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},
7
- N.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&A)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},N.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},N.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},N.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},N.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):N.atBlock(e,t,r)},N.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,A?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},N.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,A?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},N.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):N.atBlock(e,t,r)},N.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},N.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!T.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},N.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},N.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},N.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),m=r,t.state=N[t.state](p,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g),r=r.prev):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:_,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","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"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(h).concat(b).concat(x);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})},{"../../lib/codemirror":15}],17:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t||(s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^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"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,d=c.token(n,o.htmlState),f=/\btag\b/.test(d);if(f&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),m=e.getMode(r,p),g=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(c)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},{"../../lib/codemirror":15,"../css/css":16,"../javascript/javascript":18,"../xml/xml":19}],18:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Te=e,Le=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(ze),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(ze.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(ze),o("operator","operator",e.current());if(We.test(n)){e.eatWhile(We);var a=e.current(),u=Ee.propertyIsEnumerable(a)&&Ee[a];return u&&"."!=r.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(_e&&"@"==t.peek()&&t.match(De))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ne){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=Pe.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(We.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(Ie.state=e,Ie.stream=i,Ie.marked=null,Ie.cc=o,Ie.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():Oe?C:k)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Ie.marked?Ie.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)Ie.cc.push(arguments[e])}function m(){return p.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ie.state;if(Ie.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){Ie.state.context={prev:Ie.state.context,vars:Ie.state.localVars},Ie.state.localVars=Fe}function y(){Ie.state.localVars=Ie.state.context.vars,Ie.state.context=Ie.state.context.prev}function b(e,t){var r=function(){var r=Ie.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,Ie.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=Ie.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?m():";"==e?p():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),J,x(";"),w):"keyword a"==e?m(b("form"),T,k,w):"keyword b"==e?m(b("form"),k,w):"{"==e?m(b("}"),U,w):";"==e?m():"if"==e?("else"==Ie.state.lexical.info&&Ie.state.cc[Ie.state.cc.length-1]==w&&Ie.state.cc.pop()(),m(b("form"),T,k,w,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,w):"variable"==e?m(b("stat"),I):"switch"==e?m(b("form"),T,b("}","switch"),x("{"),U,w,w):"case"==e?m(C,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?m(b("form"),fe,w):"export"==e?m(b("stat"),ge,w):"import"==e?m(b("stat"),ye,w):"module"==e?m(b("form"),Q,b("}"),x("{"),U,w,w):"type"==e?m(G,x("operator"),G,x(";")):"async"==e?m(k):p(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function T(e){return"("!=e?p():m(b(")"),C,x(")"),w)}function L(e,t){if(Ie.state.fatArrowAt==Ie.stream.start){var r=t?z:E;if("("==e)return m(v,b(")"),q(Q,")"),w,x("=>"),r,y);if("variable"==e)return p(v,Q,x("=>"),r,y)}var n=t?O:_;return He.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),de,w):"keyword c"==e||"async"==e?m(t?A:M):"("==e?m(b(")"),M,x(")"),w,n):"operator"==e||"spread"==e?m(t?S:C):"["==e?m(b("]"),Ce,w,n):"{"==e?K(R,"}",null,n):"quasi"==e?p(N,n):"new"==e?m(D(t)):m()}function M(e){return e.match(/[;\}\)\],]/)?p():p(C)}function A(e){return e.match(/[;\}\)\],]/)?p():p(S)}function _(e,t){return","==e?m(C):O(e,t,!1)}function O(e,t,r){var n=0==r?_:O,i=0==r?C:S;return"=>"==e?m(v,r?z:E,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(C,x(":"),i):m(i):"quasi"==e?p(N,n):";"!=e?"("==e?K(S,")","call",n):"."==e?m(F,n):"["==e?m(b("]"),M,x("]"),w,n):void 0:void 0}function N(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?m(N):m(C,W)}function W(e){if("}"==e)return Ie.marked="string-2",Ie.state.tokenize=c,m(N)}function E(e){return u(Ie.stream,Ie.state),p("{"==e?k:C)}function z(e){return u(Ie.stream,Ie.state),p("{"==e?k:S)}function D(e){return function(t){return"."==t?m(e?H:P):p(e?S:C)}}function P(e,t){if("target"==t)return Ie.marked="keyword",m(_)}function H(e,t){if("target"==t)return Ie.marked="keyword",m(O)}function I(e){return":"==e?m(w,k):p(_,x(";"),w)}function F(e){if("variable"==e)return Ie.marked="property",m()}function R(e,t){return"async"==e?(Ie.marked="property",m(R)):"variable"==e||"keyword"==Ie.style?(Ie.marked="property",m("get"==t||"set"==t?j:B)):"number"==e||"string"==e?(Ie.marked=_e?"property":Ie.style+" property",m(B)):"jsonld-keyword"==e?m(B):"modifier"==e?m(R):"["==e?m(C,x("]"),B):"spread"==e?m(C):":"==e?p(B):void 0}function j(e){return"variable"!=e?p(B):(Ie.marked="property",m(ce))}function B(e){return":"==e?m(S):"("==e?p(ce):void 0}function q(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=Ie.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?p():p(e)},n)}return i==t||o==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():p(e,n)}}function K(e,t,r){for(var n=3;n<arguments.length;n++)Ie.cc.push(arguments[n]);return m(b(t,r),q(e,t),w)}function U(e){return"}"==e?m():p(k,U)}function V(e,t){if(Ne){if(":"==e)return m(G);if("?"==t)return m(V)}}function G(e){return"variable"==e?(Ie.marked="variable-3",m(Z)):"string"==e||"number"==e||"atom"==e?m(Z):"{"==e?m(b("}"),q(Y,"}",",;"),w):"("==e?m(q(X,")"),$):void 0}function $(e){if("=>"==e)return m(G)}function Y(e,t){return"variable"==e||"keyword"==Ie.style?(Ie.marked="property",m(Y)):"?"==t?m(Y):":"==e?m(G):void 0}function X(e){return"variable"==e?m(X):":"==e?m(G):void 0}function Z(e,t){return"<"==t?m(b(">"),q(G,">"),w,Z):"|"==t||"."==e?m(G):"["==e?m(x("]"),Z):void 0}function J(){return p(Q,V,te,re)}function Q(e,t){return"modifier"==e?m(Q):"variable"==e?(g(t),m()):"spread"==e?m(Q):"["==e?K(Q,"]"):"{"==e?K(ee,"}"):void 0}function ee(e,t){
8
- return"variable"!=e||Ie.stream.match(/^\s*:/,!1)?("variable"==e&&(Ie.marked="property"),"spread"==e?m(Q):"}"==e?p():m(x(":"),Q,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(S)}function re(e){if(","==e)return m(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,w)}function ie(e){if("("==e)return m(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?m(J,x(";"),le):";"==e?m(le):"variable"==e?m(ae):p(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(Ie.marked="keyword",m(C)):m(_,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(Ie.marked="keyword",m(C)):p(C,x(";"),se)}function se(e){")"!=e&&m(C)}function ce(e,t){return"*"==t?(Ie.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),q(ue,")"),w,V,k,y):void 0}function ue(e){return"spread"==e?m(ue):p(Q,V,te)}function de(e,t){return"variable"==e?fe(e,t):he(e,t)}function fe(e,t){if("variable"==e)return g(t),m(he)}function he(e,t){return"<"==t?m(b(">"),q(G,">"),w,he):"extends"==t||"implements"==t||Ne&&","==e?m(Ne?G:C,he):"{"==e?m(b("}"),pe,w):void 0}function pe(e,t){return"variable"==e||"keyword"==Ie.style?("async"==t||"static"==t||"get"==t||"set"==t||Ne&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&Ie.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ie.marked="keyword",m(pe)):(Ie.marked="property",m(Ne?me:ce,pe)):"["==e?m(C,x("]"),Ne?me:ce,pe):"*"==t?(Ie.marked="keyword",m(pe)):";"==e?m(pe):"}"==e?m():void 0}function me(e,t){return"?"==t?m(me):":"==e?m(G,te):"="==t?m(S):p(ce)}function ge(e,t){return"*"==t?(Ie.marked="keyword",m(ke,x(";"))):"default"==t?(Ie.marked="keyword",m(C,x(";"))):"{"==e?m(q(ve,"}"),ke,x(";")):p(k)}function ve(e,t){return"as"==t?(Ie.marked="keyword",m(x("variable"))):"variable"==e?p(S,ve):void 0}function ye(e){return"string"==e?m():p(be,we,ke)}function be(e,t){return"{"==e?K(be,"}"):("variable"==e&&g(t),"*"==t&&(Ie.marked="keyword"),m(xe))}function we(e){if(","==e)return m(be,we)}function xe(e,t){if("as"==t)return Ie.marked="keyword",m(be)}function ke(e,t){if("from"==t)return Ie.marked="keyword",m(C)}function Ce(e){return"]"==e?m():p(q(S,"]"))}function Se(e,t){return"operator"==e.lastType||","==e.lastType||ze.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Te,Le,Me=r.indentUnit,Ae=n.statementIndent,_e=n.jsonld,Oe=n.json||_e,Ne=n.typescript,We=n.wordCharacters||/[\w$\xa1-\uffff]/,Ee=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(Ne){var l={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),ze=/[+\-*&%=<>!?|~^]/,De=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Pe="([{}])",He={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ie={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Me,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Te?r:(t.lastType="operator"!=Te||"++"!=Le&&"--"!=Le?Te:"incdec",h(t,r,Te,Le,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==_||i==O)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Ae&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Me:"stat"==d?l.indented+(Se(t,r)?Ae||Me:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Me):l.indented+(/^(?:case|default)\b/.test(r)?Me:2*Me)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Oe?null:"/*",blockCommentEnd:Oe?null:"*/",lineComment:Oe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Oe?"json":"javascript",jsonldMode:_e,jsonMode:Oe,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":15}],19:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?m:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||!1===C.matchClosing?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,r){return"endTag"!=e?(M="error",g):(d(r),h)}function v(e,t,r){return M="error",g(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),h}return M="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(M="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var T in S)C[T]=S[T];for(var T in i)C[T]=i[T];var L,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(M=null,t.state=t.state(L||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==C.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":15}],20:[function(e,t,r){function n(e,t){function r(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace))t.length&&(r=!0),this.line_char_count--;else{if(r){if(this.line_char_count>=this.max_char){t.push("\n");for(var n=0;n<this.indent_level;n++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;r=!1}t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?(this.tags[e+"count"]++,this.tags[e+this.tags[e+"count"]]=this.indent_level):(this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level),this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,r="",n=[],i=!1;do{if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];r=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(r,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==r&&'"'!==r||n[1]&&"!"===n[1]||(r+=this.get_unformatted(r),i=!0),"="===r&&(i=!1),n.length&&"="!==n[n.length-1]&&">"!==r&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,n),this.line_char_count=0):(n.push(" "),this.line_char_count++),i=!1),"<"===r&&(e=this.pos-1),n.push(r))}while(">"!==r);var o,a=n.join("");o=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var l=a.substring(1,o).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(l,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===l)this.record_tag(l),this.tag_type="SCRIPT";else if("style"===l)this.record_tag(l),this.tag_type="STYLE";else if(this.Utils.in_array(l,s)){var c=this.get_unformatted("</"+l+">",a);n.push(c),e>0&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&n.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(t+1),this.Utils.whitespace)&&n.push(this.input.charAt(t+1)),this.tag_type="SINGLE"}else if("!"===l.charAt(0))if(-1!=l.indexOf("[if")){if(-1!=a.indexOf("!IE")){var c=this.get_unformatted("--\x3e",a);n.push(c)}this.tag_type="START"}else if(-1!=l.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=l.indexOf("[cdata[")){var c=this.get_unformatted("]]>",a);n.push(c),this.tag_type="SINGLE"}else{var c=this.get_unformatted("--\x3e",a);n.push(c),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 n.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var r="",n="",i=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,i=!0}while(-1==n.toLowerCase().indexOf(e));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return e=this.get_contents_to(t),"string"!=typeof e?e:[e,"TK_"+t]}if("CONTENT"===this.current_mode)return e=this.get_content(),"string"!=typeof e?e:[e,"TK_CONTENT"];if("TAG"===this.current_mode){if("string"!=typeof(e=this.get_tag()))return e;return[e,"TK_TAG_"+this.tag_type]}},this.get_full_indent=function(e){return e=this.indent_level+e||0,e<1?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,r,n,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=r,this.brace_style=i,this.indent_level=0,this.max_char=n,this.line_char_count=0;for(var o=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var n,i,o,a,l,s;for(t=t||{},i=t.indent_size||4,o=t.indent_char||" ",l=t.brace_style||"collapse",a=0==t.max_char?1/0:t.max_char||70,s=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 r,n.printer(e,o,i,a,l);;){var c=n.get_token();if(n.token_text=c[0],n.token_type=c[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 u=n.token_text.match(/\w+/)[0],d=n.output[n.output.length-1].match(/<\s*(\w+)/);null!==d&&d[1]===u||n.print_newline(!0,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z]+)/i);f&&n.Utils.in_array(f[1],s)||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 h=n.token_text;if("TK_SCRIPT"==n.token_type)var p="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==n.token_type)var p="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var m=0;else if("separate"==t.indent_scripts)var m=-n.indent_level;else var m=1;var g=n.get_full_indent(m);if(p)h=p(h.replace(/^\s*/,g),t);else{var v=h.match(/^\s*/)[0],y=v.match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,b=n.get_full_indent(m-y);h=h.replace(/^\s*/,g).replace(/\r\n|\r|\n/g,"\n"+b).replace(/\s*$/,"")}h&&(n.print_token(h),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("")}t.exports={prettyPrint:n}},{}],21:[function(e,t,r){"use strict";t.exports=e("./stream/stream")},{"./stream/stream":22}],22:[function(e,t,r){"use strict";!function(){function e(){function e(){return arguments.length>0&&arguments[0]!==C&&n(e,arguments[0]),e._state.value}return r(e),arguments.length>0&&arguments[0]!==C&&n(e,arguments[0]),e}function r(t){t.constructor=e,t._state={id:k++,value:void 0,state:0,derive:void 0,recover:void 0,deps:{},parents:[],endStream:void 0,unregister:void 0},t.map=t["fantasy-land/map"]=d,t["fantasy-land/ap"]=f,t["fantasy-land/of"]=e,t.valueOf=h,t.toJSON=p,t.toString=h,Object.defineProperties(t,{end:{get:function(){if(!t._state.endStream){var r=e();r.map(function(e){return!0===e&&(u(t),r._state.unregister=function(){u(r)}),e}),t._state.endStream=r}return t._state.endStream}}})}function n(e,t){i(e,t);for(var r in e._state.deps)o(e._state.deps[r],!1);null!=e._state.unregister&&e._state.unregister(),a(e)}function i(e,t){e._state.value=t,e._state.changed=!0,2!==e._state.state&&(e._state.state=1)}function o(e,t){var r=e._state,n=r.parents;if(n.length>0&&n.every(g)&&(t||n.some(v))){var o=e._state.derive();if(o===C)return!1;i(e,o)}}function a(e){e._state.changed=!1;for(var t in e._state.deps)e._state.deps[t]._state.changed=!1}function l(t,r){if(!r.every(m))throw new Error("Ensure that each item passed to stream.combine/stream.merge is a stream");return s(e(),r,function(){return t.apply(this,r.concat([r.filter(v)]))})}function s(e,t,r){var n=e._state;return n.derive=r,n.parents=t.filter(y),c(e,n.parents),o(e,!0),e}function c(e,t){for(var r=0;r<t.length;r++)t[r]._state.deps[e._state.id]=e,c(e,t[r]._state.parents)}function u(e){for(var t=0;t<e._state.parents.length;t++){delete e._state.parents[t]._state.deps[e._state.id]}for(var r in e._state.deps){var n=e._state.deps[r],i=n._state.parents.indexOf(e);i>-1&&n._state.parents.splice(i,1)}e._state.state=2,e._state.deps={}}function d(e){return l(function(t){return e(t())},[this])}function f(e){return l(function(e,t){return e()(t())},[e,this])}function h(){return this._state.value}function p(){return null!=this._state.value&&"function"==typeof this._state.value.toJSON?this._state.value.toJSON():this._state.value}function m(e){return e._state}function g(e){return 1===e._state.state}function v(e){return e._state.changed}function y(e){return 2!==e._state.state}function b(e){return l(function(){return e.map(function(e){return e()})},e)}function w(e,t,r){var n=l(function(r){return t=e(t,r._state.value)},[r]);return 0===n._state.state&&n(t),n}function x(e,t){var r=e.map(function(e){var t=e[0];return 0===t._state.state&&t(void 0),t});return l(function(){var n=arguments[arguments.length-1];return r.forEach(function(r,i){n.indexOf(r)>-1&&(t=e[i][1](t,r._state.value))}),t},r)}var k=0,C={};e["fantasy-land/of"]=e,e.merge=b,e.combine=l,e.scan=w,e.scanMerge=x,e.HALT=C,void 0!==t?t.exports=e:"function"!=typeof window.m||"stream"in window.m?window.m={stream:e}:window.m.stream=e}()},{}]},{},[11])}();
9
  //# sourceMappingURL=forms-admin.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function t(r,n,i){function o(l,s){if(!n[l]){if(!r[l]){var c="function"==typeof e&&e;if(!s&&c)return c(l,!0);if(a)return a(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[l]={exports:{}};r[l][0].call(d.exports,function(e){var t=r[l][1][e];return o(t||e)},d,d.exports,t,r,n,i)}return n[l].exports}for(var a="function"==typeof e&&e,l=0;l<i.length;l++)o(i[l]);return o}({1:[function(e,t,r){"use strict";var n=function(e,t){var r={};return r.showType=function(r){var n=r.type();return n=n.charAt(0).toUpperCase()+n.slice(1),e("div",[e("label",t.fieldType),e("span",n)])},r.label=function(r){return e("div",[e("label",t.fieldLabel),e("input.widefat",{type:"text",value:r.label(),onchange:e.withAttr("value",r.label),placeholder:r.title()})])},r.value=function(r){var n="hidden"===r.type();return e("div",[e("label",[n?t.value:t.initialValue," ",n?"":e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.value(),onchange:e.withAttr("value",r.value)}),n?"":e("p.help",t.valueHelp)])},r.numberMinMax=function(r){return e("div",[e("div.row",[e("div.col.col-3",[e("label",t.min),e("input",{type:"number",onchange:e.withAttr("value",r.min)})]),e("div.col.col-3",[e("label",t.max),e("input",{type:"number",onchange:e.withAttr("value",r.max)})])])])},r.isRequired=function(r){var n={type:"checkbox",checked:r.required(),onchange:e.withAttr("checked",r.required)},i=void 0;return r.forceRequired()&&(n.required=!0,n.disabled=!0,i=e("p.help",t.forceRequired)),e("div",[e("label.cb-wrap",[e("input",n),t.isFieldRequired]),i])},r.placeholder=function(r){return e("div",[e("label",[t.placeholder," ",e("small",{style:"float: right; font-weight: normal;"},t.optional)]),e("input.widefat",{type:"text",value:r.placeholder(),onchange:e.withAttr("value",r.placeholder),placeholder:""}),e("p.help",t.placeholderHelp)])},r.useParagraphs=function(r){return e("div",[e("label.cb-wrap",[e("input",{type:"checkbox",checked:r.wrap(),onchange:e.withAttr("checked",r.wrap)}),t.wrapInParagraphTags])])},r.choiceType=function(r){var n=[e("option",{value:"select",selected:"select"===r.type()&&"selected"},t.dropdown),e("option",{value:"radio",selected:"radio"===r.type()&&"selected"},t.radioButtons)];return r.acceptsMultipleValues&&n.push(e("option",{value:"checkbox",selected:"checkbox"===r.type()&&"selected"},t.checkboxes)),e("div",[e("label",t.choiceType),e("select",{value:r.type(),onchange:e.withAttr("value",r.type)},n)])},r.choices=function(r){var n=[];return n.push(e("div",[e("label",t.choices),e("div.limit-height",[e("table",[r.choices().map(function(n,i){return e("tr",{"data-id":i},[e("td.cb",e("input",{name:"selected",type:"checkbox"===r.type()?"checkbox":"radio",onchange:e.withAttr("value",r.selectChoice.bind(r)),checked:n.selected(),value:n.value(),title:t.preselect})),e("td.stretch",e("input.widefat",{type:"text",value:n.label(),placeholder:n.title(),onchange:e.withAttr("value",n.label)})),e("td",e("span",{title:t.remove,class:"dashicons dashicons-no-alt hover-activated",onclick:function(e){this.choices().splice(e,1)}.bind(r,i)},""))])})])])])),n},r};t.exports=n},{}],2:[function(e,t,r){"use strict";var n=function(t,r){var n={},i=e("./field-forms-rows.js")(t,r);return n.render=function(e){var t=e.type();if("function"==typeof n[t])return n[t](e);switch(t){case"select":case"radio":case"checkbox":return n.choice(e)}return n.text(e)},n.text=function(e){return[i.label(e),i.placeholder(e),i.value(e),i.isRequired(e),i.useParagraphs(e)]},n.choice=function(e){var t=[i.label(e),i.choiceType(e),i.choices(e)];return"select"===e.type()&&t.push(i.placeholder(e)),t.push(i.useParagraphs(e)),"select"!==e.type()&&"radio"!==e.type()||t.push(i.isRequired(e)),t},n.hidden=function(e){return e.placeholder(""),e.label(""),e.wrap(!1),[i.showType(e),i.value(e)]},n.submit=function(e){return e.label(""),e.placeholder(""),[i.value(e),i.useParagraphs(e)]},n.number=function(e){return[n.text(e),i.numberMinMax(e)]},n};t.exports=n},{"./field-forms-rows.js":1}],3:[function(e,t,r){"use strict";var n=e("html"),i=function(e){e.dom.checked&&e.dom.setAttribute("checked","true"),e.dom.value&&e.dom.setAttribute("value",e.dom.value),e.dom.selected&&e.dom.setAttribute("selected","true")},o=function(e){function t(t){var i=void 0,o=void 0,a=void 0,l=document.createElement("div");return i=t.label().length>0?e("label",{},t.label()):"",o="function"==typeof r[t.type()]?r[t.type()](t):r.default(t),a=t.wrap()?e("p",[i,o]):[i,o],e.render(l,a),n.prettyPrint(l.innerHTML)+"\n"}var r={};return r.select=function(t){var r={name:t.name(),required:t.required()},n=!1,o=t.choices().map(function(t){return t.selected()&&(n=!0),e("option",{value:t.value()!==t.label()?t.value():void 0,selected:t.selected(),oncreate:i},t.label())}),a=t.placeholder();return a.length>0&&o.unshift(e("option",{disabled:!0,value:"",selected:!n,oncreate:i},a)),e("select",r,o)},r.checkbox=function(t){return t.choices().map(function(r){var n=t.name()+("checkbox"===t.type()?"[]":""),o=t.required()&&"radio"===t.type();return e("label",[e("input",{name:n,type:t.type(),value:r.value(),checked:r.selected(),required:o,oncreate:i})," ",e("span",r.label())])})},r.radio=r.checkbox,r.default=function(t){var r={type:t.type()};return t.name()&&(r.name=t.name()),t.min()&&(r.min=t.min()),t.max()&&(r.max=t.max()),t.value().length>0&&(r.value=t.value()),t.placeholder().length>0&&(r.placeholder=t.placeholder()),r.required=t.required(),r.oncreate=i,e("input",r)},t};t.exports=o},{html:20}],4:[function(e,t,r){"use strict";var n=function(t,r,n,i,o,a){function l(e){d=i.get(e),d&&d.choices().length>0&&d.value(d.choices().map(function(e){return e.label()}).join("|")),t.redraw()}function s(){}function c(){var e=f(d);n.insert(e),l(""),t.redraw()}function u(){var e=i.getCategories(),r=i.getAll(),n=t("div.available-fields.small-margin",[t("h4",a.chooseField),e.map(function(e){var n=r.filter(function(t){return t.category===e});if(n.length)return t("div.tiny-margin",[t("strong",e),n.map(function(e){var r="button";e.forceRequired()&&(r+=" is-required");var n=e.inFormContent();return null!==n&&(r+=" "+(n?"in-form":"not-in-form")),t("button",{className:r,type:"button",onclick:t.withAttr("value",l),value:e.index},e.title())})])})]),o=null;return d&&(o=h(t("div.field-wizard",[t("h3",[d.title(),d.forceRequired()?t("span.red","*"):"",d.name().length?t("code",d.name()):""]),d.help().length?t("p",t.trust(d.help())):"",p.render(d),t("p",[t("button",{class:"button-primary",type:"button",onkeydown:function(e){e=e||window.event,13==e.keyCode&&c()},onclick:c},a.addToForm)])]),l)),[n,o]}var d,f=e("./field-generator.js")(t),h=e("./overlay.js")(t,a),p=e("./field-forms.js")(t,a);return n.on("blur",t.redraw),{view:u,controller:s}};t.exports=n},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(e,t,r){"use strict";var n=function(e,t){function r(){u.forEach(e.deregister)}function n(t,r,n){var i=e.register(t,r);n||u.push(i)}function i(e){var t={phone:"tel",dropdown:"select",checkboxes:"checkbox",birthday:"text"};return void 0!==t[e]?t[e]:e}function o(e){var r=t.listFields,o=i(e.field_type),a={name:e.tag,title:e.name,required:e.required,forceRequired:e.required,type:o,choices:e.choices,acceptsMultipleValues:!1};return"address"!==a.type?n(r,a,!1):(n(r,{name:a.name+"[addr1]",type:"text",mailchimpType:"address",title:t.streetAddress}),n(r,{name:a.name+"[city]",type:"text",mailchimpType:"address",title:t.city}),n(r,{name:a.name+"[state]",type:"text",mailchimpType:"address",title:t.state}),n(r,{name:a.name+"[zip]",type:"text",mailchimpType:"address",title:t.zip}),n(r,{name:a.name+"[country]",type:"select",mailchimpType:"address",title:t.country,choices:mc4wp_vars.countries})),!0}function a(e){var r=t.interestCategories,o=i(e.field_type);n(r,{title:e.name,name:"INTERESTS["+e.id+"]",type:o,choices:e.interests,acceptsMultipleValues:"checkbox"===o},!1)}function l(e){e.merge_fields=e.merge_fields.sort(function(e,t){return"EMAIL"===e.tag||e.public&&!t.public?-1:!e.public&&t.public?1:0}),e.merge_fields.forEach(o),e.interest_categories.forEach(a)}function s(e){r(),e.forEach(l)}function c(e){var r,i=t.formFields;n(i,{name:"",value:t.subscribe,type:"submit",title:t.submitButton},!0),r={};for(var o in e)r[e[o].id]=e[o].name;n(i,{name:"_mc4wp_lists",type:"checkbox",title:t.listChoice,choices:r,help:t.listChoiceDescription,acceptsMultipleValues:!0},!0),r={subscribe:"Subscribe",unsubscribe:"Unsubscribe"},n(i,{name:"_mc4wp_action",type:"radio",title:t.formAction,choices:r,value:"subscribe",help:t.formActionDescription},!0)}var u=[];return{registerCustomFields:c,registerListFields:l,registerListsFields:s}};t.exports=n},{}],6:[function(e,t,r){"use strict";var n=e("mithril/stream");t.exports=function(e,t){function r(e){return"function"==typeof e.map?e.map(function(e){return new p({label:e})}):Object.keys(e).map(function(t){var r=e[t];return new p({label:r,value:t})})}function i(n,i){var o,a=c("name",i.name).shift();return a?void(!a.forceRequired()&&i.forceRequired&&a.forceRequired(!0)):(i.choices&&(i.choices=r(i.choices),i.value&&(i.choices=i.choices.map(function(e){return e.value()===i.value&&e.selected(!0),e}))),f.indexOf(n)<0&&f.push(n),o=new h(i),o.category=n,d.push(o),u&&window.clearTimeout(u),u=window.setTimeout(e.redraw,200),t.trigger("fields.change"),o)}function o(t){var r=d.indexOf(t);r>-1&&(delete d[r],e.redraw())}function a(e){return d[e]}function l(){return d=d.map(function(e,t){return e.index=t,e})}function s(){return f}function c(e,t){return d.filter(function(r){return r[e]()===t})}var u,d=[],f=[],h=function(e){this.name=n(e.name),this.title=n(e.title||e.name),this.type=n(e.type),this.mailchimpType=n(e.mailchimpType||""),this.label=n(e.title||""),this.value=n(e.value||""),this.placeholder=n(e.placeholder||""),this.required=n(e.required||!1),this.forceRequired=n(e.forceRequired||!1),this.wrap=n(e.wrap||!0),this.min=n(e.min||null),this.max=n(e.max||null),this.help=n(e.help||""),this.choices=n(e.choices||[]),this.inFormContent=n(null),this.acceptsMultipleValues=e.acceptsMultipleValues,this.selectChoice=function(e){var t=this;this.choices(this.choices().map(function(r){return r.value()===e?r.selected(!0):"checkbox"!==t.type()&&r.selected(!1),r}))}},p=function(e){this.label=n(e.label),this.title=n(e.title||e.label),this.selected=n(e.selected||!1),this.value=n(e.value||e.label)};return{get:a,getAll:l,getCategories:s,deregister:o,register:i,getAllWhere:c}}},{"mithril/stream":21}],7:[function(e,t,r){"use strict";var n=e("codemirror");e("codemirror/mode/xml/xml"),e("codemirror/mode/javascript/javascript"),e("codemirror/mode/css/css"),e("codemirror/mode/htmlmixed/htmlmixed"),e("codemirror/addon/fold/xml-fold"),e("codemirror/addon/edit/matchtags"),e("codemirror/addon/edit/closetag.js");var i=function(e){function t(){return o&&(i.innerHTML=a.getValue().toLowerCase(),o=!1),i}var r,i=document.createElement("form"),o=!1,a={};return i.innerHTML=e.value.toLowerCase(),n&&(r=n.fromTextArea(e,{selectionPointer:!0,matchTags:{bothTags:!0},mode:"htmlmixed",htmlMode:!0,autoCloseTags:!0,autoRefresh:!0}),window.dispatchEvent&&r.on("change",function(){if("function"==typeof Event){var t=new Event("change",{bubbles:!0});e.dispatchEvent(t)}})),window.addEventListener("load",function(){n.signal(r,"change")}),e.addEventListener("change",function(){o=!0}),a.getValue=function(){return r?r.getValue():e.value},a.query=function(e){return t().querySelectorAll(e.toLowerCase())},a.containsField=function(e){return null!==t().elements.namedItem(e.toLowerCase())},a.insert=function(t){r?(r.replaceSelection(t),r.focus()):e.value+=t},a.on=function(t,n){return r?(t="input"===t?"changes":t,r.on(t,n)):e.addEventListener(t,n)},a.refresh=function(){r&&r.refresh()},a};t.exports=i},{codemirror:15,"codemirror/addon/edit/closetag.js":12,"codemirror/addon/edit/matchtags":13,"codemirror/addon/fold/xml-fold":14,"codemirror/mode/css/css":16,"codemirror/mode/htmlmixed/htmlmixed":17,"codemirror/mode/javascript/javascript":18,"codemirror/mode/xml/xml":19}],8:[function(e,t,r){"use strict";var n=function(e,t,r,n,i,o){function a(){n.getAll().forEach(function(e){if(!(e.name().length<=0)){var r=e.name();"checkbox"===e.type()&&(r+="[]");var n=t.containsField(r);if(e.inFormContent(n),"address"===e.mailchimpType()){e.originalRequiredValue=void 0===e.originalRequiredValue?e.forceRequired():e.originalRequiredValue;var i=e.name().replace(/\[(\w+)\]/g,"");t.query('[name^="'+i+'"]').length>0?(void 0===e.originalRequiredValue&&(e.originalRequiredValue=e.forceRequired()),e.forceRequired(!0)):e.forceRequired(e.originalRequiredValue)}}}),l(),e.redraw()}function l(){var e=n.getAllWhere("forceRequired",!0).map(function(e){return e.name().toUpperCase().replace(/\[(\w+)\]/g,".$1")}),r=t.query("[required]");Array.prototype.forEach.call(r,function(t){var r=t.name.toUpperCase();"_"!==r[0]&&(r=r.replace(/\[(\w+)\]/g,".$1"),-1===e.indexOf(r)&&e.push(r))}),s.value=e.join(",")}var s=document.getElementById("required-fields");t.on("change",o.debounce(a,500)),i.on("fields.change",o.debounce(a,500))};t.exports=n},{}],9:[function(e,t,r){"use strict";function n(e,t){l[e]=t,o()}function i(e){delete l[e],o()}function o(){var e="";for(var t in l)e+='<div class="notice notice-warning inline"><p>'+l[t]+"</p></div>";var r=document.querySelector(".mc4wp-notices");if(!r){r=document.createElement("div"),r.className="mc4wp-notices";var n=document.querySelector("h1, h2");n.parentNode.insertBefore(r,n.nextSibling)}r.innerHTML=e}function a(e,t){var r=function(){e.getValue().toLowerCase().indexOf('name="groupings')>-1?n("deprecated_groupings","Your form contains old style <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to MailChimp correctly."):i("deprecated_groupings")},o=function(){var r=t.getAllWhere("forceRequired",!0),o=r.filter(function(t){return!e.containsField(t.name().toUpperCase())}),a="<strong>Heads up!</strong> Your form is missing list fields that are required in MailChimp. Either add these fields to your form or mark them as optional in MailChimp.";a+='<br /><ul class="ul-square" style="margin-bottom: 0;"><li>'+o.map(function(e){return e.title()}).join("</li><li>")+"</li></ul>",o.length>0?n("required_fields_missing",a):i("required_fields_missing")};r(),e.on("focus",r),e.on("blur",r),o(),e.on("blur",o),e.on("focus",o)}var l={};t.exports={init:a}},{}],10:[function(e,t,r){"use strict";var n=function(e,t){function r(){document.removeEventListener("keydown",n),window.removeEventListener("resize",i),l()}function n(e){e=e||window.event,27==e.keyCode&&r(),13==e.keyCode&&e.preventDefault()}function i(){if(a){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=(e-a.clientWidth-40)/2,n=(t-a.clientHeight-40)/2;a.style.left=(r>0?r:0)+"px",a.style.top=(n>0?n:0)+"px"}}function o(e){a=e.dom,i()}var a=void 0,l=void 0;return function(a,s){return l=s,document.addEventListener("keydown",n),window.addEventListener("resize",i),[e("div.overlay-wrap",e("div.overlay",{oncreate:o},[e("span",{class:"close dashicons dashicons-no",title:t.close,onclick:r}),a])),e("div.overlay-background",{title:t.close,onclick:r})]}};t.exports=n},{}],11:[function(e,t,r){"use strict";var n=window.mc4wp_forms_i18n,i=window.mc4wp.deps.mithril,o=mc4wp.events,a=mc4wp.settings,l=mc4wp.helpers,s=mc4wp.tabs,c=e("./admin/form-watcher.js"),u=e("./admin/form-editor.js"),d=e("./admin/field-helper.js"),f=e("./admin/fields-factory.js"),h=e("./admin/fields.js")(i,o),p=document.getElementById("mc4wp-form-content"),m=window.formEditor=new u(p),g=(new c(i,formEditor,a,h,o,l),new d(i,s,formEditor,h,o,n)),v=e("./admin/notices");i.mount(document.getElementById("mc4wp-field-wizard"),g);var y=new f(h,n);o.on("selectedLists.change",y.registerListsFields),y.registerListsFields(a.getSelectedLists()),y.registerCustomFields(mc4wp_vars.mailchimp.lists),window.setTimeout(function(){i.redraw()},2e3),v.init(m,h),window.mc4wp=window.mc4wp||{},window.mc4wp.forms=window.mc4wp.forms||{},window.mc4wp.forms.editor=m,window.mc4wp.forms.fields=h},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r=t.listSelections(),n=[],s=0;s<r.length;s++){if(!r[s].empty())return e.Pass;var c=r[s].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),f=d.state;if("xml"!=d.mode.name||!f.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==d.mode.configuration,m="object"==typeof h&&h.dontCloseTags||p&&a,g="object"==typeof h&&h.indentTags||p&&l,v=f.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==f.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,f,!0))return e.Pass;var b=g&&i(g,y)>-1;n[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=r.length-1;s>=0;s--){var w=n[s];t.replaceRange(w.text,r[s].head,r[s].anchor,"+insert");var x=t.listSelections().slice(0);x[s]={head:w.newPos,anchor:w.newPos},t.setSelections(x),w.indent&&(t.indentLine(w.newPos.line,null,!0),t.indentLine(w.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),i=[],a=r?"/":"</",l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var s=n[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),d=u.state;if(r&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;var f;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)f=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;f=a+"style"}else{if(!d.context||!d.context.tagName||o(t,d.context.tagName,s,d))return e.Pass;f=a+d.context.tagName}">"!=t.getLine(s.line).charAt(c.end)&&(f+=">"),i[l]=f}t.replaceSelections(i),n=t.listSelections();for(var l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&t.indentLine(n[l].head.line)}function n(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function o(t,r,n,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),l=e.scanForClosingTag(t,n,null,a);if(!l||l.tag!=r)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==r;s=s.prev)++c;n=l.to;for(var u=1;u<c;u++){var d=e.scanForClosingTag(t,n,null,a);if(!d||d.tag!=r)return!1;n=d.to}return!0}e.defineOption("autoCloseTags",!1,function(r,i,o){if(o!=e.Init&&o&&r.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return r(e)}})},{"../../lib/codemirror":15,"../fold/xml-fold":14}],13:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../fold/xml-fold")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../fold/xml-fold"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),i=r.getViewport();i.from=Math.min(i.from,n.line),i.to=Math.max(n.line+1,i.to);var o=e.findMatchingTag(r,n,i);if(o){if(r.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?r.state.tagOther=r.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",r),i.off("viewportChange",n),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",r),i.on("viewportChange",n),r(i))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}})},{"../../lib/codemirror":15,"../fold/xml-fold":14}],14:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function r(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function n(e,t){var r=e.cm.getTokenTypeAt(f(e.line,t));return r&&/\btag\b/.test(r)}function i(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(n(e,t+1)){p.lastIndex=t,e.ch=t;var r=p.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function s(e){for(;;){p.lastIndex=e.ch;var t=p.exec(e.text);if(!t){if(i(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(n=a(e)))return;if("selfClose"!=n)if(i[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==i[2]){r.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:f(o,l),to:f(e.line,e.ch)}}else r.push(i[2])}}function d(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var s=r.length-1;s>=0;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:f(e.line,e.ch),to:f(i,o)}}}else l(e)}}var f=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=new RegExp("<(/?)(["+h+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var i,o=s(n);if(!o||n.line!=t.line||!(i=a(n)))return;if(!o[1]&&"selfClose"!=i){var l=f(n.line,n.ch),c=u(n,o[2]);return c&&{from:l,to:c.from}}}}),e.findMatchingTag=function(e,n,i){var o=new r(e,n.line,n.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&f(o.line,o.ch),h=s&&l(o);if(s&&h&&!(t(o,n)>0)){var p={from:f(o.line,o.ch),to:c,tag:h[2]};return"selfClose"==s?{open:p,close:null,at:"open"}:h[1]?{open:d(o,h[2]),close:p,at:"close"}:(o=new r(e,c.line,c.ch,i),{open:p,close:u(o,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n,i){for(var o=new r(e,t.line,t.ch,n);;){var a=d(o,i);if(!a)break;var l=new r(e,t.line,t.ch,n),s=u(l,a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,i){return u(new r(e,t.line,t.ch,i?{from:0,to:i}:null),n)}})},{"../../lib/codemirror":15}],15:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.CodeMirror=i()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,r,i){var o=n(e,t,r,i);return o.setAttribute("role","presentation"),o}function o(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 a(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function l(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function s(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function d(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function f(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function h(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Ra.length<=e;)Ra.push(m(Ra)+" ");return Ra[e]}function m(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function v(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function y(){}function b(e,t){var r;return Object.create?r=Object.create(e):(y.prototype=e,r=new y),t&&u(t,r),r}function w(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ja.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function k(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&Ba.test(e)}function S(e,t,r){for(;(r<0?t>0:t<e.length)&&C(e.charAt(t));)t+=r;return t}function T(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function L(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[a],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+Da+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),da&&fa<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),ha||la&&ka||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}function M(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function A(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function N(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function O(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function _(e){if(null==e.parent)return null;for(var t=e.parent,r=f(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function E(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function W(e,t){return t>=e.first&&t<e.first+e.size}function F(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function D(e,t,r){if(void 0===r&&(r=null),!(this instanceof D))return new D(e,t,r);this.line=e,this.ch=t,this.sticky=r}function z(e,t){return e.line-t.line||e.ch-t.ch}function P(e,t){return e.sticky==t.sticky&&0==z(e,t)}function H(e){return D(e.line,e.ch)}function I(e,t){return z(e,t)<0?t:e}function R(e,t){return z(e,t)<0?e:t}function j(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function B(e,t){if(t.line<e.first)return D(e.first,0);var r=e.first+e.size-1;return t.line>r?D(r,M(e,r).text.length):q(t,M(e,t.line).text.length)}function q(e,t){var r=e.ch;return null==r||r>t?D(e.line,t):r<0?D(e.line,0):e}function U(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=B(e,t[n]);return r}function K(){qa=!0}function V(){Ua=!0}function G(e,t,r){this.marker=e,this.from=t,this.to=r}function $(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Y(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function X(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new G(a,o.from,s?null:o.to))}}return n}function J(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new G(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Q(e,t){if(t.full)return null
2
+ ;var r=W(e,t.from.line)&&M(e,t.from.line).markedSpans,n=W(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==z(t.from,t.to),l=Z(r,i,a),s=J(n,o,a),c=1==t.text.length,u=m(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=$(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 g=s[p];if(null!=g.to&&(g.to+=u),null==g.from){var v=$(l,g.marker);v||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=ee(l)),s&&s!=l&&(s=ee(s));var y=[l];if(!c){var b,w=t.text.length-2;if(w>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(b||(b=[])).push(new G(l[x].marker,null,null));for(var k=0;k<w;++k)y.push(b);y.push(s)}return y}function ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function te(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=f(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(z(c.to,l.from)<0||z(c.from,l.to)>0)){var u=[s,1],d=z(c.from,l.from),h=z(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function ae(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=z(n.from,i.from)||ie(e)-ie(t);if(o)return-o;var a=z(n.to,i.to)||oe(e)-oe(t);return a||t.id-e.id}function le(e,t){var r,n=Ua&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||ae(r,i.marker)<0)&&(r=i.marker);return r}function se(e){return le(e,!0)}function ce(e){return le(e,!1)}function ue(e,t,r,n,i){var o=M(e,t),a=Ua&&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=z(c.from,r)||ie(s.marker)-ie(i),d=z(c.to,n)||oe(s.marker)-oe(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?z(c.to,r)>=0:z(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?z(c.from,n)<=0:z(c.from,n)<0)))return!0}}}function de(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function fe(e){for(var t;t=ce(e);)e=t.find(1,!0).line;return e}function he(e){for(var t,r;t=ce(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=M(e,t),n=de(r);return r==n?t:_(n)}function me(e,t){if(t>e.lastLine())return t;var r,n=M(e,t);if(!ge(e,n))return t;for(;r=ce(n);)n=r.find(1,!0).line;return _(n)+1}function ge(e,t){var r=Ua&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ve(e,t,n))return!0}}function ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ve(e,n.line,$(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ve(e,t,i))return!0}function ye(e){e=de(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function be(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=se(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ce(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function we(e){var t=e.display,r=e.doc;t.maxLine=M(r,r.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=be(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function xe(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ke(e,t,r){var n;Ka=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Ka=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ka=i)}return null!=n?n:Ka}function Ce(e,t){var r=e.order;return null==r&&(r=e.order=Va(e.text,t)),r}function Se(e,t,r){var n=S(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Te(e,t,r){var n=Se(e,t.ch,r);return null==n?null:new D(t.line,n,r<0?"after":"before")}function Le(e,t,r,n,i){if(e){var o=Ce(r,t.doc.direction);if(o){var a,l=i<0?m(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=Zt(t,r);a=i<0?r.text.length-1:0;var d=Jt(t,u,a).top;a=T(function(e){return Jt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=Se(r,a,1))}else a=i<0?l.to:l.from;return new D(n,a,c)}}return new D(n,i<0?r.text.length:0,i<0?"before":"after")}function Me(e,t,r,n){var i=Ce(t,e.doc.direction);if(!i)return Te(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ke(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Te(t,r,n);var l,s=function(e,r){return Se(t,e instanceof D?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||Zt(e,t),gr(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=u.end:f>=a.from&&f>=u.begin)){var h=d?"before":"after";return new D(r.line,f,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new D(r.line,s(e,1),"before"):new D(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},m=p(o+n,n,u);if(m)return m;var g=n>0?u.end:s(u.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,c(g)))?null:m}function Ae(e,t){return e._handlers&&e._handlers[t]||Ga}function Ne(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=f(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Oe(e,t){var r=Ae(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function _e(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,r||t.type,e,t),Pe(t)||t.codemirrorIgnore}function Ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==f(r,t[n])&&r.push(t[n])}function We(e,t){return Ae(e,t).length>0}function Fe(e){e.prototype.on=function(e,t){$a(this,e,t)},e.prototype.off=function(e,t){Ne(this,e,t)}}function De(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ze(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function He(e){De(e),ze(e)}function Ie(e){return e.target||e.srcElement}function Re(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ca&&e.ctrlKey&&1==t&&(t=3),t}function je(e){if(null==Wa){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Wa=t.offsetWidth<=1&&t.offsetHeight>2&&!(da&&fa<8))}var i=Wa?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Be(e){if(null!=Fa)return Fa;var n=r(e,document.createTextNode("AخA")),i=Ma(n,0,1).getBoundingClientRect(),o=Ma(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Fa=o.right-i.right<3)}function qe(e){if(null!=Qa)return Qa;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=Ma(t,0,1).getBoundingClientRect();return Qa=Math.abs(i.left-o.left)>1}function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),el[e]=t}function Ke(e,t){tl[e]=t}function Ve(e){if("string"==typeof e&&tl.hasOwnProperty(e))e=tl[e];else if(e&&"string"==typeof e.name&&tl.hasOwnProperty(e.name)){var t=tl[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),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 r=el[t.name];if(!r)return Ge(e,"text/plain");var n=r(e,t);if(rl.hasOwnProperty(t.name)){var i=rl[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function $e(e,t){u(t,rl.hasOwnProperty(e)?rl[e]:rl[e]={})}function Ye(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ze(e,t,r){return!e.startState||e.startState(t,r)}function Je(e,t,r,n){var i=[e.state.modeGen],o={};at(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=r.state,l=0;l<e.state.overlays.length;++l)!function(n){var a=e.state.overlays[n],l=1,s=0;r.state=!0,at(e,t.text,a.mode,r,function(e,t){for(var r=l;s<e;){var n=i[l];n>e&&i.splice(l,1,e,i[l+1],n),l+=2,s=Math.min(e,n)}if(t)if(a.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}},o)}(l);return r.state=a,{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=et(e,_(t)),i=t.text.length>e.options.maxHighlightLength&&Ye(e.doc.mode,n.state),o=Je(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new ol(n,!0,t);var o=lt(e,t,r),a=o>n.first&&M(n,o-1).stateAfter,l=a?ol.fromSaved(n,a,o):new ol(n,Ze(n.mode),o);return n.iter(o,t,function(r){tt(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()}),r&&(n.modeFrontier=l.line),l}function tt(e,t,r,n){var i=e.doc.mode,o=new nl(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&rt(i,r.state);!o.eol();)nt(i,o,r.state),o.start=o.pos}function rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function nt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=e.doc,a=o.mode;t=B(o,t);var l,s=M(o,t.line),c=et(e,t.line,r),u=new nl(s.text,e.options.tabSize,c);for(n&&(l=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=nt(a,u,c.state),n&&l.push(new al(u,i,Ye(o.mode,c.state)));return n?l:new al(u,i,c.state)}function ot(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function at(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new nl(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&ot(rt(r,n.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&tt(e,t,n,d.pos),d.pos=t.length,s=null):s=ot(nt(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}function lt(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=M(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof il?c.lookAhead:0)<=o.modeFrontier))return l;var u=d(s.text,null,e.options.tabSize);(null==i||n>u)&&(i=l-1,n=u)}return i}function st(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=M(e,n).stateAfter;if(i&&(!(i instanceof il)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}function ct(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),re(e),ne(e,r);var i=n?n(e):1;i!=e.height&&O(e,i)}function ut(e){e.parent=null,re(e)}function dt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ul:cl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ft(e,t){var r=i("span",null,null,ha?"padding-right: .1px":null),n={pre:i("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(da||ha)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,l=void 0;n.pos=0,n.addToken=pt,Be(e.display.measure)&&(l=Ce(a,e.doc.direction))&&(n.addToken=gt(n.addToken,l)),n.map=[];yt(a,n,Qe(e,a,t!=e.display.externalMeasured&&_(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=s(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=s(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(ha){var c=n.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=s(n.pre.className,n.textClass||"")),n}function ht(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,r,i,o,a,l){if(t){var s,c=e.splitSpaces?mt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(c.slice(f,f+m));da&&fa<9?s.appendChild(n("span",[g])):s.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=s.appendChild(n("span",p(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=s.appendChild(n("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),da&&fa<9?s.appendChild(n("span",[v])):s.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,s=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,s),da&&fa<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||i||o||d||l){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,l);return a&&(x.title=a),e.content.appendChild(x)}e.content.appendChild(s)}}function mt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function gt(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function vt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function yt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;"bookmark"==k.type&&x.from==p&&k.widgetNode?y.push(k):x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&!d&&(d=k.title),k.collapsed&&(!f||ae(f.marker,k)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==v&&(c+=" "+b[C]);if(!f||f.from==p)for(var S=0;S<y.length;++S)vt(t,0,y[S]);if(f&&(f.from||0)==p){if(vt(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var T=Math.min(h,v);;){if(g){var L=p+g.length;if(!f){var M=L>T?g.slice(0,T-p):g;t.addToken(t,M,a?a+s:s,u,p+M.length==v?c:"",d,l)}if(L>=T){g=g.slice(T-p),p=T;break}p=L,u=""}g=i.slice(o,o=r[m++]),a=dt(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),dt(r[A+1],t.cm.options))}function bt(e,t,r){this.line=t,this.rest=he(t),this.size=this.rest?_(m(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function wt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new bt(e.doc,M(e.doc,o),o);n=o+a.size,i.push(a)}return i}function xt(e){dl?dl.ops.push(e):e.ownsGroup=dl={ops:[e],delayedCallbacks:[]}}function kt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Ct(e,t){var r=e.ownsGroup;if(r)try{kt(r)}finally{dl=null,t(r)}}function St(e,t){var r=Ae(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);dl?n=dl.delayedCallbacks:fl?n=fl:(n=fl=[],setTimeout(Tt,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function Tt(){var e=fl;fl=null;for(var t=0;t<e.length;++t)e[t]()}function Lt(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Ot(e,t):"gutter"==o?Et(e,t,r,n):"class"==o?_t(e,t):"widget"==o&&Wt(e,t,n)}t.changes=null}function Mt(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),da&&fa<8&&(e.node.style.zIndex=2)),e.node}function At(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=Mt(t);t.background=i.insertBefore(n("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function Nt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ft(e,t)}function Ot(e,t){var r=t.text.className,n=Nt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,_t(e,t)):r&&(t.text.className=r)}function _t(e,t){At(e,t),t.line.wrapClass?Mt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Et(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Mt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=Mt(t),s=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(n("div",F(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var c=0;c<e.options.gutters.length;++c){var u=e.options.gutters[c],d=a.hasOwnProperty(u)&&a[u];d&&s.appendChild(n("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Wt(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Dt(e,t,r)}function Ft(e,t,r,n){var i=Nt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),_t(e,t),Et(e,t,r,n),Dt(e,t,n),t.node}function Dt(e,t,r){if(zt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)zt(e,t.rest[n],t,r,!1)}function zt(e,t,r,i,o){if(t.widgets)for(var a=Mt(r),l=0,s=t.widgets;l<s.length;++l){var c=s[l],u=n("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Pt(c,u,r,i),e.display.input.setUneditable(u),o&&c.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),St(c,"redraw")}}function Pt(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ht(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function It(e,t){for(var r=Ie(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Rt(e){return e.lineSpace.offsetTop}function jt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Bt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function qt(e){return Da-e.display.nativeBarWidth}function Ut(e){return e.display.scroller.clientWidth-qt(e)-e.display.barWidth}function Kt(e){return e.display.scroller.clientHeight-qt(e)-e.display.barHeight}function Vt(e,t,r){var n=e.options.lineWrapping,i=n&&Ut(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Gt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(_(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function $t(e,t){t=de(t);var n=_(t),i=e.display.externalMeasured=new bt(e.doc,t,n);i.lineN=n;var o=i.built=ft(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Yt(e,t,r,n){return Jt(e,Zt(e,t),r,n)}function Xt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Tr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Zt(e,t){var r=_(t),n=Xt(e,r);n&&!n.text?n=null:n&&n.changes&&(Lt(e,n,r,wr(e)),e.curOp.forceUpdate=!0),n||(n=$t(e,t));var i=Gt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Jt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),o=tr(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Qt(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function er(e,t){var r=hl;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function tr(e,t,r,n){var i,o=Qt(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&C(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&C(t.line.text.charAt(o.coverStart+s));)++s;if(i=da&&fa<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():er(Ma(a,l,s).getClientRects(),n),i.left||i.right||0==l)break;s=l,l-=1,c="right"}da&&fa<11&&(i=rr(e.display.measure,i))}else{l>0&&(c=n="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(da&&fa<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+br(e.display),top:f.top,bottom:f.bottom}:hl}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};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p),w}function rr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!qe(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function nr(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 ir(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)nr(e.display.view[r])}function or(e){ir(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ar(){return ma&&xa?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function lr(){return ma&&xa?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function sr(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var a=Ht(t.widgets[o]);r.top+=a,r.bottom+=a}if("line"==n)return r;n||(n="local");var l=ye(t);if("local"==n?l+=Rt(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:lr());var c=s.left+("window"==n?0:ar());r.left+=c,r.right+=c}return r.top+=l,r.bottom+=l,r}function cr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=ar(),i-=lr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function ur(e,t,r,n,i){return n||(n=M(e.doc,t.line)),sr(e,n,Yt(e,n,t.ch,i),r)}function dr(e,t,r,n,i,o){function a(t,a){var l=Jt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,sr(e,n,l,r)}function l(e,t,r){var n=s[t],i=n.level%2!=0;return a(r?e-1:e,i!=r)}n=n||M(e.doc,t.line),i||(i=Zt(e,n));var s=Ce(n,e.doc.direction),c=t.ch,u=t.sticky;if(c>=n.text.length?(c=n.text.length,u="before"):c<=0&&(c=0,u="after"),!s)return a("before"==u?c-1:c,"before"==u);var d=ke(s,c,u),f=Ka,h=l(c,d,"before"==u);return null!=f&&(h.other=l(c,f,"before"!=u)),h}function fr(e,t){var r=0;t=B(e.doc,t),e.options.lineWrapping||(r=br(e.display)*t.ch);var n=M(e.doc,t.line),i=ye(n)+Rt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function hr(e,t,r,n,i){var o=D(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function pr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return hr(n.first,0,null,!0,-1);var i=E(n,r),o=n.first+n.size-1;if(i>o)return hr(n.first+n.size-1,M(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=M(n,i);;){var l=vr(e,a,i,t,r),s=ce(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=_(a=c.to.line)}}function mr(e,t,r,n){var i=function(n){return sr(e,t,Jt(e,r,n),"line")},o=t.text.length,a=T(function(e){return i(e-1).bottom<=n},o,0);return o=T(function(e){return i(e).top>n},a,o),{begin:a,end:o}}function gr(e,t,r,n){return mr(e,t,r,sr(e,t,Jt(e,r,n),"line").top)}function vr(e,t,r,n,i){i-=ye(t);var o,a=0,l=t.text.length,s=Zt(e,t);if(Ce(t,e.doc.direction)){if(e.options.lineWrapping){var c;c=mr(e,t,s,i),a=c.begin,l=c.end}o=new D(r,Math.floor(a+(l-a)/2));var u,d,f=dr(e,o,"line",t,s).left,h=f<n?1:-1,p=f-n,m=Math.ceil((l-a)/4);e:do{u=p,d=o;for(var g=0;g<m;++g){var v=o;if(null==(o=Me(e,t,o,h))||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=v;break e}}if(p=dr(e,o,"line",t,s).left-n,m>1){var y=Math.abs(p-u)/m;m=Math.min(m,Math.ceil(Math.abs(p)/y)),h=p<0?1:-1}}while(0!=p&&(m>1||h<0!=p<0&&Math.abs(p)<=Math.abs(u)));if(Math.abs(p)>Math.abs(u)){if(p<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=d}}else{var b=T(function(r){var o=sr(e,t,Jt(e,s,r),"line");return o.top>i?(l=Math.min(r,l),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},a,l);b=S(t.text,b,1),o=new D(r,b,b==l?"before":"after")}var w=dr(e,o,"line",t,s);return(i<w.top||w.bottom<i)&&(o.outside=!0),o.xRel=n<w.left?-1:n>w.right?1:0,o}function yr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==sl){sl=n("pre");for(var i=0;i<49;++i)sl.appendChild(document.createTextNode("x")),sl.appendChild(n("br"));sl.appendChild(document.createTextNode("x"))}r(e.measure,sl);var o=sl.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function br(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),a=(o.right-o.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function wr(e){
3
+ for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:xr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function xr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function kr(e){var t=yr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/br(e.display)-3);return function(i){if(ge(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Cr(e){var t=e.doc,r=kr(e);t.iter(function(e){var t=r(e);t!=e.height&&O(e,t)})}function Sr(e,t,r,n){var i=e.display;if(!r&&"true"==Ie(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=pr(e,o,a);if(n&&1==c.xRel&&(s=M(e.doc,c.line).text).length==c.ch){var u=d(s,s.length,e.options.tabSize)-s.length;c=D(c.line,Math.max(0,Math.round((o-Bt(e.display).left)/br(e.display))-u))}return c}function Tr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function Lr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(!1!==t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Ar(e,l.head,i),s||Nr(e,l,o)}}return n}function Ar(e,t,r){var i=dr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Nr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?d-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return ur(e,D(t,r),"div",c,n)}var a,s,c=M(l,t),f=c.text.length;return xe(Ce(c,l.direction),r||0,null==n?f:n,function(e,t,l){var c,h,p,m=o(e,"left");if(e==t)c=m,h=p=m.left;else{if(c=o(t-1,"right"),"rtl"==l){var g=m;m=c,c=g}h=m.left,p=c.right}null==r&&0==e&&(h=u),c.top-m.top>3&&(i(h,m.top,null,m.bottom),h=u,m.bottom<c.top&&i(h,m.bottom,null,c.top)),null==n&&t==f&&(p=d),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),h<u+1&&(h=u),i(h,c.top,p-h,c.bottom)}),{start:a,end:s}}var a=e.display,l=e.doc,s=document.createDocumentFragment(),c=Bt(e.display),u=c.left,d=Math.max(a.sizerWidth,Ut(e)-a.sizer.offsetLeft)-c.right,f=t.from(),h=t.to();if(f.line==h.line)o(f.line,f.ch,h.ch);else{var p=M(l,f.line),m=M(l,h.line),g=de(p)==de(m),v=o(f.line,f.ch,g?p.text.length+1:null).end,y=o(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(i(v.right,v.top,null,v.bottom),i(u,y.top,y.left,y.bottom)):i(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&i(u,v.bottom,null,y.top)}r.appendChild(s)}function Or(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function _r(e){e.state.focused||(e.display.input.focus(),Wr(e))}function Er(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Fr(e))},100)}function Wr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Oe(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),ha&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Or(e))}function Fr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,t),e.state.focused=!1,Oa(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Dr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(da&&fa<8){var a=i.node.offsetTop+i.node.offsetHeight;o=a-r,r=a}else{var l=i.node.getBoundingClientRect();o=l.bottom-l.top}var s=i.line.height-o;if(o<2&&(o=yr(t)),(s>.001||s<-.001)&&(O(i.line,o),zr(i.line),i.rest))for(var c=0;c<i.rest.length;c++)zr(i.rest[c])}}}function zr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Pr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Rt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=E(t,n),a=E(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=E(t,ye(M(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=E(t,ye(M(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Ir(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=F(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=o.firstChild.offsetWidth,l=o.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-l)+1,i.lineNumWidth=i.lineNumInnerWidth+l,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",_n(e),!0}return!1}function Rr(e,t){if(!_e(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ba){var a=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Rt(e.display))+"px;\n height: "+(t.bottom-t.top+qt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}function jr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var a=!1,l=dr(e,t),s=r&&r!=t?dr(e,r):l;i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n};var c=qr(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Xr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Jr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function Br(e,t){var r=qr(e,t);null!=r.scrollTop&&Xr(e,r.scrollTop),null!=r.scrollLeft&&Jr(e,r.scrollLeft)}function qr(e,t){var r=e.display,n=yr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Kt(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+jt(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Ut(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Ur(e,t){null!=t&&($r(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Kr(e){$r(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?D(t.line,t.ch-1):t,n=D(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function Vr(e,t,r){null==t&&null==r||$r(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Gr(e,t){$r(e),e.curOp.scrollToPos=t}function $r(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;Yr(e,fr(e,t.from),fr(e,t.to),t.margin)}}function Yr(e,t,r,n){var i=qr(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Vr(e,i.scrollLeft,i.scrollTop)}function Xr(e,t){Math.abs(e.doc.scrollTop-t)<2||(la||Nn(e,{top:t}),Zr(e,t,!0),la&&Nn(e),kn(e,100))}function Zr(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Jr(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Qr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+jt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function en(e,t){t||(t=Qr(e));var r=e.display.barWidth,n=e.display.barHeight;tn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Dr(e),tn(e,Qr(e)),r=e.display.barWidth,n=e.display.barHeight}function tn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function rn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Oa(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new gl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),$a(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Jr(e,t):Xr(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function nn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++vl},xt(e.curOp)}function on(e){Ct(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;an(e)})}function an(e){for(var t=e.ops,r=0;r<t.length;r++)ln(t[r]);for(var n=0;n<t.length;n++)sn(t[n]);for(var i=0;i<t.length;i++)cn(t[i]);for(var o=0;o<t.length;o++)un(t[o]);for(var a=0;a<t.length;a++)dn(t[a])}function ln(e){var t=e.cm,r=t.display;Sn(t),e.updateMaxLine&&we(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new yl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function sn(e){e.updatedDisplay=e.mustUpdate&&Mn(e.cm,e.update)}function cn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Dr(t),e.barMeasure=Qr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Yt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+qt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ut(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function un(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Jr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==a()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&en(t,e.barMeasure),e.updatedDisplay&&En(t,e.barMeasure),e.selectionChanged&&Or(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&_r(e.cm)}function dn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&An(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Zr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Jr(t,e.scrollLeft,!0,!0),e.scrollToPos){Rr(t,jr(t,B(n,e.scrollToPos.from),B(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||Oe(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Oe(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function fn(e,t){if(e.curOp)return t();nn(e);try{return t()}finally{on(e)}}function hn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);nn(e);try{return t.apply(e,arguments)}finally{on(e)}}}function pn(e){return function(){if(this.curOp)return e.apply(this,arguments);nn(this);try{return e.apply(this,arguments)}finally{on(this)}}}function mn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);nn(t);try{return e.apply(this,arguments)}finally{on(t)}}}function gn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ua&&pe(e.doc,t)<i.viewTo&&yn(e);else if(r<=i.viewFrom)Ua&&me(e.doc,r+n)>i.viewFrom?yn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)yn(e);else if(t<=i.viewFrom){var o=bn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):yn(e)}else if(r>=i.viewTo){var a=bn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):yn(e)}else{var l=bn(e,t,t,-1),s=bn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(wt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):yn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function vn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Tr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==f(a,r)&&a.push(r)}}}function yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function bn(e,t,r,n){var i,o=Tr(e,t),a=e.display.view;if(!Ua||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function wn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=wt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=wt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Tr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(wt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Tr(e,r)))),n.viewTo=r}function xn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function kn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,c(Cn,e))}function Cn(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=et(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Ye(t.mode,n.state):null,s=Je(e,o,n,!0);l&&(n.state=l),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&tt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return kn(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&fn(e,function(){for(var t=0;t<i.length;t++)vn(e,i[t],"text")})}}function Sn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=qt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=qt(e)+"px",t.scrollbarsClipped=!0)}function Tn(e){if(e.hasFocus())return null;var t=a();if(!t||!o(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&o(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Ln(e){if(e&&e.activeElt&&e.activeElt!=a()&&(e.activeElt.focus(),e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Mn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return yn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==xn(e))return!1;Ir(e)&&(yn(e),r.dims=wr(e));var o=i.first+i.size,a=Math.max(r.visible.from-e.options.viewportMargin,i.first),l=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(i.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),Ua&&(a=pe(e.doc,a),l=me(e.doc,l));var s=a!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;wn(e,a,l),n.viewOffset=ye(M(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=xn(e);if(!s&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Tn(e);return c>4&&(n.lineDiv.style.display="none"),On(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ln(u),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,kn(e,400)),n.updateLineNumbers=null,!0}function An(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ut(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+jt(e.display)-Kt(e),r.top)}),t.visible=Pr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Mn(e,t);n=!1){Dr(e);var i=Qr(e);Lr(e),en(e,i),En(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 Nn(e,t){var r=new yl(e,t);if(Mn(e,r)){Dr(e),An(e,r);var n=Qr(e);Lr(e),en(e,n),En(e,n),r.finish()}}function On(e,r,n){function i(t){var r=t.nextSibling;return ha&&Ca&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,a=e.options.lineNumbers,l=o.lineDiv,s=l.firstChild,c=o.view,u=o.viewFrom,d=0;d<c.length;d++){var h=c[d];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=i(s);var p=a&&null!=r&&r<=u&&h.lineNumber;h.changes&&(f(h.changes,"gutter")>-1&&(p=!1),Lt(e,h,u,n)),p&&(t(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(F(e.options,u)))),s=h.node.nextSibling}else{var m=Ft(e,h,u,n);l.insertBefore(m,s)}u+=h.size}for(;s;)s=i(s)}function _n(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function En(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+qt(e)+"px"}function Wn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var a=i[o],l=r.appendChild(n("div",null,"CodeMirror-gutter "+a));"CodeMirror-linenumbers"==a&&(e.display.lineGutter=l,l.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",_n(e)}function Fn(e){var t=f(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Dn(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function zn(e){var t=Dn(e);return t.x*=wl,t.y*=wl,t}function Pn(e,t){var r=Dn(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&Ca&&ha)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!la&&!ga&&null!=wl)return i&&s&&Xr(e,Math.max(0,a.scrollTop+i*wl)),Jr(e,Math.max(0,a.scrollLeft+n*wl)),(!i||i&&s)&&De(t),void(o.wheelStartX=null);if(i&&null!=wl){var f=i*wl,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),Nn(e,{top:h,bottom:p})}bl<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(wl=(wl*bl+r)/(bl+1),++bl)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Hn(e,t){var r=e[t];e.sort(function(e,t){return z(e.from(),t.from())}),t=f(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(z(o.to(),i.from())>=0){var a=R(o.from(),i.from()),l=I(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new kl(s?l:a,s?a:l))}}return new xl(e,t)}function In(e,t){return new xl([new kl(e,t||e)],0)}function Rn(e){return e.text?D(e.from.line+e.text.length-1,m(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function jn(e,t){if(z(e,t.from)<0)return e;if(z(e,t.to)<=0)return Rn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Rn(t).ch-t.to.ch),D(r,n)}function Bn(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new kl(jn(i.anchor,t),jn(i.head,t)))}return Hn(r,e.sel.primIndex)}function qn(e,t,r){return e.line==t.line?D(r.line,e.ch-t.ch+r.ch):D(r.line+(e.line-t.line),e.ch)}function Un(e,t,r){for(var n=[],i=D(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=qn(l.from,i,o),c=qn(Rn(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=z(u.head,u.anchor)<0;n[a]=new kl(d?c:s,d?s:c)}else n[a]=new kl(s,s)}return new xl(n,e.sel.primIndex)}function Kn(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Vn(e)}function Vn(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,kn(e,100),e.state.modeGen++,e.curOp&&gn(e)}function Gn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==m(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function $n(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){ct(e,r,i,n),St(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new ll(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,u=M(e,l.line),d=M(e,s.line),f=m(c),h=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gn(e,t)){var g=a(0,c.length-1);o(d,d.text,h),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var v=a(1,c.length-1);v.push(new ll(f+u.text.slice(s.ch),h,n)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),h);var y=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,y)}St(e,"change",e,t)}function Yn(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function Xn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Cr(e),Kn(e),Zn(e),e.options.lineWrapping||we(e),e.options.mode=t.modeOption,gn(e)}function Zn(e){("rtl"==e.doc.direction?l:Oa)(e.display.lineDiv,"CodeMirror-rtl")}function Jn(e){fn(e,function(){Zn(e),gn(e)})}function Qn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ei(e,t){var r={from:H(t.from),to:Rn(t),text:A(e,t.from,t.to)};return li(e,r,t.from.line,t.to.line+1),Yn(e,function(e){return li(e,r,t.from.line,t.to.line+1)},!0),r}function ti(e){for(;e.length;){if(!m(e).ranges)break;e.pop()}}function ri(e,t){return t?(ti(e.done),m(e.done)):e.done.length&&!m(e.done).ranges?m(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),m(e.done)):void 0}function ni(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ri(i,i.lastOp==n)))a=m(o.changes),0==z(t.from,t.to)&&0==z(t.from,a.to)?a.to=Rn(t):o.changes.push(ei(e,t));else{var s=m(i.done);for(s&&s.ranges||ai(e.sel,i.done),o={changes:[ei(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Oe(e,"historyAdded")}function ii(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function oi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ii(e,o,m(i.done),t))?i.done[i.done.length-1]=t:ai(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&ti(i.undone)}function ai(e,t){var r=m(t);r&&r.ranges&&r.equals(e)||t.push(e)}function li(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function si(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ci(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(si(r[i]));return n}function ui(e,t){var r=ci(e,t),n=Q(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function di(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?xl.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&f(t,Number(u[1]))>-1&&(m(l)[d]=c[d],delete c[d])}}}return n}function fi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=z(t,i)<0;o!=z(r,i)<0?(i=t,t=r):o!=z(t,r)<0&&(t=r)}return new kl(i,t)}return new kl(r||t,t)}function hi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),bi(e,new xl([fi(e.sel.primary(),t,r,i)],0),n)}function pi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=fi(e.sel.ranges[o],t[o],null,i);bi(e,Hn(n,e.sel.primIndex),r)}function mi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,bi(e,Hn(i,e.sel.primIndex),n)}function gi(e,t,r,n){bi(e,In(t,r),n)}function vi(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new kl(B(e,t[n].anchor),B(e,t[n].head))},origin:r&&r.origin};return Oe(e,"beforeSelectionChange",e,n),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Hn(n.ranges,n.ranges.length-1):t}function yi(e,t,r){var n=e.history.done,i=m(n);i&&i.ranges?(n[n.length-1]=t,wi(e,t,r)):bi(e,t,r)}function bi(e,t,r){wi(e,t,r),oi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function wi(e,t,r){(We(e,"beforeSelectionChange")||e.cm&&We(e.cm,"beforeSelectionChange"))&&(t=vi(e,t,r)),xi(e,Ci(e,t,r&&r.bias||(z(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||Kr(e.cm)}function xi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ee(e.cm)),St(e,"cursorActivity",e))}function ki(e){xi(e,Ci(e,e.sel,null,!1))}function Ci(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ti(e,a.anchor,l&&l.anchor,r,n),c=Ti(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new kl(s,c))}return i?Hn(i,t.primIndex):t}function Si(e,t,r,n,i){var o=M(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Oe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var c=s.find(n<0?1:-1),u=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(c=Li(e,c,-n,c&&c.line==t.line?o:null)),
4
+ c&&c.line==t.line&&(u=z(c,r))&&(n<0?u<0:u>0))return Si(e,c,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(d=Li(e,d,n,d.line==t.line?o:null)),d?Si(e,d,t,n,i):null}}return t}function Ti(e,t,r,n,i){var o=n||1,a=Si(e,t,r,o,i)||!i&&Si(e,t,r,o,!0)||Si(e,t,r,-o,i)||!i&&Si(e,t,r,-o,!0);return a||(e.cantEdit=!0,D(e.first,0))}function Li(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?B(e,D(t.line-1)):null:r>0&&t.ch==(n||M(e,t.line)).text.length?t.line<e.first+e.size-1?D(t.line+1,0):null:new D(t.line,t.ch+r)}function Mi(e){e.setSelection(D(e.firstLine(),0),D(e.lastLine()),Pa)}function Ai(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=B(e,t)),r&&(n.to=B(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Oe(e,"beforeChange",e,n),e.cm&&Oe(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Ni(e,t,r){if(e.cm){if(!e.cm.curOp)return hn(e.cm,Ni)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"))||(t=Ai(e,t,!0))){var n=qa&&!r&&te(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Oi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Oi(e,t)}}function Oi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=z(t.from,t.to)){var r=Bn(e,t);ni(e,t,r,e.cm?e.cm.curOp.id:NaN),Wi(e,t,r,Q(e,t));var n=[];Yn(e,function(e,r){r||-1!=f(n,e.history)||(Hi(e.history,t),n.push(e.history)),Wi(e,t,null,Q(e,t))})}}function _i(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(ai(n,l),r&&!n.equals(e.sel))return void bi(e,n,{clearRedo:!1});o=n}var c=[];ai(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var u=We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"),d=n.changes.length-1;d>=0;--d){var h=function(r){var i=n.changes[r];if(i.origin=t,u&&!Ai(e,i,!1))return a.length=0,{};c.push(ei(e,i));var o=r?Bn(e,i):m(a);Wi(e,i,o,ui(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Rn(i)});var l=[];Yn(e,function(e,t){t||-1!=f(l,e.history)||(Hi(e.history,i),l.push(e.history)),Wi(e,i,null,ui(e,i))})}(d);if(h)return h.v}}}}function Ei(e,t){if(0!=t&&(e.first+=t,e.sel=new xl(g(e.sel.ranges,function(e){return new kl(D(e.anchor.line+t,e.anchor.ch),D(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){gn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)vn(e.cm,n,"gutter")}}function Wi(e,t,r,n){if(e.cm&&!e.cm.curOp)return hn(e.cm,Wi)(e,t,r,n);if(t.to.line<e.first)return void Ei(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ei(e,i),t={from:D(e.first,0),to:D(t.to.line+i,t.to.ch),text:[m(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:D(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=A(e,t.from,t.to),r||(r=Bn(e,t)),e.cm?Fi(e.cm,t,n):$n(e,t,n),wi(e,r,Pa)}}function Fi(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=_(de(M(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ee(e),$n(n,t,r,kr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),st(n,o.line),kn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?gn(e):o.line!=a.line||1!=t.text.length||Gn(e.doc,t)?gn(e,o.line,a.line+1,c):vn(e,o.line,"text");var u=We(e,"changes"),d=We(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&St(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Di(e,t,r,n,i){if(n||(n=r),z(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Ni(e,{from:r,to:n,text:t,origin:i})}function zi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Pi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)zi(o.ranges[l].anchor,t,r,n),zi(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=D(c.from.line+n,c.from.ch),c.to=D(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function Hi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Pi(e.done,r,n,i),Pi(e.undone,r,n,i)}function Ii(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=M(e,j(e,t)):i=_(t),null==i?null:(n(o,i)&&e.cm&&vn(e.cm,i,r),o)}function Ri(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r}function ji(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null}function Bi(e,t,r){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ur(e,r)}function qi(e,t,r,n){var i=new Cl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ii(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var n=ye(t)<e.scrollTop;O(t,t.height+Ht(i)),n&&Ur(o,i.height),o.curOp.forceUpdate=!0}return!0}),St(o,"lineWidgetAdded",o,i,"number"==typeof t?t:_(t)),i}function Ui(e,t,r,n,o){if(n&&n.shared)return Ki(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return hn(e.cm,Ui)(e,t,r,n,o);var a=new Tl(e,o),l=z(t,r);if(n&&u(n,a,!1),l>0||0==l&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ue(e,t.line,t,r,a)||t.line!=r.line&&ue(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");V()}a.addToHistory&&ni(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,c=t.line,d=e.cm;if(e.iter(c,r.line+1,function(e){d&&a.collapsed&&!d.options.lineWrapping&&de(e)==d.display.maxLine&&(s=!0),a.collapsed&&c!=t.line&&O(e,0),X(e,new G(a,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),a.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&O(t,0)}),a.clearOnEnter&&$a(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(K(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Sl,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)gn(d,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var f=t.line;f<=r.line;f++)vn(d,f,"text");a.atomic&&ki(d.doc),St(d,"markerAdded",d,a)}return a}function Ki(e,t,r,n,i){n=u(n),n.shared=!1;var o=[Ui(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Yn(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Ui(e,B(e,t),B(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=m(o)}),new Ll(o,a)}function Vi(e){return e.findMarks(D(e.first,0),e.clipPos(D(e.lastLine())),function(e){return e.parent})}function Gi(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(z(o,a)){var l=Ui(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function $i(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];Yn(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==f(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}(t)}function Yi(e){var t=this;if(Ji(t),!_e(t,e)&&!It(t.display,e)){De(e),da&&(Nl=+new Date);var r=Sr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=0;l<i;++l)!function(e,n){if(!t.options.allowDropFileTypes||-1!=f(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=hn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){r=B(t.doc,r);var s={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ni(t.doc,s),yi(t.doc,In(r,Rn(s)))}}),l.readAsText(e)}}(n[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var s=e.dataTransfer.getData("Text");if(s){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),wi(t.doc,In(r,r)),c)for(var u=0;u<c.length;++u)Di(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Xi(e,t){if(da&&(!e.state.draggingText||+new Date-Nl<100))return void He(t);if(!_e(e,t)&&!It(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!va)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ga&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ga&&r.parentNode.removeChild(r)}}function Zi(e,t){var i=Sr(e,t);if(i){var o=document.createDocumentFragment();Ar(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Ji(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Qi(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function eo(){Ol||(to(),Ol=!0)}function to(){var e;$a(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Qi(ro)},100))}),$a(window,"blur",function(){return Qi(Fr)})}function ro(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function no(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function io(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=g(r.split(" "),no),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function oo(e,t,r,n){t=co(t);var i=t.call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return oo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=oo(e,t.fallthrough[o],r,n);if(a)return a}}}function ao(e){var t="string"==typeof e?e:_l[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function lo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(Aa?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(Aa?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function so(e,t){if(ga&&34==e.keyCode&&e.char)return!1;var r=_l[e.keyCode];return null!=r&&!e.altGraphKey&&lo(r,e,t)}function co(e){return"string"==typeof e?Dl[e]:e}function uo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&z(o.from,m(n).to)<=0;){var a=n.pop();if(z(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}fn(e,function(){for(var t=n.length-1;t>=0;t--)Di(e.doc,"",n[t].from,n[t].to,"+delete");Kr(e)})}function fo(e,t){var r=M(e.doc,t),n=de(r);return n!=r&&(t=_(n)),Le(!0,e,n,t,1)}function ho(e,t){var r=M(e.doc,t),n=fe(r);return n!=r&&(t=_(n)),Le(!0,e,r,t,-1)}function po(e,t){var r=fo(e,t.line),n=M(e.doc,r.line),i=Ce(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return D(r.line,a?0:o,r.sticky)}return r}function mo(e,t,r){if("string"==typeof t&&!(t=zl[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=za}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function go(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=oo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&oo(t,e.options.extraKeys,r,e)||oo(t,e.options.keyMap,r,e)}function vo(e,t,r,n){var i=e.state.keySeq;if(i){if(ao(t))return"handled";Pl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=go(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&St(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(De(r),Or(e)),i&&!o&&/\'$/.test(t)?(De(r),!0):!!o}function yo(e,t){var r=so(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?vo(e,"Shift-"+r,t,function(t){return mo(e,t,!0)})||vo(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return mo(e,t)}):vo(e,r,t,function(t){return mo(e,t)}))}function bo(e,t,r){return vo(e,"'"+r+"'",t,function(t){return mo(e,t,!0)})}function wo(e){var t=this;if(t.curOp.focus=a(),!_e(t,e)){da&&fa<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=yo(t,e);ga&&(Hl=n?r:null,!n&&88==r&&!Ja&&(Ca?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||xo(t)}}function xo(e){function t(e){18!=e.keyCode&&e.altKey||(Oa(r,"CodeMirror-crosshair"),Ne(document,"keyup",t),Ne(document,"mouseover",t))}var r=e.display.lineDiv;l(r,"CodeMirror-crosshair"),$a(document,"keyup",t),$a(document,"mouseover",t)}function ko(e){16==e.keyCode&&(this.doc.sel.shift=!1),_e(this,e)}function Co(e){var t=this;if(!(It(t.display,e)||_e(t,e)||e.ctrlKey&&!e.altKey||Ca&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ga&&r==Hl)return Hl=null,void De(e);if(!ga||e.which&&!(e.which<10)||!yo(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(bo(t,e,i)||t.display.input.onKeyPress(e))}}}function So(e,t){var r=+new Date;return jl&&jl.compare(r,e,t)?(Rl=jl=null,"triple"):Rl&&Rl.compare(r,e,t)?(jl=new Il(r,e,t),Rl=null,"double"):(Rl=new Il(r,e,t),jl=null,"single")}function To(e){var t=this,r=t.display;if(!(_e(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,It(r,e))return void(ha||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!Wo(t,e)){var n=Sr(t,e),i=Re(e),o=n?So(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&Lo(t,i,n,o,e)||(1==i?n?Ao(t,n,o,e):Ie(e)==r.scroller&&De(e):2==i?(n&&hi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==i&&(Na?Fo(t,e):Er(t)))}}}function Lo(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,vo(e,lo(o,i),i,function(t){if("string"==typeof t&&(t=zl[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=za}finally{e.state.suppressEdits=!1}return n})}function Mo(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=Sa?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=Ca?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(Ca?r.altKey:r.ctrlKey)),i}function Ao(e,t,r,n){da?setTimeout(c(_r,e),0):e.curOp.focus=a();var i,o=Mo(e,r,n),l=e.doc.sel;e.options.dragDrop&&Ya&&!e.isReadOnly()&&"single"==r&&(i=l.contains(t))>-1&&(z((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(z(i.to(),t)>0||t.xRel<0)?No(e,n,t,o):_o(e,n,t,o)}function No(e,t,r,n){var i=e.display,o=!1,a=hn(e,function(t){ha&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ne(document,"mouseup",a),Ne(document,"mousemove",l),Ne(i.scroller,"dragstart",s),Ne(i.scroller,"drop",a),o||(De(t),n.addNew||hi(e.doc,r,null,null,n.extend),ha||da&&9==fa?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),l=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return o=!0};ha&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),$a(document,"mouseup",a),$a(document,"mousemove",l),$a(i.scroller,"dragstart",s),$a(i.scroller,"drop",a),Er(e),setTimeout(function(){return i.input.focus()},20)}function Oo(e,t,r){if("char"==r)return new kl(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new kl(D(t.line,0),B(e.doc,D(t.line+1,0)));var n=r(e,t);return new kl(n.from,n.to)}function _o(e,t,r,n){function i(t){if(0!=z(v,t))if(v=t,"rectangle"==n.unit){for(var i=[],o=e.options.tabSize,a=d(M(c,r.line).text,r.ch,o),l=d(M(c,t.line).text,t.ch,o),s=Math.min(a,l),m=Math.max(a,l),g=Math.min(r.line,t.line),y=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=y;g++){var b=M(c,g).text,w=h(b,s,o);s==m?i.push(new kl(D(g,w),D(g,w))):b.length>w&&i.push(new kl(D(g,w),D(g,h(b,m,o))))}i.length||i.push(new kl(r,r)),bi(c,Hn(p.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,k=u,C=Oo(e,t,n.unit),S=k.anchor;z(C.anchor,S)>0?(x=C.head,S=R(k.from(),C.anchor)):(x=C.anchor,S=I(k.to(),C.head));var T=p.ranges.slice(0);T[f]=new kl(B(c,S),x),bi(c,Hn(T,f),Ha)}}function o(t){var r=++b,l=Sr(e,t,!0,"rectangle"==n.unit);if(l)if(0!=z(l,v)){e.curOp.focus=a(),i(l);var u=Pr(s,c);(l.line>=u.to||l.line<u.from)&&setTimeout(hn(e,function(){b==r&&o(t)}),150)}else{var d=t.clientY<y.top?-20:t.clientY>y.bottom?20:0;d&&setTimeout(hn(e,function(){b==r&&(s.scroller.scrollTop+=d,o(t))}),50)}}function l(t){e.state.selectingText=!1,b=1/0,De(t),s.input.focus(),Ne(document,"mousemove",w),Ne(document,"mouseup",x),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;De(t);var u,f,p=c.sel,m=p.ranges;if(n.addNew&&!n.extend?(f=c.sel.contains(r),u=f>-1?m[f]:new kl(r,r)):(u=c.sel.primary(),f=c.sel.primIndex),"rectangle"==n.unit)n.addNew||(u=new kl(r,r)),r=Sr(e,t,!0,!0),f=-1;else{var g=Oo(e,r,n.unit);u=n.extend?fi(u,g.anchor,g.head,n.extend):g}n.addNew?-1==f?(f=m.length,bi(c,Hn(m.concat([u]),f),{scroll:!1,origin:"*mouse"})):m.length>1&&m[f].empty()&&"char"==n.unit&&!n.extend?(bi(c,Hn(m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=c.sel):mi(c,f,u,Ha):(f=0,bi(c,new xl([u],0),Ha),p=c.sel);var v=r,y=s.wrapper.getBoundingClientRect(),b=0,w=hn(e,function(e){Re(e)?o(e):l(e)}),x=hn(e,l);e.state.selectingText=x,$a(document,"mousemove",w),$a(document,"mouseup",x)}function Eo(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&De(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!We(e,r))return Pe(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){return Oe(e,r,e,E(e.doc,o),e.options.gutters[s],t),Pe(t)}}}function Wo(e,t){return Eo(e,t,"gutterClick",!0)}function Fo(e,t){It(e.display,t)||Do(e,t)||_e(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Do(e,t){return!!We(e,"gutterContextMenu")&&Eo(e,t,"gutterContextMenu",!1)}function zo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),or(e)}function Po(e){Wn(e),gn(e),Hr(e)}function Ho(e,t,r){if(!t!=!(r&&r!=Bl)){var n=e.display.dragFunctions,i=t?$a:Ne;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Io(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Oa(e.display.wrapper,"CodeMirror-wrap"),we(e)),Cr(e),gn(e),or(e),setTimeout(function(){return en(e)},100)}function Ro(e,t){var r=this;if(!(this instanceof Ro))return new Ro(e,t);this.options=t=t?u(t):{},u(ql,t,!1),Fn(t);var n=t.value;"string"==typeof n&&(n=new Al(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new Ro.inputStyles[t.inputStyle](this),o=this.display=new L(e,n,i);o.wrapper.CodeMirror=this,Wn(this),zo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),rn(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 Ea,keySeq:null,specialChars:null},t.autofocus&&!ka&&o.input.focus(),da&&fa<11&&setTimeout(function(){return r.display.input.reset(!0)},20),jo(this),eo(),nn(this),this.curOp.forceUpdate=!0,Xn(this,n),t.autofocus&&!ka||this.hasFocus()?setTimeout(c(Wr,this),20):Fr(this);for(var a in Ul)Ul.hasOwnProperty(a)&&Ul[a](r,t[a],Bl);Ir(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Kl.length;++l)Kl[l](r);on(this),ha&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function jo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;$a(i.scroller,"mousedown",hn(e,To)),da&&fa<11?$a(i.scroller,"dblclick",hn(e,function(t){if(!_e(e,t)){var r=Sr(e,t);if(r&&!Wo(e,t)&&!It(e.display,t)){De(t);var n=e.findWordAt(r);hi(e.doc,n.anchor,n.head)}}})):$a(i.scroller,"dblclick",function(t){return _e(e,t)||De(t)}),Na||$a(i.scroller,"contextmenu",function(t){return Fo(e,t)});var o,a={end:0};$a(i.scroller,"touchstart",function(t){if(!_e(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),$a(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),$a(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!It(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||n(o,o.prev)?new kl(l,l):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(l):new kl(D(l.line,0),B(e.doc,D(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),De(r)}t()}),$a(i.scroller,"touchcancel",t),$a(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Xr(e,i.scroller.scrollTop),Jr(e,i.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),$a(i.scroller,"mousewheel",function(t){return Pn(e,t)}),$a(i.scroller,"DOMMouseScroll",function(t){return Pn(e,t)}),$a(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){_e(e,t)||He(t)},over:function(t){_e(e,t)||(Zi(e,t),He(t))},start:function(t){return Xi(e,t)},drop:hn(e,Yi),leave:function(t){_e(e,t)||Ji(e)}};var l=i.input.getField();$a(l,"keyup",function(t){return ko.call(e,t)}),$a(l,"keydown",hn(e,wo)),$a(l,"keypress",hn(e,Co)),$a(l,"focus",function(t){return Wr(e,t)}),$a(l,"blur",function(t){return Fr(e,t)})}function Bo(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t).state:r="prev");var a=e.options.tabSize,l=M(o,t),s=d(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==za||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?d(M(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/a);m;--m)h+=a,f+="\t";if(h<c&&(f+=p(c-h)),f!=u)return Di(o,f,D(t,0),D(t,u.length),"+input"),l.stateAfter=null,!0;for(var g=0;g<o.sel.ranges.length;g++){var v=o.sel.ranges[g];if(v.head.line==t&&v.head.ch<u.length){var y=D(t,u.length);mi(o,g,new kl(y,y));break}}}function qo(e){Vl=e}function Uo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Xa(t),s=null;if(a&&n.ranges.length>1)if(Vl&&Vl.text.join("\n")==t){if(n.ranges.length%Vl.text.length==0){s=[];for(var c=0;c<Vl.text.length;c++)s.push(o.splitLines(Vl.text[c]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(s=g(l,function(e){return[e]}));for(var u,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],h=f.from(),p=f.to();f.empty()&&(r&&r>0?h=D(h.line,h.ch-r):e.state.overwrite&&!a?p=D(p.line,Math.min(M(o,p.line).text.length,p.ch+m(l).length)):Vl&&Vl.lineWise&&Vl.text.join("\n")==t&&(h=p=D(h.line,0))),u=e.curOp.updateInput;var v={from:h,to:p,text:s?s[d%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Ni(e.doc,v),St(e,"inputRead",e,v)}t&&!a&&Vo(e,t),Kr(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ko(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||fn(t,function(){return Uo(t,r,0,null,"paste")}),!0}function Vo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Bo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Bo(e,i.head.line,"smart"));a&&St(e,"electricInput",e,i.head.line)}}}function Go(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:D(i,0),head:D(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function $o(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Yo(){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 ha?e.style.width="1000px":e.setAttribute("wrap","off"),wa&&(e.style.border="1px solid black"),$o(e),t}function Xo(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new D(n,t.ch,t.sticky),c=M(e,n))}function a(n){var a;if(null==(a=i?Me(e.cm,c,t,r):Te(c,t,r))){if(n||!o())return!1;t=Le(i,e.cm,c,t.line,r)}else t=a;return!0}var l=t,s=r,c=M(e,t.line);if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var u=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||a(!h);h=!1){var p=c.text.charAt(t.ch)||"\n",m=x(p,f)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||h||m||(m="s"),u&&u!=m){r<0&&(r=1,a(),t.sticky="after");break}if(m&&(u=m),r>0&&!a(!h))break}var g=Ti(e,t,l,s,!0);return P(l,g)&&(g.hitSide=!0),g}function Zo(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*yr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var c;c=pr(e,a,i),c.outside;){if(r<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*r}return c}function Jo(e,t){var r=Xt(e,t.line);if(!r||r.hidden)return null;var n=M(e.doc,t.line),i=Gt(r,n,t.line),o=Ce(n,e.doc.direction),a="left";if(o){a=ke(o,t.ch)%2?"right":"left"}var l=Qt(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Qo(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ea(e,t){return t&&(e.bad=!0),e}function ta(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function a(){u&&(c+=d,u=!1)}function l(e){e&&(a(),c+=e)}function s(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void l(r||t.textContent.replace(/\u200b/g,""));var c,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(D(n,0),D(i+1,0),o(+f));return void(h.length&&(c=h[0].find())&&l(A(e.doc,c.from,c.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&a();for(var m=0;m<t.childNodes.length;m++)s(t.childNodes[m]);p&&(u=!0)}else 3==t.nodeType&&l(t.nodeValue)}for(var c="",u=!1,d=e.doc.lineSeparator();s(t),t!=r;)t=t.nextSibling;return c}function ra(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return ea(e.clipPos(D(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return na(o,t,r)}}function na(e,t,r){function n(t,r,n){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var s=_(i<0?e.line:e.rest[i]),c=o[a]+n;return(n<0||l!=t)&&(c=o[a+(n?1:0)]),D(s,c)}}}var i=e.text.firstChild,a=!1;if(!t||!o(i,t))return ea(D(_(e.line),0),!0);if(t==i&&(a=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?m(e.rest):e.line;return ea(D(_(l),l.text.length),a)}var s=3==t.nodeType?t:null,c=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,d=u.maps,f=n(s,c,r);if(f)return ea(f,a);for(var h=c.nextSibling,p=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return ea(D(f.line,f.ch-p),a);p+=h.textContent.length}for(var g=c.previousSibling,v=r;g;g=g.previousSibling){if(f=n(g,g.firstChild,-1))return ea(D(f.line,f.ch+v),a);v+=g.textContent.length}}function ia(e,t){function r(){e.value=s.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=a();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&($a(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Ne(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Ro(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}
5
+ var oa=navigator.userAgent,aa=navigator.platform,la=/gecko\/\d/i.test(oa),sa=/MSIE \d/.test(oa),ca=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oa),ua=/Edge\/(\d+)/.exec(oa),da=sa||ca||ua,fa=da&&(sa?document.documentMode||6:+(ua||ca)[1]),ha=!ua&&/WebKit\//.test(oa),pa=ha&&/Qt\/\d+\.\d+/.test(oa),ma=!ua&&/Chrome\//.test(oa),ga=/Opera\//.test(oa),va=/Apple Computer/.test(navigator.vendor),ya=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oa),ba=/PhantomJS/.test(oa),wa=!ua&&/AppleWebKit/.test(oa)&&/Mobile\/\w+/.test(oa),xa=/Android/.test(oa),ka=wa||xa||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oa),Ca=wa||/Mac/.test(aa),Sa=/\bCrOS\b/.test(oa),Ta=/win/i.test(aa),La=ga&&oa.match(/Version\/(\d*\.\d*)/);La&&(La=Number(La[1])),La&&La>=15&&(ga=!1,ha=!0);var Ma,Aa=Ca&&(pa||ga&&(null==La||La<12.11)),Na=la||da&&fa>=9,Oa=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};Ma=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var _a=function(e){e.select()};wa?_a=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:da&&(_a=function(e){try{e.select()}catch(e){}});var Ea=function(){this.id=null};Ea.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Wa,Fa,Da=30,za={toString:function(){return"CodeMirror.Pass"}},Pa={scroll:!1},Ha={origin:"*mouse"},Ia={origin:"+move"},Ra=[""],ja=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ba=/[\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]/,qa=!1,Ua=!1,Ka=null,Va=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;return function(r,n){var c="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var u=r.length,d=[],f=0;f<u;++f)d.push(e(r.charCodeAt(f)));for(var h=0,p=c;h<u;++h){var g=d[h];"m"==g?d[h]=p:p=g}for(var v=0,y=c;v<u;++v){var b=d[v];"1"==b&&"r"==y?d[v]="n":a.test(b)&&(y=b,"r"==b&&(d[v]="R"))}for(var w=1,x=d[0];w<u-1;++w){var k=d[w];"+"==k&&"1"==x&&"1"==d[w+1]?d[w]="1":","!=k||x!=d[w+1]||"1"!=x&&"n"!=x||(d[w]=x),x=k}for(var C=0;C<u;++C){var S=d[C];if(","==S)d[C]="N";else if("%"==S){var T=void 0;for(T=C+1;T<u&&"%"==d[T];++T);for(var L=C&&"!"==d[C-1]||T<u&&"1"==d[T]?"1":"N",M=C;M<T;++M)d[M]=L;C=T-1}}for(var A=0,N=c;A<u;++A){var O=d[A];"L"==N&&"1"==O?d[A]="L":a.test(O)&&(N=O)}for(var _=0;_<u;++_)if(o.test(d[_])){var E=void 0;for(E=_+1;E<u&&o.test(d[E]);++E);for(var W="L"==(_?d[_-1]:c),F="L"==(E<u?d[E]:c),D=W==F?W?"L":"R":c,z=_;z<E;++z)d[z]=D;_=E-1}for(var P,H=[],I=0;I<u;)if(l.test(d[I])){var R=I;for(++I;I<u&&l.test(d[I]);++I);H.push(new t(0,R,I))}else{var j=I,B=H.length;for(++I;I<u&&"L"!=d[I];++I);for(var q=j;q<I;)if(s.test(d[q])){j<q&&H.splice(B,0,new t(1,j,q));var U=q;for(++q;q<I&&s.test(d[q]);++q);H.splice(B,0,new t(2,U,q)),j=q}else++q;j<I&&H.splice(B,0,new t(1,j,I))}return 1==H[0].level&&(P=r.match(/^\s+/))&&(H[0].from=P[0].length,H.unshift(new t(0,0,P[0].length))),1==m(H).level&&(P=r.match(/\s+$/))&&(m(H).to-=P[0].length,H.push(new t(0,u-P[0].length,u))),"rtl"==n?H.reverse():H}}(),Ga=[],$a=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Ga).concat(r)}},Ya=function(){if(da&&fa<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Xa=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Za=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)},Ja=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Qa=null,el={},tl={},rl={},nl=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};nl.prototype.eol=function(){return this.pos>=this.string.length},nl.prototype.sol=function(){return this.pos==this.lineStart},nl.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},nl.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},nl.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},nl.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},nl.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},nl.prototype.skipToEnd=function(){this.pos=this.string.length},nl.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},nl.prototype.backUp=function(e){this.pos-=e},nl.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},nl.prototype.indentation=function(){return d(this.string,null,this.tabSize)-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},nl.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},nl.prototype.current=function(){return this.string.slice(this.start,this.pos)},nl.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},nl.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};var il=function(e,t){this.state=e,this.lookAhead=t},ol=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0};ol.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ol.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ol.fromSaved=function(e,t,r){return t instanceof il?new ol(e,Ye(e.mode,t.saved),r,t.lookAhead):new ol(e,Ye(e.mode,t),r)},ol.prototype.save=function(e){var t=!1!==e?Ye(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new il(t,this.maxLookAhead):t};var al=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r},ll=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};ll.prototype.lineNo=function(){return _(this)},Fe(ll);var sl,cl={},ul={},dl=null,fl=null,hl={left:0,right:0,top:0,bottom:0},pl=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),$a(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),$a(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,da&&fa<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pl.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},pl.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pl.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pl.prototype.zeroWidthHack=function(){var e=Ca&&!ya?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ea,this.disableVert=new Ea},pl.prototype.enableZeroWidthBar=function(e,t,r){function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},pl.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ml=function(){};ml.prototype.update=function(){return{bottom:0,right:0}},ml.prototype.setScrollLeft=function(){},ml.prototype.setScrollTop=function(){},ml.prototype.clear=function(){};var gl={native:pl,null:ml},vl=0,yl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Pr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ut(e),this.force=r,this.dims=wr(e),this.events=[]};yl.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)},yl.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Oe.apply(null,e.events[t])};var bl=0,wl=null;da?wl=-.53:la?wl=15:ma?wl=-.7:va&&(wl=-1/3);var xl=function(e,t){this.ranges=e,this.primIndex=t};xl.prototype.primary=function(){return this.ranges[this.primIndex]},xl.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!P(n.anchor,i.anchor)||!P(n.head,i.head))return!1}return!0},xl.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new kl(H(e.ranges[r].anchor),H(e.ranges[r].head));return new xl(t,this.primIndex)},xl.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},xl.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(z(t,i.from())>=0&&z(e,i.to())<=0)return n}return-1};var kl=function(e,t){this.anchor=e,this.head=t};kl.prototype.from=function(){return R(this.anchor,this.head)},kl.prototype.to=function(){return I(this.anchor,this.head)},kl.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Ri.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,ut(o),St(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},iterN:function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0}},ji.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ri))){var s=[];this.collapse(s),this.children=[new Ri(s)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new Ri(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ji(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=f(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new ji(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<a){var l=Math.min(t,a-e);if(o.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=a}}};var Cl=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};Cl.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=_(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var a=Ht(this);O(n,Math.max(0,n.height-a)),t&&(fn(t,function(){Bi(t,n,-a),vn(t,i,"widget")}),St(t,"lineWidgetCleared",t,this,i))}},Cl.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Ht(this)-t;i&&(O(n,n.height+i),r&&fn(r,function(){r.curOp.forceUpdate=!0,Bi(r,n,i),St(r,"lineWidgetChanged",r,e,_(n))}))},Fe(Cl);var Sl=0,Tl=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Sl};Tl.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&nn(t),We(this,"clear")){var n=this.find();n&&St(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=$(l.markedSpans,e);t&&!e.collapsed?vn(t,_(l),"text"):t&&(null!=s.to&&(o=_(l)),null!=s.from&&(i=_(l))),l.markedSpans=Y(l.markedSpans,s),null==s.from&&e.collapsed&&!ge(e.doc,l)&&t&&O(l,yr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=de(e.lines[c]),d=be(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&gn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ki(t.doc)),t&&St(t,"markerCleared",t,this,i,o),r&&on(t),this.parent&&this.parent.clear()}},Tl.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var a=r.lines[o],l=$(a.markedSpans,r);if(null!=l.from&&(n=D(t?a:_(a),l.from),-1==e))return n;if(null!=l.to&&(i=D(t?a:_(a),l.to),1==e))return i}return n&&{from:n,to:i}},Tl.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&fn(n,function(){var i=t.line,o=_(t.line),a=Xt(n,o);if(a&&(nr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ge(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Ht(r)-l;s&&O(i,i.height+s)}St(n,"markerChanged",n,e)})},Tl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=f(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Tl.prototype.detachLine=function(e){if(this.lines.splice(f(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Fe(Tl);var Ll=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};Ll.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();St(this,"clear")}},Ll.prototype.find=function(e,t){return this.primary.find(e,t)},Fe(Ll);var Ml=0,Al=function(e,t,r,n,i){if(!(this instanceof Al))return new Al(e,t,r,n,i);null==r&&(r=0),ji.call(this,[new Ri([new ll("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=D(r,0);this.sel=In(o),this.history=new Qn(null),this.id=++Ml,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),$n(this,{from:o,to:o,text:e}),bi(this,In(o),Pa)};Al.prototype=b(ji.prototype,{constructor:Al,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=N(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:mn(function(e){var t=D(this.first,0),r=this.first+this.size-1;Ni(this,{from:t,to:D(r,M(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Vr(this.cm,0,0),bi(this,In(t),Pa)}),replaceRange:function(e,t,r,n){t=B(this,t),r=r?B(this,r):t,Di(this,e,t,r,n)},getRange:function(e,t,r){var n=A(this,B(this,e),B(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(W(this,e))return M(this,e)},getLineNumber:function(e){return _(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=M(this,e)),de(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return B(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:mn(function(e,t,r){gi(this,B(this,"number"==typeof e?D(e,t||0):e),null,r)}),setSelection:mn(function(e,t,r){gi(this,B(this,e),B(this,t||e),r)}),extendSelection:mn(function(e,t,r){hi(this,B(this,e),t&&B(this,t),r)}),extendSelections:mn(function(e,t){pi(this,U(this,e),t)}),extendSelectionsBy:mn(function(e,t){pi(this,U(this,g(this.sel.ranges,e)),t)}),setSelections:mn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new kl(B(n,e[o].anchor),B(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),bi(this,Hn(i,t),r)}}),addSelection:mn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new kl(B(this,e),B(this,t||e))),bi(this,Hn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=A(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=A(t,n[i].from(),n[i].to());!1!==e&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:mn(function(e,t,r){for(var n=this,i=[],o=this.sel,a=0;a<o.ranges.length;a++){var l=o.ranges[a];i[a]={from:l.from(),to:l.to(),text:n.splitLines(e[a]),origin:r}}for(var s=t&&"end"!=t&&Un(this,i,t),c=i.length-1;c>=0;c--)Ni(n,i[c]);s?yi(this,s):this.cm&&Kr(this.cm)}),undo:mn(function(){_i(this,"undo")}),redo:mn(function(){_i(this,"redo")}),undoSelection:mn(function(){_i(this,"undo",!0)}),redoSelection:mn(function(){_i(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Qn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:di(this.history.done),undone:di(this.history.undone)}},setHistory:function(e){var t=this.history=new Qn(this.history.maxGeneration);t.done=di(e.done.slice(0),null,!0),t.undone=di(e.undone.slice(0),null,!0)},setGutterMarker:mn(function(e,t,r){return Ii(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&k(n)&&(e.gutterMarkers=null),!0})}),clearGutter:mn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Ii(t,r,"gutter",function(){return r.gutterMarkers[e]=null,k(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!W(this,e))return null;if(t=e,!(e=M(this,e)))return null}else if(null==(t=_(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:mn(function(t,r,n){return Ii(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:mn(function(t,r,n){return Ii(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var a=o.match(e(n));if(!a)return!1;var l=a.index+a[0].length;t[i]=o.slice(0,a.index)+(a.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0})}),addLineWidget:mn(function(e,t,r){return qi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ui(this,B(this,e),B(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=B(this,e),Ui(this,e,e,r,"bookmark")},findMarksAt:function(e){e=B(this,e);var t=[],r=M(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=B(this,e),t=B(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),B(this,D(r,t))},indexFromPos:function(e){e=B(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new Al(N(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Al(N(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Gi(n,Vi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Ro&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),$i(Vi(t));break}}if(e.history==this.history){var i=[e.id];Yn(e,function(e){return i.push(e.id)},!0),e.history=new Qn(null),e.history.done=di(this.history.done,i),e.history.undone=di(this.history.undone,i)}},iterLinkedDocs:function(e){Yn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Xa(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:mn(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Jn(this.cm))})}),Al.prototype.eachLine=Al.prototype.iter;for(var Nl=0,Ol=!1,_l={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},El=0;El<10;El++)_l[El+48]=_l[El+96]=String(El);for(var Wl=65;Wl<=90;Wl++)_l[Wl]=String.fromCharCode(Wl);for(var Fl=1;Fl<=12;Fl++)_l[Fl+111]=_l[Fl+63235]="F"+Fl;var Dl={};Dl.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"},Dl.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"},Dl.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"},Dl.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"]},Dl.default=Ca?Dl.macDefault:Dl.pcDefault;var zl={selectAll:Mi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Pa)},killLine:function(e){return uo(e,function(t){if(t.empty()){var r=M(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:D(t.head.line+1,0)}:{from:t.head,to:D(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return uo(e,function(t){return{from:D(t.from().line,0),to:B(e.doc,D(t.to().line+1,0))}})},delLineLeft:function(e){return uo(e,function(e){return{from:D(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return uo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return uo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},
6
+ goDocStart:function(e){return e.extendSelection(D(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(D(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return po(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ia)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ia)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?po(e,t.head):n},Ia)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=d(e.getLine(o.line),o.ch,n);t.push(p(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return fn(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=M(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new D(i.line,i.ch-1)),i.ch>0)i=new D(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),D(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=M(e.doc,i.line-1).text;a&&(i=new D(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),D(i.line-1,a.length-1),i,"+transpose"))}r.push(new kl(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return fn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Kr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Pl=new Ea,Hl=null,Il=function(e,t,r){this.time=e,this.pos=t,this.button=r};Il.prototype.compare=function(e,t,r){return this.time+400>e&&0==z(t,this.pos)&&r==this.button};var Rl,jl,Bl={toString:function(){return"CodeMirror.Init"}},ql={},Ul={};Ro.defaults=ql,Ro.optionHandlers=Ul;var Kl=[];Ro.defineInitHook=function(e){return Kl.push(e)};var Vl=null,Gl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ea,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gl.prototype.init=function(e){function t(e){if(!_e(i,e)){if(i.somethingSelected())qo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Go(i);qo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Pa),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Vl.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var a=Yo(),l=a.firstChild;i.display.lineSpace.insertBefore(a,i.display.lineSpace.firstChild),l.value=Vl.text.join("\n");var s=document.activeElement;_a(l),setTimeout(function(){i.display.lineSpace.removeChild(a),s.focus(),s==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;$o(o,i.options.spellcheck),$a(o,"paste",function(e){_e(i,e)||Ko(e,i)||fa<=11&&setTimeout(hn(i,function(){return r.updateFromDOM()}),20)}),$a(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),$a(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),$a(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),$a(o,"touchstart",function(){return n.forceCompositionEnd()}),$a(o,"input",function(){r.composing||r.readFromDOMSoon()}),$a(o,"copy",t),$a(o,"cut",t)},Gl.prototype.prepareSelection=function(){var e=Mr(this.cm,!1);return e.focus=this.cm.state.focused,e},Gl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Gl.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)return void e.removeAllRanges();var o=ra(t,e.anchorNode,e.anchorOffset),a=ra(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=z(R(o,a),n)||0!=z(I(o,a),i)){var l=t.display.view,s=n.line>=t.display.viewFrom&&Jo(t,n)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Jo(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)return void e.removeAllRanges();var f,h=e.rangeCount&&e.getRangeAt(0);try{f=Ma(s.node,s.offset,c.offset,c.node)}catch(e){}f&&(!la&&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):la&&this.startGracePeriod()),this.rememberSelection()}},Gl.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)},Gl.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},Gl.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gl.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},Gl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gl.prototype.blur=function(){this.div.blur()},Gl.prototype.getField=function(){return this.div},Gl.prototype.supportsTouch=function(){return!0},Gl.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():fn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Gl.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(xa&&ma&&this.cm.options.gutters.length&&Qo(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=ra(t,e.anchorNode,e.anchorOffset),n=ra(t,e.focusNode,e.focusOffset);r&&n&&fn(t,function(){bi(t.doc,In(r,n),Pa),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Gl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=D(n.line-1,M(e.doc,n.line-1).length)),i.ch==M(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=D(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;n.line==t.viewFrom||0==(o=Tr(e,n.line))?(a=_(t.view[0].line),l=t.view[0].node):(a=_(t.view[o].line),l=t.view[o-1].node.nextSibling);var s,c,u=Tr(e,i.line);if(u==t.view.length-1?(s=t.viewTo-1,c=t.lineDiv.lastChild):(s=_(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(ta(e,l,c,a,s)),f=A(e.doc,D(a,0),D(s,M(e.doc,s).text.length));d.length>1&&f.length>1;)if(m(d)==m(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,p=0,g=d[0],v=f[0],y=Math.min(g.length,v.length);h<y&&g.charCodeAt(h)==v.charCodeAt(h);)++h;for(var b=m(d),w=m(f),x=Math.min(b.length-(1==d.length?h:0),w.length-(1==f.length?h:0));p<x&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==d.length&&1==f.length&&a==n.line)for(;h&&h>n.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)h--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=D(a,h),C=D(s,f.length?m(f).length-p:0);return d.length>1||d[0]||z(k,C)?(Di(e.doc,d,k,C,"+input"),!0):void 0},Gl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gl.prototype.reset=function(){this.forceCompositionEnd()},Gl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Gl.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))},Gl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||fn(this.cm,function(){return gn(e.cm)})},Gl.prototype.setUneditable=function(e){e.contentEditable="false"},Gl.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||hn(this.cm,Uo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Gl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Gl.prototype.onContextMenu=function(){},Gl.prototype.resetPosition=function(){},Gl.prototype.needsContentAttribute=!0;var $l=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ea,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};$l.prototype.init=function(e){function t(e){if(!_e(i,e)){if(i.somethingSelected())qo({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,a.value=Vl.text.join("\n"),_a(a));else{if(!i.options.lineWiseCopyCut)return;var t=Go(i);qo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Pa):(n.prevInput="",a.value=t.text.join("\n"),_a(a))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Yo(),a=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),wa&&(a.style.width="0px"),$a(a,"input",function(){da&&fa>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),$a(a,"paste",function(e){_e(i,e)||Ko(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),$a(a,"cut",t),$a(a,"copy",t),$a(e.scroller,"paste",function(t){It(e,t)||_e(i,t)||(i.state.pasteIncoming=!0,n.focus())}),$a(e.lineSpace,"selectstart",function(t){It(e,t)||De(t)}),$a(a,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),$a(a,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$l.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=dr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},$l.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$l.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Ja&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var a=t?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&_a(this.textarea),da&&fa>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",da&&fa>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},$l.prototype.getField=function(){return this.textarea},$l.prototype.supportsTouch=function(){return!1},$l.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ka||a()!=this.textarea))try{this.textarea.focus()}catch(e){}},$l.prototype.blur=function(){this.textarea.blur()},$l.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$l.prototype.receivedFocus=function(){this.slowPoll()},$l.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$l.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},$l.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Za(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(da&&fa>=9&&this.hasSelection===i||Ca&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return fn(t,function(){Uo(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$l.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$l.prototype.onKeyPress=function(){da&&fa>=9&&(this.hasSelection=null),this.fastPoll()},$l.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=u,a.style.cssText=c,da&&fa<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!da||da&&fa<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==n.prevInput?hn(i,Mi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=Sr(i,e),s=o.scroller.scrollTop;if(l&&!ga){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&hn(i,bi)(i.doc,In(l),Pa);var c=a.style.cssText,u=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var d=n.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(da?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(ha&&(f=window.scrollY),o.input.focus(),ha&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),da&&fa>=9&&t(),Na){He(e);var h=function(){Ne(window,"mouseup",h),setTimeout(r,20)};$a(window,"mouseup",h)}else setTimeout(r,50)}},$l.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},$l.prototype.setUneditable=function(){},$l.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Bl&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Bl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Kn(e)},!0),t("indentUnit",2,Kn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Vn(e),or(e),gn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(D(n,o))}n++});for(var i=r.length-1;i>=0;i--)Di(e.doc,t,r[i],D(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Bl&&e.refresh()}),t("specialCharPlaceholder",ht,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ka?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!Ta),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){zo(e),Po(e)},!0),t("keyMap","default",function(e,t,r){var n=co(t),i=r!=Bl&&co(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Io,!0),t("gutters",[],function(e){Fn(e.options),Po(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?xr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return en(e)},!0),t("scrollbarStyle","native",function(e){rn(e),en(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Fn(e.options),Po(e)},!0),t("firstLineNumber",1,Po,!0),t("lineNumberFormatter",function(e){return e},Po,!0),t("showCursorWhenSelecting",!1,Lr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(Fr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Ho),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Lr,!0),t("singleCursorHeightPerLine",!0,Lr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Vn,!0),t("addModeClass",!1,Vn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Vn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Ro),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&hn(this,t[e])(this,r,i),Oe(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"](co(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:pn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,gn(this)}),removeOverlay:pn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void gn(t)}}),indentLine:pn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),W(this.doc,e)&&Bo(this,e,t,r)}),indentSelection:pn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Bo(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Kr(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Bo(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&u[i].from().ch>0&&mi(t.doc,i,new kl(a,u[i].to()),Pa)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,D(e),t,!0)},getTokenTypeAt:function(e){e=B(this.doc,e);var t,r=Qe(this,M(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],a=this.getModeAt(e);if("string"==typeof a[t])o[a[t]]&&i.push(o[a[t]]);else if(a[t])for(var l=0;l<a[t].length;l++){var s=o[a[t][l]];s&&i.push(s)}else a.helperType&&o[a.helperType]?i.push(o[a.helperType]):o[a.name]&&i.push(o[a.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(a,n)&&-1==f(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=j(r,null==e?r.first+r.size-1:e),et(this,e+1,t).state},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?B(this.doc,e):e?n.from():n.to(),dr(this,r,t||"page")},charCoords:function(e,t){return ur(this,B(this.doc,e),t||"page")},coordsChar:function(e,t){return e=cr(this,e,t||"page"),pr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=cr(this,{top:e,left:0},t||"page").top,E(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=M(this.doc,e)}else n=e;return sr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return yr(this.display)},defaultCharWidth:function(){return br(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=dr(this,B(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&Br(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:pn(wo),triggerOnKeyPress:pn(Co),triggerOnKeyUp:ko,triggerOnMouseDown:pn(To),execCommand:function(e){if(zl.hasOwnProperty(e))return zl[e].call(null,this)},triggerElectric:pn(function(e){Vo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var a=B(this.doc,e),l=0;l<t&&(a=Xo(i.doc,a,o,r,n),!a.hitSide);++l);return a},moveH:pn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Xo(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Ia)}),deleteH:pn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):uo(this,function(r){var i=Xo(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,a=n;t<0&&(o=-1,t=-t);for(var l=B(this.doc,e),s=0;s<t;++s){var c=dr(i,l,"div");if(null==a?a=c.left:c.left=a,l=Zo(i,c,o,r),l.hitSide)break}return l},moveV:pn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var l=dr(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Zo(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Ur(r,ur(r,s,"div").top-l.top),s},Ia),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=M(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var a=r.charAt(n),l=x(a,o)?function(e){return x(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!x(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new kl(D(e.line,n),D(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):Oa(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==a()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:pn(function(e,t){Vr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-qt(this)-this.display.barHeight,width:e.scrollWidth-qt(this)-this.display.barWidth,clientHeight:Kt(this),clientWidth:Ut(this)}},scrollIntoView:pn(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:D(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?Gr(this,e):Yr(this,e.from,e.to,e.margin)}),setSize:pn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&ir(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){vn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(e){return fn(this,e)},refresh:pn(function(){var e=this.display.cachedTextHeight;gn(this),this.curOp.forceUpdate=!0,or(this),Vr(this,this.doc.scrollLeft,this.doc.scrollTop),_n(this),(null==e||Math.abs(e-yr(this.display))>.5)&&Cr(this),Oe(this,"refresh",this)}),swapDoc:pn(function(e){var t=this.doc;return t.cm=null,Xn(this,e),or(this),this.display.input.reset(),Vr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,St(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Fe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Ro);var Yl="iter insert remove copy getEditor constructor".split(" ");for(var Xl in Al.prototype)Al.prototype.hasOwnProperty(Xl)&&f(Yl,Xl)<0&&(Ro.prototype[Xl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Al.prototype[Xl]));return Fe(Al),Ro.inputStyles={textarea:$l,contenteditable:Gl},Ro.defineMode=function(e){Ro.defaults.mode||"null"==e||(Ro.defaults.mode=e),Ue.apply(this,arguments)},Ro.defineMIME=Ke,Ro.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ro.defineMIME("text/plain","null"),Ro.defineExtension=function(e,t){Ro.prototype[e]=t},Ro.defineDocExtension=function(e,t){Al.prototype[e]=t},Ro.fromTextArea=ia,function(e){e.off=Ne,e.on=$a,e.wheelEventPixels=zn,e.Doc=Al,e.splitLines=Xa,e.countColumn=d,e.findColumn=h,e.isWordChar=w,e.Pass=za,e.signal=Oe,e.Line=ll,e.changeEnd=Rn,e.scrollbarModel=gl,e.Pos=D,e.cmpPos=z,e.modes=el,e.mimeModes=tl,e.resolveMode=Ve,e.getMode=Ge,e.modeExtensions=rl,e.extendMode=$e,e.copyState=Ye,e.startState=Ze,e.innerMode=Xe,e.commands=zl,e.keyMap=Dl,e.keyName=so,e.isModifierKey=ao,e.lookupKey=oo,e.normalizeKeyMap=io,e.StringStream=nl,e.SharedTextMarker=Ll,e.TextMarker=Tl,e.LineWidget=Cl,e.e_preventDefault=De,e.e_stopPropagation=ze,e.e_stop=He,e.addClass=l,e.contains=o,e.rmClass=Oa,e.keyNames=_l}(Ro),Ro.version="5.27.0",Ro})},{}],16:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return p=t,e}function i(e,t){var r=e.next();if(v[r]){var i=v[r](e,t);if(!1!==i)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){
7
+ ")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(!1===n?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,r){return _[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return u(e,t,r)}function f(e){var t=e.current().toLowerCase();m=M.hasOwnProperty(t)?"atom":L.hasOwnProperty(t)?"keyword":"variable"}var h=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var p,m,g=t.indentUnit,v=r.tokenHooks,y=r.documentTypes||{},b=r.mediaTypes||{},w=r.mediaFeatures||{},x=r.mediaValueKeywords||{},k=r.propertyKeywords||{},C=r.nonStandardPropertyKeywords||{},S=r.fontProperties||{},T=r.counterDescriptors||{},L=r.colorKeywords||{},M=r.valueKeywords||{},A=r.allowNested,N=r.lineComment,O=!0===r.supportsAtComponent,_={};return _.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(O&&/@component/.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return s(r,t,"parens")}return r.context.type},_.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return k.hasOwnProperty(n)?(m="property","maybeprop"):C.hasOwnProperty(n)?(m="string-2","maybeprop"):A?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?_.top(e,t,r):(m="error","block")},_.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):u(e,t,r)},_.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&A)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else m+=" error";return"prop"},_.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(m="property","maybeprop"):r.context.type},_.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&f(t),"parens")},_.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(m="variable-3",r.context.type):u(e,t,r)},_.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",r.context.type):_.atBlock(e,t,r)},_.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,r);if("{"==e)return c(r)&&s(r,t,A?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();m="only"==n||"not"==n||"and"==n||"or"==n?"keyword":b.hasOwnProperty(n)?"attribute":w.hasOwnProperty(n)?"property":x.hasOwnProperty(n)?"keyword":k.hasOwnProperty(n)?"property":C.hasOwnProperty(n)?"string-2":M.hasOwnProperty(n)?"atom":L.hasOwnProperty(n)?"keyword":"error"}return r.context.type},_.atComponentBlock=function(e,t,r){return"}"==e?d(e,t,r):"{"==e?c(r)&&s(r,t,A?"block":"top",!1):("word"==e&&(m="error"),r.context.type)},_.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?d(e,t,r,2):_.atBlock(e,t,r)},_.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,r)},_.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(m="@font-face"==r.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!T.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},_.keyframes=function(e,t,r){return"word"==e?(m="variable","keyframes"):"{"==e?s(r,t,"top"):u(e,t,r)},_.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?d(e,t,r):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},_.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?d(e,t,r):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(p=r[1],r=r[0]),m=r,t.state=_[t.state](p,e,t),m},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-g)):(r=r.prev,i=r.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:N,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","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","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"],f=t(d),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","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"],k=t(x),C=n.concat(o).concat(l).concat(c).concat(d).concat(h).concat(b).concat(x);e.registerHelper("hintWords","css",C),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!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"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:y,colorKeywords:w,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})})},{"../../lib/codemirror":15}],17:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror"),e("../xml/xml"),e("../javascript/javascript"),e("../css/css")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t||(s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function a(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(n(t,i[0])))return i[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^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"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,o){var l,d=c.token(n,o.htmlState),f=/\btag\b/.test(d);if(f&&!/[<>\s\/]/.test(n.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&f&&/>$/.test(n.current())){var h=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==n.current()&&a(u[h[1]],h[2]),m=e.getMode(r,p),g=i(h[1],!0),v=i(h[1],!1);o.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,v,r.localMode.token(e,r.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=n.current(),n.eol()&&(o.inTag+=" "));return d}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),u={},d=n&&n.tags,f=n&&n.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(c)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},{"../../lib/codemirror":15,"../css/css":16,"../javascript/javascript":18,"../xml/xml":19}],18:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Te=e,Le=r,t}function a(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=l(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Fe),o("operator","operator",e.current()));if("`"==n)return r.tokenize=c,c(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(Fe.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(Fe),o("operator","operator",e.current());if(Ee.test(n)){e.eatWhile(Ee);var a=e.current();if("."!=r.lastType){if(We.propertyIsEnumerable(a)){var u=We[a];return o(u.type,u.style,a)}if("async"==a&&e.match(/^\s*[\(\w]/,!1))return o("async","keyword",a)}return o("variable","variable",a)}}function l(e){return function(t,r){var n,i=!1;if(Ne&&"@"==t.peek()&&t.match(De))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function c(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(_e){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=ze.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ee.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}function d(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function h(e,t,r,n,i){var o=e.cc;for(He.state=e,He.stream=i,He.marked=null,He.cc=o,He.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():Oe?C:k)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return He.marked?He.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)He.cc.push(arguments[e])}function m(){return p.apply(null,arguments),!0}function g(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=He.state;if(He.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function v(){He.state.context={prev:He.state.context,vars:He.state.localVars},He.state.localVars=Ie}function y(){He.state.localVars=He.state.context.vars,He.state.context=He.state.context.prev}function b(e,t){var r=function(){var r=He.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new d(n,He.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=He.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?m():";"==e?p():m(t)}return t}function k(e,t){return"var"==e?m(b("vardef",t.length),J,x(";"),w):"keyword a"==e?m(b("form"),T,k,w):"keyword b"==e?m(b("form"),k,w):"{"==e?m(b("}"),K,w):";"==e?m():"if"==e?("else"==He.state.lexical.info&&He.state.cc[He.state.cc.length-1]==w&&He.state.cc.pop()(),m(b("form"),T,k,w,ne)):"function"==e?m(ce):"for"==e?m(b("form"),ie,k,w):"variable"==e?_e&&"type"==t?(He.marked="keyword",m(G,x("operator"),G,x(";"))):m(b("stat"),H):"switch"==e?m(b("form"),T,x("{"),b("}","switch"),K,w,w):"case"==e?m(C,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),ue,x(")"),k,w,y):"class"==e?m(b("form"),fe,w):"export"==e?m(b("stat"),ge,w):"import"==e?m(b("stat"),ye,w):"module"==e?m(b("form"),Q,x("{"),b("}"),K,w,w):"async"==e?m(k):"@"==t?m(C,k):p(b("stat"),C,x(";"),w)}function C(e){return L(e,!1)}function S(e){return L(e,!0)}function T(e){return"("!=e?p():m(b(")"),C,x(")"),w)}function L(e,t){if(He.state.fatArrowAt==He.stream.start){var r=t?F:W;if("("==e)return m(v,b(")"),q(Q,")"),w,x("=>"),r,y);if("variable"==e)return p(v,Q,x("=>"),r,y)}var n=t?O:N;return Pe.hasOwnProperty(e)?m(n):"function"==e?m(ce,n):"class"==e?m(b("form"),de,w):"keyword c"==e||"async"==e?m(t?A:M):"("==e?m(b(")"),M,x(")"),w,n):"operator"==e||"spread"==e?m(t?S:C):"["==e?m(b("]"),Ce,w,n):"{"==e?U(R,"}",null,n):"quasi"==e?p(_,n):"new"==e?m(D(t)):m()}function M(e){return e.match(/[;\}\)\],]/)?p():p(C)}function A(e){
8
+ return e.match(/[;\}\)\],]/)?p():p(S)}function N(e,t){return","==e?m(C):O(e,t,!1)}function O(e,t,r){var n=0==r?N:O,i=0==r?C:S;return"=>"==e?m(v,r?F:W,y):"operator"==e?/\+\+|--/.test(t)?m(n):"?"==t?m(C,x(":"),i):m(i):"quasi"==e?p(_,n):";"!=e?"("==e?U(S,")","call",n):"."==e?m(I,n):"["==e?m(b("]"),M,x("]"),w,n):_e&&"as"==t?(He.marked="keyword",m(G,n)):void 0:void 0}function _(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?m(_):m(C,E)}function E(e){if("}"==e)return He.marked="string-2",He.state.tokenize=c,m(_)}function W(e){return u(He.stream,He.state),p("{"==e?k:C)}function F(e){return u(He.stream,He.state),p("{"==e?k:S)}function D(e){return function(t){return"."==t?m(e?P:z):p(e?S:C)}}function z(e,t){if("target"==t)return He.marked="keyword",m(N)}function P(e,t){if("target"==t)return He.marked="keyword",m(O)}function H(e){return":"==e?m(w,k):p(N,x(";"),w)}function I(e){if("variable"==e)return He.marked="property",m()}function R(e,t){return"async"==e?(He.marked="property",m(R)):"variable"==e||"keyword"==He.style?(He.marked="property",m("get"==t||"set"==t?j:B)):"number"==e||"string"==e?(He.marked=Ne?"property":He.style+" property",m(B)):"jsonld-keyword"==e?m(B):"modifier"==e?m(R):"["==e?m(C,x("]"),B):"spread"==e?m(C,B):":"==e?p(B):void 0}function j(e){return"variable"!=e?p(B):(He.marked="property",m(ce))}function B(e){return":"==e?m(S):"("==e?p(ce):void 0}function q(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=He.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),m(function(r,n){return r==t||n==t?p():p(e)},n)}return i==t||o==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():p(e,n)}}function U(e,t,r){for(var n=3;n<arguments.length;n++)He.cc.push(arguments[n]);return m(b(t,r),q(e,t),w)}function K(e){return"}"==e?m():p(k,K)}function V(e,t){if(_e){if(":"==e)return m(G);if("?"==t)return m(V)}}function G(e){return"variable"==e?(He.marked="type",m(Z)):"string"==e||"number"==e||"atom"==e?m(Z):"{"==e?m(b("}"),q(Y,"}",",;"),w,Z):"("==e?m(q(X,")"),$):void 0}function $(e){if("=>"==e)return m(G)}function Y(e,t){return"variable"==e||"keyword"==He.style?(He.marked="property",m(Y)):"?"==t?m(Y):":"==e?m(G):"["==e?m(C,V,x("]"),Y):void 0}function X(e){return"variable"==e?m(X):":"==e?m(G):void 0}function Z(e,t){return"<"==t?m(b(">"),q(G,">"),w,Z):"|"==t||"."==e?m(G):"["==e?m(x("]"),Z):"extends"==t?m(G):void 0}function J(){return p(Q,V,te,re)}function Q(e,t){return"modifier"==e?m(Q):"variable"==e?(g(t),m()):"spread"==e?m(Q):"["==e?U(Q,"]"):"{"==e?U(ee,"}"):void 0}function ee(e,t){return"variable"!=e||He.stream.match(/^\s*:/,!1)?("variable"==e&&(He.marked="property"),"spread"==e?m(Q):"}"==e?p():m(x(":"),Q,te)):(g(t),m(te))}function te(e,t){if("="==t)return m(S)}function re(e){if(","==e)return m(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),k,w)}function ie(e){if("("==e)return m(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?m(J,x(";"),le):";"==e?m(le):"variable"==e?m(ae):p(C,x(";"),le)}function ae(e,t){return"in"==t||"of"==t?(He.marked="keyword",m(C)):m(N,le)}function le(e,t){return";"==e?m(se):"in"==t||"of"==t?(He.marked="keyword",m(C)):p(C,x(";"),se)}function se(e){")"!=e&&m(C)}function ce(e,t){return"*"==t?(He.marked="keyword",m(ce)):"variable"==e?(g(t),m(ce)):"("==e?m(v,b(")"),q(ue,")"),w,V,k,y):_e&&"<"==t?m(b(">"),q(G,">"),w,ce):void 0}function ue(e){return"spread"==e?m(ue):p(Q,V,te)}function de(e,t){return"variable"==e?fe(e,t):he(e,t)}function fe(e,t){if("variable"==e)return g(t),m(he)}function he(e,t){return"<"==t?m(b(">"),q(G,">"),w,he):"extends"==t||"implements"==t||_e&&","==e?m(_e?G:C,he):"{"==e?m(b("}"),pe,w):void 0}function pe(e,t){return"variable"==e||"keyword"==He.style?("async"==t||"static"==t||"get"==t||"set"==t||_e&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&He.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(He.marked="keyword",m(pe)):(He.marked="property",m(_e?me:ce,pe)):"["==e?m(C,x("]"),_e?me:ce,pe):"*"==t?(He.marked="keyword",m(pe)):";"==e?m(pe):"}"==e?m():"@"==t?m(C,pe):void 0}function me(e,t){return"?"==t?m(me):":"==e?m(G,te):"="==t?m(S):p(ce)}function ge(e,t){return"*"==t?(He.marked="keyword",m(ke,x(";"))):"default"==t?(He.marked="keyword",m(C,x(";"))):"{"==e?m(q(ve,"}"),ke,x(";")):p(k)}function ve(e,t){return"as"==t?(He.marked="keyword",m(x("variable"))):"variable"==e?p(S,ve):void 0}function ye(e){return"string"==e?m():p(be,we,ke)}function be(e,t){return"{"==e?U(be,"}"):("variable"==e&&g(t),"*"==t&&(He.marked="keyword"),m(xe))}function we(e){if(","==e)return m(be,we)}function xe(e,t){if("as"==t)return He.marked="keyword",m(be)}function ke(e,t){if("from"==t)return He.marked="keyword",m(C)}function Ce(e){return"]"==e?m():p(q(S,"]"))}function Se(e,t){return"operator"==e.lastType||","==e.lastType||Fe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Te,Le,Me=r.indentUnit,Ae=n.statementIndent,Ne=n.jsonld,Oe=n.json||Ne,_e=n.typescript,Ee=n.wordCharacters||/[\w$\xa1-\uffff]/,We=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n};if(_e){var l={type:"variable",style:"type"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),string:l,number:l,boolean:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Fe=/[+\-*&%=<>!?|~^@]/,De=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,ze="([{}])",Pe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},He={state:null,column:null,marked:null,cc:null},Ie={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Me,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Te?r:(t.lastType="operator"!=Te||"++"!=Le&&"--"!=Le?Te:"incdec",h(t,r,Te,Le,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i,o=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==w)l=l.prev;else if(u!=ne)break}for(;("stat"==l.type||"form"==l.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==N||i==O)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;Ae&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=o==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==o?l.indented:"form"==d?l.indented+Me:"stat"==d?l.indented+(Se(t,r)?Ae||Me:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Me):l.indented+(/^(?:case|default)\b/.test(r)?Me:2*Me)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Oe?null:"/*",blockCommentEnd:Oe?null:"*/",lineComment:Oe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Oe?"json":"javascript",jsonldMode:Ne,jsonMode:Oe,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=C&&t!=S||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":15}],19:[function(e,r,n){!function(i){"object"==typeof n&&"object"==typeof r?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(n,i){function o(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(L=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==n){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=o,L=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return L="equals",null;if("<"==r){t.tokenize=o,t.state=h,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=o;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=o;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function u(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!C.contextGrabbers.hasOwnProperty(r)||!C.contextGrabbers[r].hasOwnProperty(t))return;d(e)}}function h(e,t,r){return"openTag"==e?(r.tagStart=t.column(),p):"closeTag"==e?m:h}function p(e,t,r){return"word"==e?(r.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&C.implicitlyClosed.hasOwnProperty(r.context.tagName)&&d(r),r.context&&r.context.tagName==n||!1===C.matchClosing?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,r){return"endTag"!=e?(M="error",g):(d(r),h)}function v(e,t,r){return M="error",g(e,t,r)}function y(e,t,r){if("word"==e)return M="attribute",b;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(n)?f(r,n):(f(r,n),r.context=new u(r,n,i==r.indented)),h}return M="error",y}function b(e,t,r){return"equals"==e?w:(C.allowMissing||(M="error"),y(e,t,r))}function w(e,t,r){return"string"==e?x:"word"==e&&C.allowUnquoted?(M="string",y):(M="error",y(e,t,r))}function x(e,t,r){return"string"==e?x:y(e,t,r)}var k=n.indentUnit,C={},S=i.htmlMode?t:r;for(var T in S)C[T]=S[T];for(var T in i)C[T]=i[T];var L,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;L=null;var r=t.tokenize(e,t);return(r||L)&&"comment"!=r&&(M=null,t.state=t.state(L||r,e,t),M&&(r="error"==M?r+" error":M)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==C.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+k*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=C.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":15}],20:[function(e,t,r){function n(e,t){function r(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var r=0;r<t.length;r++)if(e===t[r])return!0;return!1}},this.get_content=function(){for(var e="",t=[],r=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace))t.length&&(r=!0),this.line_char_count--;else{if(r){if(this.line_char_count>=this.max_char){t.push("\n");for(var n=0;n<this.indent_level;n++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;r=!1}t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",r=new RegExp("</"+e+"\\s*>","igm");r.lastIndex=this.pos;var n=r.exec(this.input),i=n?n.index:this.input.length;return this.pos<i&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?(this.tags[e+"count"]++,this.tags[e+this.tags[e+"count"]]=this.indent_level):(this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level),this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,r="",n=[],i=!1;do{if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];r=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(r,this.Utils.whitespace)?(i=!0,this.line_char_count--):("'"!==r&&'"'!==r||n[1]&&"!"===n[1]||(r+=this.get_unformatted(r),i=!0),"="===r&&(i=!1),n.length&&"="!==n[n.length-1]&&">"!==r&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,n),this.line_char_count=0):(n.push(" "),this.line_char_count++),i=!1),"<"===r&&(e=this.pos-1),n.push(r))}while(">"!==r);var o,a=n.join("");o=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var l=a.substring(1,o).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(l,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===l)this.record_tag(l),this.tag_type="SCRIPT";else if("style"===l)this.record_tag(l),this.tag_type="STYLE";else if(this.Utils.in_array(l,s)){var c=this.get_unformatted("</"+l+">",a);n.push(c),e>0&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&n.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(t+1),this.Utils.whitespace)&&n.push(this.input.charAt(t+1)),this.tag_type="SINGLE"}else if("!"===l.charAt(0))if(-1!=l.indexOf("[if")){if(-1!=a.indexOf("!IE")){var c=this.get_unformatted("--\x3e",a);n.push(c)}this.tag_type="START"}else if(-1!=l.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=l.indexOf("[cdata[")){var c=this.get_unformatted("]]>",a);n.push(c),this.tag_type="SINGLE"}else{var c=this.get_unformatted("--\x3e",a);n.push(c),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 n.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var r="",n="",i=!0;do{if(this.pos>=this.input.length)return n;if(r=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(r,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===r||"\r"===r){n+="\n",this.line_char_count=0;continue}}n+=r,this.line_char_count++,i=!0}while(-1==n.toLowerCase().indexOf(e));return n},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return e=this.get_contents_to(t),"string"!=typeof e?e:[e,"TK_"+t]}if("CONTENT"===this.current_mode)return e=this.get_content(),"string"!=typeof e?e:[e,"TK_CONTENT"];if("TAG"===this.current_mode){if("string"!=typeof(e=this.get_tag()))return e;return[e,"TK_TAG_"+this.tag_type]}},this.get_full_indent=function(e){return e=this.indent_level+e||0,e<1?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,r,n,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=r,this.brace_style=i,this.indent_level=0,this.max_char=n,this.line_char_count=0;for(var o=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var r=0;r<this.indent_level;r++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var n,i,o,a,l,s;for(t=t||{},i=t.indent_size||4,o=t.indent_char||" ",l=t.brace_style||"collapse",a=0==t.max_char?1/0:t.max_char||70,s=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 r,n.printer(e,o,i,a,l);;){var c=n.get_token();if(n.token_text=c[0],n.token_type=c[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 u=n.token_text.match(/\w+/)[0],d=n.output[n.output.length-1].match(/<\s*(\w+)/);null!==d&&d[1]===u||n.print_newline(!0,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z]+)/i);f&&n.Utils.in_array(f[1],s)||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 h=n.token_text;if("TK_SCRIPT"==n.token_type)var p="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==n.token_type)var p="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var m=0;else if("separate"==t.indent_scripts)var m=-n.indent_level;else var m=1;var g=n.get_full_indent(m);if(p)h=p(h.replace(/^\s*/,g),t);else{var v=h.match(/^\s*/)[0],y=v.match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,b=n.get_full_indent(m-y);h=h.replace(/^\s*/,g).replace(/\r\n|\r|\n/g,"\n"+b).replace(/\s*$/,"")}h&&(n.print_token(h),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("")}t.exports={prettyPrint:n}},{}],21:[function(e,t,r){"use strict";t.exports=e("./stream/stream")},{"./stream/stream":22}],22:[function(e,t,r){"use strict";!function(){function e(){function e(){return arguments.length>0&&arguments[0]!==C&&n(e,arguments[0]),e._state.value}return r(e),arguments.length>0&&arguments[0]!==C&&n(e,arguments[0]),e}function r(t){t.constructor=e,t._state={id:k++,value:void 0,state:0,derive:void 0,recover:void 0,deps:{},parents:[],endStream:void 0,unregister:void 0},t.map=t["fantasy-land/map"]=d,t["fantasy-land/ap"]=f,t["fantasy-land/of"]=e,t.valueOf=h,t.toJSON=p,t.toString=h,Object.defineProperties(t,{end:{get:function(){if(!t._state.endStream){var r=e();r.map(function(e){return!0===e&&(u(t),r._state.unregister=function(){u(r)}),e}),t._state.endStream=r}return t._state.endStream}}})}function n(e,t){i(e,t);for(var r in e._state.deps)o(e._state.deps[r],!1);null!=e._state.unregister&&e._state.unregister(),a(e)}function i(e,t){e._state.value=t,e._state.changed=!0,2!==e._state.state&&(e._state.state=1)}function o(e,t){var r=e._state,n=r.parents;if(n.length>0&&n.every(g)&&(t||n.some(v))){var o=e._state.derive();if(o===C)return!1;i(e,o)}}function a(e){e._state.changed=!1;for(var t in e._state.deps)e._state.deps[t]._state.changed=!1}function l(t,r){if(!r.every(m))throw new Error("Ensure that each item passed to stream.combine/stream.merge is a stream");return s(e(),r,function(){return t.apply(this,r.concat([r.filter(v)]))})}function s(e,t,r){var n=e._state;return n.derive=r,n.parents=t.filter(y),c(e,n.parents),o(e,!0),e}function c(e,t){for(var r=0;r<t.length;r++)t[r]._state.deps[e._state.id]=e,c(e,t[r]._state.parents)}function u(e){for(var t=0;t<e._state.parents.length;t++){delete e._state.parents[t]._state.deps[e._state.id]}for(var r in e._state.deps){var n=e._state.deps[r],i=n._state.parents.indexOf(e);i>-1&&n._state.parents.splice(i,1)}e._state.state=2,e._state.deps={}}function d(e){return l(function(t){return e(t())},[this])}function f(e){return l(function(e,t){return e()(t())},[e,this])}function h(){return this._state.value}function p(){return null!=this._state.value&&"function"==typeof this._state.value.toJSON?this._state.value.toJSON():this._state.value}function m(e){return e._state}function g(e){return 1===e._state.state}function v(e){return e._state.changed}function y(e){return 2!==e._state.state}function b(e){return l(function(){return e.map(function(e){return e()})},e)}function w(e,t,r){var n=l(function(r){return t=e(t,r._state.value)},[r]);return 0===n._state.state&&n(t),n}function x(e,t){var r=e.map(function(e){var t=e[0];return 0===t._state.state&&t(void 0),t});return l(function(){var n=arguments[arguments.length-1];return r.forEach(function(r,i){n.indexOf(r)>-1&&(t=e[i][1](t,r._state.value))}),t},r)}var k=0,C={};e["fantasy-land/of"]=e,e.merge=b,e.combine=l,e.scan=w,e.scanMerge=x,e.HALT=C,void 0!==t?t.exports=e:"function"!=typeof window.m||"stream"in window.m?window.m={stream:e}:window.m.stream=e}()},{}]},{},[11])}();
9
  //# sourceMappingURL=forms-admin.min.js.map
assets/js/forms-admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["forms-admin.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","rows","m","i18n","showType","config","fieldType","type","charAt","toUpperCase","slice","label","fieldLabel","value","onchange","withAttr","placeholder","title","isHidden","initialValue","style","optional","valueHelp","numberMinMax","min","max","isRequired","inputAtts","checked","required","desc","forceRequired","disabled","isFieldRequired","placeholderHelp","useParagraphs","wrap","wrapInParagraphTags","choiceType","options","selected","dropdown","radioButtons","acceptsMultipleValues","push","checkboxes","choices","html","map","choice","index","data-id","name","selectChoice","bind","preselect","remove","class","onclick","key","this","splice","2","forms","render","text","visibleRows","hidden","submit","number","./field-forms-rows.js","3","htmlutil","setAttributes","vnode","dom","setAttribute","g","generate","field","htmlTemplate","vdom","document","createElement","generators","prettyPrint","innerHTML","select","attributes","hasSelection","oncreate","unshift","checkbox","radio","4","FieldHelper","tabs","editor","fields","events","setActiveField","fieldConfig","get","c","join","redraw","controller","createFieldHTMLAndAddToForm","insert","view","fieldCategories","getCategories","availableFields","getAll","fieldsChoice","chooseField","category","categoryFields","filter","className","inForm","inFormContent","form","overlay","help","trust","onkeydown","window","event","keyCode","addToForm","on","./field-forms.js","./field-generator.js","./overlay.js","5","FieldFactory","reset","registeredFields","forEach","deregister","register","data","sticky","getFieldType","phone","birthday","registerMergeField","mergeField","listFields","field_type","tag","mailchimpType","streetAddress","city","state","zip","country","mc4wp_vars","countries","registerInterestCategory","interestCategory","interestCategories","id","interests","registerListFields","list","merge_fields","sort","b","public","interest_categories","registerListsFields","lists","registerCustomFields","formFields","subscribe","submitButton","listChoice","listChoiceDescription","unsubscribe","formAction","formActionDescription","6","prop","createChoices","choiceLabel","FieldChoice","Object","keys","existingField","getAllWhere","shift","categories","indexOf","Field","timeout","clearTimeout","setTimeout","trigger","searchKey","searchValue","mithril/stream","7","CodeMirror","FormEditor","element","domDirty","_dom","getValue","toLowerCase","fromTextArea","selectionPointer","matchTags","bothTags","mode","htmlMode","autoCloseTags","autoRefresh","dispatchEvent","Event","bubbles","addEventListener","signal","query","querySelectorAll","containsField","fieldName","elements","namedItem","replaceSelection","focus","callback","refresh","codemirror","codemirror/addon/edit/closetag.js","codemirror/addon/edit/matchtags","codemirror/addon/fold/xml-fold","codemirror/mode/css/css","codemirror/mode/htmlmixed/htmlmixed","codemirror/mode/javascript/javascript","codemirror/mode/xml/xml","8","FormWatcher","settings","helpers","updateFields","originalRequiredValue","nameGroup","replace","findRequiredFields","requiredFields","requiredFieldElements","Array","prototype","el","requiredFieldsInput","getElementById","debounce","9","show","notices","hide","container","querySelector","heading","parentNode","insertBefore","nextSibling","init","groupingsNotice","requiredFieldsNotice","missingFields","10","close","removeEventListener","onKeyDown","position","_onCloseCallback","preventDefault","_element","windowWidth","innerWidth","documentElement","clientWidth","body","windowHeight","innerHeight","clientHeight","marginLeft","marginTop","left","top","storeElementReference","content","onCloseCallback","11","mc4wp_forms_i18n","mc4wp","deps","mithril","FieldsFactory","textareaElement","formEditor","fieldHelper","mount","fieldsFactory","getSelectedLists","mailchimp","./admin/field-helper.js","./admin/fields-factory.js","./admin/fields.js","./admin/form-editor.js","./admin/form-watcher.js","./admin/notices","12","mod","amd","autoCloseGT","cm","getOption","Pass","ranges","listSelections","replacements","empty","pos","head","tok","getTokenAt","inner","innerMode","getMode","tagName","opt","configuration","dontCloseTags","htmlDontClose","indentTags","htmlIndent","end","ch","lowerTagName","test","string","closingTagExists","indent","newPos","Pos","line","info","replaceRange","anchor","sel","setSelections","indentLine","autoCloseCurrent","typingSlash","start","replacement","context","getLine","replaceSelections","autoCloseSlash","collection","elt","newTag","scanForClosingTag","Math","lastLine","nextClose","cx","onCx","prev","to","next","defineOption","val","old","Init","removeKeyMap","whenClosing","whenOpening","addKeyMap","commands","closeTag","../../lib/codemirror","../fold/xml-fold","13","clear","tagHit","tagOther","doMatchTags","failedTagMatch","operation","somethingSelected","cur","getCursor","range","getViewport","from","match","findMatchingTag","matchBothTags","hit","at","open","markText","other","maybeUpdateMatch","off","toMatchingTag","found","extendSelection","14","cmp","Iter","firstLine","tagAt","iter","getTokenTypeAt","nextLine","prevLine","toTagEnd","gt","lastSlash","lastIndexOf","selfClose","toTagStart","lt","xmlTagStart","lastIndex","exec","toNextTag","toPrevTag","findMatchingClose","stack","startLine","startCh","findMatchingOpen","endLine","endCh","nameStartChar","RegExp","registerHelper","openTag","startPos","endPos","here","findEnclosingTag","forward","15","global","factory","classTest","cls","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","cssText","createTextNode","eltP","contains","child","nodeType","host","activeElt","activeElement","shadowRoot","addClass","node","current","joinClasses","as","split","args","arguments","apply","copyObj","obj","target","overwrite","hasOwnProperty","countColumn","tabSize","startIndex","startValue","search","nextTab","array","findColumn","goal","col","skipped","spaceStr","spaceStrs","lst","arr","out","insertSorted","score","priority","nothing","createObj","base","props","inst","create","isWordCharBasic","nonASCIISingleCaseWordChar","isWordChar","helper","source","isEmpty","isExtendingChar","charCodeAt","extendingChars","skipExtendingChars","str","dir","findFirst","pred","abs","mid","floor","Display","place","doc","input","d","scrollbarFiller","gutterFiller","lineDiv","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","lines","mover","sizer","sizerWidth","heightForcer","scrollerGap","gutters","lineGutter","scroller","wrapper","ie","ie_version","zIndex","paddingRight","webkit","gecko","mobile","draggable","viewFrom","viewTo","first","reportedViewFrom","reportedViewTo","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","selForContextMenu","activeTouch","size","chunk","children","sz","chunkSize","getBetween","getLines","updateLineHeight","height","diff","lineNo","no","lineAtHeight","h","outer","i$1","lh","isLine","lineNumberFor","String","lineNumberFormatter","firstLineNumber","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","clipPos","last","clipToLen","linelen","clipPosArray","seeReadOnlySpans","sawReadOnlySpans","seeCollapsedSpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","markedSpans","concat","attachLine","markedSpansBefore","isInsert","nw","startsBefore","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","span$1","found$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","find","j","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","conflictingCollapsedRange","lineNo$$1","visualLine","merged","visualLineEnd","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","findMaxLine","display","iterateBidiSections","order","part","level","getBidiPartAt","bidiOther","getOrder","direction","bidiOrdering","moveCharLogically","moveLogically","endOfLine","visually","moveInStorageOrder","prep","prepareMeasureForLine","targetTop","measureCharPrepared","moveVisually","bidi","partPos","mv","getWrappedLineExtent","lineWrapping","wrappedLineExtentChar","begin","wrappedLineExtent","searchInVisualLine","getRes","res","nextCh","getHandlers","emitter","_handlers","noHandlers","detachEvent","map$$1","handlers","signalDOMEvent","override","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","set","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","mac","ctrlKey","zeroWidthElement","zwspSupported","offsetHeight","offsetWidth","hasBadBidiRects","badBidiRects","txt","r0","getBoundingClientRect","r1","right","hasBadZoomedRects","badZoomedRects","normal","fromRange","defineMode","dependencies","modes","defineMIME","mime","spec","mimeModes","resolveMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","nstate","startState","a1","a2","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getStateBefore","result","maxHighlightLength","stateAfter","styleClasses","frontier","precise","findStartLine","processLine","save","startAt","stream","StringStream","callBlankLine","eol","readToken","blankLine","token","takeToken","asArray","getObj","copy","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","updateLine","estimateHeight","estHeight","cleanUpLine","interpretTokenStyle","cache","styleToClassCacheWithMode","styleToClassCache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","rest","addToken","buildToken","buildTokenBadBidi","insertLineContent","maps","caches","lastChild","defaultSpecialCharPlaceholder","toString","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","j$1","j$2","upto","tokenText","LineView","buildViewArray","nextPos","pushOperation","op","operationGroup","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","signalLater","orphanDelayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","updateLineBackground","background","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterWidth","alignable","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","widgetHeight","parentStyle","eventInWidget","getAttribute","paddingTop","offsetTop","paddingVert","paddingH","getComputedStyle","currentStyle","parseInt","isNaN","scrollGap","displayWidth","displayHeight","ensureLineHeights","rect","wrapping","curWidth","heights","rects","getClientRects","bottom","mapFromLineView","before","updateExternalMeasurement","measureChar","bias","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","measureCharInner","bogus","rtop","rbottom","nodeAndOffsetInLineMap","collapse","mStart","mEnd","coverStart","coverEnd","getUsefulRect","nullRect","maybeUpdateRectForZooming","rSpan","charWidth","rbot","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","pageScrollX","pageXOffset","scrollLeft","pageScrollY","pageYOffset","scrollTop","intoCoordSystem","includeWidgets","yOff","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","invert","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","mergedPos","assign","prevDiff","prevPos","beginLeft","box","textHeight","measureText","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","ceil","estimateLineHeights","est","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","selection","primIndex","range$$1","showCursorWhenSelecting","drawSelectionCursor","drawSelectionRange","cursor","cursorHeight","otherCursor","add","fragment","rightSide","drawForLine","fromArg","toArg","lineLen","rightPos","leftPos","tmp","leftSide","padding","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","ensureFocus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","receivedFocus","rmClass","alignHorizontally","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","updateGutterSpace","updateHeightsInViewport","prevBottom","updateWidgetHeight","visibleLines","viewport","ensure","ensureFrom","ensureTo","setScrollTop","updateDisplaySimple","scrollbars","startWorker","setScrollLeft","isScroller","scrollWidth","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","axis","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","wheelPixelsPerUnit","onScrollWheel","scroll","canScrollX","canScrollY","scrollHeight","currentWheelTarget","presto","pixels","wheelSamples","movedX","movedY","sample","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","update","paddingBottom","borderBottom","coverGutterNextToScrollbar","initScrollbars","scrollbarModel","scrollbarStyle","maybeScrollWindow","doScroll","phantom","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","changed","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollPos","resolveScrollToPos","ensureCursorVisible","scrollToPos","cursorScrollMargin","sPos","scrollTo","startOperation","viewChanged","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","nextOpId","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","i$4","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","minWidth","takeFocus","hasFocus","setDocumentHeight","postUpdateDisplay","forceScroll","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","methodOp","docMethodOp","regChange","lendiff","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","tooLong","highlighted","oldCls","newCls","ischange","workDelay","marginBottom","borderRightWidth","editorIsHidden","force","visible","viewportMargin","different","wrapperHeight","toUpdate","patchDisplay","minHeight","oldDisplayWidth","updateNumbersFrom","rm","updateNumber","updateGutters","specs","gElt","setGuttersForLineNumbers","normalizeSelection","prim","inv","Range","Selection","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","estimateHeight$$1","spansFor","linesFor","Line","lastText","lastSpans","nlines","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","directionChanged","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","history","origin","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","equals","existing","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","deepCopy","newChanges","Number","extendRange","extend","posBefore","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","filterSelectionChange","this$1","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","sel_dontScroll","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","antiChanges","returned","after","v","shiftDoc","distance","removed","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","adjustScrollWhenAboveVisible","addLineWidget","LineWidget","insertAt","aboveVisible","markTextShared","TextMarker","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","nextMarkerId","cloneNode","isParent","SharedTextMarker","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","onDrop","clearDragCursor","lastDrop","files","dataTransfer","isReadOnly","FileReader","File","read","file","allowDropFileTypes","reader","onload","lineSeparator","readAsText","draggingText","text$1","getData","onDragStart","setData","getSelection","effectAllowed","setDragImage","safari","img","src","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","ensureGlobalHandlers","globalsRegistered","registerGlobalHandlers","resizeTimer","onResize","setSize","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","keyNames","keyName","noShift","altGraphKey","altKey","flipCtrlCmd","metaKey","shiftKey","keyMap","deleteNearSelection","compute","kill","toKill","replaced","lineStart","visual","lineEnd","lineStartSmart","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","dispatchKey","seq","keySeq","stopSeq","handleKeyBinding","motion","handleCharBinding","handled","lastStoppedKey","hasCopyEvent","showCrossHair","up","onKeyUp","onKeyPress","charCode","fromCharCode","onMouseDown","supportsTouch","clickInGutter","selectingText","leftButtonDown","lastMiddleDown","captureRightClick","onContextMenu","now","lastDoubleClick","lastClick","contained","modifier","dragDrop","dragAndDrop","leftButtonStartDrag","leftButtonSelect","startTime","dragEnd","e2","addNew","extendTo","lastPos","startCol","posCol","startSel","ourIndex","oldRange","ourRange","findWordAt","ranges$1","sel_mouse","curCount","counter","editorSize","move","chromeOS","word","gutterEvent","prevent","mX","mY","lineBox","contextMenuInGutter","themeChanged","theme","guttersChanged","dragDropChanged","funcs","dragFunctions","toggle","enter","over","leave","drop","wrappingChanged","CodeMirror$1","defaults","Doc","inputStyles","inputStyle","pasteIncoming","cutIncoming","Delayed","autofocus","registerEventHandlers","optionHandlers","finishInit","initHooks","textRendering","finishTouch","touchFinished","prevTouch","isMouseLikeTouchEvent","touches","touch","radiusX","radiusY","farAway","moved","pageX","pageY","inp","getField","how","aggressive","curSpace","indentation","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","setLastCopied","newLastCopied","lastCopied","applyTextInput","inserted","deleted","paste","textLines","splitLinesAuto","multiPaste","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","getRange","disableBrowserMagic","spellcheck","hiddenTextarea","te","div","ios","border","findPosH","unit","findNextLine","moveOnce","boundToLine","origDir","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","posToDOM","side","isInGutter","scan","badPos","bad","domTextBetween","recognizeMarker","closing","lineSep","addText","walk","cmText","textContent","markerID","isBlock","nodeName","nodeValue","domToPos","lineNode","locateNodeInLineView","textNode","topNode","curNode","dist","previousSibling","dist$1","textarea","tabindex","tabIndex","realSubmit","leaveSubmitMethodAlone","wrappedSubmit","getTextArea","toTextArea","getWrapperElement","userAgent","navigator","platform","ie_upto10","ie_11up","edge","documentMode","qtwebkit","chrome","vendor","mac_geMountainLion","android","windows","presto_version","createRange","endNode","setEnd","setStart","createTextRange","moveToElementText","moveEnd","moveStart","selectInput","selectionStart","selectionEnd","_e","ms","sel_move","charType","lowTypes","arabicTypes","BidiSpan","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","outerType","types","type$1","prev$1","type$2","type$3","i$5","cur$1","type$4","i$6","end$1","replace$1","i$7","nstart","reverse","attachEvent","nl","rt","ownerDocument","parentElement","compareEndPoints","oncopy","lastColumnPos","lastColumnValue","sol","peek","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","NativeScrollbars","vert","horiz","checkedZeroWidth","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","w","pointerEvents","bar","delay","maybeDisable","elementFromPoint","NullScrollbars","native","null","there","LeafChunk","removeInner","insertInner","iterN","BranchChunk","oldHeight","remaining","leaf","maybeSpill","me","spilled","sibling","myIndex","used","oldH","withOp","dHeight","nextDocId","cleanGeneration","constructor","setValue","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","setCursor","extendSelectionsBy","addSelection","getSelections","dup","newSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","link","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","goDocStart","goDocEnd","goLineStart","goLineStartSmart","goLineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","openLine","toggleOverwrite","defineInitHook","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","updateFromDOM","readFromDOMSoon","forceCompositionEnd","showMultipleSelections","curAnchor","anchorNode","anchorOffset","curFocus","focusNode","focusOffset","removeAllRanges","rangeCount","getRangeAt","rng","addRange","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","poll","pollSelection","pollInterval","triggerOnKeyDown","pollContent","fromIndex","fromNode","toNode","toIndex","newText","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","inaccurateSelection","prepareCopyCut","fastPoll","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","minimal","slowPoll","missed","same","prepareSelectAllHack","extval","rehide","oldWrapperCSS","oldCSS","detectingSelectAll","resetSelectionOnContextMenu","wrapperBox","oldScrollY","scrollY","mouseup","option","deflt","notOnInit","newBreaks","getInputField","detach","attach","integer","setOption","getDoc","addOverlay","modeSpec","removeOverlay","newRanges","getLineTokens","getHelpers","_global","getStateAfter","defaultTextHeight","defaultCharWidth","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","amount","rtlMoveVisually","goalColumn","goals","startChar","check","getScrollInfo","interpret","swapDoc","getScrollerElement","getGutterElement","registerGlobalHelper","predicate","dontDelegate","method","contenteditable","defineExtension","func","defineDocExtension","cmpPos","version","keySet","tokenCComment","maybeEnd","tokenize","parserConfig","ret","tp","tokenBase","tokenHooks","tokenString","tokenParenthesized","quote","escaped","Context","pushContext","popContext","pass","states","popAndPass","wordAsValue","valueKeywords","colorKeywords","inline","propertyKeywords","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","allowNested","lineComment","supportsAtComponent","stateArg","block","maybeprop","propBlock","_stream","parens","pseudo","atBlock","atComponentBlock","atBlock_parens","restricted_atBlock_before","restricted_atBlock","keyframes","interpolation","textAfter","blockCommentStart","blockCommentEnd","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","fontProperties_","counterDescriptors_","colorKeywords_","valueKeywords_","allWords","/",":","$","#","@","&","maybeBackup","pat","getAttrRegexp","attr","regexp","attrRegexpCache","getAttrValue","getTagRegexp","anchored","addTags","findMatchingMode","tagInfo","tagText","defaultTags","script","htmlState","tags","inTag","endTagA","endTag","localState","localMode","multilineTagIndentFactor","multilineTagIndentPastTag","configTags","configScript","scriptTypes","matches","local","../css/css","../javascript/javascript","../xml/xml","expressionAllowed","lastType","readRegexp","inSet","cont","tokenComment","isOperatorChar","tokenQuasi","lexical","wordRE","known","keywords","propertyIsEnumerable","jsonldMode","isJsonldKeyword","findFatArrow","fatArrowAt","arrow","isTS","depth","sawSomething","bracket","brackets","JSLexical","inScope","varname","localVars","vars","parseJS","cc","marked","jsonMode","expression","statement","lex","inList","globalVars","pushcontext","defaultVars","popcontext","pushlex","poplex","expect","wanted","exp","vardef","parenExpr","maybeelse","functiondef","forspec","maybelabel","funarg","afterExport","afterImport","typeexpr","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","atomicTypes","classExpression","maybeexpressionNoComma","maybeexpression","arrayLiteral","contCommasep","objprop","quasi","maybeTarget","expr","property","continueQuasi","targetNoComma","_","getterSetter","afterprop","what","sep","proceed","maybetype","afterType","typeprop","typearg","maybeReturnType","maybeAssign","vardefCont","proppattern","_type","forspec1","forspec2","formaybeinof","forspec3","classNameAfter","classBody","classfield","maybeFrom","exportField","importSpec","maybeMoreImports","maybeAs","isContinuedStatement","statementIndent","jsonld","json","typescript","wordCharacters","kw","A","B","C","operator","atom","jsKeywords","if","while","with","else","do","try","finally","return","break","continue","new","delete","throw","debugger","var","const","let","function","catch","for","switch","case","default","in","typeof","instanceof","true","false","super","yield","export","import","extends","await","async","tsKeywords","interface","implements","namespace","enum","private","protected","abstract","boolean","any","variable","jsonld-keyword","basecolumn","firstChar","doubleIndentSwitch","closeBrackets","skipExpression","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","menu","nav","ol","section","table","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","inText","chain","parser","inBlock","doctype","baseState","tagStart","inAttribute","stringStartCol","closure","isInAttribute","terminator","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","setStyle","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","skipAttribute","style_html","html_source","Parser","current_mode","parentcount","parent1","tag_type","token_text","last_token","last_text","token_type","Utils","whitespace","single_token","extra_liners","in_array","get_content","input_char","line_char_count","max_char","indent_level","indent_string","get_contents_to","reg_match","reg_array","end_script","substring","record_tag","retrieve_tag","temp_parent","get_tag","tag_start","tag_end","get_unformatted","print_newline","tag_index","tag_complete","tag_check","unformatted","comment","unindent","delimiter","orig_tag","get_token","get_full_indent","printer","js_source","indent_character","indent_size","brace_style","ignore","print_token","multi_parser","indent_char","tag_name","tag_extracted_from_last_output","_beautifier","js_beautify","css_beautify","indent_scripts","script_indent_level","white","_level","reindent","21","./stream/stream","22","createStream","HALT","updateStream","_state","initStream","guid","derive","recover","parents","endStream","unregister","ap","valueOf","toJSON","defineProperties","unregisterStream","updateState","updateDependency","finalize","mustSync","every","active","some","combine","fn","streams","valid","initDependency","dep","notEnded","registerDependency","dependent","s1","s2","merge","reducer","seed","newStream","scanMerge","tuples","tuple","idx"],"mappings":"CAAA,WAAe,GAAIA,OAAUC,GAAeC,MAASD,IAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,GAAIF,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