diff --git a/packages/api-explorer/dist/index.js b/packages/api-explorer/dist/index.js
index 6b6406137..1482359f6 100644
--- a/packages/api-explorer/dist/index.js
+++ b/packages/api-explorer/dist/index.js
@@ -1 +1 @@
-module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=159)}([function(e,t,r){"use strict";e.exports=r(162)},function(e,t,r){e.exports=r(166)()},function(e,t){var r=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},function(e,t,r){(function(e,n){var a=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r
=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function l(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var a=r.inspect(n,e);return v(a)||(a=c(e,a,n)),a}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(k(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var l,w="",S=!1,E=["{","}"];(p(r)&&(S=!0,E=["[","]"]),k(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||S&&0!=r.length?n<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=S?function(e,t,r,n,a){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,w,E)):E[0]+w+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,a,i){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),O(n,a)||(o="["+a+"]"),s||(e.seen.indexOf(u.value)<0?(s=m(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===S(e)}function _(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(y(i)&&(i=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=h,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(366);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),P[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(367),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(10),r(16))},function(e,t,r){"use strict";var n=r(3),a=function(e,t){this.code=[],this.indentation=e,this.lineJoin=t||"\n"};a.prototype.buildLine=function(e,t){var r="",a=2;if("[object String]"===Object.prototype.toString.call(e))a=1,t=e,e=0;else if(null===e)return null;for(;e;)r+=this.indentation,e--;var i=Array.prototype.slice.call(arguments,a,arguments.length);return i.unshift(r+t),n.format.apply(this,i)},a.prototype.unshift=function(){return this.code.unshift(this.buildLine.apply(this,arguments)),this},a.prototype.push=function(){return this.code.push(this.buildLine.apply(this,arguments)),this},a.prototype.blank=function(){return this.code.push(null),this},a.prototype.join=function(){return this.code.join(this.lineJoin)},e.exports=a},function(e,t,r){"use strict";t.__esModule=!0;var n,a=r(104),i=(n=a)&&n.__esModule?n:{default:n};t.default=i.default||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};var a=w(t);if("function"==typeof r)return function(e){if(!e.MergedWidget){var t=e.defaultProps&&e.defaultProps.options||{};e.MergedWidget=function(r){var n=r.options,a=void 0===n?{}:n,i=(0,h.default)(r,["options"]);return m.default.createElement(e,(0,p.default)({options:(0,p.default)({},t,a)},i))}}return e.MergedWidget}(r);if("string"!=typeof r)throw new Error("Unsupported widget definition: "+(void 0===r?"undefined":(0,d.default)(r)));if(n.hasOwnProperty(r)){var i=n[r];return e(t,i,n)}if(!b.hasOwnProperty(a))throw new Error('No widget for type "'+a+'"');if(b[a].hasOwnProperty(r)){var o=n[b[a][r]];return e(t,o,n)}throw new Error('No widget "'+r+'" for type "'+a+'"')},t.getDefaultFormState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!x(e))throw new Error("Invalid schema: "+e);var n=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var a=r;if(x(a)&&x(t.default))a=_(a,t.default);else if("default"in t)a=t.default;else{if("$ref"in t){var i=C(t.$ref,n);return e(i,a,n)}O(t)&&(a=t.items.map(function(t){return e(t,void 0,n)}))}void 0===a&&(a=t.default);switch(t.type){case"object":return(0,f.default)(t.properties||{}).reduce(function(r,i){return r[i]=e(t.properties[i],(a||{})[i],n),r},{});case"array":if(t.minItems){if(P(t,n))return[];var o=a?a.length:0;if(t.minItems>o){var s=a||[],u=(0,v.default)(new Array(t.minItems-o),e(t.items,t.items.defaults,n));return s.concat(u)}}}return a}(T(e,r,t),e.default,r);if(void 0===t)return n;if(x(t))return _(n,t);return t||n},t.getUiOptions=function(e){return(0,f.default)(e).filter(function(e){return 0===e.indexOf("ui:")}).reduce(function(t,r){var n=e[r];return"ui:widget"===r&&x(n)?(console.warn("Setting options via ui:widget object is deprecated, use ui:options instead"),(0,p.default)({},t,n.options||{},{widget:n.component})):"ui:options"===r&&x(n)?(0,p.default)({},t,n):(0,p.default)({},t,(0,c.default)({},r.substring(3),n))},{})},t.isObject=x,t.mergeObjects=_,t.asNumber=function(e){if(""===e)return;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;var t=Number(e),r="number"==typeof t&&!(0,u.default)(t);if(/\.\d*0$/.test(e))return e;return r?t:e},t.orderProperties=function(e,t){if(!Array.isArray(t))return e;var r=function(e){return e.reduce(function(e,t){return e[t]=!0,e},{})},n=function(e){return e.length>1?"properties '"+e.join("', '")+"'":"property '"+e[0]+"'"},a=r(e),i=r(t),o=t.filter(function(e){return"*"!==e&&!a[e]});if(o.length)throw new Error("uiSchema order list contains extraneous "+n(o));var u=e.filter(function(e){return!i[e]}),l=t.indexOf("*");if(-1===l){if(u.length)throw new Error("uiSchema order list does not contain "+n(u));return t}if(l!==t.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var c=[].concat((0,s.default)(t));return c.splice.apply(c,[l,1].concat((0,s.default)(u))),c},t.isConstant=k,t.toConstant=S,t.isSelect=E,t.isMultiSelect=P,t.isFilesArray=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("files"===t["ui:widget"])return!0;if(e.items){var n=T(e.items,r);return"string"===n.type&&"data-url"===n.format}return!1},t.isFixedItems=O,t.allowAdditionalItems=function(e){!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported");return x(e.additionalItems)},t.optionsList=function(e){if(e.enum)return e.enum.map(function(t,r){var n=e.enumNames&&e.enumNames[r]||String(t);return{label:n,value:t}});var t=e.oneOf||e.anyOf;return t.map(function(e,t){var r=S(e),n=e.title||String(r);return{label:n,value:r}})},t.retrieveSchema=T,t.deepEquals=D,t.shouldRender=function(e,t,r){var n=e.props,a=e.state;return!D(n,t)||!D(a,r)},t.toIdSchema=function e(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"root";var o={$id:r||i};if("$ref"in t){var s=T(t,n,a);return e(s,r,n,a,i)}if("items"in t&&!t.items.$ref)return e(t.items,r,n,a,i);if("object"!==t.type)return o;for(var u in t.properties||{}){var l=t.properties[u],c=o.$id+"_"+u;o[u]=e(l,c,n,a[u],i)}return o},t.parseDateString=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};var r=new Date(e);if((0,u.default)(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}},t.toDateString=function(e){var t=e.year,r=e.month,n=e.day,a=e.hour,i=void 0===a?0:a,o=e.minute,s=void 0===o?0:o,u=e.second,l=void 0===u?0:u,c=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],f=Date.UTC(t,r-1,n,i,s,l),d=new Date(f).toJSON();return c?d:d.slice(0,10)},t.pad=function(e,t){var r=String(e);for(;r.length2&&void 0!==arguments[2]&&arguments[2],n=(0,l.default)({},e);return(0,f.default)(t).reduce(function(n,a){var i=e[a],o=t[a];return e.hasOwnProperty(a)&&x(o)?n[a]=_(i,o,r):r&&Array.isArray(i)&&Array.isArray(o)?n[a]=i.concat(o):n[a]=o,n},n)}function k(e){return Array.isArray(e.enum)&&1===e.enum.length||e.hasOwnProperty("const")}function S(e){if(Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(e.hasOwnProperty("const"))return e.const;throw new Error("schema cannot be inferred as a constant")}function E(e){var t=T(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=t.oneOf||t.anyOf;return!!Array.isArray(t.enum)||!!Array.isArray(r)&&r.every(function(e){return k(e)})}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!e.uniqueItems||!e.items)&&E(e.items,t)}function O(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(function(e){return x(e)})}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=/^#(?:\/definitions)?\/(.*)$/.exec(e);if(r&&r[1]){var n=r[1].split("/"),a=t,i=!0,s=!1,u=void 0;try{for(var l,c=(0,o.default)(n);!(i=(l=c.next()).done);i=!0){var f=l.value;if(f=f.replace(/~1/g,"/").replace(/~0/g,"~"),!a.hasOwnProperty(f))throw new Error("Could not find a definition for "+e+".");a=a[f]}}catch(e){s=!0,u=e}finally{try{!i&&c.return&&c.return()}finally{if(s)throw u}}return a}throw new Error("Could not find a definition for "+e+".")}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.hasOwnProperty("$ref")){var n=C(e.$ref,t),a=(e.$ref,(0,h.default)(e,["$ref"]));return T((0,p.default)({},n,a),t,r)}return e.hasOwnProperty("dependencies")?T(function(e,t,r){var n=e.dependencies,a=void 0===n?{}:n,i=(0,h.default)(e,["dependencies"]);for(var o in a)if(void 0!==r[o]){var s=a[o];Array.isArray(s)?i=j(i,s):x(s)&&(i=R(i,t,r,o,s))}return i}(e,t,r),t,r):e}function j(e,t){if(!t)return e;var r=Array.isArray(e.required)?(0,i.default)(new a.default([].concat((0,s.default)(e.required),(0,s.default)(t)))):t;return(0,p.default)({},e,{required:r})}function R(e,t,r,n,a){var i=T(a,t,r),o=i.oneOf;return e=A(e,(0,h.default)(i,["oneOf"])),void 0===o?e:function(e,t,r,n,a){if(!Array.isArray(a))throw new Error("invalid oneOf: it is some "+(void 0===a?"undefined":(0,d.default)(a))+" instead of an array");var i=a.filter(function(e){if(!e.properties)return!1;var t=e.properties[n];if(t){var a={type:"object",properties:(0,c.default)({},n,t)},i=(0,g.default)(r,a),o=i.errors;return 0===o.length}});if(1!==i.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),e;var o=i[0],s=o.properties,u=(s[n],(0,h.default)(s,[n])),l=(0,p.default)({},o,{properties:u});return A(e,T(l,t,r))}(e,t,r,n,o)}function A(e,t){return _(e,t,!0)}function L(e){return"[object Arguments]"===Object.prototype.toString.call(e)}function D(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return!0;if("function"==typeof e||"function"==typeof t)return!0;if("object"!==(void 0===e?"undefined":(0,d.default)(e))||"object"!==(void 0===t?"undefined":(0,d.default)(t)))return!1;if(null===e||null===t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(L(e)||L(t)){if(!L(e)||!L(t))return!1;var a=Array.prototype.slice;return D(a.call(e),a.call(t),r,n)}if(e.constructor!==t.constructor)return!1;var i=(0,f.default)(e),o=(0,f.default)(t);if(0===i.length&&0===o.length)return!0;if(i.length!==o.length)return!1;for(var s=r.length;s--;)if(r[s]===e)return n[s]===t;r.push(e),n.push(t),i.sort(),o.sort();for(var u=i.length-1;u>=0;u--)if(i[u]!==o[u])return!1;for(var l=void 0,c=i.length-1;c>=0;c--)if(!D(e[l=i[c]],t[l],r,n))return!1;return r.pop(),n.pop(),!0}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n;n=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),a=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),o=n||a||i,s=o&&(n?document.documentMode||6:+(i||a)[1]),u=!i&&/WebKit\//.test(e),l=u&&/Qt\/\d+\.\d+/.test(e),c=!i&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,u=!0);var _=y&&(l||f&&(null==x||x<12.11)),k=r||o&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,P=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var a=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(a?n[1]+a:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return O(e).appendChild(t)}function T(e,t,r,n){var a=document.createElement(e);if(r&&(a.className=r),n&&(a.style.cssText=n),"string"==typeof t)a.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return o+(t-i);o+=s-i,o+=r-o%r,i=s+1}}m?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(N=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function z(e,t){for(var r=0;r=t)return n+Math.min(o,t-a);if(a+=i-n,n=i+1,(a+=r-a%r)>=t)return n}}var K=[""];function G(e){for(;K.length<=e;)K.push(J(K)+" ");return K[e]}function J(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||X.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ae(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var a=(t+r)/2,i=n<0?Math.ceil(a):Math.floor(a);if(i==t)return e(i)?t:r;e(i)?r=i:t=i+n}}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var a=r.children[n],i=a.chunkSize();if(t=e.first&&tr?me(r,se(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?me(e.line,t):r<0?me(e.line,0):e}(t,se(e,t.line).text.length)}function ke(e,t){for(var r=[],n=0;n=t:i.to>t);(n||(n=[])).push(new Pe(o,i.from,s?null:i.to))}}return n}(r,a,o),u=function(e,t,r){var n;if(e)for(var a=0;a=t:i.to>t)||i.from==t&&"bookmark"==o.type&&(!r||i.marker.insertLeft)){var s=null==i.from||(o.inclusiveLeft?i.from<=t:i.from0&&s)for(var b=0;b=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(u.marker.inclusiveRight&&a.inclusiveLeft?ge(l.to,r)>=0:ge(l.to,r)>0)||c>=0&&(u.marker.inclusiveRight&&a.inclusiveLeft?ge(l.from,n)<=0:ge(l.from,n)<0)))return!0}}}function ze(e){for(var t;t=qe(e);)e=t.find(-1,!0).line;return e}function Ue(e,t){var r=se(e,t),n=ze(r);return r==n?t:fe(n)}function Be(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!$e(e,n))return t;for(;r=Fe(n);)n=r.find(1,!0).line;return fe(n)+1}function $e(e,t){var r=Ee&&t.markedSpans;if(r)for(var n=void 0,a=0;at.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var Ge=null;function Je(e,t,r){var n;Ge=null;for(var a=0;at)return a;i.to==t&&(i.from!=i.to&&"before"==r?n=a:Ge=a),i.from==t&&(i.from!=i.to&&"before"!=r?n=a:Ge=a)}return null!=n?n:Ge}var Ye=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,a=/[LRr]/,i=/[Lb1n]/,o=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(u,l){var c="ltr"==l?"L":"R";if(0==u.length||"ltr"==l&&!r.test(u))return!1;for(var f,d=u.length,p=[],h=0;h-1&&(n[t]=a.slice(0,i).concat(a.slice(i+1)))}}}function rt(e,t){var r=et(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),a=0;a0}function ot(e){e.prototype.on=function(e,t){Xe(this,e,t)},e.prototype.off=function(e,t){tt(this,e,t)}}function st(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function lt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ct(e){st(e),ut(e)}function ft(e){return e.target||e.srcElement}function dt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var pt,ht,mt=function(){if(o&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function gt(e){if(null==pt){var t=T("span","");C(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var r=pt?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function vt(e){if(null!=ht)return ht;var t=C(e,document.createTextNode("AخA")),r=E(t,0,1).getBoundingClientRect(),n=E(t,1,2).getBoundingClientRect();return O(e),!(!r||r.left==r.right)&&(ht=n.right-r.right<3)}var yt,bt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var a=e.indexOf("\n",t);-1==a&&(a=e.length);var i=e.slice(t,"\r"==e.charAt(a-1)?a-1:a),o=i.indexOf("\r");-1!=o?(r.push(i.slice(0,o)),t+=o+1):(r.push(i),t=a+1)}return r}:function(e){return e.split(/\r\n?|\n/)},wt=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)},xt="oncopy"in(yt=T("div"))||(yt.setAttribute("oncopy","return;"),"function"==typeof yt.oncopy),_t=null;var kt={},St={};function Et(e){if("string"==typeof e&&St.hasOwnProperty(e))e=St[e];else if(e&&"string"==typeof e.name&&St.hasOwnProperty(e.name)){var t=St[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Et("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Et("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Pt(e,t){t=Et(t);var r=kt[t.name];if(!r)return Pt(e,"text/plain");var n=r(e,t);if(Ot.hasOwnProperty(t.name)){var a=Ot[t.name];for(var i in a)a.hasOwnProperty(i)&&(n.hasOwnProperty(i)&&(n["_"+i]=n[i]),n[i]=a[i])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n}var Ot={};function Ct(e,t){q(t,Ot.hasOwnProperty(e)?Ot[e]:Ot[e]={})}function Tt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var a=t[n];a instanceof Array&&(a=a.concat([])),r[n]=a}return r}function jt(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 Rt(e,t,r){return!e.startState||e.startState(t,r)}var At=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};At.prototype.eol=function(){return this.pos>=this.string.length},At.prototype.sol=function(){return this.pos==this.lineStart},At.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},At.prototype.next=function(){if(this.post},At.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},At.prototype.skipToEnd=function(){this.pos=this.string.length},At.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},At.prototype.backUp=function(e){this.pos-=e},At.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var a=function(e){return r?e.toLowerCase():e};if(a(this.string.substr(this.pos,e.length))==a(e))return!1!==t&&(this.pos+=e.length),!0},At.prototype.current=function(){return this.string.slice(this.start,this.pos)},At.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},At.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},At.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Lt=function(e,t){this.state=e,this.lookAhead=t},Dt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Nt(e,t,r,n){var a=[e.state.modeGen],i={};Ht(e,t.text,e.doc.mode,r,function(e,t){return a.push(e,t)},i,n);for(var o=r.state,s=function(n){r.baseTokens=a;var s=e.state.overlays[n],u=1,l=0;r.state=!0,Ht(e,t.text,s.mode,r,function(e,t){for(var r=u;le&&a.splice(u,1,e,a[u+1],n),u+=2,l=Math.min(e,n)}if(t)if(s.opaque)a.splice(r,u-r,e,"overlay "+t),u=r+2;else for(;re.options.maxHighlightLength&&Tt(e.doc.mode,n.state),i=Nt(e,t,n);a&&(n.state=a),t.stateAfter=n.save(!a),t.styles=i.styles,i.classes?t.styleClasses=i.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 qt(e,t,r){var n=e.doc,a=e.display;if(!n.mode.startState)return new Dt(n,!0,t);var i=function(e,t,r){for(var n,a,i=e.doc,o=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=i.first)return i.first;var u=se(i,s-1),l=u.stateAfter;if(l&&(!r||s+(l instanceof Lt?l.lookAhead:0)<=i.modeFrontier))return s;var c=F(u.text,null,e.options.tabSize);(null==a||n>c)&&(a=s-1,n=c)}return a}(e,t,r),o=i>n.first&&se(n,i-1).stateAfter,s=o?Dt.fromSaved(n,o,i):new Dt(n,Rt(n.mode),i);return n.iter(i,t,function(r){Ft(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=a.viewFrom&&nt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}Dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Dt.fromSaved=function(e,t,r){return t instanceof Lt?new Dt(e,Tt(e.mode,t.state),r,t.lookAhead):new Dt(e,Tt(e.mode,t),r)},Dt.prototype.save=function(e){var t=!1!==e?Tt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Lt(t,this.maxLookAhead):t};var Ut=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Bt(e,t,r,n){var a,i,o=e.doc,s=o.mode,u=se(o,(t=_e(o,t)).line),l=qt(e,t.line,r),c=new At(u.text,e.options.tabSize,l);for(n&&(i=[]);(n||c.pose.options.maxHighlightLength?(s=!1,o&&Ft(e,t,n,f.pos),f.pos=t.length,u=null):u=$t(zt(r,f,n.state,d),i),d){var p=d[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!s||c!=u){for(;l1&&!/ /.test(e))return e;for(var r=t,n="",a=0;al&&f.from<=l);d++);if(f.to>=c)return e(r,n,a,i,o,s,u);e(r,n.slice(0,f.to-l),a,i,null,s,u),i=null,n=n.slice(f.to-l),l=f.to}}}function er(e,t,r,n){var a=!n&&r.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!n&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",r.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function tr(e,t,r){var n=e.markedSpans,a=e.text,i=0;if(n)for(var o,s,u,l,c,f,d,p=a.length,h=0,m=1,g="",v=0;;){if(v==h){u=l=c=f=s="",d=null,v=1/0;for(var y=[],b=void 0,w=0;wh||_.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,l=""),_.className&&(u+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&x.from==h&&(c+=" "+_.startStyle),_.endStyle&&x.to==v&&(b||(b=[])).push(_.endStyle,x.to),_.title&&!f&&(f=_.title),_.collapsed&&(!d||Ne(d.marker,_)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(b)for(var k=0;k=p)break;for(var E=Math.min(p,v);;){if(g){var P=h+g.length;if(!d){var O=P>E?g.slice(0,E-h):g;t.addToken(t,O,o?o+u:u,c,h+O.length==v?l:"",f,s)}if(P>=E){g=g.slice(E-h),h=E;break}h=P,c=""}g=a.slice(i,i=r[m++]),o=Jt(r[m++],t.cm.options)}}else for(var C=1;Cr)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function Cr(e,t,r,n){return Rr(e,jr(e,t),r,n)}function Tr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&i.push((u.bottom+l.top)/2-r.top)}}i.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,r,n){var a,i=Dr(t.map,r,n),u=i.node,l=i.start,c=i.end,f=i.collapse;if(3==u.nodeType){for(var d=0;d<4;d++){for(;l&&ae(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,a))}else{var p;l>0&&(f=n="right"),a=e.options.lineWrapping&&(p=u.getClientRects()).length>1?p["right"==n?p.length-1:0]:u.getBoundingClientRect()}if(o&&s<9&&!l&&(!a||!a.left&&!a.right)){var h=u.parentNode.getClientRects()[0];a=h?{left:h.left,right:h.left+en(e.display),top:h.top,bottom:h.bottom}:Lr}for(var m=a.top-t.rect.top,g=a.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(a=(i=u-s)-1,t>=u&&(o="right")),null!=a){if(n=e[l+2],s==u&&r==(n.insertLeft?"left":"right")&&(o=r),"left"==r&&0==a)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)n=e[2+(l-=3)],o="left";if("right"==r&&a==u-s)for(;l=0&&(r=e[a]).left==r.right;a--);return r}function Mr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(u=n.text.length,l="before"):u<=0&&(u=0,l="after"),!s)return o("before"==l?u-1:u,"before"==l);function c(e,t,r){var n=1==s[t].level;return o(r?e-1:e,n!=r)}var f=Je(s,u,l),d=Ge,p=c(u,f,"before"==l);return null!=d&&(p.other=c(u,d,"before"!=l)),p}function Vr(e,t){var r=0;t=_e(e.doc,t),e.options.lineWrapping||(r=en(e.display)*t.ch);var n=se(e.doc,t.line),a=We(n)+xr(e.display);return{left:r,right:r,top:a,bottom:a+n.height}}function Kr(e,t,r,n,a){var i=me(e,t,r);return i.xRel=a,n&&(i.outside=!0),i}function Gr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Kr(n.first,0,null,!0,-1);var a=de(n,r),i=n.first+n.size-1;if(a>i)return Kr(n.first+n.size-1,se(n,i).text.length,null,!0,1);t<0&&(t=0);for(var o=se(n,a);;){var s=Zr(e,o,a,t,r),u=Fe(o),l=u&&u.find(0,!0);if(!u||!(s.ch>l.from.ch||s.ch==l.from.ch&&s.xRel>0))return s;a=fe(o=l.to.line)}}function Jr(e,t,r,n){n-=Ur(t);var a=t.text.length,i=oe(function(t){return Rr(e,r,t-1).bottom<=n},a,0);return{begin:i,end:a=oe(function(t){return Rr(e,r,t).top>n},i,a)}}function Yr(e,t,r,n){return r||(r=jr(e,t)),Jr(e,t,r,Br(e,t,Rr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Zr(e,t,r,n,a){a-=We(t);var i=jr(e,t),o=Ur(t),s=0,u=t.text.length,l=!0,c=Qe(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?function(e,t,r,n,a,i,o){var s=Jr(e,t,n,o),u=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var c=null,f=null,d=0;d=l||p.to<=u)){var h=1!=p.level,m=Rr(e,n,h?Math.min(l,p.to)-1:Math.max(u,p.from)).right,g=mg)&&(c=p,f=g)}}c||(c=a[a.length-1]);c.froml&&(c={from:c.from,to:l,level:c.level});return c}:function(e,t,r,n,a,i,o){var s=oe(function(s){var u=a[s],l=1!=u.level;return Qr(Wr(e,me(r,l?u.to:u.from,l?"before":"after"),"line",t,n),i,o,!0)},0,a.length-1),u=a[s];if(s>0){var l=1!=u.level,c=Wr(e,me(r,l?u.from:u.to,l?"after":"before"),"line",t,n);Qr(c,i,o,!0)&&c.top>o&&(u=a[s-1])}return u})(e,t,r,i,c,n,a);s=(l=1!=f.level)?f.from:f.to-1,u=l?f.to:f.from-1}var d,p,h=null,m=null,g=oe(function(t){var r=Rr(e,i,t);return r.top+=o,r.bottom+=o,!!Qr(r,n,a,!1)&&(r.top<=a&&r.left<=n&&(h=t,m=r),!0)},s,u),v=!1;if(m){var y=n-m.left=w.bottom}return Kr(r,g=ie(t.text,g,1),p,v,n-d)}function Xr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ar){Ar=T("pre");for(var t=0;t<49;++t)Ar.appendChild(document.createTextNode("x")),Ar.appendChild(T("br"));Ar.appendChild(document.createTextNode("x"))}C(e.measure,Ar);var r=Ar.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),O(e.measure),r||1}function en(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),r=T("pre",[t]);C(e.measure,r);var n=t.getBoundingClientRect(),a=(n.right-n.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function tn(e){for(var t=e.display,r={},n={},a=t.gutters.clientLeft,i=t.gutters.firstChild,o=0;i;i=i.nextSibling,++o)r[e.options.gutters[o]]=i.offsetLeft+i.clientLeft+a,n[e.options.gutters[o]]=i.clientWidth;return{fixedPos:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nn(e){var t=Xr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/en(e.display)-3);return function(a){if($e(e.doc,a))return 0;var i=0;if(a.widgets)for(var o=0;o=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().linet||t==r&&o.to==t)&&(n(Math.max(o.from,t),Math.min(o.to,r),1==o.level?"rtl":"ltr",i),a=!0)}a||n(t,r,"ltr")}(m,r||0,null==n?d:n,function(e,t,a,f){var g="ltr"==a,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==r&&0==e,w=null==n&&t==d,x=0==f,_=!m||f==m.length-1;if(y.top-v.top<=3){var k=(l?w:b)&&_,S=(l?b:w)&&x?s:(g?v:y).left,E=k?u:(g?y:v).right;c(S,v.top,E-S,v.bottom)}else{var P,O,C,T;g?(P=l&&b&&x?s:v.left,O=l?u:h(e,a,"before"),C=l?s:h(t,a,"after"),T=l&&w&&_?u:y.right):(P=l?h(e,a,"before"):s,O=!l&&b&&x?u:v.right,C=!l&&w&&_?s:y.left,T=l?h(t,a,"after"):u),c(P,v.top,O-P,v.bottom),v.bottom0?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 hn(e){e.state.focused||(e.display.input.focus(),gn(e))}function mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vn(e))},100)}function gn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(rt(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(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),pn(e))}function vn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,P(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||c<-.005)&&(ce(a.line,i),bn(a.line),a.rest))for(var f=0;f=o&&(i=de(t,We(se(t,u))-e.wrapper.clientHeight),o=u)}return{from:i,to:Math.max(o,i+1)}}function xn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,i=n+"px",o=0;oi&&(t.bottom=t.top+i);var s=e.doc.height+_r(r),u=t.tops-n;if(t.topa+i){var c=Math.min(t.top,(l?s:t.bottom)-i);c!=a&&(o.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,d=Er(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?o.scrollLeft=0:t.leftd+f-3&&(o.scrollLeft=t.right+(p?0:10)-d),o}function Sn(e,t){null!=t&&(On(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function En(e){On(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pn(e,t,r){null==t&&null==r||On(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function On(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Cn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Cn(e,t,r,n){var a=kn(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});Pn(e,a.scrollLeft,a.scrollTop)}function Tn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||oa(e,{top:t}),jn(e,t,!0),r&&oa(e),ta(e,100))}function jn(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 Rn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,xn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function An(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+_r(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+Sr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Ln=function(e,t,r){this.cm=r;var n=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(a),Xe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Xe(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ln.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 a=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"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 i=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"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}},Ln.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ln.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ln.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},Ln.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,function n(){var a=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)})},Ln.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Dn=function(){};function Nn(e,t){t||(t=An(e));var r=e.display.barWidth,n=e.display.barHeight;Mn(e,t);for(var a=0;a<4&&r!=e.display.barWidth||n!=e.display.barHeight;a++)r!=e.display.barWidth&&e.options.lineWrapping&&yn(e),Mn(e,An(e)),r=e.display.barWidth,n=e.display.barHeight}function Mn(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=""}Dn.prototype.update=function(){return{bottom:0,right:0}},Dn.prototype.setScrollLeft=function(){},Dn.prototype.setScrollTop=function(){},Dn.prototype.clear=function(){};var qn={native:Ln,null:Dn};function Fn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new qn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Xe(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?Rn(e,t):Tn(e,t)},e),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)}var In=0;function zn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++In},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function Un(e){!function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new na(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function $n(e){var t=e.cm,r=t.display;e.updatedDisplay&&yn(t),e.barMeasure=An(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Cr(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+Sr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Er(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Hn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null!=a&&!h){var i=T("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-xr(e.display))+"px;\n height: "+(t.bottom-t.top+Sr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(a),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,r,n){var a;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?me(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?me(t.line,t.ch+1,"before"):t);for(var i=0;i<5;i++){var o=!1,s=Wr(e,t),u=r&&r!=t?Wr(e,r):s,l=kn(e,a={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-n,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+n}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=l.scrollTop&&(Tn(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=l.scrollLeft&&(Rn(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(o=!0)),!o)break}return a}(t,_e(n,e.scrollToPos.from),_e(n,e.scrollToPos.to),e.scrollToPos.margin));var a=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(a)for(var o=0;ot)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)Ee&&Ue(e.doc,t)a.viewFrom?Zn(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&r>=a.viewTo)Zn(e);else if(t<=a.viewFrom){var i=Xn(e,r,r+n,1);i?(a.view=a.view.slice(i.index),a.viewFrom=i.lineN,a.viewTo+=n):Zn(e)}else if(r>=a.viewTo){var o=Xn(e,t,t,-1);o?(a.view=a.view.slice(0,o.index),a.viewTo=o.lineN):Zn(e)}else{var s=Xn(e,t,t,-1),u=Xn(e,r,r+n,1);s&&u?(a.view=a.view.slice(0,s.index).concat(nr(e,s.lineN,u.lineN)).concat(a.view.slice(u.index)),a.viewTo+=n):Zn(e)}var l=a.externalMeasured;l&&(r=a.lineN&&t=n.viewTo)){var i=n.view[sn(e,t)];if(null!=i.node){var o=i.changes||(i.changes=[]);-1==z(o,r)&&o.push(r)}}}function Zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Xn(e,t,r,n){var a,i=sn(e,t),o=e.display.view;if(!Ee||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,u=0;u0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,r+=a}for(;Ue(e.doc,r)!=r;){if(i==(n<0?0:o.length-1))return null;r+=n*o[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function ea(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=qt(e,t.highlightFrontier),a=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(i){if(n.line>=e.display.viewFrom){var o=i.styles,s=i.text.length>e.options.maxHighlightLength?Tt(t.mode,n.state):null,u=Nt(e,i,n,!0);s&&(n.state=s),i.styles=u.styles;var l=i.styleClasses,c=u.classes;c?i.styleClasses=c:l&&(i.styleClasses=null);for(var f=!o||o.length!=i.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!f&&dr)return ta(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&Vn(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==ea(e))return!1;_n(e)&&(Zn(e),t.dims=tn(e));var a=n.first+n.size,i=Math.max(t.visible.from-e.options.viewportMargin,n.first),o=Math.min(a,t.visible.to+e.options.viewportMargin);r.viewFromo&&r.viewTo-o<20&&(o=Math.min(a,r.viewTo)),Ee&&(i=Ue(e.doc,i),o=Be(e.doc,o));var s=i!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=nr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=nr(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,sn(e,r)))),n.viewTo=r}(e,i,o),r.viewOffset=We(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=ea(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=A();if(!t||!R(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&R(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return l>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,a=e.options.lineNumbers,i=n.lineDiv,o=i.firstChild;function s(t){var r=t.nextSibling;return u&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var l=n.view,c=n.viewFrom,f=0;f-1&&(p=!1),ur(e,d,c,r)),p&&(O(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(he(e.options,c)))),o=d.node.nextSibling}else{var h=mr(e,d,c,r);i.insertBefore(h,o)}c+=d.size}for(;o;)o=s(o)}(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=A()&&(e.activeElt.focus(),e.anchorNode&&R(document.body,e.anchorNode)&&R(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)}}(c),O(r.cursorDiv),O(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ta(e,400)),r.updateLineNumbers=null,!0}function ia(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Er(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+_r(e.display)-Pr(e),r.top)}),t.visible=wn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&aa(e,t);n=!1){yn(e);var a=An(e);un(e),Nn(e,a),ua(e,a),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 oa(e,t){var r=new na(e,t);if(aa(e,r)){yn(e),ia(e,r);var n=An(e);un(e),Nn(e,n),ua(e,n),r.finish()}}function sa(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function ua(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+Sr(e)+"px"}function la(e){var t=e.display.gutters,r=e.options.gutters;O(t);for(var n=0;n-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}na.prototype.signal=function(e,t){it(e,t)&&this.events.push(arguments)},na.prototype.finish=function(){for(var e=0;es.clientWidth,c=s.scrollHeight>s.clientHeight;if(a&&l||i&&c){if(i&&y&&u)e:for(var d=t.target,p=o.view;d!=s;d=d.parentNode)for(var h=0;h=0&&ge(e,n.to())<=0)return r}return-1};var va=function(e,t){this.anchor=e,this.head=t};function ya(e,t){var r=e[t];e.sort(function(e,t){return ge(e.from(),t.from())}),t=z(e,r);for(var n=1;n=0){var o=we(i.from(),a.from()),s=be(i.to(),a.to()),u=i.empty()?a.from()==a.head:i.from()==i.head;n<=t&&--t,e.splice(--n,2,new va(u?s:o,u?o:s))}}return new ga(e,t)}function ba(e,t){return new ga([new va(e,t||e)],0)}function wa(e){return e.text?me(e.from.line+e.text.length-1,J(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function xa(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return wa(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+=wa(t).ch-t.to.ch),me(r,n)}function _a(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}or(e,"change",e,t)}function Ca(e,t,r){!function e(n,a,i){if(n.linked)for(var o=0;os-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(La(e.done),J(e.done)):e.done.length&&!J(e.done).ranges?J(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),J(e.done)):void 0}(a,a.lastOp==n)))o=J(i.changes),0==ge(t.from,t.to)&&0==ge(t.from,o.to)?o.to=wa(t):i.changes.push(Aa(e,t));else{var u=J(a.done);for(u&&u.ranges||Ma(e.sel,a.done),i={changes:[Aa(e,t)],generation:a.generation},a.done.push(i);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(r),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=s,a.lastOp=a.lastSelOp=n,a.lastOrigin=a.lastSelOrigin=t.origin,o||rt(e,"historyAdded")}function Na(e,t,r,n){var a=e.history,i=n&&n.origin;r==a.lastSelOp||i&&a.lastSelOrigin==i&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==i||function(e,t,r,n){var a=t.charAt(0);return"*"==a||"+"==a&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,J(a.done),t))?a.done[a.done.length-1]=t:Ma(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=i,a.lastSelOp=r,n&&!1!==n.clearRedo&&La(a.undone)}function Ma(e,t){var r=J(t);r&&r.ranges&&r.equals(e)||t.push(e)}function qa(e,t,r,n){var a=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((a||(a=t["spans_"+e.id]={}))[i]=r.markedSpans),++i})}function Fa(e){if(!e)return null;for(var t,r=0;r-1&&(J(s)[f]=l[f],delete l[f])}}}return n}function Ua(e,t,r,n){if(n){var a=e.anchor;if(r){var i=ge(t,a)<0;i!=ge(r,a)<0?(a=t,t=r):i!=ge(t,r)<0&&(t=r)}return new va(a,t)}return new va(r||t,t)}function Ba(e,t,r,n,a){null==a&&(a=e.cm&&(e.cm.display.shift||e.extend)),Ka(e,new ga([Ua(e.sel.primary(),t,r,a)],0),n)}function $a(e,t,r){for(var n=[],a=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:s.to>t.ch))){if(a&&(rt(u,"beforeCursorEnter"),u.explicitlyCleared)){if(i.markedSpans){--o;continue}break}if(!u.atomic)continue;if(r){var l=u.find(n<0?1:-1),c=void 0;if((n<0?u.inclusiveRight:u.inclusiveLeft)&&(l=ei(e,l,-n,l&&l.line==t.line?i:null)),l&&l.line==t.line&&(c=ge(l,r))&&(n<0?c<0:c>0))return Za(e,l,t,n,a)}var f=u.find(n<0?-1:1);return(n<0?u.inclusiveLeft:u.inclusiveRight)&&(f=ei(e,f,n,f.line==t.line?i:null)),f?Za(e,f,t,n,a):null}}return t}function Xa(e,t,r,n,a){var i=n||1,o=Za(e,t,r,i,a)||!a&&Za(e,t,r,i,!0)||Za(e,t,r,-i,a)||!a&&Za(e,t,r,-i,!0);return o||(e.cantEdit=!0,me(e.first,0))}function ei(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?_e(e,me(t.line-1)):null:r>0&&t.ch==(n||se(e,t.line)).text.length?t.line0)){var c=[u,1],f=ge(l.from,s.from),d=ge(l.to,s.to);(f<0||!o.inclusiveLeft&&!f)&&c.push({from:l.from,to:s.from}),(d>0||!o.inclusiveRight&&!d)&&c.push({from:s.to,to:l.to}),a.splice.apply(a,c),u+=c.length-3}}return a}(e,t.from,t.to);if(n)for(var a=n.length-1;a>=0;--a)ai(e,{from:n[a].from,to:n[a].to,text:a?[""]:t.text,origin:t.origin});else ai(e,t)}}function ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ge(t.from,t.to)){var r=_a(e,t);Da(e,t,r,e.cm?e.cm.curOp.id:NaN),si(e,t,r,Te(e,t));var n=[];Ca(e,function(e,r){r||-1!=z(n,e.history)||(fi(e.history,t),n.push(e.history)),si(e,t,null,Te(e,t))})}}function ii(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,a=e.history,i=e.sel,o="undo"==t?a.done:a.undone,s="undo"==t?a.undone:a.done,u=0;u=0;--d){var p=f(d);if(p)return p.v}}}}function oi(e,t){if(0!=t&&(e.first+=t,e.sel=new ga(Y(e.sel.ranges,function(e){return new va(me(e.anchor.line+t,e.anchor.ch),me(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Yn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linei&&(t={from:t.from,to:me(i,se(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ue(e,t.from,t.to),r||(r=_a(e,t)),e.cm?function(e,t,r){var n=e.doc,a=e.display,i=t.from,o=t.to,s=!1,u=i.line;e.options.lineWrapping||(u=fe(ze(se(n,i.line))),n.iter(u,o.line+1,function(e){if(e==a.maxLine)return s=!0,!0}));n.sel.contains(t.from,t.to)>-1&&at(e);Oa(n,t,r,nn(e)),e.options.lineWrapping||(n.iter(u,i.line+t.text.length,function(e){var t=Ve(e);t>a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var a=se(e,n).stateAfter;if(a&&(!(a instanceof Lt)||n+a.lookAhead1||!(this.children[0]instanceof pi))){var s=[];this.collapse(s),this.children=[new pi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var o=a.lines.length%25+25,s=o;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==o&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=j("span",[i.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ie(e,t.line,t,r,i)||t.line!=r.line&&Ie(e,r.line,t,r,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee=!0}i.addToHistory&&Da(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,u=t.line,l=e.cm;if(e.iter(u,r.line+1,function(e){l&&i.collapsed&&!l.options.lineWrapping&&ze(e)==l.display.maxLine&&(s=!0),i.collapsed&&u!=t.line&&ce(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Pe(i,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),i.collapsed&&e.iter(t.line,r.line+1,function(t){$e(e,t)&&ce(t,0)}),i.clearOnEnter&&Xe(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(Se=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++vi,i.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),i.collapsed)Yn(l,t.line,r.line+1);else if(i.className||i.title||i.startStyle||i.endStyle||i.css)for(var c=t.line;c<=r.line;c++)Qn(l,c,"text");i.atomic&&Ya(l.doc),or(l,"markerAdded",l,i)}return i}yi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&zn(e),it(this,"clear")){var r=this.find();r&&or(this,"clear",r.from,r.to)}for(var n=null,a=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Yn(e,n,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ya(e.doc)),e&&or(e,"markerCleared",e,this,n,a),t&&Un(e),this.parent&&this.parent.clear()}},yi.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var a=0;a=0;u--)ni(this,n[u]);s?Va(this,s):this.cm&&En(this.cm)}),undo:Jn(function(){ii(this,"undo")}),redo:Jn(function(){ii(this,"redo")}),undoSelection:Jn(function(){ii(this,"undo",!0)}),redoSelection:Jn(function(){ii(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.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,r){e=_e(this,e),t=_e(this,t);var n=[],a=e.line;return this.iter(e.line,t.line+1,function(i){var o=i.markedSpans;if(o)for(var s=0;s=u.to||null==u.from&&a!=e.line||null!=u.from&&a==t.line&&u.from>=t.ch||r&&!r(u.marker)||n.push(u.marker.parent||u.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=i,++r}),_e(this,me(r,t))},indexFromPos:function(e){var t=(e=_e(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ga(t.doc,ba(r,r)),f)for(var d=0;d=0;t--)ui(e.doc,"",n[t].from,n[t].to,"+delete");En(e)})}function Wi(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Vi(e,t,r){var n=Wi(e,t.ch,r);return null==n?null:new me(t.line,n,r<0?"after":"before")}function Ki(e,t,r,n,a){if(e){var i=Qe(r,t.doc.direction);if(i){var o,s=a<0?J(i):i[0],u=a<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var l=jr(t,r);o=a<0?r.text.length-1:0;var c=Rr(t,l,o).top;o=oe(function(e){return Rr(t,l,e).top==c},a<0==(1==s.level)?s.from:s.to-1,o),"before"==u&&(o=Wi(r,o,1))}else o=a<0?s.to:s.from;return new me(n,o,u)}}return new me(n,a<0?r.text.length:0,a<0?"before":"after")}Mi.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"},Mi.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"},Mi.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"},Mi.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"]},Mi.default=y?Mi.macDefault:Mi.pcDefault;var Gi={selectAll:ti,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Hi(e,function(t){if(t.empty()){var r=se(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)a=new me(a.line,a.ch+1),e.replaceRange(i.charAt(a.ch-1)+i.charAt(a.ch-2),me(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var o=se(e.doc,a.line-1).text;o&&(a=new me(a.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),me(a.line-1,o.length-1),a,"+transpose"))}r.push(new va(a,a))}e.setSelections(r)})},newlineAndIndent:function(e){return Vn(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-1&&(ge((a=l.ranges[a]).from(),t)<0||t.xRel>0)&&(ge(a.to(),t)>0||t.xRel<0)?function(e,t,r,n){var a=e.display,i=!1,l=Kn(e,function(t){u&&(a.scroller.draggable=!1),e.state.draggingText=!1,tt(document,"mouseup",l),tt(document,"mousemove",c),tt(a.scroller,"dragstart",f),tt(a.scroller,"drop",l),i||(st(t),n.addNew||Ba(e.doc,r,null,null,n.extend),u||o&&9==s?setTimeout(function(){document.body.focus(),a.input.focus()},20):a.input.focus())}),c=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};u&&(a.scroller.draggable=!0);e.state.draggingText=l,l.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop();Xe(document,"mouseup",l),Xe(document,"mousemove",c),Xe(a.scroller,"dragstart",f),Xe(a.scroller,"drop",l),mn(e),setTimeout(function(){return a.input.focus()},20)}(e,n,t,i):function(e,t,r,n){var a=e.display,i=e.doc;st(t);var o,s,u=i.sel,l=u.ranges;n.addNew&&!n.extend?(s=i.sel.contains(r),o=s>-1?l[s]:new va(r,r)):(o=i.sel.primary(),s=i.sel.primIndex);if("rectangle"==n.unit)n.addNew||(o=new va(r,r)),r=on(e,t,!0,!0),s=-1;else{var c=lo(e,r,n.unit);o=n.extend?Ua(o,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=l.length,Ka(i,ya(l.concat([o]),s),{scroll:!1,origin:"*mouse"})):l.length>1&&l[s].empty()&&"char"==n.unit&&!n.extend?(Ka(i,ya(l.slice(0,s).concat(l.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=i.sel):Ha(i,s,o,H):(s=0,Ka(i,new ga([o],0),H),u=i.sel);var f=r;function d(t){if(0!=ge(f,t))if(f=t,"rectangle"==n.unit){for(var a=[],l=e.options.tabSize,c=F(se(i,r.line).text,r.ch,l),d=F(se(i,t.line).text,t.ch,l),p=Math.min(c,d),h=Math.max(c,d),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var v=se(i,m).text,y=V(v,p,l);p==h?a.push(new va(me(m,y),me(m,y))):v.length>y&&a.push(new va(me(m,y),me(m,V(v,h,l))))}a.length||a.push(new va(r,r)),Ka(i,ya(u.ranges.slice(0,s).concat(a),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=o,x=lo(e,t,n.unit),_=w.anchor;ge(x.anchor,_)>0?(b=x.head,_=we(w.from(),x.anchor)):(b=x.anchor,_=be(w.to(),x.head));var k=u.ranges.slice(0);k[s]=function(e,t){var r=t.anchor,n=t.head,a=se(e.doc,r.line);if(0==ge(r,n)&&r.sticky==n.sticky)return t;var i=Qe(a);if(!i)return t;var o=Je(i,r.ch,r.sticky),s=i[o];if(s.from!=r.ch&&s.to!=r.ch)return t;var u,l=o+(s.from==r.ch==(1!=s.level)?0:1);if(0==l||l==i.length)return t;if(n.line!=r.line)u=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Je(i,n.ch,n.sticky),f=c-o||(n.ch-r.ch)*(1==s.level?-1:1);u=c==l-1||c==l?f<0:f>0}var d=i[l+(u?-1:0)],p=u==(1==d.level),h=p?d.from:d.to,m=p?"after":"before";return r.ch==h&&r.sticky==m?t:new va(new me(r.line,h,m),n)}(e,new va(_e(i,_),b)),Ka(i,ya(k,s),H)}}var p=a.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,st(t),a.input.focus(),tt(document,"mousemove",g),tt(document,"mouseup",v),i.history.lastSelOrigin=null}var g=Kn(e,function(t){dt(t)?function t(r){var o=++h;var s=on(e,r,!0,"rectangle"==n.unit);if(!s)return;if(0!=ge(s,f)){e.curOp.focus=A(),d(s);var u=wn(a,i);(s.line>=u.to||s.linep.bottom?20:0;l&&setTimeout(Kn(e,function(){h==o&&(a.scroller.scrollTop+=l,t(r))}),50)}}(t):m(t)}),v=Kn(e,m);e.state.selectingText=v,Xe(document,"mousemove",g),Xe(document,"mouseup",v)}(e,n,t,i)}(t,n,i,e):ft(e)==r.scroller&&st(e):2==a?(n&&Ba(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==a&&(k?po(t,e):mn(t)))}}function lo(e,t,r){if("char"==r)return new va(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new va(me(t.line,0),_e(e.doc,me(t.line+1,0)));var n=r(e,t);return new va(n.from,n.to)}function co(e,t,r,n){var a,i;if(t.touches)a=t.touches[0].clientX,i=t.touches[0].clientY;else try{a=t.clientX,i=t.clientY}catch(t){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&st(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(i>s.bottom||!it(e,r))return lt(t);i-=s.top-o.viewOffset;for(var u=0;u=a)return rt(e,r,e,de(e.doc,i),e.options.gutters[u],t),lt(t)}}function fo(e,t){return co(e,t,"gutterClick",!0)}function po(e,t){wr(e.display,t)||function(e,t){if(!it(e,"gutterContextMenu"))return!1;return co(e,t,"gutterContextMenu",!1)}(e,t)||nt(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function ho(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fr(e)}so.prototype.compare=function(e,t,r){return this.time+400>e&&0==ge(t,this.pos)&&r==this.button};var mo={toString:function(){return"CodeMirror.Init"}},go={},vo={};function yo(e){la(e),Yn(e),xn(e)}function bo(e,t,r){if(!t!=!(r&&r!=mo)){var n=e.display.dragFunctions,a=t?Xe:tt;a(e.display.scroller,"dragstart",n.start),a(e.display.scroller,"dragenter",n.enter),a(e.display.scroller,"dragover",n.over),a(e.display.scroller,"dragleave",n.leave),a(e.display.scroller,"drop",n.drop)}}function wo(e){e.options.lineWrapping?(L(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(P(e.display.wrapper,"CodeMirror-wrap"),Ke(e)),an(e),Yn(e),Fr(e),setTimeout(function(){return Nn(e)},100)}function xo(e,t){var n=this;if(!(this instanceof xo))return new xo(e,t);this.options=t=t?q(t):{},q(go,t,!1),ca(t);var a=t.value;"string"==typeof a&&(a=new Si(a,t.mode,null,t.lineSeparator,t.direction)),this.doc=a;var i=new xo.inputStyles[t.inputStyle](this),l=this.display=new function(e,t,n){var a=this;this.input=n,a.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=j("div",null,"CodeMirror-code"),a.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=T("div",null,"CodeMirror-cursors"),a.measure=T("div",null,"CodeMirror-measure"),a.lineMeasure=T("div",null,"CodeMirror-measure"),a.lineSpace=j("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var i=j("div",[a.lineSpace],"CodeMirror-lines");a.mover=T("div",[i],null,"position: relative"),a.sizer=T("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=T("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),a.gutters=T("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=T("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=T("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),u||r&&v||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,n.init(a)}(e,a,i);for(var c in l.wrapper.CodeMirror=this,la(this),ho(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},t.autofocus&&!v&&l.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;Xe(t.scroller,"mousedown",Kn(e,uo)),Xe(t.scroller,"dblclick",o&&s<11?Kn(e,function(t){if(!nt(e,t)){var r=on(e,t);if(r&&!fo(e,t)&&!wr(e.display,t)){st(t);var n=e.findWordAt(r);Ba(e.doc,n.anchor,n.head)}}}):function(t){return nt(e,t)||st(t)});k||Xe(t.scroller,"contextmenu",function(t){return po(e,t)});var r,n={end:0};function a(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function i(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}Xe(t.scroller,"touchstart",function(a){if(!nt(e,a)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(a)&&!fo(e,a)){t.input.ensurePolled(),clearTimeout(r);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-n.end<=300?n:null},1==a.touches.length&&(t.activeTouch.left=a.touches[0].pageX,t.activeTouch.top=a.touches[0].pageY)}}),Xe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Xe(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!wr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!n.prev||i(n,n.prev)?new va(s,s):!n.prev.prev||i(n,n.prev.prev)?e.findWordAt(s):new va(me(s.line,0),_e(e.doc,me(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),st(r)}a()}),Xe(t.scroller,"touchcancel",a),Xe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Tn(e,t.scroller.scrollTop),Rn(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),Xe(t.scroller,"mousewheel",function(t){return ma(e,t)}),Xe(t.scroller,"DOMMouseScroll",function(t){return ma(e,t)}),Xe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){nt(e,t)||ct(t)},over:function(t){nt(e,t)||(!function(e,t){var r=on(e,t);if(r){var n=document.createDocumentFragment();cn(e,r,n),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,n)}}(e,t),ct(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-Ei<100))ct(t);else if(!nt(e,t)&&!wr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=T("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(e,t)},drop:Kn(e,Pi),leave:function(t){nt(e,t)||Oi(e)}};var u=t.input.getField();Xe(u,"keyup",function(t){return no.call(e,t)}),Xe(u,"keydown",Kn(e,ro)),Xe(u,"keypress",Kn(e,ao)),Xe(u,"focus",function(t){return gn(e,t)}),Xe(u,"blur",function(t){return vn(e,t)})}(this),ji(),zn(this),this.curOp.forceUpdate=!0,Ta(this,a),t.autofocus&&!v||this.hasFocus()?setTimeout(M(gn,this),20):vn(this),vo)vo.hasOwnProperty(c)&&vo[c](n,t[c],mo);_n(this),t.finishInit&&t.finishInit(this);for(var p=0;p<_o.length;++p)_o[p](n);Un(this),u&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(l.lineDiv).textRendering&&(l.lineDiv.style.textRendering="auto")}xo.defaults=go,xo.optionHandlers=vo;var _o=[];function ko(e,t,r,n){var a,i=e.doc;null==r&&(r="add"),"smart"==r&&(i.mode.indent?a=qt(e,t).state:r="prev");var o=e.options.tabSize,s=se(i,t),u=F(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var l,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((l=i.mode.indent(a,s.text.slice(c.length),s.text))==B||l>150)){if(!n)return;r="prev"}}else l=0,r="not";"prev"==r?l=t>i.first?F(se(i,t-1).text,null,o):0:"add"==r?l=u+e.options.indentUnit:"subtract"==r?l=u-e.options.indentUnit:"number"==typeof r&&(l=u+r),l=Math.max(0,l);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/o);p;--p)d+=o,f+="\t";if(d1)if(So&&So.text.join("\n")==t){if(n.ranges.length%So.text.length==0){l=[];for(var c=0;c=0;f--){var d=n.ranges[f],p=d.from(),h=d.to();d.empty()&&(r&&r>0?p=me(p.line,p.ch-r):e.state.overwrite&&!s?h=me(h.line,Math.min(se(i,h.line).text.length,h.ch+J(u).length)):So&&So.lineWise&&So.text.join("\n")==t&&(p=h=me(p.line,0))),o=e.curOp.updateInput;var m={from:p,to:h,text:l?l[f%l.length]:u,origin:a||(s?"paste":e.state.cutIncoming?"cut":"+input")};ni(e.doc,m),or(e,"inputRead",e,m)}t&&!s&&Co(e,t),En(e),e.curOp.updateInput=o,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Oo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vn(t,function(){return Po(t,r,0,null,"paste")}),!0}function Co(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var a=r.ranges[n];if(!(a.head.ch>100||n&&r.ranges[n-1].head.line==a.head.line)){var i=e.getModeAt(a.head),o=!1;if(i.electricChars){for(var s=0;s-1){o=ko(e,a.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(se(e.doc,a.head.line).text.slice(0,a.head.ch))&&(o=ko(e,a.head.line,"smart"));o&&or(e,"electricInput",e,a.head.line)}}}function To(e){for(var t=[],r=[],n=0;n=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var i=Je(a,r.ch,r.sticky),o=a[i];if("ltr"==e.doc.direction&&o.level%2==0&&(n>0?o.to>r.ch:o.from=o.from&&d>=c.begin)){var p=f?"before":"after";return new me(r.line,d,p)}}var h=function(e,t,n){for(var i=function(e,t){return t?new me(r.line,u(e,1),"before"):new me(r.line,e,"after")};e>=0&&e0==(1!=o.level),l=s?n.begin:u(n.end,-1);if(o.from<=l&&l0?c.end:u(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=h(n>0?0:a.length-1,n,l(g)))?null:m}(e.cm,s,t,r):Vi(s,t,r))){if(n||(o=t.line+r)=e.first+e.size||(t=new me(o,t.ch,t.sticky),!(s=se(e,o))))return!1;t=Ki(a,e.cm,s,t.line,r)}else t=i;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var l=null,c="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",h=te(p,f)?"w":c&&"\n"==p?"n":!c||/\s/.test(p)?null:"p";if(!c||d||h||(h="s"),l&&l!=h){r<0&&(r=1,u(),t.sticky="after");break}if(h&&(l=h),r>0&&!u(!d))break}var m=Xa(e,t,i,o,!0);return ve(i,m)&&(m.hitSide=!0),m}function Lo(e,t,r,n){var a,i,o=e.doc,s=t.left;if("page"==n){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(u-.5*Xr(e.display),3);a=(r>0?t.bottom:t.top)+r*l}else"line"==n&&(a=r>0?t.bottom+3:t.top-3);for(;(i=Gr(e,s,a)).outside;){if(r<0?a<=0:a>=o.height){i.hitSide=!0;break}a+=5*r}return i}var Do=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function No(e,t){var r=Tr(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),a=Or(r,n,t.line),i=Qe(n,e.doc.direction),o="left";i&&(o=Je(i,t.ch)%2?"right":"left");var s=Dr(a.map,t.ch,o);return s.offset="right"==s.collapse?s.end:s.start,s}function Mo(e,t){return t&&(e.bad=!0),e}function qo(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Mo(e.clipPos(me(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 a=0;a=t.display.viewTo||i.line=t.display.viewFrom&&No(t,a)||{node:u[0].measure.map[2],offset:0},c=i.linen.firstLine()&&(o=me(o.line-1,se(n.doc,o.line-1).length)),s.ch==se(n.doc,s.line).text.length&&s.linea.viewTo-1)return!1;o.line==a.viewFrom||0==(e=sn(n,o.line))?(t=fe(a.view[0].line),r=a.view[0].node):(t=fe(a.view[e].line),r=a.view[e-1].node.nextSibling);var u,l,c=sn(n,s.line);if(c==a.view.length-1?(u=a.viewTo-1,l=a.lineDiv.lastChild):(u=fe(a.view[c+1].line)-1,l=a.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,a){var i="",o=!1,s=e.doc.lineSeparator();function u(){o&&(i+=s,o=!1)}function l(e){e&&(u(),i+=e)}function c(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void l(r||t.textContent.replace(/\u200b/g,""));var i,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(me(n,0),me(a+1,0),(m=+f,function(e){return e.id==m}));return void(d.length&&(i=d[0].find(0))&&l(ue(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&u();for(var h=0;h1&&d.length>1;)if(J(f)==J(d))f.pop(),d.pop(),u--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);po.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var x=me(t,p),_=me(u,d.length?J(d).length-h:0);return f.length>1||f[0]||ge(x,_)?(ui(n.doc,f,x,_,"+input"),!0):void 0},Do.prototype.ensurePolled=function(){this.forceCompositionEnd()},Do.prototype.reset=function(){this.forceCompositionEnd()},Do.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Do.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))},Do.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vn(this.cm,function(){return Yn(e.cm)})},Do.prototype.setUneditable=function(e){e.contentEditable="false"},Do.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Kn(this.cm,Po)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Do.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Do.prototype.onContextMenu=function(){},Do.prototype.resetPosition=function(){},Do.prototype.needsContentAttribute=!0;var Io=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};Io.prototype.init=function(e){var t=this,r=this,n=this.cm,a=this.wrapper=Ro(),i=this.textarea=a.firstChild;function u(e){if(!nt(n,e)){if(n.somethingSelected())Eo({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=To(n);Eo({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(r.prevInput="",i.value=t.text.join("\n"),N(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(a,e.wrapper.firstChild),m&&(i.style.width="0px"),Xe(i,"input",function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Xe(i,"paste",function(e){nt(n,e)||Oo(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Xe(i,"cut",u),Xe(i,"copy",u),Xe(e.scroller,"paste",function(t){wr(e,t)||nt(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Xe(e.lineSpace,"selectstart",function(t){wr(e,t)||st(t)}),Xe(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Xe(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Io.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ln(e);if(e.options.moveInputWithCursor){var a=Wr(e,r.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+o.top-i.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+o.left-i.left))}return n},Io.prototype.showSelection=function(e){var t=this.cm.display;C(t.cursorDiv,e.cursors),C(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Io.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&N(this.textarea),o&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",o&&s>=9&&(this.hasSelection=null))}},Io.prototype.getField=function(){return this.textarea},Io.prototype.supportsTouch=function(){return!1},Io.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},Io.prototype.blur=function(){this.textarea.blur()},Io.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Io.prototype.receivedFocus=function(){this.slowPoll()},Io.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Io.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},Io.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||wt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=r.value;if(a==n&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===a||y&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=a.charCodeAt(0);if(8203!=i||n||(n=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var u=0,l=Math.min(n.length,a.length);u1e3||a.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Io.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Io.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},Io.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,a=t.textarea,i=on(r,e),l=n.scroller.scrollTop;if(i&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(i)&&Kn(r,Ka)(r.doc,ba(i),$);var c=a.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var p,h=t.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(p=window.scrollY),n.input.focus(),u&&window.scrollTo(null,p),n.input.reset(),r.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),o&&s>=9&&g(),k){ct(e);var m=function(){tt(window,"mouseup",m),setTimeout(v,20)};Xe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=a.selectionStart){var e=r.somethingSelected(),i=""+(e?a.value:"");a.value="⇚",a.value=i,t.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=i.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,a.style.cssText=c,o&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),null!=a.selectionStart){(!o||o&&s<9)&&g();var e=0,i=function(){n.selForContextMenu==r.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&""==t.prevInput?Kn(r,ti)(r):e++<10?n.detectingSelectAll=setTimeout(i,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(i,200)}}},Io.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Io.prototype.setUneditable=function(){},Io.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,a,i){e.defaults[r]=n,a&&(t[r]=i?function(e,t,r){r!=mo&&a(e,t,r)}:a)}e.defineOption=r,e.Init=mo,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,Sa(e)},!0),r("indentUnit",2,Sa,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){Ea(e),Fr(e),Yn(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var a=0;;){var i=e.text.indexOf(t,a);if(-1==i)break;a=i+t.length,r.push(me(n,i))}n++});for(var a=r.length-1;a>=0;a--)ui(e.doc,t,r[a],me(r[a].line,r[a].ch+t.length))}}),r("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!=mo&&e.refresh()}),r("specialCharPlaceholder",Qt,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){ho(e),yo(e)},!0),r("keyMap","default",function(e,t,r){var n=$i(t),a=r!=mo&&$i(r);a&&a.detach&&a.detach(e,n),n.attach&&n.attach(e,a||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,wo,!0),r("gutters",[],function(e){ca(e.options),yo(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rn(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return Nn(e)},!0),r("scrollbarStyle","native",function(e){Fn(e),Nn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e){ca(e.options),yo(e)},!0),r("firstLineNumber",1,yo,!0),r("lineNumberFormatter",function(e){return e},yo,!0),r("showCursorWhenSelecting",!1,un,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("readOnly",!1,function(e,t){"nocursor"==t&&(vn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,bo),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,un,!0),r("singleCursorHeightPerLine",!0,un,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Ea,!0),r("addModeClass",!1,Ea,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,Ea,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(xo),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,a=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Kn(this,t[e])(this,r,a),rt(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"]($i(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(ko(this,a.head.line,e,!0),r=a.head.line,n==this.doc.sel.primIndex&&En(this));else{var i=a.from(),o=a.to(),s=Math.max(r,i.line);r=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var u=s;u0&&Ha(this.doc,n,new va(i,l[n].to()),$)}}}),getTokenAt:function(e,t){return Bt(this,e,t)},getLineTokens:function(e,t){return Bt(this,me(e),t,!0)},getTokenTypeAt:function(e){e=_e(this.doc,e);var t,r=Mt(this,se(this.doc,e.line)),n=0,a=(r.length-1)/2,i=e.ch;if(0==i)t=r[2];else for(;;){var o=n+a>>1;if((o?r[2*o-1]:0)>=i)a=o;else{if(!(r[2*o+1]i&&(e=i,a=!0),n=se(this.doc,e)}else n=e;return Br(this,n,{top:0,left:0},t||"page",r||a).top+(a?this.doc.height-We(n):0)},defaultTextHeight:function(){return Xr(this.display)},defaultCharWidth:function(){return en(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,a){var i,o,s,u=this.display,l=(e=Wr(this,_e(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),u.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var f=Math.max(u.wrapper.clientHeight,this.doc.height),d=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(l=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==a?(c=u.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==a?c=0:"middle"==a&&(c=(u.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(i=this,o={left:c,top:l,right:c+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=kn(i,o)).scrollTop&&Tn(i,s.scrollTop),null!=s.scrollLeft&&Rn(i,s.scrollLeft))},triggerOnKeyDown:Gn(ro),triggerOnKeyPress:Gn(ao),triggerOnKeyUp:no,triggerOnMouseDown:Gn(uo),execCommand:function(e){if(Gi.hasOwnProperty(e))return Gi[e].call(null,this)},triggerElectric:Gn(function(e){Co(this,e)}),findPosH:function(e,t,r,n){var a=1;t<0&&(a=-1,t=-t);for(var i=_e(this.doc,e),o=0;o0&&o(t.charAt(r-1));)--r;for(;n.5)&&an(this),rt(this,"refresh",this)}),swapDoc:Gn(function(e){var t=this.doc;return t.cm=null,Ta(this,e),Fr(this),this.display.input.reset(),Pn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,or(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}},ot(e),e.registerHelper=function(t,n,a){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=a},e.registerGlobalHelper=function(t,n,a,i){e.registerHelper(t,n,i),r[t]._global.push({pred:a,val:i})}}(xo);var zo,Uo="iter insert remove copy getEditor constructor".split(" ");for(var Bo in Si.prototype)Si.prototype.hasOwnProperty(Bo)&&z(Uo,Bo)<0&&(xo.prototype[Bo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Si.prototype[Bo]));return ot(Si),xo.inputStyles={textarea:Io,contenteditable:Do},xo.defineMode=function(e){xo.defaults.mode||"null"==e||(xo.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}.apply(this,arguments)},xo.defineMIME=function(e,t){St[e]=t},xo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xo.defineMIME("text/plain","null"),xo.defineExtension=function(e,t){xo.prototype[e]=t},xo.defineDocExtension=function(e,t){Si.prototype[e]=t},xo.fromTextArea=function(e,t){if((t=t?q(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=A();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var a;if(e.form&&(Xe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;a=i.submit;try{var o=i.submit=function(){n(),i.submit=a,i.submit(),i.submit=o}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=a))}},e.style.display="none";var s=xo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(zo=xo).off=tt,zo.on=Xe,zo.wheelEventPixels=ha,zo.Doc=Si,zo.splitLines=bt,zo.countColumn=F,zo.findColumn=V,zo.isWordChar=ee,zo.Pass=B,zo.signal=rt,zo.Line=Wt,zo.changeEnd=wa,zo.scrollbarModel=qn,zo.Pos=me,zo.cmpPos=ge,zo.modes=kt,zo.mimeModes=St,zo.resolveMode=Et,zo.getMode=Pt,zo.modeExtensions=Ot,zo.extendMode=Ct,zo.copyState=Tt,zo.startState=Rt,zo.innerMode=jt,zo.commands=Gi,zo.keyMap=Mi,zo.keyName=Bi,zo.isModifierKey=zi,zo.lookupKey=Ii,zo.normalizeKeyMap=Fi,zo.StringStream=At,zo.SharedTextMarker=wi,zo.TextMarker=yi,zo.LineWidget=mi,zo.e_preventDefault=st,zo.e_stopPropagation=ut,zo.e_stop=ct,zo.addClass=L,zo.contains=R,zo.rmClass=P,zo.keyNames=Ai,xo.version="5.31.0",xo},e.exports=n()},function(e,t,r){var n=r(14),a=r(103),i=r(66),o=Object.defineProperty;t.f=r(15)?Object.defineProperty:function(e,t,r){if(n(e),t=i(t,!0),n(r),a)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){e.exports=!r(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var r=1;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,r){"use strict";function n(e,t,r){var n=r?" !== ":" === ",a=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+a+"typeof "+t+n+'"object"'+a+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+a+o+"("+t+" % 1)"+a+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:n,checkDataTypes:function(e,t){switch(e.length){case 1:return n(e[0],t,!0);default:var r="",a=i(e);for(var o in a.array&&a.object&&(r=a.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete a.null,delete a.array,delete a.object),a.number&&delete a.integer,a)r+=(r?" && ":"")+n(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],n=0;n=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(i="data"+(t-n||""),!a)return i}for(var s=i,l=a.split("/"),c=0;c":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,function(e){return t[e]})}(e):'').concat(n(e,t),"")},e.exports.uppercase=r(339)},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";(function(e){var n=r(176),a=r(177),i=r(96);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return z(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,a){var i,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var c=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){for(var f=!0,d=0;da&&(n=a):n=a;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a239?4:l>223?3:l>191?2:1;if(a+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[a+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&(u=(15&l)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var i=a-n,o=r-t,s=Math.min(i,o),l=this.slice(n,a),c=e.slice(t,r),f=0;fa)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;an)&&(r=n);for(var a="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,r,n,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-r,2);a>>8*(n?a:1-a)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-r,4);a>>8*(n?a:3-a)&255}function N(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return i||N(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function q(e,t,r,n,i){return i||N(e,0,r,8),a.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(a*=256);)n+=this[e+--t]*a;return n},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||A(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);A(this,e,t,r,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var a=Math.pow(2,8*r-1);A(this,e,t,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--a)e[a+t]=this[a+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}}).call(t,r(10))},function(e,t,r){var n=r(99),a=r(64);e.exports=Object.keys||function(e){return n(e,a)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(61),a=Math.min;e.exports=function(e){return e>0?a(n(e),9007199254740991):0}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(208)(!0);r(69)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports={}},function(e,t,r){var n=r(12).f,a=r(23),i=r(8)("toStringTag");e.exports=function(e,t,r){e&&!a(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){var n=r(19),a=r(114),i=r(115),o=r(14),s=r(40),u=r(78),l={},c={};(t=e.exports=function(e,t,r,f,d){var p,h,m,g,v=d?function(){return e}:u(e),y=n(r,f,t?2:1),b=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(i(v)){for(p=s(e.length);p>b;b++)if((g=t?y(o(h=e[b])[0],h[1]):y(e[b]))===l||g===c)return g}else for(m=v.call(e);!(h=m.next()).done;)if((g=a(m,y,h.value,t))===l||g===c)return g}).BREAK=l,t.RETURN=c},function(e,t,r){"use strict";t.__esModule=!0;var n,a=r(106),i=(n=a)&&n.__esModule?n:{default:n};t.default=function(e,t,r){return t in e?(0,i.default)(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){e.exports=a;var n=r(86).EventEmitter;function a(){n.call(this)}r(36)(a,n),a.Readable=r(87),a.Writable=r(352),a.Duplex=r(353),a.Transform=r(354),a.PassThrough=r(355),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",a),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(t,r(37).Buffer)},function(e,t,r){"use strict";t.decode=t.parse=r(172),t.encode=t.stringify=r(173)},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(14),a=r(210),i=r(64),o=r(62)("IE_PROTO"),s=function(){},u=function(){var e,t=r(65)("iframe"),n=i.length;for(t.style.display="none",r(108).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("